]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
UBUNTU: SAUCE: (noup) Update spl to 0.6.5.4-0ubuntu2, zfs to 0.6.5.4-0ubuntu1
authorColin Ian King <colin.king@canonical.com>
Thu, 4 Feb 2016 15:57:21 +0000 (10:57 -0500)
committerTim Gardner <tim.gardner@canonical.com>
Mon, 29 Feb 2016 16:01:52 +0000 (09:01 -0700)
BugLink: http://bugs.launchpad.net/bugs/1542296
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Tim Gardner <tim.gardner@canonical.com>
548 files changed:
spl/META
spl/Makefile.am
spl/Makefile.in [new file with mode: 0644]
spl/README.markdown [deleted file]
spl/aclocal.m4 [new file with mode: 0644]
spl/cmd/Makefile.in [new file with mode: 0644]
spl/config/compile [new file with mode: 0755]
spl/config/config.guess [new file with mode: 0755]
spl/config/config.sub [new file with mode: 0755]
spl/config/depcomp [new file with mode: 0755]
spl/config/install-sh [new file with mode: 0755]
spl/config/libtool.m4 [new file with mode: 0644]
spl/config/ltmain.sh [new file with mode: 0644]
spl/config/ltoptions.m4 [new file with mode: 0644]
spl/config/ltsugar.m4 [new file with mode: 0644]
spl/config/ltversion.m4 [new file with mode: 0644]
spl/config/lt~obsolete.m4 [new file with mode: 0644]
spl/config/missing [new file with mode: 0755]
spl/config/spl-build.m4
spl/configure [new file with mode: 0755]
spl/copy-builtin
spl/cp [new file with mode: 0755]
spl/dkms.conf [new file with mode: 0644]
spl/include/Makefile.in [new file with mode: 0644]
spl/include/fs/Makefile.in [new file with mode: 0644]
spl/include/linux/Makefile.in [new file with mode: 0644]
spl/include/rpc/Makefile.in [new file with mode: 0644]
spl/include/sharefs/Makefile.in [new file with mode: 0644]
spl/include/sys/Makefile.in [new file with mode: 0644]
spl/include/sys/fm/Makefile.in [new file with mode: 0644]
spl/include/sys/fs/Makefile.in [new file with mode: 0644]
spl/include/sys/isa_defs.h
spl/include/sys/rwlock.h
spl/include/sys/sysevent/Makefile.in [new file with mode: 0644]
spl/include/sys/time.h
spl/include/sys/vmem.h
spl/include/util/Makefile.in [new file with mode: 0644]
spl/include/vm/Makefile.in [new file with mode: 0644]
spl/lib/Makefile.in [new file with mode: 0644]
spl/man/Makefile.in [new file with mode: 0644]
spl/man/man1/Makefile.in [new file with mode: 0644]
spl/man/man5/Makefile.in [new file with mode: 0644]
spl/module/Makefile.in
spl/module/spl/spl-generic.c
spl/module/spl/spl-kmem-cache.c
spl/module/spl/spl-kmem.c
spl/module/spl/spl-taskq.c
spl/module/spl/spl-vmem.c
spl/module/splat/splat-kmem.c
spl/rpm/Makefile.in [new file with mode: 0644]
spl/rpm/generic/Makefile.in [new file with mode: 0644]
spl/rpm/generic/spl-dkms.spec.in
spl/rpm/generic/spl-kmod.spec.in
spl/rpm/generic/spl.spec.in
spl/rpm/redhat/Makefile.in [new file with mode: 0644]
spl/rpm/redhat/spl-dkms.spec.in [changed from symlink to file mode: 0644]
spl/rpm/redhat/spl.spec.in [changed from symlink to file mode: 0644]
spl/scripts/Makefile.in [new file with mode: 0644]
spl/spl_config.h.in [new file with mode: 0644]
zfs/.gitignore [deleted file]
zfs/META
zfs/Makefile.in [new file with mode: 0644]
zfs/TEST [deleted file]
zfs/aclocal.m4 [new file with mode: 0644]
zfs/cmd/Makefile.am [deleted file]
zfs/cmd/Makefile.in [new file with mode: 0644]
zfs/cmd/arc_summary/Makefile.am [deleted file]
zfs/cmd/arc_summary/Makefile.in [new file with mode: 0644]
zfs/cmd/arc_summary/arc_summary.py [deleted file]
zfs/cmd/arcstat/Makefile.am [deleted file]
zfs/cmd/arcstat/Makefile.in [new file with mode: 0644]
zfs/cmd/arcstat/arcstat.py [deleted file]
zfs/cmd/dbufstat/Makefile.am [deleted file]
zfs/cmd/dbufstat/Makefile.in [new file with mode: 0644]
zfs/cmd/dbufstat/dbufstat.py [deleted file]
zfs/cmd/fsck_zfs/Makefile.am [deleted file]
zfs/cmd/fsck_zfs/Makefile.in [new file with mode: 0644]
zfs/cmd/fsck_zfs/fsck.zfs [deleted file]
zfs/cmd/mount_zfs/.gitignore [deleted file]
zfs/cmd/mount_zfs/Makefile.am [deleted file]
zfs/cmd/mount_zfs/Makefile.in [new file with mode: 0644]
zfs/cmd/mount_zfs/mount_zfs.c [deleted file]
zfs/cmd/vdev_id/Makefile.am [deleted file]
zfs/cmd/vdev_id/Makefile.in [new file with mode: 0644]
zfs/cmd/vdev_id/vdev_id [deleted file]
zfs/cmd/zdb/.gitignore [deleted file]
zfs/cmd/zdb/Makefile.am [deleted file]
zfs/cmd/zdb/Makefile.in [new file with mode: 0644]
zfs/cmd/zdb/zdb.c [deleted file]
zfs/cmd/zdb/zdb_il.c [deleted file]
zfs/cmd/zed/.gitignore [deleted file]
zfs/cmd/zed/Makefile.am [deleted file]
zfs/cmd/zed/Makefile.in [new file with mode: 0644]
zfs/cmd/zed/zed.c [deleted file]
zfs/cmd/zed/zed.d/README [deleted file]
zfs/cmd/zed/zed.d/all-debug.sh [deleted file]
zfs/cmd/zed/zed.d/all-syslog.sh [deleted file]
zfs/cmd/zed/zed.d/checksum-notify.sh [deleted symlink]
zfs/cmd/zed/zed.d/checksum-spare.sh [deleted symlink]
zfs/cmd/zed/zed.d/data-notify.sh [deleted symlink]
zfs/cmd/zed/zed.d/generic-notify.sh [deleted file]
zfs/cmd/zed/zed.d/io-notify.sh [deleted file]
zfs/cmd/zed/zed.d/io-spare.sh [deleted file]
zfs/cmd/zed/zed.d/resilver.finish-notify.sh [deleted symlink]
zfs/cmd/zed/zed.d/scrub.finish-notify.sh [deleted file]
zfs/cmd/zed/zed.d/zed-functions.sh [deleted file]
zfs/cmd/zed/zed.d/zed.rc [deleted file]
zfs/cmd/zed/zed.h [deleted file]
zfs/cmd/zed/zed_conf.c [deleted file]
zfs/cmd/zed/zed_conf.h [deleted file]
zfs/cmd/zed/zed_event.c [deleted file]
zfs/cmd/zed/zed_event.h [deleted file]
zfs/cmd/zed/zed_exec.c [deleted file]
zfs/cmd/zed/zed_exec.h [deleted file]
zfs/cmd/zed/zed_file.c [deleted file]
zfs/cmd/zed/zed_file.h [deleted file]
zfs/cmd/zed/zed_log.c [deleted file]
zfs/cmd/zed/zed_log.h [deleted file]
zfs/cmd/zed/zed_strings.c [deleted file]
zfs/cmd/zed/zed_strings.h [deleted file]
zfs/cmd/zfs/.gitignore [deleted file]
zfs/cmd/zfs/Makefile.am [deleted file]
zfs/cmd/zfs/Makefile.in [new file with mode: 0644]
zfs/cmd/zfs/zfs_iter.c [deleted file]
zfs/cmd/zfs/zfs_iter.h [deleted file]
zfs/cmd/zfs/zfs_main.c [deleted file]
zfs/cmd/zfs/zfs_util.h [deleted file]
zfs/cmd/zhack/.gitignore [deleted file]
zfs/cmd/zhack/Makefile.am [deleted file]
zfs/cmd/zhack/Makefile.in [new file with mode: 0644]
zfs/cmd/zhack/zhack.c [deleted file]
zfs/cmd/zinject/.gitignore [deleted file]
zfs/cmd/zinject/Makefile.am [deleted file]
zfs/cmd/zinject/Makefile.in [new file with mode: 0644]
zfs/cmd/zinject/translate.c [deleted file]
zfs/cmd/zinject/zinject.c [deleted file]
zfs/cmd/zinject/zinject.h [deleted file]
zfs/cmd/zpios/.gitignore [deleted file]
zfs/cmd/zpios/Makefile.am [deleted file]
zfs/cmd/zpios/Makefile.in [new file with mode: 0644]
zfs/cmd/zpios/zpios.h [deleted file]
zfs/cmd/zpios/zpios_main.c [deleted file]
zfs/cmd/zpios/zpios_util.c [deleted file]
zfs/cmd/zpool/.gitignore [deleted file]
zfs/cmd/zpool/Makefile.am [deleted file]
zfs/cmd/zpool/Makefile.in [new file with mode: 0644]
zfs/cmd/zpool/zpool_iter.c [deleted file]
zfs/cmd/zpool/zpool_main.c [deleted file]
zfs/cmd/zpool/zpool_util.c [deleted file]
zfs/cmd/zpool/zpool_util.h [deleted file]
zfs/cmd/zpool/zpool_vdev.c [deleted file]
zfs/cmd/zstreamdump/.gitignore [deleted file]
zfs/cmd/zstreamdump/Makefile.am [deleted file]
zfs/cmd/zstreamdump/Makefile.in [new file with mode: 0644]
zfs/cmd/zstreamdump/zstreamdump.c [deleted file]
zfs/cmd/ztest/.gitignore [deleted file]
zfs/cmd/ztest/Makefile.am [deleted file]
zfs/cmd/ztest/Makefile.in [new file with mode: 0644]
zfs/cmd/ztest/ztest.c [deleted file]
zfs/cmd/zvol_id/.gitignore [deleted file]
zfs/cmd/zvol_id/Makefile.am [deleted file]
zfs/cmd/zvol_id/Makefile.in [new file with mode: 0644]
zfs/cmd/zvol_id/zvol_id_main.c [deleted file]
zfs/config/.gitignore [deleted file]
zfs/config/compile [new file with mode: 0755]
zfs/config/config.guess [new file with mode: 0755]
zfs/config/config.sub [new file with mode: 0755]
zfs/config/depcomp [new file with mode: 0755]
zfs/config/dkms.m4 [new file with mode: 0644]
zfs/config/install-sh [new file with mode: 0755]
zfs/config/kernel.m4
zfs/config/libtool.m4 [new file with mode: 0644]
zfs/config/ltmain.sh [new file with mode: 0644]
zfs/config/ltoptions.m4 [new file with mode: 0644]
zfs/config/ltsugar.m4 [new file with mode: 0644]
zfs/config/ltversion.m4 [new file with mode: 0644]
zfs/config/lt~obsolete.m4 [new file with mode: 0644]
zfs/config/missing [new file with mode: 0755]
zfs/config/suppressed-warnings.txt [deleted file]
zfs/config/user.m4
zfs/config/zfs-build.m4
zfs/config/zfs-meta.m4
zfs/configure [new file with mode: 0755]
zfs/contrib/Makefile.in [new file with mode: 0644]
zfs/contrib/bash_completion.d/Makefile.in [new file with mode: 0644]
zfs/contrib/dracut/90zfs/.gitignore [deleted file]
zfs/contrib/dracut/90zfs/Makefile.in [new file with mode: 0644]
zfs/contrib/dracut/Makefile.in [new file with mode: 0644]
zfs/contrib/initramfs/Makefile.in [new file with mode: 0644]
zfs/copy-builtin
zfs/cp [new file with mode: 0755]
zfs/dkms.conf [new file with mode: 0644]
zfs/etc/Makefile.am [deleted file]
zfs/etc/Makefile.in [new file with mode: 0644]
zfs/etc/init.d/.gitignore [deleted file]
zfs/etc/init.d/Makefile.am [deleted file]
zfs/etc/init.d/Makefile.in [new file with mode: 0644]
zfs/etc/init.d/README.md [deleted file]
zfs/etc/init.d/zfs-functions.in
zfs/etc/init.d/zfs-import.in [changed mode: 0755->0644]
zfs/etc/init.d/zfs-mount.in [changed mode: 0755->0644]
zfs/etc/init.d/zfs-share.in [changed mode: 0755->0644]
zfs/etc/init.d/zfs-zed.in [changed mode: 0755->0644]
zfs/etc/init.d/zfs.in
zfs/etc/modules-load.d/.gitignore [deleted file]
zfs/etc/modules-load.d/Makefile.am [deleted file]
zfs/etc/modules-load.d/Makefile.in [new file with mode: 0644]
zfs/etc/modules-load.d/zfs.conf.in
zfs/etc/systemd/Makefile.am [deleted file]
zfs/etc/systemd/Makefile.in [new file with mode: 0644]
zfs/etc/systemd/system/.gitignore [deleted file]
zfs/etc/systemd/system/50-zfs.preset.in
zfs/etc/systemd/system/Makefile.am [deleted file]
zfs/etc/systemd/system/Makefile.in [new file with mode: 0644]
zfs/etc/systemd/system/zed.service.in [new file with mode: 0644]
zfs/etc/systemd/system/zfs-import-cache.service.in
zfs/etc/systemd/system/zfs-import-scan.service.in
zfs/etc/systemd/system/zfs-mount.service.in
zfs/etc/systemd/system/zfs-share.service.in
zfs/etc/systemd/system/zfs-zed.service.in [deleted file]
zfs/etc/systemd/system/zfs.target.in
zfs/etc/zfs/Makefile.am [deleted file]
zfs/etc/zfs/Makefile.in [new file with mode: 0644]
zfs/etc/zfs/vdev_id.conf.alias.example [deleted file]
zfs/etc/zfs/vdev_id.conf.multipath.example [deleted file]
zfs/etc/zfs/vdev_id.conf.sas_direct.example [deleted file]
zfs/etc/zfs/vdev_id.conf.sas_switch.example [deleted file]
zfs/include/Makefile.in [new file with mode: 0644]
zfs/include/linux/Makefile.in [new file with mode: 0644]
zfs/include/sys/Makefile.in [new file with mode: 0644]
zfs/include/sys/fm/Makefile.in [new file with mode: 0644]
zfs/include/sys/fm/fs/Makefile.in [new file with mode: 0644]
zfs/include/sys/fs/Makefile.in [new file with mode: 0644]
zfs/include/sys/zap.h
zfs/include/sys/zfs_ctldir.h
zfs/include/sys/zio.h
zfs/include/zpios-ctl.h
zfs/include/zpios-internal.h
zfs/lib/Makefile.am [deleted file]
zfs/lib/Makefile.in [new file with mode: 0644]
zfs/lib/libavl/Makefile.am [deleted file]
zfs/lib/libavl/Makefile.in [new file with mode: 0644]
zfs/lib/libefi/Makefile.am [deleted file]
zfs/lib/libefi/Makefile.in [new file with mode: 0644]
zfs/lib/libefi/rdwr_efi.c [deleted file]
zfs/lib/libnvpair/Makefile.am [deleted file]
zfs/lib/libnvpair/Makefile.in [new file with mode: 0644]
zfs/lib/libnvpair/libnvpair.c [deleted file]
zfs/lib/libnvpair/nvpair_alloc_system.c [deleted file]
zfs/lib/libshare/Makefile.am [deleted file]
zfs/lib/libshare/Makefile.in [new file with mode: 0644]
zfs/lib/libshare/libshare.c [deleted file]
zfs/lib/libshare/libshare_impl.h [deleted file]
zfs/lib/libshare/nfs.c [deleted file]
zfs/lib/libshare/nfs.h [deleted file]
zfs/lib/libshare/smb.c [deleted file]
zfs/lib/libshare/smb.h [deleted file]
zfs/lib/libspl/Makefile.am [deleted file]
zfs/lib/libspl/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/asm-generic/Makefile.am [deleted file]
zfs/lib/libspl/asm-generic/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/asm-generic/atomic.c [deleted file]
zfs/lib/libspl/asm-i386/Makefile.am [deleted file]
zfs/lib/libspl/asm-i386/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/asm-i386/atomic.S [deleted file]
zfs/lib/libspl/asm-x86_64/Makefile.am [deleted file]
zfs/lib/libspl/asm-x86_64/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/asm-x86_64/atomic.S [deleted file]
zfs/lib/libspl/getexecname.c [deleted file]
zfs/lib/libspl/gethrestime.c [deleted file]
zfs/lib/libspl/gethrtime.c [deleted file]
zfs/lib/libspl/getmntany.c [deleted file]
zfs/lib/libspl/include/Makefile.am [deleted file]
zfs/lib/libspl/include/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/assert.h [deleted file]
zfs/lib/libspl/include/atomic.h [deleted file]
zfs/lib/libspl/include/attr.h [deleted file]
zfs/lib/libspl/include/devid.h [deleted file]
zfs/lib/libspl/include/ia32/Makefile.am [deleted file]
zfs/lib/libspl/include/ia32/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/ia32/sys/Makefile.am [deleted file]
zfs/lib/libspl/include/ia32/sys/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/ia32/sys/asm_linkage.h [deleted file]
zfs/lib/libspl/include/libdevinfo.h [deleted file]
zfs/lib/libspl/include/libgen.h [deleted file]
zfs/lib/libspl/include/libshare.h [deleted file]
zfs/lib/libspl/include/limits.h [deleted file]
zfs/lib/libspl/include/locale.h [deleted file]
zfs/lib/libspl/include/note.h [deleted file]
zfs/lib/libspl/include/priv.h [deleted file]
zfs/lib/libspl/include/rpc/Makefile.am [deleted file]
zfs/lib/libspl/include/rpc/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/rpc/types.h [deleted file]
zfs/lib/libspl/include/rpc/xdr.h [deleted file]
zfs/lib/libspl/include/statcommon.h [deleted file]
zfs/lib/libspl/include/stdio.h [deleted file]
zfs/lib/libspl/include/stdlib.h [deleted file]
zfs/lib/libspl/include/string.h [deleted file]
zfs/lib/libspl/include/strings.h [deleted file]
zfs/lib/libspl/include/stropts.h [deleted file]
zfs/lib/libspl/include/synch.h [deleted file]
zfs/lib/libspl/include/sys/Makefile.am [deleted file]
zfs/lib/libspl/include/sys/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/sys/acl.h [deleted file]
zfs/lib/libspl/include/sys/acl_impl.h [deleted file]
zfs/lib/libspl/include/sys/bitmap.h [deleted file]
zfs/lib/libspl/include/sys/byteorder.h [deleted file]
zfs/lib/libspl/include/sys/callb.h [deleted file]
zfs/lib/libspl/include/sys/cmn_err.h [deleted file]
zfs/lib/libspl/include/sys/compress.h [deleted file]
zfs/lib/libspl/include/sys/cred.h [deleted file]
zfs/lib/libspl/include/sys/debug.h [deleted file]
zfs/lib/libspl/include/sys/dkio.h [deleted file]
zfs/lib/libspl/include/sys/dklabel.h [deleted file]
zfs/lib/libspl/include/sys/dktp/Makefile.am [deleted file]
zfs/lib/libspl/include/sys/dktp/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/sys/dktp/fdisk.h [deleted file]
zfs/lib/libspl/include/sys/feature_tests.h [deleted file]
zfs/lib/libspl/include/sys/file.h [deleted file]
zfs/lib/libspl/include/sys/frame.h [deleted file]
zfs/lib/libspl/include/sys/int_limits.h [deleted file]
zfs/lib/libspl/include/sys/int_types.h [deleted file]
zfs/lib/libspl/include/sys/inttypes.h [deleted file]
zfs/lib/libspl/include/sys/isa_defs.h [deleted file]
zfs/lib/libspl/include/sys/kmem.h [deleted file]
zfs/lib/libspl/include/sys/kstat.h [deleted file]
zfs/lib/libspl/include/sys/list.h [deleted file]
zfs/lib/libspl/include/sys/list_impl.h [deleted file]
zfs/lib/libspl/include/sys/mhd.h [deleted file]
zfs/lib/libspl/include/sys/mkdev.h [deleted file]
zfs/lib/libspl/include/sys/mnttab.h [deleted file]
zfs/lib/libspl/include/sys/mount.h [deleted file]
zfs/lib/libspl/include/sys/note.h [deleted file]
zfs/lib/libspl/include/sys/param.h [deleted file]
zfs/lib/libspl/include/sys/policy.h [deleted file]
zfs/lib/libspl/include/sys/priv.h [deleted file]
zfs/lib/libspl/include/sys/processor.h [deleted file]
zfs/lib/libspl/include/sys/stack.h [deleted file]
zfs/lib/libspl/include/sys/stat.h [deleted file]
zfs/lib/libspl/include/sys/stropts.h [deleted file]
zfs/lib/libspl/include/sys/sunddi.h [deleted file]
zfs/lib/libspl/include/sys/sysevent.h [deleted file]
zfs/lib/libspl/include/sys/sysevent/Makefile.am [deleted file]
zfs/lib/libspl/include/sys/sysevent/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/sys/sysevent/eventdefs.h [deleted file]
zfs/lib/libspl/include/sys/sysmacros.h [deleted file]
zfs/lib/libspl/include/sys/systeminfo.h [deleted file]
zfs/lib/libspl/include/sys/systm.h [deleted file]
zfs/lib/libspl/include/sys/time.h [deleted file]
zfs/lib/libspl/include/sys/types.h [deleted file]
zfs/lib/libspl/include/sys/types32.h [deleted file]
zfs/lib/libspl/include/sys/tzfile.h [deleted file]
zfs/lib/libspl/include/sys/uio.h [deleted file]
zfs/lib/libspl/include/sys/va_list.h [deleted file]
zfs/lib/libspl/include/sys/varargs.h [deleted file]
zfs/lib/libspl/include/sys/vnode.h [deleted file]
zfs/lib/libspl/include/sys/vtoc.h [deleted file]
zfs/lib/libspl/include/sys/zone.h [deleted file]
zfs/lib/libspl/include/thread.h [deleted file]
zfs/lib/libspl/include/tzfile.h [deleted file]
zfs/lib/libspl/include/ucred.h [deleted file]
zfs/lib/libspl/include/umem.h [deleted file]
zfs/lib/libspl/include/unistd.h [deleted file]
zfs/lib/libspl/include/util/Makefile.am [deleted file]
zfs/lib/libspl/include/util/Makefile.in [new file with mode: 0644]
zfs/lib/libspl/include/util/sscanf.h [deleted file]
zfs/lib/libspl/include/zone.h [deleted file]
zfs/lib/libspl/list.c [deleted file]
zfs/lib/libspl/mkdirp.c [deleted file]
zfs/lib/libspl/strlcat.c [deleted file]
zfs/lib/libspl/strlcpy.c [deleted file]
zfs/lib/libspl/strnlen.c [deleted file]
zfs/lib/libspl/timestamp.c [deleted file]
zfs/lib/libspl/xdr.c [deleted file]
zfs/lib/libspl/zone.c [deleted file]
zfs/lib/libunicode/Makefile.am [deleted file]
zfs/lib/libunicode/Makefile.in [new file with mode: 0644]
zfs/lib/libuutil/Makefile.am [deleted file]
zfs/lib/libuutil/Makefile.in [new file with mode: 0644]
zfs/lib/libuutil/uu_alloc.c [deleted file]
zfs/lib/libuutil/uu_avl.c [deleted file]
zfs/lib/libuutil/uu_dprintf.c [deleted file]
zfs/lib/libuutil/uu_ident.c [deleted file]
zfs/lib/libuutil/uu_list.c [deleted file]
zfs/lib/libuutil/uu_misc.c [deleted file]
zfs/lib/libuutil/uu_open.c [deleted file]
zfs/lib/libuutil/uu_pname.c [deleted file]
zfs/lib/libuutil/uu_string.c [deleted file]
zfs/lib/libuutil/uu_strtoint.c [deleted file]
zfs/lib/libzfs/.gitignore [deleted file]
zfs/lib/libzfs/Makefile.am [deleted file]
zfs/lib/libzfs/Makefile.in [new file with mode: 0644]
zfs/lib/libzfs/libzfs.pc.in
zfs/lib/libzfs/libzfs_changelist.c [deleted file]
zfs/lib/libzfs/libzfs_config.c [deleted file]
zfs/lib/libzfs/libzfs_core.pc.in
zfs/lib/libzfs/libzfs_dataset.c [deleted file]
zfs/lib/libzfs/libzfs_diff.c [deleted file]
zfs/lib/libzfs/libzfs_fru.c [deleted file]
zfs/lib/libzfs/libzfs_graph.c [deleted file]
zfs/lib/libzfs/libzfs_import.c [deleted file]
zfs/lib/libzfs/libzfs_iter.c [deleted file]
zfs/lib/libzfs/libzfs_mount.c [deleted file]
zfs/lib/libzfs/libzfs_pool.c [deleted file]
zfs/lib/libzfs/libzfs_sendrecv.c [deleted file]
zfs/lib/libzfs/libzfs_status.c [deleted file]
zfs/lib/libzfs/libzfs_util.c [deleted file]
zfs/lib/libzfs_core/Makefile.am [deleted file]
zfs/lib/libzfs_core/Makefile.in [new file with mode: 0644]
zfs/lib/libzfs_core/libzfs_core.c [deleted file]
zfs/lib/libzpool/Makefile.am [deleted file]
zfs/lib/libzpool/Makefile.in [new file with mode: 0644]
zfs/lib/libzpool/kernel.c [deleted file]
zfs/lib/libzpool/taskq.c [deleted file]
zfs/lib/libzpool/util.c [deleted file]
zfs/man/Makefile.am [deleted file]
zfs/man/Makefile.in [new file with mode: 0644]
zfs/man/man1/Makefile.am [deleted file]
zfs/man/man1/Makefile.in [new file with mode: 0644]
zfs/man/man1/cstyle.1 [deleted file]
zfs/man/man1/zhack.1 [deleted file]
zfs/man/man1/zpios.1 [deleted file]
zfs/man/man1/ztest.1 [deleted file]
zfs/man/man5/Makefile.am [deleted file]
zfs/man/man5/Makefile.in [new file with mode: 0644]
zfs/man/man5/vdev_id.conf.5 [deleted file]
zfs/man/man5/zfs-events.5 [deleted file]
zfs/man/man5/zfs-module-parameters.5 [deleted file]
zfs/man/man5/zpool-features.5 [deleted file]
zfs/man/man8/.gitignore [deleted file]
zfs/man/man8/Makefile.am [deleted file]
zfs/man/man8/Makefile.in [new file with mode: 0644]
zfs/man/man8/fsck.zfs.8 [deleted file]
zfs/man/man8/mount.zfs.8 [deleted file]
zfs/man/man8/vdev_id.8 [deleted file]
zfs/man/man8/zdb.8 [deleted file]
zfs/man/man8/zed.8.in
zfs/man/man8/zfs.8 [deleted file]
zfs/man/man8/zinject.8 [deleted file]
zfs/man/man8/zpool.8 [deleted file]
zfs/man/man8/zstreamdump.8 [deleted file]
zfs/module/.gitignore [deleted file]
zfs/module/Makefile.in
zfs/module/zfs/arc.c
zfs/module/zfs/spa.c
zfs/module/zfs/vdev_queue.c
zfs/module/zfs/zap.c
zfs/module/zfs/zap_micro.c
zfs/module/zfs/zfs_ctldir.c
zfs/module/zfs/zfs_dir.c
zfs/module/zfs/zfs_znode.c
zfs/module/zfs/zio.c
zfs/module/zfs/zpl_inode.c
zfs/module/zfs/zpl_xattr.c
zfs/module/zfs/zvol.c
zfs/module/zpios/pios.c
zfs/rpm/Makefile.am [deleted file]
zfs/rpm/Makefile.in [new file with mode: 0644]
zfs/rpm/generic/.gitignore [deleted file]
zfs/rpm/generic/Makefile.am [deleted file]
zfs/rpm/generic/Makefile.in [new file with mode: 0644]
zfs/rpm/generic/zfs-dkms.spec.in
zfs/rpm/generic/zfs-kmod.spec.in
zfs/rpm/generic/zfs.spec.in
zfs/rpm/redhat/.gitignore [deleted file]
zfs/rpm/redhat/Makefile.am [deleted file]
zfs/rpm/redhat/Makefile.in [new file with mode: 0644]
zfs/rpm/redhat/zfs-dkms.spec.in [changed from symlink to file mode: 0644]
zfs/rpm/redhat/zfs-kmod.spec.in
zfs/rpm/redhat/zfs.spec.in [changed from symlink to file mode: 0644]
zfs/scripts/.gitignore [deleted file]
zfs/scripts/Makefile.am [deleted file]
zfs/scripts/Makefile.in [new file with mode: 0644]
zfs/scripts/common.sh.in
zfs/scripts/cstyle.pl [deleted file]
zfs/scripts/dkms.mkconf [deleted file]
zfs/scripts/dkms.postbuild [deleted file]
zfs/scripts/kmodtool [deleted file]
zfs/scripts/smb.sh [deleted file]
zfs/scripts/zconfig.sh [deleted file]
zfs/scripts/zfault.sh [deleted file]
zfs/scripts/zfs.sh [deleted file]
zfs/scripts/zfs2zol-patch.sed [deleted file]
zfs/scripts/ziltest.sh [deleted file]
zfs/scripts/zimport.sh [deleted file]
zfs/scripts/zpios-profile/Makefile.am [deleted file]
zfs/scripts/zpios-profile/Makefile.in [new file with mode: 0644]
zfs/scripts/zpios-profile/zpios-profile-disk.sh [deleted file]
zfs/scripts/zpios-profile/zpios-profile-pids.sh [deleted file]
zfs/scripts/zpios-profile/zpios-profile-post.sh [deleted file]
zfs/scripts/zpios-profile/zpios-profile-pre.sh [deleted file]
zfs/scripts/zpios-profile/zpios-profile.sh [deleted file]
zfs/scripts/zpios-sanity.sh [deleted file]
zfs/scripts/zpios-survey.sh [deleted file]
zfs/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh [deleted file]
zfs/scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh [deleted file]
zfs/scripts/zpios-test/1x256th-65536rc-4rs-1cs-4off.sh [deleted file]
zfs/scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh [deleted file]
zfs/scripts/zpios-test/4th-1024rc-4rs-1cs-4off.sh [deleted file]
zfs/scripts/zpios-test/Makefile.am [deleted file]
zfs/scripts/zpios-test/Makefile.in [new file with mode: 0644]
zfs/scripts/zpios-test/large-thread-survey.sh [deleted symlink]
zfs/scripts/zpios-test/large.sh [deleted symlink]
zfs/scripts/zpios-test/lustre.sh [deleted file]
zfs/scripts/zpios-test/medium.sh [deleted symlink]
zfs/scripts/zpios-test/small.sh [deleted symlink]
zfs/scripts/zpios-test/tiny.sh [deleted symlink]
zfs/scripts/zpios.sh [deleted file]
zfs/scripts/zpool-config/Makefile.am [deleted file]
zfs/scripts/zpool-config/Makefile.in [new file with mode: 0644]
zfs/scripts/zpool-config/dm0-raid0.sh [deleted file]
zfs/scripts/zpool-config/file-raid0.sh [deleted file]
zfs/scripts/zpool-config/file-raid10.sh [deleted file]
zfs/scripts/zpool-config/file-raidz.sh [deleted file]
zfs/scripts/zpool-config/file-raidz2.sh [deleted file]
zfs/scripts/zpool-config/hda-raid0.sh [deleted file]
zfs/scripts/zpool-config/lo-faulty-raid0.sh [deleted file]
zfs/scripts/zpool-config/lo-faulty-raid10.sh [deleted file]
zfs/scripts/zpool-config/lo-faulty-raidz.sh [deleted file]
zfs/scripts/zpool-config/lo-faulty-raidz2.sh [deleted file]
zfs/scripts/zpool-config/lo-faulty-raidz3.sh [deleted file]
zfs/scripts/zpool-config/lo-raid0.sh [deleted file]
zfs/scripts/zpool-config/lo-raid10.sh [deleted file]
zfs/scripts/zpool-config/lo-raidz.sh [deleted file]
zfs/scripts/zpool-config/lo-raidz2.sh [deleted file]
zfs/scripts/zpool-config/md0-raid10.sh [deleted file]
zfs/scripts/zpool-config/md0-raid5.sh [deleted file]
zfs/scripts/zpool-config/ram0-raid0.sh [deleted file]
zfs/scripts/zpool-config/scsi_debug-noraid.sh [deleted file]
zfs/scripts/zpool-config/scsi_debug-raid0.sh [deleted file]
zfs/scripts/zpool-config/scsi_debug-raid10.sh [deleted file]
zfs/scripts/zpool-config/scsi_debug-raidz.sh [deleted file]
zfs/scripts/zpool-config/scsi_debug-raidz2.sh [deleted file]
zfs/scripts/zpool-config/scsi_debug-raidz3.sh [deleted file]
zfs/scripts/zpool-config/sda-raid0.sh [deleted file]
zfs/scripts/zpool-config/zpool-raid0.sh [deleted file]
zfs/scripts/zpool-config/zpool-raid10.sh [deleted file]
zfs/scripts/zpool-config/zpool-raidz.sh [deleted file]
zfs/scripts/zpool-create.sh [deleted file]
zfs/udev/Makefile.am [deleted file]
zfs/udev/Makefile.in [new file with mode: 0644]
zfs/udev/rules.d/.gitignore [deleted file]
zfs/udev/rules.d/60-zvol.rules.in
zfs/udev/rules.d/69-vdev.rules.in
zfs/udev/rules.d/90-zfs.rules.in
zfs/udev/rules.d/Makefile.am [deleted file]
zfs/udev/rules.d/Makefile.in [new file with mode: 0644]
zfs/zfs_config.h.in [new file with mode: 0644]

index 357e1169cde35b3fcfb8be310128e3c55ead0741..0eeb6f2b3396867152d94f5f6a2a21a7369ae555 100644 (file)
--- a/spl/META
+++ b/spl/META
@@ -1,8 +1,8 @@
 Meta:         1
 Name:         spl
 Branch:       1.0
-Version:      0.6.5.3
-Release:      1
+Version:      0.6.5.4
+Release:      0ubuntu2
 Release-Tags: relext
 License:      GPL
 Author:       OpenZFS on Linux
index 4977448fda95ca7acf5baf63a031f5b726fb7c35..89950ed26f2263e5ed5badab8fa3665a2321953c 100644 (file)
@@ -20,7 +20,7 @@ nodist_kernel_HEADERS = spl.release spl_config.h module/$(LINUX_SYMBOLS)
 endif
 
 AUTOMAKE_OPTIONS = foreign
-EXTRA_DIST  = autogen.sh META DISCLAIMER copy-builtin
+EXTRA_DIST  = autogen.sh META DISCLAIMER copy-builtin COPYING
 EXTRA_DIST += config/config.awk config/rpm.am config/deb.am config/tgz.am
 
 distclean-local::
diff --git a/spl/Makefile.in b/spl/Makefile.in
new file mode 100644 (file)
index 0000000..bdf618c
--- /dev/null
@@ -0,0 +1,1182 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+###############################################################################
+# Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC.
+# Copyright (C) 2007 The Regents of the University of California.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Build targets for RPM packages.
+###############################################################################
+
+###############################################################################
+# Copyright (C) 2010 Lawrence Livermore National Security, LLC.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Build targets for DEB packages.
+#
+# Long term native distro specific Debian style packaging should be added.
+# In the short term RPM packages are built and converted to DEB packages
+# using alien.  If someone familiar with Debian style packaging were to
+# update the build system to correctly build Debian style packages I would
+# happily take it.  Until then we will have to make due with alien.
+#
+###############################################################################
+
+###############################################################################
+# Copyright (C) 2010 Lawrence Livermore National Security, LLC.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Build targets for TGZ packages.
+#
+# Long term native distro specific Slackware style packaging should be added.
+# In the short term RPM packages are built and converted to TGZ packages
+# using alien.  If someone familiar with Slackware style packaging were to
+# update the build system to correctly build Slackware style packages I would
+# happily take it.  Until then we will have to make due with alien.
+#
+###############################################################################
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@CONFIG_USER_TRUE@am__append_1 = lib cmd man scripts
+@CONFIG_KERNEL_TRUE@am__append_2 = module
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(am__extra_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = spl_config.h
+CONFIG_CLEAN_FILES = module/Makefile module/spl/Makefile \
+       module/splat/Makefile spl.release
+CONFIG_CLEAN_VPATH_FILES =
+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 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__extra_HEADERS_DIST = spl.release.in spl_config.h.in
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(extradir)" "$(DESTDIR)$(kerneldir)"
+HEADERS = $(extra_HEADERS) $(nodist_kernel_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)spl_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 = include rpm lib cmd man scripts module
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config/deb.am \
+       $(srcdir)/config/rpm.am $(srcdir)/config/tgz.am \
+       $(srcdir)/spl.release.in $(srcdir)/spl_config.h.in \
+       $(top_srcdir)/config/compile $(top_srcdir)/config/config.guess \
+       $(top_srcdir)/config/config.sub \
+       $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
+       $(top_srcdir)/config/missing $(top_srcdir)/module/Makefile.in \
+       $(top_srcdir)/module/spl/Makefile.in \
+       $(top_srcdir)/module/splat/Makefile.in AUTHORS COPYING \
+       config/compile config/config.guess config/config.sub \
+       config/depcomp config/install-sh config/ltmain.sh \
+       config/missing
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_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,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  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
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+ACLOCAL_AMFLAGS = -I config
+SUBDIRS = include rpm $(am__append_1) $(am__append_2)
+@CONFIG_KERNEL_TRUE@extradir = @prefix@/src/spl-$(VERSION)
+@CONFIG_KERNEL_TRUE@extra_HEADERS = spl.release.in spl_config.h.in
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/$(LINUX_VERSION)
+@CONFIG_KERNEL_TRUE@nodist_kernel_HEADERS = spl.release spl_config.h module/$(LINUX_SYMBOLS)
+AUTOMAKE_OPTIONS = foreign
+EXTRA_DIST = autogen.sh META DISCLAIMER copy-builtin COPYING \
+       config/config.awk config/rpm.am config/deb.am config/tgz.am
+all: spl_config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+       @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/config/rpm.am $(srcdir)/config/deb.am $(srcdir)/config/tgz.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+$(srcdir)/config/rpm.am $(srcdir)/config/deb.am $(srcdir)/config/tgz.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+spl_config.h: stamp-h1
+       @test -f $@ || rm -f stamp-h1
+       @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/spl_config.h.in $(top_builddir)/config.status
+       @rm -f stamp-h1
+       cd $(top_builddir) && $(SHELL) ./config.status spl_config.h
+$(srcdir)/spl_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+       ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f spl_config.h stamp-h1
+module/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/spl/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/spl/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/splat/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/splat/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+spl.release: $(top_builddir)/config.status $(srcdir)/spl.release.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool config.lt
+install-extraHEADERS: $(extra_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(extra_HEADERS)'; test -n "$(extradir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(extradir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(extradir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(extradir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(extradir)" || exit $$?; \
+       done
+
+uninstall-extraHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(extra_HEADERS)'; test -n "$(extradir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(extradir)'; $(am__uninstall_files_from_dir)
+install-nodist_kernelHEADERS: $(nodist_kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(nodist_kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-nodist_kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+
+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
+
+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)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__post_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_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+       $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+       @echo WARNING: "Support for distribution archives compressed with" \
+                      "legacy program 'compress' is deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__post_remove_distdir)
+
+dist-shar: distdir
+       @echo WARNING: "Support for shar distribution archives is" \
+                      "deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       $(am__post_remove_distdir)
+
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__post_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
+# tarfile.
+distcheck: dist
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
+       chmod -R a-w $(distdir)
+       chmod u+w $(distdir)
+       mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+       chmod a-w $(distdir)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__cd) $(distdir)/_build/sub \
+         && ../../configure \
+           $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+           $(DISTCHECK_CONFIGURE_FLAGS) \
+           --srcdir=../.. --prefix="$$dc_install_base" \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+               distuninstallcheck \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({ \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(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:
+       @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)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS) spl_config.h
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(extradir)" "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+       distclean-libtool distclean-local distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-extraHEADERS install-nodist_kernelHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-extraHEADERS uninstall-nodist_kernelHEADERS
+
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.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-hook 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-dvi \
+       install-dvi-am install-exec install-exec-am \
+       install-extraHEADERS install-html install-html-am install-info \
+       install-info-am install-man install-nodist_kernelHEADERS \
+       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-extraHEADERS uninstall-nodist_kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+srpm-kmod:
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \
+               def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_KMOD}' srpm-common
+
+srpm-dkms:
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
+               def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_DKMS}' srpm-common
+
+srpm-utils:
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
+               def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_UTIL}' srpm-common
+
+srpm: srpm-kmod srpm-dkms srpm-utils
+srpms: srpm-kmod srpm-dkms srpm-utils
+
+rpm-kmod: srpm-kmod
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \
+               def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_KMOD}' rpm-common
+
+rpm-dkms: srpm-dkms
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
+               def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common
+
+rpm-utils: srpm-utils
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
+               def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common
+
+rpm: rpm-kmod rpm-dkms rpm-utils
+rpms: rpm-kmod rpm-dkms rpm-utils
+
+rpm-local:
+       @(if test "${HAVE_RPMBUILD}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${RPMBUILD} missing.  Please install the\n" \
+       "*** package for your distribution which provides ${RPMBUILD},\n" \
+       "*** re-run configure, and try again.\n"; \
+               exit 1; \
+       fi; \
+       mkdir -p $(rpmbuild)/TMP && \
+       mkdir -p $(rpmbuild)/BUILD && \
+       mkdir -p $(rpmbuild)/RPMS && \
+       mkdir -p $(rpmbuild)/SRPMS && \
+       mkdir -p $(rpmbuild)/SPECS && \
+       cp ${RPM_SPEC_DIR}/$(rpmspec) $(rpmbuild)/SPECS && \
+       mkdir -p $(rpmbuild)/SOURCES && \
+       cp $(top_srcdir)/scripts/kmodtool $(rpmbuild)/SOURCES && \
+       cp $(distdir).tar.gz $(rpmbuild)/SOURCES)
+
+srpm-common: dist
+       @(dist=`$(RPM) --eval %{?dist}`; \
+       rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \
+       rpmspec=$(pkg).spec; \
+       rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
+       $(MAKE) $(AM_MAKEFLAGS) \
+               rpmbuild="$$rpmbuild" \
+               rpmspec="$$rpmspec" \
+               rpm-local || exit 1; \
+       LANG=C $(RPMBUILD) \
+               --define "_tmppath $$rpmbuild/TMP" \
+               --define "_topdir $$rpmbuild" \
+               $(def) -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \
+       cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \
+       rm -R $$rpmbuild)
+
+rpm-common: 
+       @(dist=`$(RPM) --eval %{?dist}`; \
+       rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \
+       rpmspec=$(pkg).spec; \
+       rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
+       $(MAKE) $(AM_MAKEFLAGS) \
+               rpmbuild="$$rpmbuild" \
+               rpmspec="$$rpmspec" \
+               rpm-local || exit 1; \
+       LANG=C ${RPMBUILD} \
+               --define "_tmppath $$rpmbuild/TMP" \
+               --define "_topdir $$rpmbuild" \
+               $(def) --rebuild $$rpmpkg || exit 1; \
+       cp $$rpmbuild/RPMS/*/* . || exit 1; \
+       rm -R $$rpmbuild)
+
+deb-local:
+       @(if test "${HAVE_DPKGBUILD}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${DPKGBUILD} missing.  Please install the\n" \
+        "*** package for your distribution which provides ${DPKGBUILD},\n" \
+       "*** re-run configure, and try again.\n"; \
+                exit 1; \
+       fi; \
+       if test "${HAVE_ALIEN}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${ALIEN} missing.  Please install the\n" \
+        "*** package for your distribution which provides ${ALIEN},\n" \
+       "*** re-run configure, and try again.\n"; \
+                exit 1; \
+       fi)
+
+deb-kmod: deb-local rpm-kmod
+@CONFIG_KERNEL_TRUE@   name=${PACKAGE}; \
+@CONFIG_KERNEL_TRUE@   version=${VERSION}-${RELEASE}; \
+@CONFIG_KERNEL_TRUE@   arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_KERNEL_TRUE@   pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
+@CONFIG_KERNEL_TRUE@   fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+@CONFIG_KERNEL_TRUE@   $(RM) $$pkg1
+
+deb-utils: deb-local rpm-utils
+@CONFIG_USER_TRUE@     name=${PACKAGE}; \
+@CONFIG_USER_TRUE@     version=${VERSION}-${RELEASE}; \
+@CONFIG_USER_TRUE@     arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_USER_TRUE@     pkg1=$${name}-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+@CONFIG_USER_TRUE@     $(RM) $$pkg1
+
+deb: deb-kmod deb-utils
+
+tgz-local:
+       @(if test "${HAVE_ALIEN}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${ALIEN} missing.  Please install the\n" \
+        "*** package for your distribution which provides ${ALIEN},\n" \
+       "*** re-run configure, and try again.\n"; \
+                exit 1; \
+       fi)
+
+tgz-kmod: tgz-local rpm-kmod
+@CONFIG_KERNEL_TRUE@   name=${PACKAGE}; \
+@CONFIG_KERNEL_TRUE@   version=${VERSION}-${RELEASE}; \
+@CONFIG_KERNEL_TRUE@   arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_KERNEL_TRUE@   pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
+@CONFIG_KERNEL_TRUE@   fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \
+@CONFIG_KERNEL_TRUE@   $(RM) $$pkg1
+
+tgz-utils: tgz-local rpm-utils
+@CONFIG_USER_TRUE@     name=${PACKAGE}; \
+@CONFIG_USER_TRUE@     version=${VERSION}-${RELEASE}; \
+@CONFIG_USER_TRUE@     arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_USER_TRUE@     pkg1=$${name}-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \
+@CONFIG_USER_TRUE@     $(RM) $$pkg1
+
+tgz: tgz-kmod tgz-utils
+
+distclean-local::
+       -$(RM) -R autom4te*.cache
+       -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
+               -o -name .pc -o -name .hg -o -name .git \) -prune -o \
+               \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+               -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
+               -o -name '.*.rej' -o -name 'aclocal.m4' -o -size 0 \
+               -o -name '*%' -o -name '.*.cmd' -o -name 'core' \
+               -o -name 'Makefile' -o -name '$(LINUX_SYMBOLS)' \
+               -o -name '*.order' -o -name '*.markers' \) \
+               -type f -print | xargs $(RM)
+
+dist-hook:
+       sed -i 's/Release:[[:print:]]*/Release:      $(RELEASE)/' \
+               $(distdir)/META
+
+ctags:
+       $(RM) tags
+       find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
+
+etags:
+       $(RM) TAGS
+       find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
+
+tags: ctags etags
+
+pkg: @DEFAULT_PACKAGE@
+pkg-kmod: @DEFAULT_PACKAGE@-kmod
+pkg-utils: @DEFAULT_PACKAGE@-utils
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/README.markdown b/spl/README.markdown
deleted file mode 100644 (file)
index 1de82ef..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-The Solaris Porting Layer (SPL) is a Linux kernel module which provides
-many of the Solaris kernel APIs.  This shim layer makes it possible to
-run Solaris kernel code in the Linux kernel with relatively minimal
-modification.  This can be particularly useful when you want to track
-upstream Solaris development closely and do not want the overhead of
-maintaining a large patch which converts Solaris primitives to Linux
-primitives.
-
-To build packages for your distribution:
-
-    $ ./configure
-    $ make pkg
-
-If you are building directly from the git tree and not an officially
-released tarball you will need to generate the configure script.
-This can be done by executing the autogen.sh script after installing
-the GNU autotools for your distribution.
-
-To copy the kernel code inside your kernel source tree for builtin
-compilation:
-
-    $ ./configure --enable-linux-builtin --with-linux=/usr/src/linux-...
-    $ ./copy-builtin /usr/src/linux-...
-
-The SPL comes with an automated test suite called SPLAT.  The test suite
-is implemented in two parts.  There is a kernel module which contains
-the tests and a user space utility which controls which tests are run.
-To run the full test suite:
-
-    $ sudo insmod ./module/splat/splat.ko
-    $ sudo ./cmd/splat --all
-
-Full documentation for building, configuring, testing, and using the
-SPL can be found at: <http://zfsonlinux.org>
diff --git a/spl/aclocal.m4 b/spl/aclocal.m4
new file mode 100644 (file)
index 0000000..77267d9
--- /dev/null
@@ -0,0 +1,1195 @@
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# 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.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'.])])
+
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.15'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.15], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.15])dnl
+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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# 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
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[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
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# 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
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# 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
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+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],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# 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
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# 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.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
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[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], [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
+
+# 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])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                 [_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])],
+                 [m4_define([AC_PROG_CXX],
+                            m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_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
+])
+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
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+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],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# 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
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_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])])
+
+# _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)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# 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_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# 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 (
+   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
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# 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
+# 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
+# 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'.
+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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# 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
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# 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.  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'
+
+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],
+    [],
+
+  [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
+
+  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
+
+m4_include([config/libtool.m4])
+m4_include([config/ltoptions.m4])
+m4_include([config/ltsugar.m4])
+m4_include([config/ltversion.m4])
+m4_include([config/lt~obsolete.m4])
+m4_include([config/spl-build.m4])
+m4_include([config/spl-meta.m4])
diff --git a/spl/cmd/Makefile.in b/spl/cmd/Makefile.in
new file mode 100644 (file)
index 0000000..3d48e14
--- /dev/null
@@ -0,0 +1,702 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+###############################################################################
+# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
+# Copyright (C) 2007 The Regents of the University of California.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Common rules for user space components.
+###############################################################################
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+sbin_PROGRAMS = splat$(EXEEXT)
+subdir = cmd
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__installdirs = "$(DESTDIR)$(sbindir)"
+PROGRAMS = $(sbin_PROGRAMS)
+am_splat_OBJECTS = splat.$(OBJEXT)
+splat_OBJECTS = $(am_splat_OBJECTS)
+splat_LDADD = $(LDADD)
+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 = 
+splat_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+       $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+       $(splat_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 = 
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+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_@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_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(splat_SOURCES)
+DIST_SOURCES = $(splat_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
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/Rules.am \
+       $(top_srcdir)/config/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+DEFAULT_INCLUDES = -include ${top_builddir}/spl_config.h \
+       -I$(top_srcdir)/lib
+AM_LIBTOOLFLAGS = --silent
+AM_CPPFLAGS = -D__USE_LARGEFILE64
+AM_CFLAGS = -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing \
+       ${DEBUG_CFLAGS}
+splat_SOURCES = splat.c
+splat_LDFLAGS = $(top_builddir)/lib/libcommon.la
+EXTRA_DIST = splat.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/Rules.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu cmd/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu cmd/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+$(top_srcdir)/config/Rules.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-sbinPROGRAMS: $(sbin_PROGRAMS)
+       @$(NORMAL_INSTALL)
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(sbindir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(sbindir)" || 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; \
+       done | \
+       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 } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) files[d] = files[d] " " $$1; \
+           else { print "f", $$3 "/" $$4, $$1; } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+           if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+           test -z "$$files" || { \
+           echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(sbindir)$$dir'"; \
+           $(INSTALL_PROGRAM_ENV) $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(sbindir)$$dir" || exit $$?; \
+           } \
+       ; done
+
+uninstall-sbinPROGRAMS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(sbin_PROGRAMS)'; test -n "$(sbindir)" || list=; \
+       files=`for p in $$list; do echo "$$p"; done | \
+         sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
+             -e 's/$$/$(EXEEXT)/' \
+       `; \
+       test -n "$$list" || exit 0; \
+       echo " ( cd '$(DESTDIR)$(sbindir)' && rm -f" $$files ")"; \
+       cd "$(DESTDIR)$(sbindir)" && rm -f $$files
+
+clean-sbinPROGRAMS:
+       @list='$(sbin_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
+
+splat$(EXEEXT): $(splat_OBJECTS) $(splat_DEPENDENCIES) $(EXTRA_splat_DEPENDENCIES) 
+       @rm -f splat$(EXEEXT)
+       $(AM_V_CCLD)$(splat_LINK) $(splat_OBJECTS) $(splat_LDADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/splat.Po@am__quote@
+
+.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
+@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@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.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
+@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@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(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
+@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@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(PROGRAMS)
+installdirs:
+       for dir in "$(DESTDIR)$(sbindir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-sbinPROGRAMS \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am: install-sbinPROGRAMS
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-sbinPROGRAMS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool clean-sbinPROGRAMS 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-sbinPROGRAMS 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-sbinPROGRAMS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/config/compile b/spl/config/compile
new file mode 100755 (executable)
index 0000000..a85b723
--- /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-2014 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:
diff --git a/spl/config/config.guess b/spl/config/config.guess
new file mode 100755 (executable)
index 0000000..1659250
--- /dev/null
@@ -0,0 +1,1441 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
+
+timestamp='2015-08-20'
+
+# 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.
+#
+# 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 Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches to <config-patches@gnu.org>.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2015 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+            CC_FOR_BUILD="$c"; break ;
+         fi ;
+       done ;
+       if test x"$CC_FOR_BUILD" = x ; then
+         CC_FOR_BUILD=no_compiler_found ;
+       fi
+       ;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+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 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
+       # compatibility and a consistent mechanism for selecting the
+       # object file format.
+       #
+       # Note: NetBSD doesn't particularly care about the vendor
+       # portion of the name.  We always set it to "unknown".
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+           /sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || \
+           echo unknown)`
+       case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
+           arm*) machine=arm-unknown ;;
+           sh3el) machine=shl-unknown ;;
+           sh3eb) machine=sh-unknown ;;
+           sh5el) machine=sh5le-unknown ;;
+           earmv*)
+               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine=${arch}${endian}-unknown
+               ;;
+           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+       esac
+       # The Operating System including object format, if it has switched
+       # to ELF recently, or will in the future.
+       case "${UNAME_MACHINE_ARCH}" in
+           arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
+               eval $set_cc_for_build
+               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+                       | grep -q __ELF__
+               then
+                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+                   # Return netbsd for either.  FIX?
+                   os=netbsd
+               else
+                   os=netbsdelf
+               fi
+               ;;
+           *)
+               os=netbsd
+               ;;
+       esac
+       # Determine ABI tags.
+       case "${UNAME_MACHINE_ARCH}" in
+           earm*)
+               expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               ;;
+       esac
+       # The OS release
+       # Debian GNU/NetBSD machines have a different userland, and
+       # thus, need a distinct triplet. However, they do not need
+       # kernel version information, so it can be replaced with a
+       # suitable tag, in the style of linux-gnu.
+       case "${UNAME_VERSION}" in
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+               ;;
+       esac
+       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+       # contains redundant information, the shorter form:
+       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+       echo "${machine}-${os}${release}${abi}"
+       exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       exit ;;
+    *:OpenBSD:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       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 ;;
+    *:Sortix:*:*)
+       echo ${UNAME_MACHINE}-unknown-sortix
+       exit ;;
+    alpha:OSF1:*:*)
+       case $UNAME_RELEASE in
+       *4.0)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+               ;;
+       *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
+       # types through head -n 1, so we only detect the type of CPU 0.
+       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+       case "$ALPHA_CPU_TYPE" in
+           "EV4 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE="alpha" ;;
+           "EV5 (21164)")
+               UNAME_MACHINE="alphaev5" ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE="alphaev56" ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE="alphapca56" ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE="alphapca57" ;;
+           "EV6 (21264)")
+               UNAME_MACHINE="alphaev6" ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE="alphaev67" ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE="alphaev69" ;;
+           "EV7 (21364)")
+               UNAME_MACHINE="alphaev7" ;;
+           "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/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
+    Alpha\ *:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # Should we change UNAME_MACHINE based on the output of uname instead
+       # of the specific Alpha model?
+       echo alpha-pc-interix
+       exit ;;
+    21064:Windows_NT:50:3)
+       echo alpha-dec-winnt3.5
+       exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-unknown-sysv4
+       exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-amigaos
+       exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-morphos
+       exit ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       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 ;;
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+       echo hppa1.1-hitachi-hiuxmpp
+       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
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit ;;
+    NILE*:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       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 ;;
+       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 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       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 ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       exit ;;
+    sun3*:SunOS:*:*)
+       echo m68k-sun-sunos${UNAME_RELEASE}
+       exit ;;
+    sun*:*:4.2BSD:*)
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+       case "`/bin/arch`" in
+           sun3)
+               echo m68k-sun-sunos${UNAME_RELEASE}
+               ;;
+           sun4)
+               echo sparc-sun-sunos${UNAME_RELEASE}
+               ;;
+       esac
+       exit ;;
+    aushp:SunOS:*:*)
+       echo sparc-auspex-sunos${UNAME_RELEASE}
+       exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # 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 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+       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 ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+       echo clipper-intergraph-clix${UNAME_RELEASE}
+       exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
+       echo mips-mips-riscos${UNAME_RELEASE}
+       exit ;;
+    Motorola:PowerMAX_OS:*:*)
+       echo powerpc-motorola-powermax
+       exit ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit ;;
+    AViiON:dgux:*:*)
+       # 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 ] || \
+              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           then
+               echo m88k-dg-dgux${UNAME_RELEASE}
+           else
+               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+           fi
+       else
+           echo i586-dg-dgux${UNAME_RELEASE}
+       fi
+       exit ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit ;;
+    *:IRIX*:*:*)
+       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+       echo i386-ibm-aix
+       exit ;;
+    ia64:AIX:*:*)
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:2:3)
+       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               eval $set_cc_for_build
+               sed 's/^                //' << EOF >$dummy.c
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               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:*:[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
+       else
+               IBM_ARCH=powerpc
+       fi
+       if [ -x /usr/bin/lslpp ] ; then
+               IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+       echo romp-ibm-bsd4.4
+       exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       echo m68k-hp-bsd4.4
+       exit ;;
+    9000/[34678]??:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       case "${UNAME_MACHINE}" in
+           9000/31? )            HP_ARCH=m68000 ;;
+           9000/[34]?? )         HP_ARCH=m68k ;;
+           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" ;;
+                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                       esac ;;
+                   esac
+               fi
+               if [ "${HP_ARCH}" = "" ]; then
+                   eval $set_cc_for_build
+                   sed 's/^            //' << EOF >$dummy.c
+
+               #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);
+
+                   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
+               fi ;;
+       esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           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
+               HP_ARCH="hppa64"
+           fi
+       fi
+       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       exit ;;
+    ia64:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux${HPUX_REV}
+       exit ;;
+    3050*:HI-UX:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
+       echo unknown-hitachi-hiuxwe2
+       exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+       echo hppa1.1-hp-bsd
+       exit ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+       echo hppa1.1-hp-osf
+       exit ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit ;;
+    i*86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo ${UNAME_MACHINE}-unknown-osf1mk
+       else
+           echo ${UNAME_MACHINE}-unknown-osf1
+       fi
+       exit ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+       exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+       exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+       exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+       exit ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       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 ;;
+    CRAY*TS:*:*:*)
+       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*T3E:*:*:*)
+       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*SV1:*:*:*)
+       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    *:UNICOS/mp:*:*)
+       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 ;;
+    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 ;;
+    sparc*:BSD/OS:*:*)
+       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       exit ;;
+    *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       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 ;;
+    *:MINGW64*:*)
+       echo ${UNAME_MACHINE}-pc-mingw64
+       exit ;;
+    *:MINGW*:*)
+       echo ${UNAME_MACHINE}-pc-mingw32
+       exit ;;
+    *:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
+    i*:PW*:*)
+       echo ${UNAME_MACHINE}-pc-pw32
+       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 ;;
+    8664:Windows_NT:*)
+       echo x86_64-pc-mks
+       exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+       # UNAME_MACHINE based on the output of uname instead of i386?
+       echo i586-pc-interix
+       exit ;;
+    i*:UWIN*:*)
+       echo ${UNAME_MACHINE}-pc-uwin
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
+    p*:CYGWIN*:*)
+       echo powerpcle-unknown-cygwin
+       exit ;;
+    prep*:SunOS:5.*:*)
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    *:GNU:*:*)
+       # the GNU system
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       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 ;;
+    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:*:*)
+       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 ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    crisv32:Linux:*:*)
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    e2k:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-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-${LIBC}
+       exit ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    m68*: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 ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       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-${LIBC}"; exit; }
+       ;;
+    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-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
+       esac
+       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-${LIBC}
+       exit ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sh*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+       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 ${UNAME_MACHINE}-pc-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 ;;
+    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,
+       # I just have to hope.  -- rms.
+       # Use sysv4.2uw... so that sysv4* matches it.
+       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       exit ;;
+    i*86:OS/2:*:*)
+       # If we were able to find `uname', then EMX Unix compatibility
+       # is probably installed.
+       echo ${UNAME_MACHINE}-pc-os2-emx
+       exit ;;
+    i*86:XTS-300:*:STOP)
+       echo ${UNAME_MACHINE}-unknown-stop
+       exit ;;
+    i*86:atheos:*:*)
+       echo ${UNAME_MACHINE}-unknown-atheos
+       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 ;;
+    i*86:*DOS:*:*)
+       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       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
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+       fi
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       case `/bin/uname -X | grep "^Machine"` in
+           *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 ;;
+    i*86:*:3.2:*)
+       if test -f /usr/options/cb.name; then
+               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       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 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 ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       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 ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       test -r /etc/.relid \
+           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /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 ;;
+    mc68030:UNIX_System_V:4.*:*)
+       echo m68k-atari-sysv4
+       exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    rs6000:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv${UNAME_RELEASE}
+       exit ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo ${UNAME_MACHINE}-sni-sysv4
+       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 ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       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 ;;
+    mc68*:A/UX:*:*)
+       echo m68k-apple-aux${UNAME_RELEASE}
+       exit ;;
+    news*:NEWS-OS:6*:*)
+       echo mips-sony-newsos6
+       exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+       if [ -d /usr/nec ]; then
+               echo mips-nec-sysv${UNAME_RELEASE}
+       else
+               echo mips-unknown-sysv${UNAME_RELEASE}
+       fi
+       exit ;;
+    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
+       echo powerpc-be-beos
+       exit ;;
+    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
+       echo powerpc-apple-beos
+       exit ;;
+    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
+       echo i586-pc-beos
+       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 ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux${UNAME_RELEASE}
+       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 ;;
+    *:Rhapsody:*:*)
+       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       exit ;;
+    *:Darwin:*:*)
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       eval $set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       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 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = "x86"; then
+               UNAME_PROCESSOR=i386
+               UNAME_MACHINE=pc
+       fi
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       exit ;;
+    *:QNX:*:4*)
+       echo i386-pc-qnx
+       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 ;;
+    *:NonStop-UX:*:*)
+       echo mips-compaq-nonstopux
+       exit ;;
+    BS2000:POSIX*:*:*)
+       echo bs2000-siemens-sysv
+       exit ;;
+    DS/*:UNIX_System_V:*:*)
+       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       exit ;;
+    *:Plan9:*:*)
+       # "uname -m" is not consistent, so use $cputype instead. 386
+       # is converted to i386 for consistency with other x86
+       # operating systems.
+       if test "$cputype" = "386"; then
+           UNAME_MACHINE=i386
+       else
+           UNAME_MACHINE="$cputype"
+       fi
+       echo ${UNAME_MACHINE}-unknown-plan9
+       exit ;;
+    *:TOPS-10:*:*)
+       echo pdp10-unknown-tops10
+       exit ;;
+    *:TENEX:*:*)
+       echo pdp10-unknown-tenex
+       exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+       echo pdp10-dec-tops20
+       exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+       echo pdp10-xkl-tops20
+       exit ;;
+    *:TOPS-20:*:*)
+       echo pdp10-unknown-tops20
+       exit ;;
+    *:ITS:*:*)
+       echo pdp10-unknown-its
+       exit ;;
+    SEI:*:*:SEIUX)
+       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
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+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
+
+  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
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/spl/config/config.sub b/spl/config/config.sub
new file mode 100755 (executable)
index 0000000..1acc966
--- /dev/null
@@ -0,0 +1,1813 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
+
+timestamp='2015-08-20'
+
+# 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.
+#
+# 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 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>.
+#
+# 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.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2015 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+       -sun*os*)
+               # Prevent following clause from handling this invalid input.
+               ;;
+       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+       -apple | -axis | -knuth | -cray | -microblaze*)
+               os=
+               basic_machine=$1
+               ;;
+       -bluegene*)
+               os=-cnk
+               ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -scout)
+               ;;
+       -wrs)
+               os=-vxworks
+               basic_machine=$1
+               ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
+       -hiux*)
+               os=-hiuxwe2
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5)
+               os=-sco3.2v5
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco4)
+               os=-sco3.2v4
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2v[4-9]*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco*)
+               os=-sco3.2v2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -udk*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -isc)
+               os=-isc2.2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -clix*)
+               basic_machine=clipper-intergraph
+               ;;
+       -isc*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
+       -lynx*)
+               os=-lynxos
+               ;;
+       -ptx*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+               ;;
+       -windowsnt*)
+               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+       # Recognize the basic CPU types without company name.
+       # Some are omitted here because they have special meanings below.
+       1750a | 580 \
+       | a29k \
+       | aarch64 | aarch64_be \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | am33_2.0 \
+       | arc | arceb \
+       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+       | avr | avr32 \
+       | ba \
+       | be32 | be64 \
+       | bfin \
+       | c4x | c8051 | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | e2k | epiphany \
+       | fido | fr30 | frv | ft32 \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | k1om \
+       | le32 | le64 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa32r6 | mipsisa32r6el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64r6 | mipsisa64r6el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipsr5900 | mipsr5900el \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 | nios2eb | nios2el \
+       | ns16k | ns32k \
+       | open8 | or1k | or1knd | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
+       | pyramid \
+       | riscv32 | riscv64 \
+       | rl78 | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu \
+       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+       | visium \
+       | we32k \
+       | x86 | xc16x | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       leon|leon[3-9])
+               basic_machine=sparc-$basic_machine
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       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
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+         basic_machine=$basic_machine-pc
+         ;;
+       # Object if more than one company name word.
+       *-*-*)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+       # Recognize the basic CPU types with company name.
+       580-* \
+       | a29k-* \
+       | aarch64-* | aarch64_be-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* | avr32-* \
+       | ba-* \
+       | be32-* | be64-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | e2k-* | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | k1om-* \
+       | le32-* | le64-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | microblaze-* | microblazeel-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa32r6-* | mipsisa32r6el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64r6-* | mipsisa64r6el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipsr5900-* | mipsr5900el-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* | nios2eb-* | nios2el-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
+       | or1k*-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+       | pyramid-* \
+       | riscv32-* | riscv64-* \
+       | rl78-* | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+       | tahoe-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile*-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
+       | visium-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               basic_machine=i386-unknown
+               os=-bsd
+               ;;
+       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+               basic_machine=m68000-att
+               ;;
+       3b*)
+               basic_machine=we32k-att
+               ;;
+       a29khif)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       abacus)
+               basic_machine=abacus-unknown
+               ;;
+       adobe68k)
+               basic_machine=m68010-adobe
+               os=-scout
+               ;;
+       alliant | fx80)
+               basic_machine=fx80-alliant
+               ;;
+       altos | altos3068)
+               basic_machine=m68k-altos
+               ;;
+       am29k)
+               basic_machine=a29k-none
+               os=-bsd
+               ;;
+       amd64)
+               basic_machine=x86_64-pc
+               ;;
+       amd64-*)
+               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       amdahl)
+               basic_machine=580-amdahl
+               os=-sysv
+               ;;
+       amiga | amiga-*)
+               basic_machine=m68k-unknown
+               ;;
+       amigaos | amigados)
+               basic_machine=m68k-unknown
+               os=-amigaos
+               ;;
+       amigaunix | amix)
+               basic_machine=m68k-unknown
+               os=-sysv4
+               ;;
+       apollo68)
+               basic_machine=m68k-apollo
+               os=-sysv
+               ;;
+       apollo68bsd)
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+        asmjs)
+               basic_machine=asmjs-unknown
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+       cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       convex-c1)
+               basic_machine=c1-convex
+               os=-bsd
+               ;;
+       convex-c2)
+               basic_machine=c2-convex
+               os=-bsd
+               ;;
+       convex-c32)
+               basic_machine=c32-convex
+               os=-bsd
+               ;;
+       convex-c34)
+               basic_machine=c34-convex
+               os=-bsd
+               ;;
+       convex-c38)
+               basic_machine=c38-convex
+               os=-bsd
+               ;;
+       cray | j90)
+               basic_machine=j90-cray
+               os=-unicos
+               ;;
+       craynv)
+               basic_machine=craynv-cray
+               os=-unicosmp
+               ;;
+       cr16 | cr16-*)
+               basic_machine=cr16-unknown
+               os=-elf
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
+       cris | cris-* | etrax*)
+               basic_machine=cris-axis
+               ;;
+       crx)
+               basic_machine=crx-unknown
+               os=-elf
+               ;;
+       da30 | da30-*)
+               basic_machine=m68k-da30
+               ;;
+       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+               basic_machine=mips-dec
+               ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
+       delta | 3300 | motorola-3300 | motorola-delta \
+             | 3300-motorola | delta-motorola)
+               basic_machine=m68k-motorola
+               ;;
+       delta88)
+               basic_machine=m88k-motorola
+               os=-sysv3
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
+       dpx20 | dpx20-*)
+               basic_machine=rs6000-bull
+               os=-bosx
+               ;;
+       dpx2* | dpx2*-bull)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       ebmon29k)
+               basic_machine=a29k-amd
+               os=-ebmon
+               ;;
+       elxsi)
+               basic_machine=elxsi-elxsi
+               os=-bsd
+               ;;
+       encore | umax | mmax)
+               basic_machine=ns32k-encore
+               ;;
+       es1800 | OSE68k | ose68k | ose | OSE)
+               basic_machine=m68k-ericsson
+               os=-ose
+               ;;
+       fx2800)
+               basic_machine=i860-alliant
+               ;;
+       genix)
+               basic_machine=ns32k-ns
+               ;;
+       gmicro)
+               basic_machine=tron-gmicro
+               os=-sysv
+               ;;
+       go32)
+               basic_machine=i386-pc
+               os=-go32
+               ;;
+       h3050r* | hiux*)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       h8300hms)
+               basic_machine=h8300-hitachi
+               os=-hms
+               ;;
+       h8300xray)
+               basic_machine=h8300-hitachi
+               os=-xray
+               ;;
+       h8500hms)
+               basic_machine=h8500-hitachi
+               os=-hms
+               ;;
+       harris)
+               basic_machine=m88k-harris
+               os=-sysv3
+               ;;
+       hp300-*)
+               basic_machine=m68k-hp
+               ;;
+       hp300bsd)
+               basic_machine=m68k-hp
+               os=-bsd
+               ;;
+       hp300hpux)
+               basic_machine=m68k-hp
+               os=-hpux
+               ;;
+       hp3k9[0-9][0-9] | hp9[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k2[0-9][0-9] | hp9k31[0-9])
+               basic_machine=m68000-hp
+               ;;
+       hp9k3[2-9][0-9])
+               basic_machine=m68k-hp
+               ;;
+       hp9k6[0-9][0-9] | hp6[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k7[0-79][0-9] | hp7[0-79][0-9])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k78[0-9] | hp78[0-9])
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][13679] | hp8[0-9][13679])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][0-9] | hp8[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hppa-next)
+               os=-nextstep3
+               ;;
+       hppaosf)
+               basic_machine=hppa1.1-hp
+               os=-osf
+               ;;
+       hppro)
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
+       i370-ibm* | ibm*)
+               basic_machine=i370-ibm
+               ;;
+       i*86v32)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv32
+               ;;
+       i*86v4*)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv4
+               ;;
+       i*86v)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv
+               ;;
+       i*86sol2)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-solaris2
+               ;;
+       i386mach)
+               basic_machine=i386-mach
+               os=-mach
+               ;;
+       i386-vsta | vsta)
+               basic_machine=i386-unknown
+               os=-vsta
+               ;;
+       iris | iris4d)
+               basic_machine=mips-sgi
+               case $os in
+                   -irix*)
+                       ;;
+                   *)
+                       os=-irix4
+                       ;;
+               esac
+               ;;
+       isi68 | isi)
+               basic_machine=m68k-isi
+               os=-sysv
+               ;;
+       leon-*|leon[3-9]-*)
+               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+       microblaze*)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw64)
+               basic_machine=x86_64-pc
+               os=-mingw64
+               ;;
+       mingw32)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+       mips3*-*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               ;;
+       mips3*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               ;;
+       monitor)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
+       moxiebox)
+               basic_machine=moxie-unknown
+               os=-moxiebox
+               ;;
+       msdos)
+               basic_machine=i386-pc
+               os=-msdos
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       msys)
+               basic_machine=i686-pc
+               os=-msys
+               ;;
+       mvs)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
+       nacl)
+               basic_machine=le32-unknown
+               os=-nacl
+               ;;
+       ncr3000)
+               basic_machine=i486-ncr
+               os=-sysv4
+               ;;
+       netbsd386)
+               basic_machine=i386-unknown
+               os=-netbsd
+               ;;
+       netwinder)
+               basic_machine=armv4l-rebel
+               os=-linux
+               ;;
+       news | news700 | news800 | news900)
+               basic_machine=m68k-sony
+               os=-newsos
+               ;;
+       news1000)
+               basic_machine=m68030-sony
+               os=-newsos
+               ;;
+       news-3600 | risc-news)
+               basic_machine=mips-sony
+               os=-newsos
+               ;;
+       necv70)
+               basic_machine=v70-nec
+               os=-sysv
+               ;;
+       next | m*-next )
+               basic_machine=m68k-next
+               case $os in
+                   -nextstep* )
+                       ;;
+                   -ns2*)
+                     os=-nextstep2
+                       ;;
+                   *)
+                     os=-nextstep3
+                       ;;
+               esac
+               ;;
+       nh3000)
+               basic_machine=m68k-harris
+               os=-cxux
+               ;;
+       nh[45]000)
+               basic_machine=m88k-harris
+               os=-cxux
+               ;;
+       nindy960)
+               basic_machine=i960-intel
+               os=-nindy
+               ;;
+       mon960)
+               basic_machine=i960-intel
+               os=-mon960
+               ;;
+       nonstopux)
+               basic_machine=mips-compaq
+               os=-nonstopux
+               ;;
+       np1)
+               basic_machine=np1-gould
+               ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
+       nsr-tandem)
+               basic_machine=nsr-tandem
+               ;;
+       op50n-* | op60c-*)
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       openrisc | openrisc-*)
+               basic_machine=or32-unknown
+               ;;
+       os400)
+               basic_machine=powerpc-ibm
+               os=-os400
+               ;;
+       OSE68000 | ose68000)
+               basic_machine=m68000-ericsson
+               os=-ose
+               ;;
+       os68k)
+               basic_machine=m68k-none
+               os=-os68k
+               ;;
+       pa-hitachi)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       paragon)
+               basic_machine=i860-intel
+               os=-osf
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium | p5 | k5 | k6 | nexgen | viac3)
+               basic_machine=i586-pc
+               ;;
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
+               basic_machine=i686-pc
+               ;;
+       pentiumii | pentium2 | pentiumiii | pentium3)
+               basic_machine=i686-pc
+               ;;
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-* | 6x86-* | athlon-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium4-*)
+               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=power-ibm
+               ;;
+       ppc | ppcbe)    basic_machine=powerpc-unknown
+               ;;
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle | ppc-le | powerpc-little)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ps2)
+               basic_machine=i386-ibm
+               ;;
+       pw32)
+               basic_machine=i586-unknown
+               os=-pw32
+               ;;
+       rdos | rdos64)
+               basic_machine=x86_64-pc
+               os=-rdos
+               ;;
+       rdos32)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       rom68k)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       rm[46]00)
+               basic_machine=mips-siemens
+               ;;
+       rtpc | rtpc-*)
+               basic_machine=romp-ibm
+               ;;
+       s390 | s390-*)
+               basic_machine=s390-ibm
+               ;;
+       s390x | s390x-*)
+               basic_machine=s390x-ibm
+               ;;
+       sa29200)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       sb1)
+               basic_machine=mipsisa64sb1-unknown
+               ;;
+       sb1el)
+               basic_machine=mipsisa64sb1el-unknown
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparclite-wrs | simso-wrs)
+               basic_machine=sparclite-wrs
+               os=-vxworks
+               ;;
+       sps7)
+               basic_machine=m68k-bull
+               os=-sysv2
+               ;;
+       spur)
+               basic_machine=spur-unknown
+               ;;
+       st2000)
+               basic_machine=m68k-tandem
+               ;;
+       stratus)
+               basic_machine=i860-stratus
+               os=-sysv4
+               ;;
+       strongarm-* | thumb-*)
+               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       sun2)
+               basic_machine=m68000-sun
+               ;;
+       sun2os3)
+               basic_machine=m68000-sun
+               os=-sunos3
+               ;;
+       sun2os4)
+               basic_machine=m68000-sun
+               os=-sunos4
+               ;;
+       sun3os3)
+               basic_machine=m68k-sun
+               os=-sunos3
+               ;;
+       sun3os4)
+               basic_machine=m68k-sun
+               os=-sunos4
+               ;;
+       sun4os3)
+               basic_machine=sparc-sun
+               os=-sunos3
+               ;;
+       sun4os4)
+               basic_machine=sparc-sun
+               os=-sunos4
+               ;;
+       sun4sol2)
+               basic_machine=sparc-sun
+               os=-solaris2
+               ;;
+       sun3 | sun3-*)
+               basic_machine=m68k-sun
+               ;;
+       sun4)
+               basic_machine=sparc-sun
+               ;;
+       sun386 | sun386i | roadrunner)
+               basic_machine=i386-sun
+               ;;
+       sv1)
+               basic_machine=sv1-cray
+               os=-unicos
+               ;;
+       symmetry)
+               basic_machine=i386-sequent
+               os=-dynix
+               ;;
+       t3e)
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
+               os=-unicos
+               ;;
+       tile*)
+               basic_machine=$basic_machine-unknown
+               os=-linux-gnu
+               ;;
+       tx39)
+               basic_machine=mipstx39-unknown
+               ;;
+       tx39el)
+               basic_machine=mipstx39el-unknown
+               ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
+       tower | tower-32)
+               basic_machine=m68k-ncr
+               ;;
+       tpf)
+               basic_machine=s390x-ibm
+               os=-tpf
+               ;;
+       udi29k)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       ultra3)
+               basic_machine=a29k-nyu
+               os=-sym1
+               ;;
+       v810 | necv810)
+               basic_machine=v810-nec
+               os=-none
+               ;;
+       vaxv)
+               basic_machine=vax-dec
+               os=-sysv
+               ;;
+       vms)
+               basic_machine=vax-dec
+               os=-vms
+               ;;
+       vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+       vxworks960)
+               basic_machine=i960-wrs
+               os=-vxworks
+               ;;
+       vxworks68)
+               basic_machine=m68k-wrs
+               os=-vxworks
+               ;;
+       vxworks29k)
+               basic_machine=a29k-wrs
+               os=-vxworks
+               ;;
+       w65*)
+               basic_machine=w65-wdc
+               os=-none
+               ;;
+       w89k-*)
+               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
+               ;;
+       z8k-*-coff)
+               basic_machine=z8k-unknown
+               os=-sim
+               ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               basic_machine=hppa1.1-winbond
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp10)
+               # there are many clones, so DEC is not a safe bet
+               basic_machine=pdp10-unknown
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               basic_machine=sparc-sun
+               ;;
+       cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       *-unknown)
+               # Make sure to match an already-canonicalized machine name.
+               ;;
+       *)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+       # First match some system type aliases
+       # that might get confused with valid system types.
+       # -solaris* is a basic system type, with this one exception.
+       -auroraux)
+               os=-auroraux
+               ;;
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -svr4*)
+               os=-sysv4
+               ;;
+       -unixware*)
+               os=-sysv4.2uw
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # First accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST END IN A *, to match a version number.
+       # -sysv* is not here because it comes later, after sysvr4.
+       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* | -plan9* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* | -cloudabi* | -sortix* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* \
+             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
+             | -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* | -dragonfly* \
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -qnx*)
+               case $basic_machine in
+                   x86-* | i*86-*)
+                       ;;
+                   *)
+                       os=-nto$os
+                       ;;
+               esac
+               ;;
+       -nto-qnx*)
+               ;;
+       -nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+               ;;
+       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+             | -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|'`
+               ;;
+       -sunos5*)
+               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -opened*)
+               os=-openedition
+               ;;
+       -os400*)
+               os=-os400
+               ;;
+       -wince*)
+               os=-wince
+               ;;
+       -osfrose*)
+               os=-osfrose
+               ;;
+       -osf*)
+               os=-osf
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -syllable*)
+               os=-syllable
+               ;;
+       -386bsd)
+               os=-bsd
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
+       -ns2 )
+               os=-nextstep2
+               ;;
+       -nsk*)
+               os=-nsk
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+       -tpf*)
+               os=-tpf
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -ose*)
+               os=-ose
+               ;;
+       -es1800*)
+               os=-ose
+               ;;
+       -xenix)
+               os=-xenix
+               ;;
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -aros*)
+               os=-aros
+               ;;
+       -zvmoe)
+               os=-zvmoe
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -nacl*)
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+       score-*)
+               os=-elf
+               ;;
+       spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+       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
+               ;;
+       pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mep-*)
+               os=-elf
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
+       or32-*)
+               os=-coff
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       *-be)
+               os=-beos
+               ;;
+       *-haiku)
+               os=-haiku
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-knuth)
+               os=-mmixware
+               ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigaos
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next )
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-next)
+               os=-nextstep3
+               ;;
+       *-gould)
+               os=-sysv
+               ;;
+       *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+       *-sgi)
+               os=-irix
+               ;;
+       *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f30[01]-fujitsu | f700-fujitsu)
+               os=-uxpv
+               ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
+       *)
+               os=-none
+               ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+       *-unknown)
+               case $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -cnk*|-aix*)
+                               vendor=ibm
+                               ;;
+                       -beos*)
+                               vendor=be
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs* | -opened*)
+                               vendor=ibm
+                               ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -tpf*)
+                               vendor=ibm
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                               vendor=atari
+                               ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
+               esac
+               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/spl/config/depcomp b/spl/config/depcomp
new file mode 100755 (executable)
index 0000000..fc98710
--- /dev/null
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can 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.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  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 outputting dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+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
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+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
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+  # 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
+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
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+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).  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
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # 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.
+## 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.
+## 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.  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.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # 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
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # 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
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  set_dir_from "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  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
+  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"
+  ;;
+
+## 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 '\' :
+  #    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
+
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  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"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # '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.
+  set_dir_from  "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
+  else
+    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.
+  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
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # 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.
+  "$@" $dashmflag |
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$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"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$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
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    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"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+        set fnord "$@"
+        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::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# 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/spl/config/install-sh b/spl/config/install-sh
new file mode 100755 (executable)
index 0000000..0b0fdcb
--- /dev/null
@@ -0,0 +1,501 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2013-12-25.23; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# 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
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab='  '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
+
+    -o) chowncmd="$chownprog $2"
+        shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
+
+    -T) is_target_a_directory=never;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --) shift
+        break;;
+
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    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
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # 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
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
+  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.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      dstdir=`dirname "$dst"`
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/d" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      set -f
+      set fnord $dstdir
+      shift
+      set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       set +f &&
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# 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/spl/config/libtool.m4 b/spl/config/libtool.m4
new file mode 100644 (file)
index 0000000..d7c043f
--- /dev/null
@@ -0,0 +1,7997 @@
+# 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, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# 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.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+                  [m4_fatal([Libtool version $1 or higher is required],
+                            63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\    *)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+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
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+       [m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+       [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+       [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+          m4_quote(lt_decl_varnames),
+       m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+                       lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+                                          [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+       dnl If the libtool generation code has been placed in $CONFIG_LT,
+       dnl instead of duplicating it all over again into config.status,
+       dnl then we will have config.status run $CONFIG_LT later, so it
+       dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+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) 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."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_REPLACE_SHELLFNS
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+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)],
+  [Windows Resource],  [_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _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],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+       [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+       [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(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)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # 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
+       fi
+       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
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+       [lt_cv_ld_exported_symbols_list=yes],
+       [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
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_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 -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
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[[012]]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _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
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
+
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # 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.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+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
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         powerpcle-*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*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*)
+        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"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test "$ac_status" -eq 0; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       AC_TRY_EVAL([lt_ar_try])
+       if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    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
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[        ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # 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"`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen="dlopen"],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+        [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+        [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+        [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+       [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+       [], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  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
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  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
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[23]].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  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"
+  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=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  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'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux # correct to gnu/linux during the next big refactor
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+        LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+        [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsdelf*-gnu)
+  version_type=linux
+  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
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  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
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  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
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  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=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  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
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    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
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/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}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  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
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+        [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+       [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # 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};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT@&t@_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+       # This hack is so that the source file can tell whether it is being
+       # built for inclusion in a dll (and should export symbols for example).
+       m4_if([$1], [GCJ], [],
+         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           if test "$host_cpu" != ia64; then
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         ecpc* )
+           # old Intel C++ for x86_64 which still supported -KPIC.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         icpc* )
+           # Intel C++, used to be incompatible with GCC.
+           # ICC 10 doesn't accept -KPIC any more.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC* | pgcpp*)
+           # Portland Group C++ compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+           # IBM XL 8.0, 9.0 on PPC and BlueGene
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *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)='-Qoption ld '
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd* | netbsdelf*-gnu)
+       ;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _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 '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      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
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *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
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+       [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+       [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+       [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    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']
+      ;;
+    esac
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _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']
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         _LT_TAGVAR(whole_archive_flag_spec, $1)=
+         tmp_sharedflag='--shared' ;;
+       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       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)='${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~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         _LT_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+       _LT_TAGVAR(link_all_deplibs, $1)=no
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         fi
+         _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=yes
+       _LT_TAGVAR(file_list_spec, $1)='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+         else
+           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+         fi~
+         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+         linknames='
+       # 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'
+       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+         lt_tool_outputfile="@TOOL_OUTPUT@"~
+         case $lt_outputfile in
+           *.exe|*.EXE) ;;
+           *)
+             lt_outputfile="$lt_outputfile.exe"
+             lt_tool_outputfile="$lt_tool_outputfile.exe"
+             ;;
+         esac~
+         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+           $RM "$lt_outputfile.manifest";
+         fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       # FIXME: Should let the user specify the lib program.
+       _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $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
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    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
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+       m4_if($1, [], [
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         _LT_LINKER_OPTION([if $CC understands -b],
+           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+         [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_TAGVAR(hardcode_direct, $1)=no
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       *)
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+         [lt_cv_irix_exported_symbol],
+         [save_LDFLAGS="$LDFLAGS"
+          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+          AC_LINK_IFELSE(
+            [AC_LANG_SOURCE(
+               [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+                             [C++], [[int foo (void) { return 0; }]],
+                             [Fortran 77], [[
+      subroutine foo
+      end]],
+                             [Fortran], [[
+      subroutine foo
+      end]])])],
+             [lt_cv_irix_exported_symbol=yes],
+             [lt_cv_irix_exported_symbol=no])
+           LDFLAGS="$save_LDFLAGS"])
+       if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+       fi
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       else
+         case $host_os in
+          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+            _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+            ;;
+          *)
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+       [$RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+         pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+         _LT_TAGVAR(allow_undefined_flag, $1)=
+         if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+         then
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+         else
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         fi
+         _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+       ])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_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_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## 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_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_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_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # 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_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+         $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+           for ld_flag in $LDFLAGS; do
+             case $ld_flag in
+             *-brtl*)
+               aix_use_runtimelinking=yes
+               break
+               ;;
+             esac
+           done
+           ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+           # We have reworked collect2
+           :
+         else
+           # We have old collect2
+           _LT_TAGVAR(hardcode_direct, $1)=unsupported
+           # It fails to find uninstalled libraries when the uninstalled
+           # path is not listed in the libpath.  Setting hardcode_minus_L
+           # to unsupported forces relinking
+           _LT_TAGVAR(hardcode_minus_L, $1)=yes
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+          esac
+          shared_flag='-shared'
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag="$shared_flag "'${wl}-G'
+         fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+         # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+          else
+           if test "$aix_use_runtimelinking" = yes; then
+             shared_flag='${wl}-G'
+           else
+             shared_flag='${wl}-bM:SRE'
+           fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+       # export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX([$1])
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+           # Determine the default libpath from the value encoded in an
+           # empty executable.
+           _LT_SYS_MODULE_PATH_AIX([$1])
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+           # Warning - without using the other run time loading flags,
+           # -berok will link without error, but may produce a broken library.
+           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+           if test "$with_gnu_ld" = yes; then
+             # We only use this code for GNU lds that support --whole-archive.
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           else
+             # Exported symbols can be pulled into shared objects from archives
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+           fi
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+           # This is similar to how AIX traditionally builds its shared
+           # libraries.
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+         # support --undefined.  This deserves some investigation.  FIXME
+         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+         # FIXME: insert proper C++ library support
+         _LT_TAGVAR(ld_shlibs, $1)=no
+         ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+       case $GXX,$cc_basename in
+       ,cl* | no,cl*)
+         # Native MSVC
+         # hardcode_libdir_flag_spec is actually meaningless, as there is
+         # no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=yes
+         _LT_TAGVAR(file_list_spec, $1)='@'
+         # Tell ltmain to make .lib files, not .a files.
+         libext=lib
+         # Tell ltmain to make .dll files, not .so files.
+         shrext_cmds=".dll"
+         # FIXME: Setting linknames here is a bad hack.
+         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+             $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+           else
+             $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+           fi~
+           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+           linknames='
+         # 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
+         # Don't use ranlib
+         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+           lt_tool_outputfile="@TOOL_OUTPUT@"~
+           case $lt_outputfile in
+             *.exe|*.EXE) ;;
+             *)
+               lt_outputfile="$lt_outputfile.exe"
+               lt_tool_outputfile="$lt_tool_outputfile.exe"
+               ;;
+           esac~
+           func_to_tool_file "$lt_outputfile"~
+           if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+             $RM "$lt_outputfile.manifest";
+           fi'
+         ;;
+       *)
+         # g++
+         # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+         # as there is no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=no
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+         if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+           # If the export-symbols file already is a .def file (1st line
+           # is EXPORTS), use it as is; otherwise, prepend...
+           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+             cp $export_symbols $output_objdir/$soname.def;
+           else
+             echo EXPORTS > $output_objdir/$soname.def;
+             cat $export_symbols >> $output_objdir/$soname.def;
+           fi~
+           $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+         ;;
+       esac
+       ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+       ;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          ghcx*)
+           # Green Hills C++ Compiler
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+       # switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                            # but as the default
+                                            # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                                # but as the default
+                                                # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          aCC*)
+           case $host_cpu in
+             hppa*64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             ia64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             *)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+           esac
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test $with_gnu_ld = no; then
+               case $host_cpu in
+                 hppa*64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 ia64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 *)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+               esac
+             fi
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+       _LT_TAGVAR(hardcode_direct, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+       # Instead, shared libraries are loaded at an image base (0x10000000 by
+       # default) and relocated if they conflict, which is a slow very memory
+       # consuming and fragmenting process.  To avoid this, we pick a random,
+       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       ;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+           # SGI C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+           # Archives containing C++ object files must be created using
+           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test "$with_gnu_ld" = no; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+             else
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+             fi
+           fi
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+           ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+           # Archives containing C++ object files must be created using
+           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+           ;;
+         icpc* | ecpc* )
+           # Intel C++
+           with_gnu_ld=yes
+           # version 8.0 and above of icpc choke on multiply defined symbols
+           # if we add $predep_objects and $postdep_objects, however 7.1 and
+           # earlier do not add the objects themselves.
+           case `$CC -V 2>&1` in
+             *"Version 7."*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+             *)  # Version 8.0 or newer
+               tmp_idyn=
+               case $host_cpu in
+                 ia64*) tmp_idyn=' -i_dynamic';;
+               esac
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+           esac
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+           case `$CC -V` in
+           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+             _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+               $RANLIB $oldlib'
+             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           *) # Version 6 and above use weak symbols
+             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+         cxx*)
+           # Compaq C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+           runpath_var=LD_RUN_PATH
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+           ;;
+         xl* | mpixl* | bgxl*)
+           # IBM XL 8.0 on PPC, with GNU ld
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           if test "x$supports_anon_versioning" = xyes; then
+             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+               echo "local: *; };" >> $output_objdir/$libname.ver~
+               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+           fi
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+             _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+             # Not sure whether something based on
+             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+             # would be better.
+             output_verbose_link_cmd='func_echo_all'
+
+             # Archives containing C++ object files must be created using
+             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+             # necessary to make sure instantiated templates are included
+             # in the archive.
+             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+         *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+       esac
+       ;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+         wlarc=
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       fi
+       # Workaround some broken pre-1.5 toolchains
+       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+       ;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+       ;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      openbsd*)
+       if test -f /usr/libexec/ld.so; then
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+         fi
+         output_verbose_link_cmd=func_echo_all
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Archives containing C++ object files must be created using
+           # the KAI C++ compiler.
+           case $host in
+             osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+             *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+           esac
+           ;;
+          RCC*)
+           # Rational C++ 2.4.1
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          cxx*)
+           case $host in
+             osf3*)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+               ;;
+             *)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                 echo "-hidden">> $lib.exp~
+                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+                 $RM $lib.exp'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+               ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+         *)
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+             case $host in
+               osf3*)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+               *)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+             esac
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+             # Commands to make compiler produce verbose output that lists
+             # what "hidden" libraries, object files and flags are used when
+             # linking a shared library.
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+           # Sun C++ 4.x
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          lcc*)
+           # Lucid
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+           _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+           case $host_os in
+             solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+             *)
+               # The compiler driver will combine and reorder linker options,
+               # but understands `-z linker_flag'.
+               # Supported since Solaris 2.6 (maybe 2.5.1?)
+               _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+               ;;
+           esac
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+           output_verbose_link_cmd='func_echo_all'
+
+           # Archives containing C++ object files must be created using
+           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+           ;;
+          gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+           # The C++ compiler must be used to create the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+           ;;
+          *)
+           # GNU C++ compiler with Solaris linker
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             else
+               # g++ 2.7 appears to require `-G' NOT `-shared' on this
+               # platform.
+               _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             fi
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+             case $host_os in
+               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+               *)
+                 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+                 ;;
+             esac
+           fi
+           ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+       # Note: We can NOT use -z defs as we might desire, because we do not
+       # link with -lc, and that would cause any symbols used from libc to
+       # always be unresolved, which means just about no library would
+       # ever link correctly.  If we're not using GNU ld we use -z text
+       # though, which does catch some bad symbols but isn't as heavy-handed
+       # as -z defs.
+       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+       _LT_TAGVAR(link_all_deplibs, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+       runpath_var='LD_RUN_PATH'
+
+       case $cc_basename in
+          CC*)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+             '"$_LT_TAGVAR(old_archive_cmds, $1)"
+           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+             '"$_LT_TAGVAR(reload_cmds, $1)"
+           ;;
+         *)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           ;;
+       esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+           # NonStop-UX NCC 3.20
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## 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...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_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
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+        prev=$p
+        continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+        case ${prev} in
+        -L | -R)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+          _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+          _LT_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+          _LT_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_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_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # 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_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## 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...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_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_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # 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_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## 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...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# 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=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ 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_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
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# 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=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+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],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([    ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/spl/config/ltmain.sh b/spl/config/ltmain.sh
new file mode 100644 (file)
index 0000000..bffda54
--- /dev/null
@@ -0,0 +1,9661 @@
+
+# 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, 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.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --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
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#         host-triplet:        $host
+#         shell:               $SHELL
+#         compiler:            $LTCC
+#         compiler flags:              $LTCFLAGS
+#         linker:              $LD (gnu? $with_gnu_ld)
+#         $progname:   (GNU libtool) 2.4.2 Debian-2.4.2-1.11
+#         automake:    $automake_version
+#         autoconf:    $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION="2.4.2 Debian-2.4.2-1.11"
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+         export $lt_var
+         lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+         lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+       fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77     # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS="  $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+    # Extract subdirectory from the argument.
+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+    case ${2} in
+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+    esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+               s@/\./@/@g
+               t dotsl
+               s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
+
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+       # list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+       IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+       func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    case $1 in
+      *[\\\`\"]*)
+       my_arg=`$ECHO "$1" | $SED \
+           -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+       eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+           $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+       eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+  case $1 in
+  [0-9]* | *[!a-zA-Z0-9_]*)
+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+    ;;
+  * )
+    func_tr_sh_result=$1
+    ;;
+  esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $opt_debug
+
+    $SED -n '/(C)/!b go
+       :more
+       /\./!{
+         N
+         s/\n# / /
+         b more
+       }
+       :go
+       /^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+       s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+        s/^# //
+       s/^# *$//
+       s/\$progname/'$progname'/
+       p
+    }' < "$progpath"
+    echo
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+       :print
+        s/^# //
+       s/^# *$//
+       s*\$progname*'$progname'*
+       s*\$host*'"$host"'*
+       s*\$SHELL*'"$SHELL"'*
+       s*\$LTCC*'"$LTCC"'*
+       s*\$LTCFLAGS*'"$LTCFLAGS"'*
+       s*\$LD*'"$LD"'*
+       s/\$with_gnu_ld/'"$with_gnu_ld"'/
+       s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+       s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+       p
+       d
+     }
+     /^# .* home page:/b print
+     /^# General help using/b print
+     ' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $opt_debug
+
+    func_error "missing argument for $1."
+    exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+    my_sed_long_arg='1s/^--[^=]*=//'
+
+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+    eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+    func_quote_for_eval "${2}"
+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+    func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+
+    exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
+
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+       taglist="$taglist $tagname"
+
+       # Evaluate the configuration.  Be careful to quote the path
+       # and the sed script, to avoid splitting on whitespace, but
+       # also don't use non-portable quotes within backquotes within
+       # quotes we have to do it in 2 steps:
+       extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+       eval "$extractedcf"
+      else
+       func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+  shift; set dummy --mode clean ${1+"$@"}; shift
+  ;;
+compile|compil|compi|comp|com|co|c)
+  shift; set dummy --mode compile ${1+"$@"}; shift
+  ;;
+execute|execut|execu|exec|exe|ex|e)
+  shift; set dummy --mode execute ${1+"$@"}; shift
+  ;;
+finish|finis|fini|fin|fi|f)
+  shift; set dummy --mode finish ${1+"$@"}; shift
+  ;;
+install|instal|insta|inst|ins|in|i)
+  shift; set dummy --mode install ${1+"$@"}; shift
+  ;;
+link|lin|li|l)
+  shift; set dummy --mode link ${1+"$@"}; shift
+  ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+  shift; set dummy --mode uninstall ${1+"$@"}; shift
+  ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly.  This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+  # this just eases exit handling
+  while test $# -gt 0; do
+    opt="$1"
+    shift
+    case $opt in
+      --debug|-x)      opt_debug='set -x'
+                       func_echo "enabling shell trace mode"
+                       $opt_debug
+                       ;;
+      --dry-run|--dryrun|-n)
+                       opt_dry_run=:
+                       ;;
+      --config)
+                       opt_config=:
+func_config
+                       ;;
+      --dlopen|-dlopen)
+                       optarg="$1"
+                       opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+                       shift
+                       ;;
+      --preserve-dup-deps)
+                       opt_preserve_dup_deps=:
+                       ;;
+      --features)
+                       opt_features=:
+func_features
+                       ;;
+      --finish)
+                       opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+                       ;;
+      --help)
+                       opt_help=:
+                       ;;
+      --help-all)
+                       opt_help_all=:
+opt_help=': help-all'
+                       ;;
+      --mode)
+                       test $# = 0 && func_missing_arg $opt && break
+                       optarg="$1"
+                       opt_mode="$optarg"
+case $optarg in
+  # Valid mode arguments:
+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+  # Catch anything else as an error
+  *) func_error "invalid argument for $opt"
+     exit_cmd=exit
+     break
+     ;;
+esac
+                       shift
+                       ;;
+      --no-silent|--no-quiet)
+                       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"
+                       ;;
+      --silent|--quiet)
+                       opt_silent=:
+func_append preserve_args " $opt"
+        opt_verbose=false
+                       ;;
+      --verbose|-v)
+                       opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+                       ;;
+      --tag)
+                       test $# = 0 && func_missing_arg $opt && break
+                       optarg="$1"
+                       opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+                       shift
+                       ;;
+
+      -\?|-h)          func_usage                              ;;
+      --help)          func_help                               ;;
+      --version)       func_version                            ;;
+
+      # Separate optargs to long options:
+      --*=*)
+                       func_split_long_opt "$opt"
+                       set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+                       shift
+                       ;;
+
+      # Separate non-argument short options:
+      -\?*|-h*|-n*|-v*)
+                       func_split_short_opt "$opt"
+                       set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+                       shift
+                       ;;
+
+      --)              break                                   ;;
+      -*)              func_fatal_help "unrecognized option \`$opt'" ;;
+      *)               set dummy "$opt" ${1+"$@"};     shift; break  ;;
+    esac
+  done
+
+  # Validate options:
+
+  # save first non-option argument
+  if test "$#" -gt 0; then
+    nonopt="$opt"
+    shift
+  fi
+
+  # preserve --debug
+  test "$opt_debug" = : || func_append preserve_args " --debug"
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+      ;;
+  esac
+
+  $opt_help || {
+    # Sanity checks first:
+    func_check_version_match
+
+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+      func_fatal_configuration "not configured to build any kind of library"
+    fi
+
+    # Darwin sucks
+    eval std_shrext=\"$shrext_cmds\"
+
+    # Only execute mode is allowed to have -dlopen flags.
+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+      func_error "unrecognized option \`-dlopen'"
+      $ECHO "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Change the help message to a mode-specific one.
+    generic_help="$help"
+    help="Try \`$progname --help --mode=$opt_mode' for more information."
+  }
+
+
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+       for lalib_p_l in 1 2 3 4
+       do
+           read lalib_p_line
+           case "$lalib_p_line" in
+               \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+           esac
+       done
+       exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)        . "$1" ;;
+    *)         . "./$1" ;;
+    esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+    ;;
+  esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case "$lt_sysroot:$1" in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result="=$func_stripname_result"
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+       func_append_quoted CC_quoted "$arg"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+       for z in $available_tags; do
+         if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+           # Evaluate the configuration.
+           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+           CC_quoted=
+           for arg in $CC; do
+             # Double-quote args containing other shell metacharacters.
+             func_append_quoted CC_quoted "$arg"
+           done
+           CC_expanded=`func_echo_all $CC`
+           CC_quoted_expanded=`func_echo_all $CC_quoted`
+           case "$@ " in
+           " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+           " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+             # The compiler in the base compile command matches
+             # the one in the tagged configuration.
+             # Assume this is the tagged configuration we want.
+             tagname=$z
+             break
+             ;;
+           esac
+         fi
+       done
+       # If $tagname still isn't set, then no tagged configuration
+       # was found and let the user know that the "--tag" command
+       # line option must be used.
+       if test -z "$tagname"; then
+         func_echo "unable to infer tagged configuration"
+         func_fatal_error "specify a tag with \`--tag'"
+#      else
+#        func_verbose "using $tagname tagged configuration"
+       fi
+       ;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $opt_debug
+  func_convert_core_file_wine_to_w32_result="$1"
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$lt_sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $opt_debug
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=""
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $opt_debug
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $opt_debug
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $opt_debug
+  if test -z "$2" && test -n "$1" ; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  \`$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result="$1"
+  fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $opt_debug
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  \`$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result="$3"
+    fi
+  fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $opt_debug
+  case $4 in
+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $opt_debug
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $opt_debug
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $opt_debug
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+  fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $opt_debug
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+       # do not "continue".  Instead, add this to base_compile
+       lastarg="$arg"
+       arg_mode=normal
+       ;;
+
+      target )
+       libobj="$arg"
+       arg_mode=normal
+       continue
+       ;;
+
+      normal )
+       # Accept any command-line options.
+       case $arg in
+       -o)
+         test -n "$libobj" && \
+           func_fatal_error "you cannot specify \`-o' more than once"
+         arg_mode=target
+         continue
+         ;;
+
+       -pie | -fpie | -fPIE)
+          func_append pie_flag " $arg"
+         continue
+         ;;
+
+       -shared | -static | -prefer-pic | -prefer-non-pic)
+         func_append later " $arg"
+         continue
+         ;;
+
+       -no-suppress)
+         suppress_opt=no
+         continue
+         ;;
+
+       -Xcompiler)
+         arg_mode=arg  #  the next one goes into the "base_compile" arg list
+         continue      #  The current "srcfile" will either be retained or
+         ;;            #  replaced later.  I would guess that would be a bug.
+
+       -Wc,*)
+         func_stripname '-Wc,' '' "$arg"
+         args=$func_stripname_result
+         lastarg=
+         save_ifs="$IFS"; IFS=','
+         for arg in $args; do
+           IFS="$save_ifs"
+           func_append_quoted lastarg "$arg"
+         done
+         IFS="$save_ifs"
+         func_stripname ' ' '' "$lastarg"
+         lastarg=$func_stripname_result
+
+         # Add the arguments to base_compile.
+         func_append base_compile " $lastarg"
+         continue
+         ;;
+
+       *)
+         # Accept the current argument as the source file.
+         # The previous "srcfile" becomes the current argument.
+         #
+         lastarg="$srcfile"
+         srcfile="$arg"
+         ;;
+       esac  #  case $arg
+       ;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_append_quoted base_compile "$lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+       func_basename "$srcfile"
+       libobj="$func_basename_result"
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+       test "$build_libtool_libs" != yes && \
+         func_fatal_configuration "can not build a shared library"
+       build_old_libs=no
+       continue
+       ;;
+
+      -static)
+       build_libtool_libs=no
+       build_old_libs=yes
+       continue
+       ;;
+
+      -prefer-pic)
+       pic_mode=yes
+       continue
+       ;;
+
+      -prefer-non-pic)
+       pic_mode=no
+       continue
+       ;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'   &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+       func_echo "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+       $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+      func_append removelist " $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    func_append removelist " $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+       command="$base_compile $qsrcfile $pic_flag"
+      else
+       # Don't build PIC code
+       command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+       # Place PIC objects in $objdir
+       func_append command " -o $lobj"
+      fi
+
+      func_show_eval_locale "$command" \
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+       func_show_eval '$MV "$output_obj" "$lobj"' \
+         'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+       suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+       # Don't build PIC code
+       command="$base_compile $qsrcfile$pie_flag"
+      else
+       command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+       func_append command " -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      func_append command "$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+       func_show_eval '$MV "$output_obj" "$obj"' \
+         'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+       removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $opt_mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$opt_mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+       func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+       echo
+       func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+       H
+       d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $opt_dlopen; do
+      test -f "$file" \
+       || func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+       func_resolve_sysroot "$file"
+       file=$func_resolve_sysroot_result
+
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$file" \
+         || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+       # Read the libtool library.
+       dlname=
+       library_names=
+       func_source "$file"
+
+       # Skip this library if it cannot be dlopened.
+       if test -z "$dlname"; then
+         # Warn if it was a shared library.
+         test -n "$library_names" && \
+           func_warning "\`$file' was not linked with \`-export-dynamic'"
+         continue
+       fi
+
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+
+       if test -f "$dir/$objdir/$dlname"; then
+         func_append dir "/$objdir"
+       else
+         if test ! -f "$dir/$dlname"; then
+           func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+         fi
+       fi
+       ;;
+
+      *.lo)
+       # Just add the directory containing the .lo file.
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+       ;;
+
+      *)
+       func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+       continue
+       ;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+       eval "$shlibpath_var=\"\$dir\""
+      else
+       eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+       # Do a test to see if this is really a libtool program.
+       if func_ltwrapper_script_p "$file"; then
+         func_source "$file"
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       elif func_ltwrapper_executable_p "$file"; then
+         func_ltwrapper_scriptname "$file"
+         func_source "$func_ltwrapper_scriptname_result"
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       fi
+       ;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_append_quoted args "$file"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+       # Export the shlibpath_var.
+       eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+       eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+             else
+               $lt_unset $lt_var
+             fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+       eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+       echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libs=
+    libdirs=
+    admincmds=
+
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+       func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+       if func_lalib_unsafe_p "$opt"; then
+         func_append libs " $opt"
+       else
+         func_warning "\`$opt' is not a valid libtool archive"
+       fi
+
+      else
+       func_fatal_error "invalid argument \`$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+         sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+           > $tmpdir/tmp-la
+         mv -f $tmpdir/tmp-la $lib
+       done
+        ${RM}r "$tmpdir"
+      fi
+    fi
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for libdir in $libdirs; do
+       if test -n "$finish_cmds"; then
+         # Do each command in the finish commands.
+         func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+       fi
+       if test -n "$finish_eval"; then
+         # Do the single finish_eval.
+         eval cmds=\"$finish_eval\"
+         $opt_dry_run || eval "$cmds" || func_append admincmds "
+       $cmds"
+       fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+       $ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+       echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+       echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+       libdir=LIBDIR
+       eval flag=\"$hardcode_libdir_flag_spec\"
+
+       $ECHO "   - use the \`$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+       $ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+      fi
+      echo
+
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+       solaris2.[6789]|solaris2.1[0-9])
+         echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+         echo "pages."
+         ;;
+       *)
+         echo "more information, such as the ld(1) and ld.so(8) manual pages."
+         ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
+    exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+       func_append files " $dest"
+       dest=$arg
+       continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+       if $install_cp; then :; else
+         prev=$arg
+       fi
+       ;;
+      -g | -m | -o)
+       prev=$arg
+       ;;
+      -s)
+       stripme=" -s"
+       continue
+       ;;
+      -*)
+       ;;
+      *)
+       # If the previous option needed an argument, then skip it.
+       if test -n "$prev"; then
+         if test "x$prev" = x-m && test -n "$install_override_mode"; then
+           arg2=$install_override_mode
+           no_mode=false
+         fi
+         prev=
+       else
+         dest=$arg
+         continue
+       fi
+       ;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+       func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+       func_quote_for_eval "$install_override_mode"
+       func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+       func_fatal_help "no file or destination specified"
+      else
+       func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+       func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+       case $file in
+       *.lo) ;;
+       *)
+         func_fatal_help "\`$destdir' must be an absolute directory name"
+         ;;
+       esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+       # Do the static libraries later.
+       func_append staticlibs " $file"
+       ;;
+
+      *.la)
+       func_resolve_sysroot "$file"
+       file=$func_resolve_sysroot_result
+
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$file" \
+         || func_fatal_help "\`$file' is not a valid libtool archive"
+
+       library_names=
+       old_library=
+       relink_command=
+       func_source "$file"
+
+       # Add the libdir to current_libdirs if it is the destination.
+       if test "X$destdir" = "X$libdir"; then
+         case "$current_libdirs " in
+         *" $libdir "*) ;;
+         *) func_append current_libdirs " $libdir" ;;
+         esac
+       else
+         # Note the libdir as a future libdir.
+         case "$future_libdirs " in
+         *" $libdir "*) ;;
+         *) func_append future_libdirs " $libdir" ;;
+         esac
+       fi
+
+       func_dirname "$file" "/" ""
+       dir="$func_dirname_result"
+       func_append dir "$objdir"
+
+       if test -n "$relink_command"; then
+         # Determine the prefix the user has applied to our future dir.
+         inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+         # Don't allow the user to place us outside of our expected
+         # location b/c this prevents finding dependent libraries that
+         # are installed to the same prefix.
+         # At present, this check doesn't affect windows .dll's that
+         # are installed into $libdir/../bin (currently, that works fine)
+         # but it's something to keep an eye on.
+         test "$inst_prefix_dir" = "$destdir" && \
+           func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+         if test -n "$inst_prefix_dir"; then
+           # Stick the inst_prefix_dir data into the link command.
+           relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+         else
+           relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+         fi
+
+         func_warning "relinking \`$file'"
+         func_show_eval "$relink_command" \
+           'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+       fi
+
+       # See the names of the shared library.
+       set dummy $library_names; shift
+       if test -n "$1"; then
+         realname="$1"
+         shift
+
+         srcname="$realname"
+         test -n "$relink_command" && srcname="$realname"T
+
+         # Install the shared library and build the symlinks.
+         func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+             'exit $?'
+         tstripme="$stripme"
+         case $host_os in
+         cygwin* | mingw* | pw32* | cegcc*)
+           case $realname in
+           *.dll.a)
+             tstripme=""
+             ;;
+           esac
+           ;;
+         esac
+         if test -n "$tstripme" && test -n "$striplib"; then
+           func_show_eval "$striplib $destdir/$realname" 'exit $?'
+         fi
+
+         if test "$#" -gt 0; then
+           # Delete the old symlinks, and create new ones.
+           # Try `ln -sf' first, because the `ln' binary might depend on
+           # the symlink we replace!  Solaris /bin/ln does not understand -f,
+           # so we also need to try rm && ln -s.
+           for linkname
+           do
+             test "$linkname" != "$realname" \
+               && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+           done
+         fi
+
+         # Do each command in the postinstall commands.
+         lib="$destdir/$realname"
+         func_execute_cmds "$postinstall_cmds" 'exit $?'
+       fi
+
+       # Install the pseudo-library for information purposes.
+       func_basename "$file"
+       name="$func_basename_result"
+       instname="$dir/$name"i
+       func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+       # Maybe install the static library, too.
+       test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+       ;;
+
+      *.lo)
+       # Install (i.e. copy) a libtool object.
+
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         func_basename "$file"
+         destfile="$func_basename_result"
+         destfile="$destdir/$destfile"
+       fi
+
+       # Deduce the name of the destination old-style object file.
+       case $destfile in
+       *.lo)
+         func_lo2o "$destfile"
+         staticdest=$func_lo2o_result
+         ;;
+       *.$objext)
+         staticdest="$destfile"
+         destfile=
+         ;;
+       *)
+         func_fatal_help "cannot copy a libtool object to \`$destfile'"
+         ;;
+       esac
+
+       # Install the libtool object if requested.
+       test -n "$destfile" && \
+         func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+       # Install the old object if enabled.
+       if test "$build_old_libs" = yes; then
+         # Deduce the name of the old-style object file.
+         func_lo2o "$file"
+         staticobj=$func_lo2o_result
+         func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+       fi
+       exit $EXIT_SUCCESS
+       ;;
+
+      *)
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         func_basename "$file"
+         destfile="$func_basename_result"
+         destfile="$destdir/$destfile"
+       fi
+
+       # If the file is missing, and there is a .exe on the end, strip it
+       # because it is most likely a libtool script we actually want to
+       # install
+       stripped_ext=""
+       case $file in
+         *.exe)
+           if test ! -f "$file"; then
+             func_stripname '' '.exe' "$file"
+             file=$func_stripname_result
+             stripped_ext=".exe"
+           fi
+           ;;
+       esac
+
+       # Do a test to see if this is really a libtool program.
+       case $host in
+       *cygwin* | *mingw*)
+           if func_ltwrapper_executable_p "$file"; then
+             func_ltwrapper_scriptname "$file"
+             wrapper=$func_ltwrapper_scriptname_result
+           else
+             func_stripname '' '.exe' "$file"
+             wrapper=$func_stripname_result
+           fi
+           ;;
+       *)
+           wrapper=$file
+           ;;
+       esac
+       if func_ltwrapper_script_p "$wrapper"; then
+         notinst_deplibs=
+         relink_command=
+
+         func_source "$wrapper"
+
+         # Check the variables that should have been set.
+         test -z "$generated_by_libtool_version" && \
+           func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+         finalize=yes
+         for lib in $notinst_deplibs; do
+           # Check to see that each library is installed.
+           libdir=
+           if test -f "$lib"; then
+             func_source "$lib"
+           fi
+           libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+           if test -n "$libdir" && test ! -f "$libfile"; then
+             func_warning "\`$lib' has not been installed in \`$libdir'"
+             finalize=no
+           fi
+         done
+
+         relink_command=
+         func_source "$wrapper"
+
+         outputname=
+         if test "$fast_install" = no && test -n "$relink_command"; then
+           $opt_dry_run || {
+             if test "$finalize" = yes; then
+               tmpdir=`func_mktempdir`
+               func_basename "$file$stripped_ext"
+               file="$func_basename_result"
+               outputname="$tmpdir/$file"
+               # Replace the output file specification.
+               relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+               $opt_silent || {
+                 func_quote_for_expand "$relink_command"
+                 eval "func_echo $func_quote_for_expand_result"
+               }
+               if eval "$relink_command"; then :
+                 else
+                 func_error "error: relink \`$file' with the above command before installing it"
+                 $opt_dry_run || ${RM}r "$tmpdir"
+                 continue
+               fi
+               file="$outputname"
+             else
+               func_warning "cannot relink \`$file'"
+             fi
+           }
+         else
+           # Install the binary that we compiled earlier.
+           file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+         fi
+       fi
+
+       # remove .exe since cygwin /usr/bin/install will append another
+       # one anyway
+       case $install_prog,$host in
+       */usr/bin/install*,*cygwin*)
+         case $file:$destfile in
+         *.exe:*.exe)
+           # this is ok
+           ;;
+         *.exe:*)
+           destfile=$destfile.exe
+           ;;
+         *:*.exe)
+           func_stripname '' '.exe' "$destfile"
+           destfile=$func_stripname_result
+           ;;
+         esac
+         ;;
+       esac
+       func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+       $opt_dry_run || if test -n "$outputname"; then
+         ${RM}r "$tmpdir"
+       fi
+       ;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # 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 $tool_oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+       my_dlsyms="${my_outputname}S.c"
+      else
+       func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+       # Discover the nlist of each of the dlfiles.
+       nlist="$output_objdir/${my_outputname}.nm"
+
+       func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+       # Parse the name list into a source file.
+       func_verbose "creating $output_objdir/$my_dlsyms"
+
+       $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+       if test "$dlself" = yes; then
+         func_verbose "generating symbol list for \`$output'"
+
+         $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+         # Add our own program objects to the symbol list.
+         progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+         for progfile in $progfiles; do
+           func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+           func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+           $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+         done
+
+         if test -n "$exclude_expsyms"; then
+           $opt_dry_run || {
+             eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+           }
+         fi
+
+         if test -n "$export_symbols_regex"; then
+           $opt_dry_run || {
+             eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+           }
+         fi
+
+         # Prepare the list of exported symbols
+         if test -z "$export_symbols"; then
+           export_symbols="$output_objdir/$outputname.exp"
+           $opt_dry_run || {
+             $RM $export_symbols
+             eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+             case $host in
+             *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+               ;;
+             esac
+           }
+         else
+           $opt_dry_run || {
+             eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+             case $host in
+               *cygwin* | *mingw* | *cegcc* )
+                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                 ;;
+             esac
+           }
+         fi
+       fi
+
+       for dlprefile in $dlprefiles; do
+         func_verbose "extracting global C symbols from \`$dlprefile'"
+         func_basename "$dlprefile"
+         name="$func_basename_result"
+          case $host in
+           *cygwin* | *mingw* | *cegcc* )
+             # if an import library, we need to obtain dlname
+             if func_win32_import_lib_p "$dlprefile"; then
+               func_tr_sh "$dlprefile"
+               eval "curr_lafile=\$libfile_$func_tr_sh_result"
+               dlprefile_dlbasename=""
+               if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+                 # Use subshell, to avoid clobbering current variable values
+                 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+                 if test -n "$dlprefile_dlname" ; then
+                   func_basename "$dlprefile_dlname"
+                   dlprefile_dlbasename="$func_basename_result"
+                 else
+                   # no lafile. user explicitly requested -dlpreopen <import library>.
+                   $sharedlib_from_linklib_cmd "$dlprefile"
+                   dlprefile_dlbasename=$sharedlib_from_linklib_result
+                 fi
+               fi
+               $opt_dry_run || {
+                 if test -n "$dlprefile_dlbasename" ; then
+                   eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+                 else
+                   func_warning "Could not compute DLL name from $name"
+                   eval '$ECHO ": $name " >> "$nlist"'
+                 fi
+                 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+                   $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+               }
+             else # not an import lib
+               $opt_dry_run || {
+                 eval '$ECHO ": $name " >> "$nlist"'
+                 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+               }
+             fi
+           ;;
+           *)
+             $opt_dry_run || {
+               eval '$ECHO ": $name " >> "$nlist"'
+               func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+               eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+             }
+           ;;
+          esac
+       done
+
+       $opt_dry_run || {
+         # Make sure we have at least an empty file.
+         test -f "$nlist" || : > "$nlist"
+
+         if test -n "$exclude_expsyms"; then
+           $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+           $MV "$nlist"T "$nlist"
+         fi
+
+         # Try sorting and uniquifying the output.
+         if $GREP -v "^: " < "$nlist" |
+             if sort -k 3 </dev/null >/dev/null 2>&1; then
+               sort -k 3
+             else
+               sort +2
+             fi |
+             uniq > "$nlist"S; then
+           :
+         else
+           $GREP -v "^: " < "$nlist" > "$nlist"S
+         fi
+
+         if test -f "$nlist"S; then
+           eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+         else
+           echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+         fi
+
+         echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+         case $need_lib_prefix in
+         no)
+           eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+           ;;
+         *)
+           eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+           ;;
+         esac
+         echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+       } # !$opt_dry_run
+
+       pic_flag_for_symtable=
+       case "$compile_command " in
+       *" -static "*) ;;
+       *)
+         case $host in
+         # compiling the symbol table file with pic_flag works around
+         # a FreeBSD bug that causes programs to crash when -lm is
+         # 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*)
+           pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+         *-*-hpux*)
+           pic_flag_for_symtable=" $pic_flag"  ;;
+         *)
+           if test "X$my_pic_p" != Xno; then
+             pic_flag_for_symtable=" $pic_flag"
+           fi
+           ;;
+         esac
+         ;;
+       esac
+       symtab_cflags=
+       for arg in $LTCFLAGS; do
+         case $arg in
+         -pie | -fpie | -fPIE) ;;
+         *) func_append symtab_cflags " $arg" ;;
+         esac
+       done
+
+       # Now compile the dynamic symbol file.
+       func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+       # Clean up the generated files.
+       func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+       # Transform the symbol file into the correct name.
+       symfileobj="$output_objdir/${my_outputname}S.$objext"
+       case $host in
+       *cygwin* | *mingw* | *cegcc* )
+         if test -f "$output_objdir/$my_outputname.def"; then
+           compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+           finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+         else
+           compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+           finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         fi
+         ;;
+       *)
+         compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         ;;
+       esac
+       ;;
+      *)
+       func_fatal_error "unknown suffix for \`$my_dlsyms'"
+       ;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      func_to_tool_file "$1" func_convert_file_msys_to_w32
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+       $SED -n -e '
+           1,100{
+               / I /{
+                   s,.*,import,
+                   p
+                   q
+               }
+           }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $opt_debug
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $opt_debug
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[         ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive which possess that section. Heuristic: eliminate
+    # all those which have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $opt_debug
+  if func_cygming_gnu_implib_p "$1" ; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1" ; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=""
+  fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+       func_echo "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+                  'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+       [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+       *) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+       *" $my_xlib_u "*)
+         func_arith $extracted_serial + 1
+         extracted_serial=$func_arith_result
+         my_xlib_u=lt$extracted_serial-$my_xlib ;;
+       *) break ;;
+       esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+       func_verbose "Extracting $my_xabs"
+       # Do not bother doing anything if just a dry run
+       $opt_dry_run || {
+         darwin_orig_dir=`pwd`
+         cd $my_xdir || exit $?
+         darwin_archive=$my_xabs
+         darwin_curdir=`pwd`
+         darwin_base_archive=`basename "$darwin_archive"`
+         darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+         if test -n "$darwin_arches"; then
+           darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+           darwin_arch=
+           func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+           for darwin_arch in  $darwin_arches ; do
+             func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+             cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+             cd "$darwin_curdir"
+             $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+           done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+           darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+           darwin_file=
+           darwin_files=
+           for darwin_file in $darwin_filelist; do
+             darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+             $LIPO -create -output "$darwin_file" $darwin_files
+           done # $darwin_filelist
+           $RM -rf unfat-$$
+           cd "$darwin_orig_dir"
+         else
+           cd $darwin_orig_dir
+           func_extract_an_archive "$my_xdir" "$my_xabs"
+         fi # $darwin_arches
+       } # !$opt_dry_run
+       ;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+       ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+       func_emit_wrapper_arg1=${1-no}
+
+       $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  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+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+       if test "$fast_install" = yes; then
+         $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+         $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+       $ECHO \"\$relink_command_output\" >&2
+       $RM \"\$progdir/\$file\"
+       exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+       else
+         $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+       fi
+
+       $ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+       # fixup the dll searchpath if we need to.
+       #
+       # Fix the DLL searchpath if we need to.  Do this before prepending
+       # to shlibpath, because on Windows, both are PATH and uninstalled
+       # libraries must come first.
+       if test -n "$dllsearchpath"; then
+         $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+       fi
+
+       # Export our shlibpath_var if we have one.
+       if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+         $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+       fi
+
+       $ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+       cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+           cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+       (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+           cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+           if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_path "$temp_rpath"
+             cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+           else
+             cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+           fi
+
+           if test -n "$dllsearchpath"; then
+              func_to_host_path "$dllsearchpath:"
+             cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+           else
+             cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+           fi
+
+           if test "$fast_install" = yes; then
+             cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+           else
+             cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+           fi
+
+
+           cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+       {
+EOF
+           case "$host" in
+             *mingw* | *cygwin* )
+               # make stdout use "unix" line endings
+               echo "          setmode(1,_O_BINARY);"
+               ;;
+             esac
+
+           cat <<"EOF"
+         lt_dump_script (stdout);
+         return 0;
+       }
+      if (strcmp (argv[i], debug_opt) == 0)
+       {
+          lt_debug = 1;
+          continue;
+       }
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+                   "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+           cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+           cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+                 tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+                 actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(main) libtool target name: %s\n",
+                 target_name);
+EOF
+
+           cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+                   strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+           cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+           case $host_os in
+             mingw*)
+           cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+       *p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+       *p = '/';
+      }
+  }
+EOF
+           ;;
+           esac
+
+           cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+                 nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+                     i, nonnull (newargz[i]));
+    }
+
+EOF
+
+           case $host_os in
+             mingw*)
+               cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+                     "(main) failed to launch target \"%s\": %s\n",
+                     lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+               ;;
+             *)
+               cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+               ;;
+           esac
+
+           cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+                         string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+       return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+       {
+         concat_name = xstrdup (wrapper);
+         if (check_executable (concat_name))
+           return concat_name;
+         XFREE (concat_name);
+       }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+       has_slash = 1;
+       break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+       {
+         for (p = path; *p; p = p_next)
+           {
+             const char *q;
+             size_t p_len;
+             for (q = p; *q; q++)
+               if (IS_PATH_SEPARATOR (*q))
+                 break;
+             p_len = q - p;
+             p_next = (*q == '\0' ? q : q + 1);
+             if (p_len == 0)
+               {
+                 /* empty path: current directory */
+                 if (getcwd (tmp, LT_PATHMAX) == NULL)
+                   lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+                 tmp_len = strlen (tmp);
+                 concat_name =
+                   XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+                 memcpy (concat_name, tmp, tmp_len);
+                 concat_name[tmp_len] = '/';
+                 strcpy (concat_name + tmp_len + 1, wrapper);
+               }
+             else
+               {
+                 concat_name =
+                   XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+                 memcpy (concat_name, p, p_len);
+                 concat_name[p_len] = '/';
+                 strcpy (concat_name + p_len + 1, wrapper);
+               }
+             if (check_executable (concat_name))
+               return concat_name;
+             XFREE (concat_name);
+           }
+       }
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+                     "checking path component for symlinks: %s\n",
+                     tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+       {
+         if (S_ISLNK (s.st_mode) != 0)
+           {
+             has_symlinks = 1;
+             break;
+           }
+
+         /* search backwards for last DIR_SEPARATOR */
+         p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+         while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+           p--;
+         if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+           {
+             /* no more DIR_SEPARATORS left */
+             break;
+           }
+         *p = '\0';
+       }
+      else
+       {
+         lt_fatal (__FILE__, __LINE__,
+                   "error accessing file \"%s\": %s",
+                   tmp_pathspec, nonnull (strerror (errno)));
+       }
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+               "could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+       *str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+              int line, const char *mode,
+              const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+           case $host_os in
+             mingw*)
+               cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+       new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+       {
+         int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+         size_t length;
+         unsigned int backslashes;
+         const char *s;
+         char *quoted_string;
+         char *p;
+
+         length = 0;
+         backslashes = 0;
+         if (quote_around)
+           length++;
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               length += backslashes + 1;
+             length++;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           length += backslashes + 1;
+
+         quoted_string = XMALLOC (char, length + 1);
+
+         p = quoted_string;
+         backslashes = 0;
+         if (quote_around)
+           *p++ = '"';
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               {
+                 unsigned int j;
+                 for (j = backslashes + 1; j > 0; j--)
+                   *p++ = '\\';
+               }
+             *p++ = c;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           {
+             unsigned int j;
+             for (j = backslashes; j > 0; j--)
+               *p++ = '\\';
+             *p++ = '"';
+           }
+         *p = '\0';
+
+         new_argv[i] = quoted_string;
+       }
+      else
+       new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+               ;;
+           esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+           func_emit_wrapper yes |
+             $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+       test "$build_libtool_libs" != yes && \
+         func_fatal_configuration "can not build a shared library"
+       build_old_libs=no
+       break
+       ;;
+      -all-static | -static | -static-libtool-libs)
+       case $arg in
+       -all-static)
+         if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+           func_warning "complete static linking is impossible in this configuration"
+         fi
+         if test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=yes
+         ;;
+       -static)
+         if test -z "$pic_flag" && test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=built
+         ;;
+       -static-libtool-libs)
+         if test -z "$pic_flag" && test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=yes
+         ;;
+       esac
+       build_libtool_libs=no
+       build_old_libs=yes
+       break
+       ;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+       case $prev in
+       output)
+         func_append compile_command " @OUTPUT@"
+         func_append finalize_command " @OUTPUT@"
+         ;;
+       esac
+
+       case $prev in
+       bindir)
+         bindir="$arg"
+         prev=
+         continue
+         ;;
+       dlfiles|dlprefiles)
+         if test "$preload" = no; then
+           # Add the symbol object into the linking commands.
+           func_append compile_command " @SYMFILE@"
+           func_append finalize_command " @SYMFILE@"
+           preload=yes
+         fi
+         case $arg in
+         *.la | *.lo) ;;  # We handle these cases below.
+         force)
+           if test "$dlself" = no; then
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         self)
+           if test "$prev" = dlprefiles; then
+             dlself=yes
+           elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+             dlself=yes
+           else
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         *)
+           if test "$prev" = dlfiles; then
+             func_append dlfiles " $arg"
+           else
+             func_append dlprefiles " $arg"
+           fi
+           prev=
+           continue
+           ;;
+         esac
+         ;;
+       expsyms)
+         export_symbols="$arg"
+         test -f "$arg" \
+           || func_fatal_error "symbol file \`$arg' does not exist"
+         prev=
+         continue
+         ;;
+       expsyms_regex)
+         export_symbols_regex="$arg"
+         prev=
+         continue
+         ;;
+       framework)
+         case $host in
+           *-*-darwin*)
+             case "$deplibs " in
+               *" $qarg.ltframework "*) ;;
+               *) func_append deplibs " $qarg.ltframework" # this is fixed later
+                  ;;
+             esac
+             ;;
+         esac
+         prev=
+         continue
+         ;;
+       inst_prefix)
+         inst_prefix_dir="$arg"
+         prev=
+         continue
+         ;;
+       objectlist)
+         if test -f "$arg"; then
+           save_arg=$arg
+           moreargs=
+           for fil in `cat "$save_arg"`
+           do
+#            func_append moreargs " $fil"
+             arg=$fil
+             # A libtool-controlled object.
+
+             # Check to see that this really is a libtool object.
+             if func_lalib_unsafe_p "$arg"; then
+               pic_object=
+               non_pic_object=
+
+               # Read the .lo file
+               func_source "$arg"
+
+               if test -z "$pic_object" ||
+                  test -z "$non_pic_object" ||
+                  test "$pic_object" = none &&
+                  test "$non_pic_object" = none; then
+                 func_fatal_error "cannot find name of object for \`$arg'"
+               fi
+
+               # Extract subdirectory from the argument.
+               func_dirname "$arg" "/" ""
+               xdir="$func_dirname_result"
+
+               if test "$pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 pic_object="$xdir$pic_object"
+
+                 if test "$prev" = dlfiles; then
+                   if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+                     func_append dlfiles " $pic_object"
+                     prev=
+                     continue
+                   else
+                     # If libtool objects are unsupported, then we need to preload.
+                     prev=dlprefiles
+                   fi
+                 fi
+
+                 # CHECK ME:  I think I busted this.  -Ossama
+                 if test "$prev" = dlprefiles; then
+                   # Preload the old-style object.
+                   func_append dlprefiles " $pic_object"
+                   prev=
+                 fi
+
+                 # A PIC object.
+                 func_append libobjs " $pic_object"
+                 arg="$pic_object"
+               fi
+
+               # Non-PIC object.
+               if test "$non_pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 non_pic_object="$xdir$non_pic_object"
+
+                 # A standard non-PIC object
+                 func_append non_pic_objects " $non_pic_object"
+                 if test -z "$pic_object" || test "$pic_object" = none ; then
+                   arg="$non_pic_object"
+                 fi
+               else
+                 # If the PIC object exists, use it instead.
+                 # $xdir was prepended to $pic_object above.
+                 non_pic_object="$pic_object"
+                 func_append non_pic_objects " $non_pic_object"
+               fi
+             else
+               # Only an error if not doing a dry-run.
+               if $opt_dry_run; then
+                 # Extract subdirectory from the argument.
+                 func_dirname "$arg" "/" ""
+                 xdir="$func_dirname_result"
+
+                 func_lo2o "$arg"
+                 pic_object=$xdir$objdir/$func_lo2o_result
+                 non_pic_object=$xdir$func_lo2o_result
+                 func_append libobjs " $pic_object"
+                 func_append non_pic_objects " $non_pic_object"
+               else
+                 func_fatal_error "\`$arg' is not a valid libtool object"
+               fi
+             fi
+           done
+         else
+           func_fatal_error "link input file \`$arg' does not exist"
+         fi
+         arg=$save_arg
+         prev=
+         continue
+         ;;
+       precious_regex)
+         precious_files_regex="$arg"
+         prev=
+         continue
+         ;;
+       release)
+         release="-$arg"
+         prev=
+         continue
+         ;;
+       rpath | xrpath)
+         # We need an absolute path.
+         case $arg in
+         [\\/]* | [A-Za-z]:[\\/]*) ;;
+         *)
+           func_fatal_error "only absolute run-paths are allowed"
+           ;;
+         esac
+         if test "$prev" = rpath; then
+           case "$rpath " in
+           *" $arg "*) ;;
+           *) func_append rpath " $arg" ;;
+           esac
+         else
+           case "$xrpath " in
+           *" $arg "*) ;;
+           *) func_append xrpath " $arg" ;;
+           esac
+         fi
+         prev=
+         continue
+         ;;
+       shrext)
+         shrext_cmds="$arg"
+         prev=
+         continue
+         ;;
+       weak)
+         func_append weak_libs " $arg"
+         prev=
+         continue
+         ;;
+       xcclinker)
+         func_append linker_flags " $qarg"
+         func_append compiler_flags " $qarg"
+         prev=
+         func_append compile_command " $qarg"
+         func_append finalize_command " $qarg"
+         continue
+         ;;
+       xcompiler)
+         func_append compiler_flags " $qarg"
+         prev=
+         func_append compile_command " $qarg"
+         func_append finalize_command " $qarg"
+         continue
+         ;;
+       xlinker)
+         func_append linker_flags " $qarg"
+         func_append compiler_flags " $wl$qarg"
+         prev=
+         func_append compile_command " $wl$qarg"
+         func_append finalize_command " $wl$qarg"
+         continue
+         ;;
+       *)
+         eval "$prev=\"\$arg\""
+         prev=
+         continue
+         ;;
+       esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+       if test -n "$link_static_flag"; then
+         # See comment for -static flag below, for more details.
+         func_append compile_command " $link_static_flag"
+         func_append finalize_command " $link_static_flag"
+       fi
+       continue
+       ;;
+
+      -allow-undefined)
+       # FIXME: remove this flag sometime in the future.
+       func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+       ;;
+
+      -avoid-version)
+       avoid_version=yes
+       continue
+       ;;
+
+      -bindir)
+       prev=bindir
+       continue
+       ;;
+
+      -dlopen)
+       prev=dlfiles
+       continue
+       ;;
+
+      -dlpreopen)
+       prev=dlprefiles
+       continue
+       ;;
+
+      -export-dynamic)
+       export_dynamic=yes
+       continue
+       ;;
+
+      -export-symbols | -export-symbols-regex)
+       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+         func_fatal_error "more than one -exported-symbols argument is not allowed"
+       fi
+       if test "X$arg" = "X-export-symbols"; then
+         prev=expsyms
+       else
+         prev=expsyms_regex
+       fi
+       continue
+       ;;
+
+      -framework)
+       prev=framework
+       continue
+       ;;
+
+      -inst-prefix-dir)
+       prev=inst_prefix
+       continue
+       ;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+       case $with_gcc/$host in
+       no/*-*-irix* | /*-*-irix*)
+         func_append compile_command " $arg"
+         func_append finalize_command " $arg"
+         ;;
+       esac
+       continue
+       ;;
+
+      -L*)
+       func_stripname "-L" '' "$arg"
+       if test -z "$func_stripname_result"; then
+         if test "$#" -gt 0; then
+           func_fatal_error "require no space between \`-L' and \`$1'"
+         else
+           func_fatal_error "need path for \`-L' option"
+         fi
+       fi
+       func_resolve_sysroot "$func_stripname_result"
+       dir=$func_resolve_sysroot_result
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       *)
+         absdir=`cd "$dir" && pwd`
+         test -z "$absdir" && \
+           func_fatal_error "cannot determine absolute directory name of \`$dir'"
+         dir="$absdir"
+         ;;
+       esac
+       case "$deplibs " in
+       *" -L$dir "* | *" $arg "*)
+         # Will only happen for absolute or sysroot arguments
+         ;;
+       *)
+         # Preserve sysroot, but never include relative directories
+         case $dir in
+           [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+           *) func_append deplibs " -L$dir" ;;
+         esac
+         func_append lib_search_path " $dir"
+         ;;
+       esac
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+         testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$dir:"*) ;;
+         ::) dllsearchpath=$dir;;
+         *) func_append dllsearchpath ":$dir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         ::) dllsearchpath=$testbindir;;
+         *) func_append dllsearchpath ":$testbindir";;
+         esac
+         ;;
+       esac
+       continue
+       ;;
+
+      -l*)
+       if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+           # These systems don't actually have a C or math library (as such)
+           continue
+           ;;
+         *-*-os2*)
+           # These systems don't actually have a C library (as such)
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C and math libraries are in the System framework
+           func_append deplibs " System.ltframework"
+           continue
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           test "X$arg" = "X-lc" && continue
+           ;;
+         esac
+       elif test "X$arg" = "X-lc_r"; then
+        case $host in
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+          # Do not include libc_r directly, use -pthread flag.
+          continue
+          ;;
+        esac
+       fi
+       func_append deplibs " $arg"
+       continue
+       ;;
+
+      -module)
+       module=yes
+       continue
+       ;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot|--sysroot)
+       func_append compiler_flags " $arg"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+       prev=xcompiler
+       continue
+       ;;
+
+      -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"
+       case "$new_inherited_linker_flags " in
+           *" $arg "*) ;;
+           * ) func_append new_inherited_linker_flags " $arg" ;;
+       esac
+       continue
+       ;;
+
+      -multi_module)
+       single_module="${wl}-multi_module"
+       continue
+       ;;
+
+      -no-fast-install)
+       fast_install=no
+       continue
+       ;;
+
+      -no-install)
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+         # The PATH hackery in wrapper scripts is required on Windows
+         # and Darwin in order for the loader to find any dlls it needs.
+         func_warning "\`-no-install' is ignored for $host"
+         func_warning "assuming \`-no-fast-install' instead"
+         fast_install=no
+         ;;
+       *) no_install=yes ;;
+       esac
+       continue
+       ;;
+
+      -no-undefined)
+       allow_undefined=no
+       continue
+       ;;
+
+      -objectlist)
+       prev=objectlist
+       continue
+       ;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+       prev=precious_regex
+       continue
+       ;;
+
+      -release)
+       prev=release
+       continue
+       ;;
+
+      -rpath)
+       prev=rpath
+       continue
+       ;;
+
+      -R)
+       prev=xrpath
+       continue
+       ;;
+
+      -R*)
+       func_stripname '-R' '' "$arg"
+       dir=$func_stripname_result
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       =*)
+         func_stripname '=' '' "$dir"
+         dir=$lt_sysroot$func_stripname_result
+         ;;
+       *)
+         func_fatal_error "only absolute run-paths are allowed"
+         ;;
+       esac
+       case "$xrpath " in
+       *" $dir "*) ;;
+       *) func_append xrpath " $dir" ;;
+       esac
+       continue
+       ;;
+
+      -shared)
+       # The effects of -shared are defined in a previous loop.
+       continue
+       ;;
+
+      -shrext)
+       prev=shrext
+       continue
+       ;;
+
+      -static | -static-libtool-libs)
+       # The effects of -static are defined in a previous loop.
+       # We used to do the same as -all-static on platforms that
+       # didn't have a PIC flag, but the assumption that the effects
+       # would be equivalent was wrong.  It would break on at least
+       # Digital Unix and AIX.
+       continue
+       ;;
+
+      -thread-safe)
+       thread_safe=yes
+       continue
+       ;;
+
+      -version-info)
+       prev=vinfo
+       continue
+       ;;
+
+      -version-number)
+       prev=vinfo
+       vinfo_number=yes
+       continue
+       ;;
+
+      -weak)
+        prev=weak
+       continue
+       ;;
+
+      -Wc,*)
+       func_stripname '-Wc,' '' "$arg"
+       args=$func_stripname_result
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+         func_append arg " $func_quote_for_eval_result"
+         func_append compiler_flags " $func_quote_for_eval_result"
+       done
+       IFS="$save_ifs"
+       func_stripname ' ' '' "$arg"
+       arg=$func_stripname_result
+       ;;
+
+      -Wl,*)
+       func_stripname '-Wl,' '' "$arg"
+       args=$func_stripname_result
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+         func_append arg " $wl$func_quote_for_eval_result"
+         func_append compiler_flags " $wl$func_quote_for_eval_result"
+         func_append linker_flags " $func_quote_for_eval_result"
+       done
+       IFS="$save_ifs"
+       func_stripname ' ' '' "$arg"
+       arg=$func_stripname_result
+       ;;
+
+      -Xcompiler)
+       prev=xcompiler
+       continue
+       ;;
+
+      -Xlinker)
+       prev=xlinker
+       continue
+       ;;
+
+      -XCClinker)
+       prev=xcclinker
+       continue
+       ;;
+
+      # -msg_* for osf cc
+      -msg_*)
+       func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+        func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        func_append compiler_flags " $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+
+      *.$objext)
+       # A standard object.
+       func_append objs " $arg"
+       ;;
+
+      *.lo)
+       # A libtool-controlled object.
+
+       # Check to see that this really is a libtool object.
+       if func_lalib_unsafe_p "$arg"; then
+         pic_object=
+         non_pic_object=
+
+         # Read the .lo file
+         func_source "$arg"
+
+         if test -z "$pic_object" ||
+            test -z "$non_pic_object" ||
+            test "$pic_object" = none &&
+            test "$non_pic_object" = none; then
+           func_fatal_error "cannot find name of object for \`$arg'"
+         fi
+
+         # Extract subdirectory from the argument.
+         func_dirname "$arg" "/" ""
+         xdir="$func_dirname_result"
+
+         if test "$pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           pic_object="$xdir$pic_object"
+
+           if test "$prev" = dlfiles; then
+             if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+               func_append dlfiles " $pic_object"
+               prev=
+               continue
+             else
+               # If libtool objects are unsupported, then we need to preload.
+               prev=dlprefiles
+             fi
+           fi
+
+           # CHECK ME:  I think I busted this.  -Ossama
+           if test "$prev" = dlprefiles; then
+             # Preload the old-style object.
+             func_append dlprefiles " $pic_object"
+             prev=
+           fi
+
+           # A PIC object.
+           func_append libobjs " $pic_object"
+           arg="$pic_object"
+         fi
+
+         # Non-PIC object.
+         if test "$non_pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           non_pic_object="$xdir$non_pic_object"
+
+           # A standard non-PIC object
+           func_append non_pic_objects " $non_pic_object"
+           if test -z "$pic_object" || test "$pic_object" = none ; then
+             arg="$non_pic_object"
+           fi
+         else
+           # If the PIC object exists, use it instead.
+           # $xdir was prepended to $pic_object above.
+           non_pic_object="$pic_object"
+           func_append non_pic_objects " $non_pic_object"
+         fi
+       else
+         # Only an error if not doing a dry-run.
+         if $opt_dry_run; then
+           # Extract subdirectory from the argument.
+           func_dirname "$arg" "/" ""
+           xdir="$func_dirname_result"
+
+           func_lo2o "$arg"
+           pic_object=$xdir$objdir/$func_lo2o_result
+           non_pic_object=$xdir$func_lo2o_result
+           func_append libobjs " $pic_object"
+           func_append non_pic_objects " $non_pic_object"
+         else
+           func_fatal_error "\`$arg' is not a valid libtool object"
+         fi
+       fi
+       ;;
+
+      *.$libext)
+       # An archive.
+       func_append deplibs " $arg"
+       func_append old_deplibs " $arg"
+       continue
+       ;;
+
+      *.la)
+       # A libtool-controlled library.
+
+       func_resolve_sysroot "$arg"
+       if test "$prev" = dlfiles; then
+         # This library was specified with -dlopen.
+         func_append dlfiles " $func_resolve_sysroot_result"
+         prev=
+       elif test "$prev" = dlprefiles; then
+         # The library was specified with -dlpreopen.
+         func_append dlprefiles " $func_resolve_sysroot_result"
+         prev=
+       else
+         func_append deplibs " $func_resolve_sysroot_result"
+       fi
+       continue
+       ;;
+
+      # Some other compiler argument.
+      *)
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_preserve_dup_deps ; then
+       case "$libs " in
+       *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+       esac
+      fi
+      func_append libs " $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+       for pre_post_dep in $predeps $postdeps; do
+         case "$pre_post_deps " in
+         *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+         esac
+         func_append pre_post_deps " $pre_post_dep"
+       done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+       passes="conv dlpreopen link"
+       for file in $dlfiles $dlprefiles; do
+         case $file in
+         *.la) ;;
+         *)
+           func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+           ;;
+         esac
+       done
+       ;;
+    prog)
+       compile_deplibs=
+       finalize_deplibs=
+       alldeplibs=no
+       newdlfiles=
+       newdlprefiles=
+       passes="conv scan dlopen dlpreopen link"
+       ;;
+    *)  passes="conv"
+       ;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+       ## FIXME: Find the place where the list is rebuilt in the wrong
+       ##        order, and fix it there properly
+        tmp_deplibs=
+       for deplib in $deplibs; do
+         tmp_deplibs="$deplib $tmp_deplibs"
+       done
+       deplibs="$tmp_deplibs"
+      fi
+
+      if test "$linkmode,$pass" = "lib,link" ||
+        test "$linkmode,$pass" = "prog,scan"; then
+       libs="$deplibs"
+       deplibs=
+      fi
+      if test "$linkmode" = prog; then
+       case $pass in
+       dlopen) libs="$dlfiles" ;;
+       dlpreopen) libs="$dlprefiles" ;;
+       link)
+         libs="$deplibs %DEPLIBS%"
+         test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+         ;;
+       esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+       # Collect and forward deplibs of preopened libtool libs
+       for lib in $dlprefiles; do
+         # Ignore non-libtool-libs
+         dependency_libs=
+         func_resolve_sysroot "$lib"
+         case $lib in
+         *.la) func_source "$func_resolve_sysroot_result" ;;
+         esac
+
+         # Collect preopened libtool deplibs, except any this library
+         # has declared as weak libs
+         for deplib in $dependency_libs; do
+           func_basename "$deplib"
+            deplib_base=$func_basename_result
+           case " $weak_libs " in
+           *" $deplib_base "*) ;;
+           *) func_append deplibs " $deplib" ;;
+           esac
+         done
+       done
+       libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+       # Collect dlpreopened libraries
+       save_deplibs="$deplibs"
+       deplibs=
+      fi
+
+      for deplib in $libs; do
+       lib=
+       found=no
+       case $deplib in
+       -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"
+         else
+           func_append compiler_flags " $deplib"
+           if test "$linkmode" = lib ; then
+               case "$new_inherited_linker_flags " in
+                   *" $deplib "*) ;;
+                   * ) func_append new_inherited_linker_flags " $deplib" ;;
+               esac
+           fi
+         fi
+         continue
+         ;;
+       -l*)
+         if test "$linkmode" != lib && test "$linkmode" != prog; then
+           func_warning "\`-l' is ignored for archives/objects"
+           continue
+         fi
+         func_stripname '-l' '' "$deplib"
+         name=$func_stripname_result
+         if test "$linkmode" = lib; then
+           searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+         else
+           searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+         fi
+         for searchdir in $searchdirs; do
+           for search_ext in .la $std_shrext .so .a; do
+             # Search the libtool library
+             lib="$searchdir/lib${name}${search_ext}"
+             if test -f "$lib"; then
+               if test "$search_ext" = ".la"; then
+                 found=yes
+               else
+                 found=no
+               fi
+               break 2
+             fi
+           done
+         done
+         if test "$found" != yes; then
+           # deplib doesn't seem to be a libtool library
+           if test "$linkmode,$pass" = "prog,link"; then
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             deplibs="$deplib $deplibs"
+             test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+           fi
+           continue
+         else # deplib is a libtool library
+           # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+           # We need to do some special things here, and not later.
+           if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+             case " $predeps $postdeps " in
+             *" $deplib "*)
+               if func_lalib_p "$lib"; then
+                 library_names=
+                 old_library=
+                 func_source "$lib"
+                 for l in $old_library $library_names; do
+                   ll="$l"
+                 done
+                 if test "X$ll" = "X$old_library" ; then # only static version available
+                   found=no
+                   func_dirname "$lib" "" "."
+                   ladir="$func_dirname_result"
+                   lib=$ladir/$old_library
+                   if test "$linkmode,$pass" = "prog,link"; then
+                     compile_deplibs="$deplib $compile_deplibs"
+                     finalize_deplibs="$deplib $finalize_deplibs"
+                   else
+                     deplibs="$deplib $deplibs"
+                     test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+                   fi
+                   continue
+                 fi
+               fi
+               ;;
+             *) ;;
+             esac
+           fi
+         fi
+         ;; # -l
+       *.ltframework)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           deplibs="$deplib $deplibs"
+           if test "$linkmode" = lib ; then
+               case "$new_inherited_linker_flags " in
+                   *" $deplib "*) ;;
+                   * ) func_append new_inherited_linker_flags " $deplib" ;;
+               esac
+           fi
+         fi
+         continue
+         ;;
+       -L*)
+         case $linkmode in
+         lib)
+           deplibs="$deplib $deplibs"
+           test "$pass" = conv && continue
+           newdependency_libs="$deplib $newdependency_libs"
+           func_stripname '-L' '' "$deplib"
+           func_resolve_sysroot "$func_stripname_result"
+           func_append newlib_search_path " $func_resolve_sysroot_result"
+           ;;
+         prog)
+           if test "$pass" = conv; then
+             deplibs="$deplib $deplibs"
+             continue
+           fi
+           if test "$pass" = scan; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           func_stripname '-L' '' "$deplib"
+           func_resolve_sysroot "$func_stripname_result"
+           func_append newlib_search_path " $func_resolve_sysroot_result"
+           ;;
+         *)
+           func_warning "\`-L' is ignored for archives/objects"
+           ;;
+         esac # linkmode
+         continue
+         ;; # -L
+       -R*)
+         if test "$pass" = link; then
+           func_stripname '-R' '' "$deplib"
+           func_resolve_sysroot "$func_stripname_result"
+           dir=$func_resolve_sysroot_result
+           # Make sure the xrpath contains only unique directories.
+           case "$xrpath " in
+           *" $dir "*) ;;
+           *) func_append xrpath " $dir" ;;
+           esac
+         fi
+         deplibs="$deplib $deplibs"
+         continue
+         ;;
+       *.la)
+         func_resolve_sysroot "$deplib"
+         lib=$func_resolve_sysroot_result
+         ;;
+       *.$libext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+           continue
+         fi
+         case $linkmode in
+         lib)
+           # Linking convenience modules into shared libraries is allowed,
+           # but linking other static libraries is non-portable.
+           case " $dlpreconveniencelibs " in
+           *" $deplib "*) ;;
+           *)
+             valid_a_lib=no
+             case $deplibs_check_method in
+               match_pattern*)
+                 set dummy $deplibs_check_method; shift
+                 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+                 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+                   | $EGREP "$match_pattern_regex" > /dev/null; then
+                   valid_a_lib=yes
+                 fi
+               ;;
+               pass_all)
+                 valid_a_lib=yes
+               ;;
+             esac
+             if test "$valid_a_lib" != yes; then
+               echo
+               $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because the file extensions .$libext of this argument makes me believe"
+               echo "*** that it is just a static archive that I should not use here."
+             else
+               echo
+               $ECHO "*** Warning: Linking the shared library $output against the"
+               $ECHO "*** static library $deplib is not portable!"
+               deplibs="$deplib $deplibs"
+             fi
+             ;;
+           esac
+           continue
+           ;;
+         prog)
+           if test "$pass" != link; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           continue
+           ;;
+         esac # linkmode
+         ;; # *.$libext
+       *.lo | *.$objext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+         elif test "$linkmode" = prog; then
+           if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+             # If there is no dlopen support or we're linking statically,
+             # we need to preload.
+             func_append newdlprefiles " $deplib"
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             func_append newdlfiles " $deplib"
+           fi
+         fi
+         continue
+         ;;
+       %DEPLIBS%)
+         alldeplibs=yes
+         continue
+         ;;
+       esac # case $deplib
+
+       if test "$found" = yes || test -f "$lib"; then :
+       else
+         func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+       fi
+
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$lib" \
+         || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+       func_dirname "$lib" "" "."
+       ladir="$func_dirname_result"
+
+       dlname=
+       dlopen=
+       dlpreopen=
+       libdir=
+       library_names=
+       old_library=
+       inherited_linker_flags=
+       # If the library was installed with an old release of libtool,
+       # it will not redefine variables installed, or shouldnotlink
+       installed=yes
+       shouldnotlink=no
+       avoidtemprpath=
+
+
+       # Read the .la file
+       func_source "$lib"
+
+       # Convert "-framework foo" to "foo.ltframework"
+       if test -n "$inherited_linker_flags"; then
+         tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+         for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+           case " $new_inherited_linker_flags " in
+             *" $tmp_inherited_linker_flag "*) ;;
+             *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+           esac
+         done
+       fi
+       dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       if test "$linkmode,$pass" = "lib,link" ||
+          test "$linkmode,$pass" = "prog,scan" ||
+          { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+         test -n "$dlopen" && func_append dlfiles " $dlopen"
+         test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+       fi
+
+       if test "$pass" = conv; then
+         # Only check for convenience libraries
+         deplibs="$lib $deplibs"
+         if test -z "$libdir"; then
+           if test -z "$old_library"; then
+             func_fatal_error "cannot find name of link library for \`$lib'"
+           fi
+           # It is a libtool convenience library, so add in its objects.
+           func_append convenience " $ladir/$objdir/$old_library"
+           func_append old_convenience " $ladir/$objdir/$old_library"
+           tmp_libs=
+           for deplib in $dependency_libs; do
+             deplibs="$deplib $deplibs"
+             if $opt_preserve_dup_deps ; then
+               case "$tmp_libs " in
+               *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+               esac
+             fi
+             func_append tmp_libs " $deplib"
+           done
+         elif test "$linkmode" != prog && test "$linkmode" != lib; then
+           func_fatal_error "\`$lib' is not a convenience library"
+         fi
+         continue
+       fi # $pass = conv
+
+
+       # Get the name of the library we link against.
+       linklib=
+       if test -n "$old_library" &&
+          { test "$prefer_static_libs" = yes ||
+            test "$prefer_static_libs,$installed" = "built,no"; }; then
+         linklib=$old_library
+       else
+         for l in $old_library $library_names; do
+           linklib="$l"
+         done
+       fi
+       if test -z "$linklib"; then
+         func_fatal_error "cannot find name of link library for \`$lib'"
+       fi
+
+       # This library was specified with -dlopen.
+       if test "$pass" = dlopen; then
+         if test -z "$libdir"; then
+           func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+         fi
+         if test -z "$dlname" ||
+            test "$dlopen_support" != yes ||
+            test "$build_libtool_libs" = no; then
+           # If there is no dlname, no dlopen support or we're linking
+           # statically, we need to preload.  We also need to preload any
+           # dependent libraries so libltdl's deplib preloader doesn't
+           # bomb out in the load deplibs phase.
+           func_append dlprefiles " $lib $dependency_libs"
+         else
+           func_append newdlfiles " $lib"
+         fi
+         continue
+       fi # $pass = dlopen
+
+       # We need an absolute path.
+       case $ladir in
+       [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+       *)
+         abs_ladir=`cd "$ladir" && pwd`
+         if test -z "$abs_ladir"; then
+           func_warning "cannot determine absolute directory name of \`$ladir'"
+           func_warning "passing it literally to the linker, although it might fail"
+           abs_ladir="$ladir"
+         fi
+         ;;
+       esac
+       func_basename "$lib"
+       laname="$func_basename_result"
+
+       # Find the relevant object directory and library name.
+       if test "X$installed" = Xyes; then
+         if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           func_warning "library \`$lib' was moved."
+           dir="$ladir"
+           absdir="$abs_ladir"
+           libdir="$abs_ladir"
+         else
+           dir="$lt_sysroot$libdir"
+           absdir="$lt_sysroot$libdir"
+         fi
+         test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+       else
+         if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           dir="$ladir"
+           absdir="$abs_ladir"
+           # Remove this search path later
+           func_append notinst_path " $abs_ladir"
+         else
+           dir="$ladir/$objdir"
+           absdir="$abs_ladir/$objdir"
+           # Remove this search path later
+           func_append notinst_path " $abs_ladir"
+         fi
+       fi # $installed = yes
+       func_stripname 'lib' '.la' "$laname"
+       name=$func_stripname_result
+
+       # This library was specified with -dlpreopen.
+       if test "$pass" = dlpreopen; then
+         if test -z "$libdir" && test "$linkmode" = prog; then
+           func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+         fi
+         case "$host" in
+           # special handling for platforms with PE-DLLs.
+           *cygwin* | *mingw* | *cegcc* )
+             # Linker will automatically link against shared library if both
+             # static and shared are present.  Therefore, ensure we extract
+             # symbols from the import library if a shared library is present
+             # (otherwise, the dlopen module name will be incorrect).  We do
+             # this by putting the import library name into $newdlprefiles.
+             # We recover the dlopen module name by 'saving' the la file
+             # name in a special purpose variable, and (later) extracting the
+             # dlname from the la file.
+             if test -n "$dlname"; then
+               func_tr_sh "$dir/$linklib"
+               eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+               func_append newdlprefiles " $dir/$linklib"
+             else
+               func_append newdlprefiles " $dir/$old_library"
+               # Keep a list of preopened convenience libraries to check
+               # that they are being used correctly in the link pass.
+               test -z "$libdir" && \
+                 func_append dlpreconveniencelibs " $dir/$old_library"
+             fi
+           ;;
+           * )
+             # Prefer using a static library (so that no silly _DYNAMIC symbols
+             # are required to link).
+             if test -n "$old_library"; then
+               func_append newdlprefiles " $dir/$old_library"
+               # Keep a list of preopened convenience libraries to check
+               # that they are being used correctly in the link pass.
+               test -z "$libdir" && \
+                 func_append dlpreconveniencelibs " $dir/$old_library"
+             # Otherwise, use the dlname, so that lt_dlopen finds it.
+             elif test -n "$dlname"; then
+               func_append newdlprefiles " $dir/$dlname"
+             else
+               func_append newdlprefiles " $dir/$linklib"
+             fi
+           ;;
+         esac
+       fi # $pass = dlpreopen
+
+       if test -z "$libdir"; then
+         # Link the convenience library
+         if test "$linkmode" = lib; then
+           deplibs="$dir/$old_library $deplibs"
+         elif test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$dir/$old_library $compile_deplibs"
+           finalize_deplibs="$dir/$old_library $finalize_deplibs"
+         else
+           deplibs="$lib $deplibs" # used for prog,scan pass
+         fi
+         continue
+       fi
+
+
+       if test "$linkmode" = prog && test "$pass" != link; then
+         func_append newlib_search_path " $ladir"
+         deplibs="$lib $deplibs"
+
+         linkalldeplibs=no
+         if test "$link_all_deplibs" != no || test -z "$library_names" ||
+            test "$build_libtool_libs" = no; then
+           linkalldeplibs=yes
+         fi
+
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           case $deplib in
+           -L*) func_stripname '-L' '' "$deplib"
+                func_resolve_sysroot "$func_stripname_result"
+                func_append newlib_search_path " $func_resolve_sysroot_result"
+                ;;
+           esac
+           # Need to link against all dependency_libs?
+           if test "$linkalldeplibs" = yes; then
+             deplibs="$deplib $deplibs"
+           else
+             # Need to hardcode shared library paths
+             # or/and link against static libraries
+             newdependency_libs="$deplib $newdependency_libs"
+           fi
+           if $opt_preserve_dup_deps ; then
+             case "$tmp_libs " in
+             *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+             esac
+           fi
+           func_append tmp_libs " $deplib"
+         done # for deplib
+         continue
+       fi # $linkmode = prog...
+
+       if test "$linkmode,$pass" = "prog,link"; then
+         if test -n "$library_names" &&
+            { { test "$prefer_static_libs" = no ||
+                test "$prefer_static_libs,$installed" = "built,yes"; } ||
+              test -z "$old_library"; }; then
+           # We need to hardcode the library path
+           if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+             # Make sure the rpath contains only unique directories.
+             case "$temp_rpath:" in
+             *"$absdir:"*) ;;
+             *) func_append temp_rpath "$absdir:" ;;
+             esac
+           fi
+
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) func_append compile_rpath " $absdir" ;;
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) func_append finalize_rpath " $libdir" ;;
+             esac
+             ;;
+           esac
+         fi # $linkmode,$pass = prog,link...
+
+         if test "$alldeplibs" = yes &&
+            { test "$deplibs_check_method" = pass_all ||
+              { test "$build_libtool_libs" = yes &&
+                test -n "$library_names"; }; }; then
+           # We only need to search for static libraries
+           continue
+         fi
+       fi
+
+       link_static=no # Whether the deplib will be linked statically
+       use_static_libs=$prefer_static_libs
+       if test "$use_static_libs" = built && test "$installed" = yes; then
+         use_static_libs=no
+       fi
+       if test -n "$library_names" &&
+          { test "$use_static_libs" = no || test -z "$old_library"; }; then
+         case $host in
+         *cygwin* | *mingw* | *cegcc*)
+             # No point in relinking DLLs because paths are not encoded
+             func_append notinst_deplibs " $lib"
+             need_relink=no
+           ;;
+         *)
+           if test "$installed" = no; then
+             func_append notinst_deplibs " $lib"
+             need_relink=yes
+           fi
+           ;;
+         esac
+         # This is a shared library
+
+         # Warn about portability, can't link against -module's on some
+         # systems (darwin).  Don't bleat about dlopened modules though!
+         dlopenmodule=""
+         for dlpremoduletest in $dlprefiles; do
+           if test "X$dlpremoduletest" = "X$lib"; then
+             dlopenmodule="$dlpremoduletest"
+             break
+           fi
+         done
+         if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+           echo
+           if test "$linkmode" = prog; then
+             $ECHO "*** Warning: Linking the executable $output against the loadable module"
+           else
+             $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+           fi
+           $ECHO "*** $linklib is not portable!"
+         fi
+         if test "$linkmode" = lib &&
+            test "$hardcode_into_libs" = yes; then
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) func_append compile_rpath " $absdir" ;;
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) func_append finalize_rpath " $libdir" ;;
+             esac
+             ;;
+           esac
+         fi
+
+         if test -n "$old_archive_from_expsyms_cmds"; then
+           # figure out the soname
+           set dummy $library_names
+           shift
+           realname="$1"
+           shift
+           libname=`eval "\\$ECHO \"$libname_spec\""`
+           # use dlname if we got it. it's perfectly good, no?
+           if test -n "$dlname"; then
+             soname="$dlname"
+           elif test -n "$soname_spec"; then
+             # bleh windows
+             case $host in
+             *cygwin* | mingw* | *cegcc*)
+               func_arith $current - $age
+               major=$func_arith_result
+               versuffix="-$major"
+               ;;
+             esac
+             eval soname=\"$soname_spec\"
+           else
+             soname="$realname"
+           fi
+
+           # Make a new name for the extract_expsyms_cmds to use
+           soroot="$soname"
+           func_basename "$soroot"
+           soname="$func_basename_result"
+           func_stripname 'lib' '.dll' "$soname"
+           newlib=libimp-$func_stripname_result.a
+
+           # If the library has no export list, then create one now
+           if test -f "$output_objdir/$soname-def"; then :
+           else
+             func_verbose "extracting exported symbol list from \`$soname'"
+             func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+           fi
+
+           # Create $newlib
+           if test -f "$output_objdir/$newlib"; then :; else
+             func_verbose "generating import library for \`$soname'"
+             func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+           fi
+           # make sure the library variables are pointing to the new library
+           dir=$output_objdir
+           linklib=$newlib
+         fi # test -n "$old_archive_from_expsyms_cmds"
+
+         if test "$linkmode" = prog || test "$opt_mode" != relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           lib_linked=yes
+           case $hardcode_action in
+           immediate | unsupported)
+             if test "$hardcode_direct" = no; then
+               add="$dir/$linklib"
+               case $host in
+                 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+                 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+                 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+                   *-*-unixware7*) add_dir="-L$dir" ;;
+                 *-*-darwin* )
+                   # if the lib is a (non-dlopened) module then we can not
+                   # link against it, someone is ignoring the earlier warnings
+                   if /usr/bin/file -L $add 2> /dev/null |
+                        $GREP ": [^:]* bundle" >/dev/null ; then
+                     if test "X$dlopenmodule" != "X$lib"; then
+                       $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+                       if test -z "$old_library" ; then
+                         echo
+                         echo "*** And there doesn't seem to be a static archive available"
+                         echo "*** The link will probably fail, sorry"
+                       else
+                         add="$dir/$old_library"
+                       fi
+                     elif test -n "$old_library"; then
+                       add="$dir/$old_library"
+                     fi
+                   fi
+               esac
+             elif test "$hardcode_minus_L" = no; then
+               case $host in
+               *-*-sunos*) add_shlibpath="$dir" ;;
+               esac
+               add_dir="-L$dir"
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = no; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           relink)
+             if test "$hardcode_direct" = yes &&
+                test "$hardcode_direct_absolute" = no; then
+               add="$dir/$linklib"
+             elif test "$hardcode_minus_L" = yes; then
+               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
+                   [\\/]*)
+                     func_append add_dir " -L$inst_prefix_dir$libdir"
+                     ;;
+                 esac
+               fi
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = yes; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           *) lib_linked=no ;;
+           esac
+
+           if test "$lib_linked" != yes; then
+             func_fatal_configuration "unsupported hardcode properties"
+           fi
+
+           if test -n "$add_shlibpath"; then
+             case :$compile_shlibpath: in
+             *":$add_shlibpath:"*) ;;
+             *) func_append compile_shlibpath "$add_shlibpath:" ;;
+             esac
+           fi
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+             test -n "$add" && compile_deplibs="$add $compile_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+             if test "$hardcode_direct" != yes &&
+                test "$hardcode_minus_L" != yes &&
+                test "$hardcode_shlibpath_var" = yes; then
+               case :$finalize_shlibpath: in
+               *":$libdir:"*) ;;
+               *) func_append finalize_shlibpath "$libdir:" ;;
+               esac
+             fi
+           fi
+         fi
+
+         if test "$linkmode" = prog || test "$opt_mode" = relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           # Finalize command for both is simple: just hardcode it.
+           if test "$hardcode_direct" = yes &&
+              test "$hardcode_direct_absolute" = no; then
+             add="$libdir/$linklib"
+           elif test "$hardcode_minus_L" = yes; then
+             add_dir="-L$libdir"
+             add="-l$name"
+           elif test "$hardcode_shlibpath_var" = yes; then
+             case :$finalize_shlibpath: in
+             *":$libdir:"*) ;;
+             *) func_append finalize_shlibpath "$libdir:" ;;
+             esac
+             add="-l$name"
+           elif test "$hardcode_automatic" = yes; then
+             if test -n "$inst_prefix_dir" &&
+                test -f "$inst_prefix_dir$libdir/$linklib" ; then
+               add="$inst_prefix_dir$libdir/$linklib"
+             else
+               add="$libdir/$linklib"
+             fi
+           else
+             # We cannot seem to hardcode it, guess we'll fake it.
+             add_dir="-L$libdir"
+             # Try looking first in the location we're being installed to.
+             if test -n "$inst_prefix_dir"; then
+               case $libdir in
+                 [\\/]*)
+                   func_append add_dir " -L$inst_prefix_dir$libdir"
+                   ;;
+               esac
+             fi
+             add="-l$name"
+           fi
+
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+             test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+           fi
+         fi
+       elif test "$linkmode" = prog; then
+         # Here we assume that one of hardcode_direct or hardcode_minus_L
+         # is not unsupported.  This is valid on all known static and
+         # shared platforms.
+         if test "$hardcode_direct" != unsupported; then
+           test -n "$old_library" && linklib="$old_library"
+           compile_deplibs="$dir/$linklib $compile_deplibs"
+           finalize_deplibs="$dir/$linklib $finalize_deplibs"
+         else
+           compile_deplibs="-l$name -L$dir $compile_deplibs"
+           finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+         fi
+       elif test "$build_libtool_libs" = yes; then
+         # Not a shared library
+         if test "$deplibs_check_method" != pass_all; then
+           # We're trying link a shared library against a static one
+           # but the system doesn't support it.
+
+           # Just print a warning and add the library to dependency_libs so
+           # that the program can be linked against the static library.
+           echo
+           $ECHO "*** Warning: This system can not link to static lib archive $lib."
+           echo "*** I have the capability to make that library automatically link in when"
+           echo "*** you link to this library.  But I can only do this if you have a"
+           echo "*** shared version of the library, which you do not appear to have."
+           if test "$module" = yes; then
+             echo "*** But as you try to build a module library, libtool will still create "
+             echo "*** a static module, that should work as long as the dlopening application"
+             echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+             if test -z "$global_symbol_pipe"; then
+               echo
+               echo "*** However, this would only work if libtool was able to extract symbol"
+               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+               echo "*** not find such a program.  So, this module is probably useless."
+               echo "*** \`nm' from GNU binutils and a full rebuild may help."
+             fi
+             if test "$build_old_libs" = no; then
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         else
+           deplibs="$dir/$old_library $deplibs"
+           link_static=yes
+         fi
+       fi # link shared/static library?
+
+       if test "$linkmode" = lib; then
+         if test -n "$dependency_libs" &&
+            { test "$hardcode_into_libs" != yes ||
+              test "$build_old_libs" = yes ||
+              test "$link_static" = yes; }; then
+           # Extract -R from dependency_libs
+           temp_deplibs=
+           for libdir in $dependency_libs; do
+             case $libdir in
+             -R*) func_stripname '-R' '' "$libdir"
+                  temp_xrpath=$func_stripname_result
+                  case " $xrpath " in
+                  *" $temp_xrpath "*) ;;
+                  *) func_append xrpath " $temp_xrpath";;
+                  esac;;
+             *) func_append temp_deplibs " $libdir";;
+             esac
+           done
+           dependency_libs="$temp_deplibs"
+         fi
+
+         func_append newlib_search_path " $absdir"
+         # Link against this library
+         test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+         # ... and its dependency_libs
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           newdependency_libs="$deplib $newdependency_libs"
+           case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+           if $opt_preserve_dup_deps ; then
+             case "$tmp_libs " in
+             *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+             esac
+           fi
+           func_append tmp_libs " $func_resolve_sysroot_result"
+         done
+
+         if test "$link_all_deplibs" != no; then
+           # Add the search paths of all dependency libraries
+           for deplib in $dependency_libs; do
+             path=
+             case $deplib in
+             -L*) path="$deplib" ;;
+             *.la)
+               func_resolve_sysroot "$deplib"
+               deplib=$func_resolve_sysroot_result
+               func_dirname "$deplib" "" "."
+               dir=$func_dirname_result
+               # We need an absolute path.
+               case $dir in
+               [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+               *)
+                 absdir=`cd "$dir" && pwd`
+                 if test -z "$absdir"; then
+                   func_warning "cannot determine absolute directory name of \`$dir'"
+                   absdir="$dir"
+                 fi
+                 ;;
+               esac
+               if $GREP "^installed=no" $deplib > /dev/null; then
+               case $host in
+               *-*-darwin*)
+                 depdepl=
+                 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+                 if test -n "$deplibrary_names" ; then
+                   for tmp in $deplibrary_names ; do
+                     depdepl=$tmp
+                   done
+                   if test -f "$absdir/$objdir/$depdepl" ; then
+                     depdepl="$absdir/$objdir/$depdepl"
+                     darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+                     func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+                     func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+                     path=
+                   fi
+                 fi
+                 ;;
+               *)
+                 path="-L$absdir/$objdir"
+                 ;;
+               esac
+               else
+                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+                 test -z "$libdir" && \
+                   func_fatal_error "\`$deplib' is not a valid libtool archive"
+                 test "$absdir" != "$libdir" && \
+                   func_warning "\`$deplib' seems to be moved"
+
+                 path="-L$absdir"
+               fi
+               ;;
+             esac
+             case " $deplibs " in
+             *" $path "*) ;;
+             *) deplibs="$path $deplibs" ;;
+             esac
+           done
+         fi # link_all_deplibs != no
+       fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+       if test "$linkmode" = "prog"; then
+         compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+         finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+       else
+         compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       fi
+      fi
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+       # Link the dlpreopened libraries before other libraries
+       for deplib in $save_deplibs; do
+         deplibs="$deplib $deplibs"
+       done
+      fi
+      if test "$pass" != dlopen; then
+       if test "$pass" != conv; then
+         # Make sure lib_search_path contains only unique directories.
+         lib_search_path=
+         for dir in $newlib_search_path; do
+           case "$lib_search_path " in
+           *" $dir "*) ;;
+           *) func_append lib_search_path " $dir" ;;
+           esac
+         done
+         newlib_search_path=
+       fi
+
+       if test "$linkmode,$pass" != "prog,link"; then
+         vars="deplibs"
+       else
+         vars="compile_deplibs finalize_deplibs"
+       fi
+       for var in $vars dependency_libs; do
+         # Add libraries to $var in reverse order
+         eval tmp_libs=\"\$$var\"
+         new_libs=
+         for deplib in $tmp_libs; do
+           # FIXME: Pedantically, this is the right thing to do, so
+           #        that some nasty dependency loop isn't accidentally
+           #        broken:
+           #new_libs="$deplib $new_libs"
+           # Pragmatically, this seems to cause very few problems in
+           # practice:
+           case $deplib in
+           -L*) new_libs="$deplib $new_libs" ;;
+           -R*) ;;
+           *)
+             # And here is the reason: when a library appears more
+             # than once as an explicit dependence of a library, or
+             # is implicitly linked in more than once by the
+             # compiler, it is considered special, and multiple
+             # occurrences thereof are not removed.  Compare this
+             # with having the same library being listed as a
+             # dependency of multiple other libraries: in this case,
+             # we know (pedantically, we assume) the library does not
+             # need to be listed more than once, so we keep only the
+             # last copy.  This is not always right, but it is rare
+             # enough that we require users that really mean to play
+             # such unportable linking tricks to link the library
+             # using -Wl,-lname, so that libtool does not consider it
+             # for duplicate removal.
+             case " $specialdeplibs " in
+             *" $deplib "*) new_libs="$deplib $new_libs" ;;
+             *)
+               case " $new_libs " in
+               *" $deplib "*) ;;
+               *) new_libs="$deplib $new_libs" ;;
+               esac
+               ;;
+             esac
+             ;;
+           esac
+         done
+         tmp_libs=
+         for deplib in $new_libs; do
+           case $deplib in
+           -L*)
+             case " $tmp_libs " in
+             *" $deplib "*) ;;
+             *) func_append tmp_libs " $deplib" ;;
+             esac
+             ;;
+           *) func_append tmp_libs " $deplib" ;;
+           esac
+         done
+         eval $var=\"$tmp_libs\"
+       done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+       case " $predeps $postdeps $compiler_lib_search_path " in
+       *" $i "*)
+         i=""
+         ;;
+       esac
+       if test -n "$i" ; then
+         func_append tmp_libs " $i"
+       fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       func_warning "\`-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+       func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+       func_warning "\`-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+       func_warning "\`-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+       func_warning "\`-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+       func_warning "\`-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      func_append objs "$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+       func_stripname 'lib' '.la' "$outputname"
+       name=$func_stripname_result
+       eval shared_ext=\"$shrext_cmds\"
+       eval libname=\"$libname_spec\"
+       ;;
+      *)
+       test "$module" = no && \
+         func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+       if test "$need_lib_prefix" != no; then
+         # Add the "lib" prefix for modules if required
+         func_stripname '' '.la' "$outputname"
+         name=$func_stripname_result
+         eval shared_ext=\"$shrext_cmds\"
+         eval libname=\"$libname_spec\"
+       else
+         func_stripname '' '.la' "$outputname"
+         libname=$func_stripname_result
+       fi
+       ;;
+      esac
+
+      if test -n "$objs"; then
+       if test "$deplibs_check_method" != pass_all; then
+         func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+       else
+         echo
+         $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+         $ECHO "*** objects $objs is not portable!"
+         func_append libobjs " $objs"
+       fi
+      fi
+
+      test "$dlself" != no && \
+       func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+       func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
+
+      oldlibs=
+      if test -z "$rpath"; then
+       if test "$build_libtool_libs" = yes; then
+         # Building a libtool convenience library.
+         # Some compilers have problems with a `.al' extension so
+         # convenience libraries should have the same extension an
+         # archive normally would.
+         oldlibs="$output_objdir/$libname.$libext $oldlibs"
+         build_libtool_libs=convenience
+         build_old_libs=yes
+       fi
+
+       test -n "$vinfo" && \
+         func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+       test -n "$release" && \
+         func_warning "\`-release' is ignored for convenience libraries"
+      else
+
+       # Parse the version information argument.
+       save_ifs="$IFS"; IFS=':'
+       set dummy $vinfo 0 0 0
+       shift
+       IFS="$save_ifs"
+
+       test -n "$7" && \
+         func_fatal_help "too many parameters to \`-version-info'"
+
+       # convert absolute version numbers to libtool ages
+       # this retains compatibility with .la files and attempts
+       # to make the code below a bit more comprehensible
+
+       case $vinfo_number in
+       yes)
+         number_major="$1"
+         number_minor="$2"
+         number_revision="$3"
+         #
+         # There are really only two kinds -- those that
+         # use the current revision as the major version
+         # and those that subtract age and use age as
+         # a minor version.  But, then there is irix
+         # 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
+           age="$number_minor"
+           revision="$number_revision"
+           ;;
+         freebsd-aout|freebsd-elf|qnx|sunos)
+           current="$number_major"
+           revision="$number_minor"
+           age="0"
+           ;;
+         irix|nonstopux)
+           func_arith $number_major + $number_minor
+           current=$func_arith_result
+           age="$number_minor"
+           revision="$number_minor"
+           lt_irix_increment=no
+           ;;
+         *)
+           func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+           ;;
+         esac
+         ;;
+       no)
+         current="$1"
+         revision="$2"
+         age="$3"
+         ;;
+       esac
+
+       # Check that each of the things are valid numbers.
+       case $current in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "CURRENT \`$current' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       case $revision in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "REVISION \`$revision' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       case $age in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "AGE \`$age' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       if test "$age" -gt "$current"; then
+         func_error "AGE \`$age' is greater than the current interface number \`$current'"
+         func_fatal_error "\`$vinfo' is not valid version information"
+       fi
+
+       # Calculate the version variables.
+       major=
+       versuffix=
+       verstring=
+       case $version_type in
+       none) ;;
+
+       darwin)
+         # Like Linux, but with the current version available in
+         # verstring for coding it into the library header
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix="$major.$age.$revision"
+         # Darwin ld doesn't like 0 for these options...
+         func_arith $current + 1
+         minor_current=$func_arith_result
+         xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+         verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+         ;;
+
+       freebsd-aout)
+         major=".$current"
+         versuffix=".$current.$revision";
+         ;;
+
+       freebsd-elf)
+         major=".$current"
+         versuffix=".$current"
+         ;;
+
+       irix | nonstopux)
+         if test "X$lt_irix_increment" = "Xno"; then
+           func_arith $current - $age
+         else
+           func_arith $current - $age + 1
+         fi
+         major=$func_arith_result
+
+         case $version_type in
+           nonstopux) verstring_prefix=nonstopux ;;
+           *)         verstring_prefix=sgi ;;
+         esac
+         verstring="$verstring_prefix$major.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$revision
+         while test "$loop" -ne 0; do
+           func_arith $revision - $loop
+           iface=$func_arith_result
+           func_arith $loop - 1
+           loop=$func_arith_result
+           verstring="$verstring_prefix$major.$iface:$verstring"
+         done
+
+         # Before this point, $major must not contain `.'.
+         major=.$major
+         versuffix="$major.$revision"
+         ;;
+
+       linux) # correct to gnu/linux during the next big refactor
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix="$major.$age.$revision"
+         ;;
+
+       osf)
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix=".$current.$age.$revision"
+         verstring="$current.$age.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$age
+         while test "$loop" -ne 0; do
+           func_arith $current - $loop
+           iface=$func_arith_result
+           func_arith $loop - 1
+           loop=$func_arith_result
+           verstring="$verstring:${iface}.0"
+         done
+
+         # Make executables depend on our current version.
+         func_append verstring ":${current}.0"
+         ;;
+
+       qnx)
+         major=".$current"
+         versuffix=".$current"
+         ;;
+
+       sunos)
+         major=".$current"
+         versuffix=".$current.$revision"
+         ;;
+
+       windows)
+         # Use '-' rather than '.', since we only want one
+         # extension on DOS 8.3 filesystems.
+         func_arith $current - $age
+         major=$func_arith_result
+         versuffix="-$major"
+         ;;
+
+       *)
+         func_fatal_configuration "unknown library version type \`$version_type'"
+         ;;
+       esac
+
+       # Clear the version info if we defaulted, and they specified a release.
+       if test -z "$vinfo" && test -n "$release"; then
+         major=
+         case $version_type in
+         darwin)
+           # we can't check for "0.0" in archive_cmds due to quoting
+           # problems, so we reset it completely
+           verstring=
+           ;;
+         *)
+           verstring="0.0"
+           ;;
+         esac
+         if test "$need_version" = no; then
+           versuffix=
+         else
+           versuffix=".0.0"
+         fi
+       fi
+
+       # Remove version info from name if versioning should be avoided
+       if test "$avoid_version" = yes && test "$need_version" = no; then
+         major=
+         versuffix=
+         verstring=""
+       fi
+
+       # Check to see if the archive will have undefined symbols.
+       if test "$allow_undefined" = yes; then
+         if test "$allow_undefined_flag" = unsupported; then
+           func_warning "undefined symbols not allowed in $host shared libraries"
+           build_libtool_libs=no
+           build_old_libs=yes
+         fi
+       else
+         # Don't allow undefined symbols.
+         allow_undefined_flag="$no_undefined_flag"
+       fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_append libobjs " $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
+      if test "$opt_mode" != relink; then
+       # Remove our outputs, but don't remove object files since they
+       # may have been created when compiling PIC objects.
+       removelist=
+       tempremovelist=`$ECHO "$output_objdir/*"`
+       for p in $tempremovelist; do
+         case $p in
+           *.$objext | *.gcno)
+              ;;
+           $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+              if test "X$precious_files_regex" != "X"; then
+                if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+                then
+                  continue
+                fi
+              fi
+              func_append removelist " $p"
+              ;;
+           *) ;;
+         esac
+       done
+       test -n "$removelist" && \
+         func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+       func_append oldlibs " $output_objdir/$libname.$libext"
+
+       # Transform .lo files to .o files.
+       oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #        lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #        deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #        dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       temp_xrpath=
+       for libdir in $xrpath; do
+         func_replace_sysroot "$libdir"
+         func_append temp_xrpath " -R$func_replace_sysroot_result"
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) func_append finalize_rpath " $libdir" ;;
+         esac
+       done
+       if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+         dependency_libs="$temp_xrpath $dependency_libs"
+       fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+       case " $dlprefiles $dlfiles " in
+       *" $lib "*) ;;
+       *) func_append dlfiles " $lib" ;;
+       esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+       case "$dlprefiles " in
+       *" $lib "*) ;;
+       *) func_append dlprefiles " $lib" ;;
+       esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+       if test -n "$rpath"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+           # these systems don't actually have a c library (as such)!
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C library is in the System framework
+           func_append deplibs " System.ltframework"
+           ;;
+         *-*-netbsd*)
+           # Don't link with libc until the a.out ld.so is fixed.
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           ;;
+         *)
+           # Add libc to deplibs on all other systems if necessary.
+           if test "$build_libtool_need_lc" = "yes"; then
+             func_append deplibs " -lc"
+           fi
+           ;;
+         esac
+       fi
+
+       # Transform deplibs into only deplibs that can be linked in shared.
+       name_save=$name
+       libname_save=$libname
+       release_save=$release
+       versuffix_save=$versuffix
+       major_save=$major
+       # I'm not sure if I'm treating the release correctly.  I think
+       # release should show up in the -l (ie -lgmp5) so we don't want to
+       # add it in twice.  Is that correct?
+       release=""
+       versuffix=""
+       major=""
+       newdeplibs=
+       droppeddeps=no
+       case $deplibs_check_method in
+       pass_all)
+         # Don't check for shared/static.  Everything works.
+         # This might be a little naive.  We might want to check
+         # whether the library exists or not.  But this is on
+         # osf3 & osf4 and I'm not really sure... Just
+         # implementing what was already the behavior.
+         newdeplibs=$deplibs
+         ;;
+       test_compile)
+         # This code stresses the "libraries are programs" paradigm to its
+         # limits. Maybe even breaks it.  We compile a program, linking it
+         # against the deplibs as a proxy for the library.  Then we can check
+         # whether they linked in statically or dynamically with ldd.
+         $opt_dry_run || $RM conftest.c
+         cat > conftest.c <<EOF
+         int main() { return 0; }
+EOF
+         $opt_dry_run || $RM conftest
+         if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+           ldd_output=`ldd conftest`
+           for i in $deplibs; do
+             case $i in
+             -l*)
+               func_stripname -l '' "$i"
+               name=$func_stripname_result
+               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                 case " $predeps $postdeps " in
+                 *" $i "*)
+                   func_append newdeplibs " $i"
+                   i=""
+                   ;;
+                 esac
+               fi
+               if test -n "$i" ; then
+                 libname=`eval "\\$ECHO \"$libname_spec\""`
+                 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+                 set dummy $deplib_matches; shift
+                 deplib_match=$1
+                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                   func_append newdeplibs " $i"
+                 else
+                   droppeddeps=yes
+                   echo
+                   $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+                   echo "*** I have the capability to make that library automatically link in when"
+                   echo "*** you link to this library.  But I can only do this if you have a"
+                   echo "*** shared version of the library, which I believe you do not have"
+                   echo "*** because a test_compile did reveal that the linker did not use it for"
+                   echo "*** its dynamic dependency list that programs get resolved with at runtime."
+                 fi
+               fi
+               ;;
+             *)
+               func_append newdeplibs " $i"
+               ;;
+             esac
+           done
+         else
+           # Error occurred in the first compile.  Let's try to salvage
+           # the situation: Compile a separate program for each library.
+           for i in $deplibs; do
+             case $i in
+             -l*)
+               func_stripname -l '' "$i"
+               name=$func_stripname_result
+               $opt_dry_run || $RM conftest
+               if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+                 ldd_output=`ldd conftest`
+                 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                   case " $predeps $postdeps " in
+                   *" $i "*)
+                     func_append newdeplibs " $i"
+                     i=""
+                     ;;
+                   esac
+                 fi
+                 if test -n "$i" ; then
+                   libname=`eval "\\$ECHO \"$libname_spec\""`
+                   deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+                   set dummy $deplib_matches; shift
+                   deplib_match=$1
+                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                     func_append newdeplibs " $i"
+                   else
+                     droppeddeps=yes
+                     echo
+                     $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+                     echo "*** I have the capability to make that library automatically link in when"
+                     echo "*** you link to this library.  But I can only do this if you have a"
+                     echo "*** shared version of the library, which you do not appear to have"
+                     echo "*** because a test_compile did reveal that the linker did not use this one"
+                     echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+                   fi
+                 fi
+               else
+                 droppeddeps=yes
+                 echo
+                 $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+                 echo "*** make it link in!  You will probably need to install it or some"
+                 echo "*** library that it depends on before this library will be fully"
+                 echo "*** functional.  Installing it before continuing would be even better."
+               fi
+               ;;
+             *)
+               func_append newdeplibs " $i"
+               ;;
+             esac
+           done
+         fi
+         ;;
+       file_magic*)
+         set dummy $deplibs_check_method; shift
+         file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+         for a_deplib in $deplibs; do
+           case $a_deplib in
+           -l*)
+             func_stripname -l '' "$a_deplib"
+             name=$func_stripname_result
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 func_append newdeplibs " $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval "\\$ECHO \"$libname_spec\""`
+               if test -n "$file_magic_glob"; then
+                 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+               else
+                 libnameglob=$libname
+               fi
+               test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 if test "$want_nocaseglob" = yes; then
+                   shopt -s nocaseglob
+                   potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+                   $nocaseglob
+                 else
+                   potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+                 fi
+                 for potent_lib in $potential_libs; do
+                     # Follow soft links.
+                     if ls -lLd "$potent_lib" 2>/dev/null |
+                        $GREP " -> " >/dev/null; then
+                       continue
+                     fi
+                     # The statement above tries to avoid entering an
+                     # endless loop below, in case of cyclic links.
+                     # We might still enter an endless loop, since a link
+                     # loop can be closed while we follow links,
+                     # but so what?
+                     potlib="$potent_lib"
+                     while test -h "$potlib" 2>/dev/null; do
+                       potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+                       case $potliblink in
+                       [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+                       *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+                       esac
+                     done
+                     if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+                        $SED -e 10q |
+                        $EGREP "$file_magic_regex" > /dev/null; then
+                       func_append newdeplibs " $a_deplib"
+                       a_deplib=""
+                       break 2
+                     fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               echo
+               $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+               else
+                 $ECHO "*** with $libname and none of the candidates passed a file format test"
+                 $ECHO "*** using a file magic. Last file checked: $potlib"
+               fi
+             fi
+             ;;
+           *)
+             # Add a -L argument.
+             func_append newdeplibs " $a_deplib"
+             ;;
+           esac
+         done # Gone through all deplibs.
+         ;;
+       match_pattern*)
+         set dummy $deplibs_check_method; shift
+         match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+         for a_deplib in $deplibs; do
+           case $a_deplib in
+           -l*)
+             func_stripname -l '' "$a_deplib"
+             name=$func_stripname_result
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 func_append newdeplibs " $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval "\\$ECHO \"$libname_spec\""`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
+                   potlib="$potent_lib" # see symlink-check above in file_magic test
+                   if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+                      $EGREP "$match_pattern_regex" > /dev/null; then
+                     func_append newdeplibs " $a_deplib"
+                     a_deplib=""
+                     break 2
+                   fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               echo
+               $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+               else
+                 $ECHO "*** with $libname and none of the candidates passed a file format test"
+                 $ECHO "*** using a regex pattern. Last file checked: $potlib"
+               fi
+             fi
+             ;;
+           *)
+             # Add a -L argument.
+             func_append newdeplibs " $a_deplib"
+             ;;
+           esac
+         done # Gone through all deplibs.
+         ;;
+       none | unknown | *)
+         newdeplibs=""
+         tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+         if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+           for i in $predeps $postdeps ; do
+             # can't use Xsed below, because $i might contain '/'
+             tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+           done
+         fi
+         case $tmp_deplibs in
+         *[!\  \ ]*)
+           echo
+           if test "X$deplibs_check_method" = "Xnone"; then
+             echo "*** Warning: inter-library dependencies are not supported in this platform."
+           else
+             echo "*** Warning: inter-library dependencies are not known to be supported."
+           fi
+           echo "*** All declared inter-library dependencies are being dropped."
+           droppeddeps=yes
+           ;;
+         esac
+         ;;
+       esac
+       versuffix=$versuffix_save
+       major=$major_save
+       release=$release_save
+       libname=$libname_save
+       name=$name_save
+
+       case $host in
+       *-*-rhapsody* | *-*-darwin1.[012])
+         # On Rhapsody replace the C library with the System framework
+         newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+         ;;
+       esac
+
+       if test "$droppeddeps" = yes; then
+         if test "$module" = yes; then
+           echo
+           echo "*** Warning: libtool could not satisfy all declared inter-library"
+           $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+           echo "*** a static module, that should work as long as the dlopening"
+           echo "*** application is linked with the -dlopen flag."
+           if test -z "$global_symbol_pipe"; then
+             echo
+             echo "*** However, this would only work if libtool was able to extract symbol"
+             echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+             echo "*** not find such a program.  So, this module is probably useless."
+             echo "*** \`nm' from GNU binutils and a full rebuild may help."
+           fi
+           if test "$build_old_libs" = no; then
+             oldlibs="$output_objdir/$libname.$libext"
+             build_libtool_libs=module
+             build_old_libs=yes
+           else
+             build_libtool_libs=no
+           fi
+         else
+           echo "*** The inter-library dependencies that have been dropped here will be"
+           echo "*** automatically added whenever a program is linked with this library"
+           echo "*** or is declared to -dlopen it."
+
+           if test "$allow_undefined" = no; then
+             echo
+             echo "*** Since this library must not contain undefined symbols,"
+             echo "*** because either the platform does not support them or"
+             echo "*** it was explicitly requested with -no-undefined,"
+             echo "*** libtool will only create a static version of it."
+             if test "$build_old_libs" = no; then
+               oldlibs="$output_objdir/$libname.$libext"
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         fi
+       fi
+       # Done checking deplibs!
+       deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+       *-*-darwin*)
+         newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $deplibs " in
+         *" -L$path/$objdir "*)
+           func_append new_libs " -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) func_append new_libs " $deplib" ;;
+         esac
+         ;;
+       *) func_append new_libs " $deplib" ;;
+       esac
+      done
+      deplibs="$new_libs"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # 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=
+         dep_rpath=
+         rpath="$finalize_rpath"
+         test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+         for libdir in $rpath; do
+           if test -n "$hardcode_libdir_flag_spec"; then
+             if test -n "$hardcode_libdir_separator"; then
+               func_replace_sysroot "$libdir"
+               libdir=$func_replace_sysroot_result
+               if test -z "$hardcode_libdirs"; then
+                 hardcode_libdirs="$libdir"
+               else
+                 # Just accumulate the unique libdirs.
+                 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+                 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+                   ;;
+                 *)
+                   func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+                   ;;
+                 esac
+               fi
+             else
+               eval flag=\"$hardcode_libdir_flag_spec\"
+               func_append dep_rpath " $flag"
+             fi
+           elif test -n "$runpath_var"; then
+             case "$perm_rpath " in
+             *" $libdir "*) ;;
+             *) func_append perm_rpath " $libdir" ;;
+             esac
+           fi
+         done
+         # Substitute the hardcoded libdirs into the rpath.
+         if test -n "$hardcode_libdir_separator" &&
+            test -n "$hardcode_libdirs"; then
+           libdir="$hardcode_libdirs"
+           eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+         fi
+         if test -n "$runpath_var" && test -n "$perm_rpath"; then
+           # We should set the runpath_var.
+           rpath=
+           for dir in $perm_rpath; do
+             func_append rpath "$dir:"
+           done
+           eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+         fi
+         test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+       fi
+
+       shlibpath="$finalize_shlibpath"
+       test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+       if test -n "$shlibpath"; then
+         eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+       fi
+
+       # Get the real and link names of the library.
+       eval shared_ext=\"$shrext_cmds\"
+       eval library_names=\"$library_names_spec\"
+       set dummy $library_names
+       shift
+       realname="$1"
+       shift
+
+       if test -n "$soname_spec"; then
+         eval soname=\"$soname_spec\"
+       else
+         soname="$realname"
+       fi
+       if test -z "$dlname"; then
+         dlname=$soname
+       fi
+
+       lib="$output_objdir/$realname"
+       linknames=
+       for link
+       do
+         func_append linknames " $link"
+       done
+
+       # Use standard objects if they are pic
+       test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+       test "X$libobjs" = "X " && libobjs=
+
+       delfiles=
+       if test -n "$export_symbols" && test -n "$include_expsyms"; then
+         $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+         export_symbols="$output_objdir/$libname.uexp"
+         func_append delfiles " $export_symbols"
+       fi
+
+       orig_export_symbols=
+       case $host_os in
+       cygwin* | mingw* | cegcc*)
+         if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+           # exporting using user supplied symfile
+           if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+             # and it's NOT already a .def file. Must figure out
+             # which of the given symbols are data symbols and tag
+             # them as such. So, trigger use of export_symbols_cmds.
+             # export_symbols gets reassigned inside the "prepare
+             # the list of exported symbols" if statement, so the
+             # include_expsyms logic still works.
+             orig_export_symbols="$export_symbols"
+             export_symbols=
+             always_export_symbols=yes
+           fi
+         fi
+         ;;
+       esac
+
+       # Prepare the list of exported symbols
+       if test -z "$export_symbols"; then
+         if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+           func_verbose "generating symbol list for \`$libname.la'"
+           export_symbols="$output_objdir/$libname.exp"
+           $opt_dry_run || $RM $export_symbols
+           cmds=$export_symbols_cmds
+           save_ifs="$IFS"; IFS='~'
+           for cmd1 in $cmds; do
+             IFS="$save_ifs"
+             # Take the normal branch if the nm_file_list_spec branch
+             # doesn't work or if tool conversion is not needed.
+             case $nm_file_list_spec~$to_tool_file_cmd in
+               *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+                 try_normal_branch=yes
+                 eval cmd=\"$cmd1\"
+                 func_len " $cmd"
+                 len=$func_len_result
+                 ;;
+               *)
+                 try_normal_branch=no
+                 ;;
+             esac
+             if test "$try_normal_branch" = yes \
+                && { test "$len" -lt "$max_cmd_len" \
+                     || test "$max_cmd_len" -le -1; }
+             then
+               func_show_eval "$cmd" 'exit $?'
+               skipped_export=false
+             elif test -n "$nm_file_list_spec"; then
+               func_basename "$output"
+               output_la=$func_basename_result
+               save_libobjs=$libobjs
+               save_output=$output
+               output=${output_objdir}/${output_la}.nm
+               func_to_tool_file "$output"
+               libobjs=$nm_file_list_spec$func_to_tool_file_result
+               func_append delfiles " $output"
+               func_verbose "creating $NM input file list: $output"
+               for obj in $save_libobjs; do
+                 func_to_tool_file "$obj"
+                 $ECHO "$func_to_tool_file_result"
+               done > "$output"
+               eval cmd=\"$cmd1\"
+               func_show_eval "$cmd" 'exit $?'
+               output=$save_output
+               libobjs=$save_libobjs
+               skipped_export=false
+             else
+               # The command line is too long to execute in one step.
+               func_verbose "using reloadable object file for export list..."
+               skipped_export=:
+               # Break out early, otherwise skipped_export may be
+               # set to false by a later but shorter cmd.
+               break
+             fi
+           done
+           IFS="$save_ifs"
+           if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+             func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+       fi
+
+       if test -n "$export_symbols" && test -n "$include_expsyms"; then
+         tmp_export_symbols="$export_symbols"
+         test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+         $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+       fi
+
+       if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+         # The given exports_symbols file has to be filtered, so filter it.
+         func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+         # FIXME: $output_objdir/$libname.filter potentially contains lots of
+         # 's' commands which not all seds can handle. GNU sed should be fine
+         # though. Also, the filter scales superlinearly with the number of
+         # global variables. join(1) would be nice here, but unfortunately
+         # isn't a blessed tool.
+         $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+         func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+         export_symbols=$output_objdir/$libname.def
+         $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+       fi
+
+       tmp_deplibs=
+       for test_deplib in $deplibs; do
+         case " $convenience " in
+         *" $test_deplib "*) ;;
+         *)
+           func_append tmp_deplibs " $test_deplib"
+           ;;
+         esac
+       done
+       deplibs="$tmp_deplibs"
+
+       if test -n "$convenience"; then
+         if test -n "$whole_archive_flag_spec" &&
+           test "$compiler_needs_object" = yes &&
+           test -z "$libobjs"; then
+           # extract the archives, so we have objects to list.
+           # TODO: could optimize this to just extract one archive.
+           whole_archive_flag_spec=
+         fi
+         if test -n "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+           test "X$libobjs" = "X " && libobjs=
+         else
+           gentop="$output_objdir/${outputname}x"
+           func_append generated " $gentop"
+
+           func_extract_archives $gentop $convenience
+           func_append libobjs " $func_extract_archives_result"
+           test "X$libobjs" = "X " && libobjs=
+         fi
+       fi
+
+       if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+         eval flag=\"$thread_safe_flag_spec\"
+         func_append linker_flags " $flag"
+       fi
+
+       # Make a backup of the uninstalled library when relinking
+       if test "$opt_mode" = relink; then
+         $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+       fi
+
+       # Do each of the archive commands.
+       if test "$module" = yes && test -n "$module_cmds" ; then
+         if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+           eval test_cmds=\"$module_expsym_cmds\"
+           cmds=$module_expsym_cmds
+         else
+           eval test_cmds=\"$module_cmds\"
+           cmds=$module_cmds
+         fi
+       else
+         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+           eval test_cmds=\"$archive_expsym_cmds\"
+           cmds=$archive_expsym_cmds
+         else
+           eval test_cmds=\"$archive_cmds\"
+           cmds=$archive_cmds
+         fi
+       fi
+
+       if test "X$skipped_export" != "X:" &&
+          func_len " $test_cmds" &&
+          len=$func_len_result &&
+          test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         :
+       else
+         # The command line is too long to link in one step, link piecewise
+         # or, if using GNU ld and skipped_export is not :, use a linker
+         # script.
+
+         # Save the value of $output and $libobjs because we want to
+         # use them later.  If we have whole_archive_flag_spec, we
+         # want to use save_libobjs as it was before
+         # whole_archive_flag_spec was expanded, because we can't
+         # assume the linker understands whole_archive_flag_spec.
+         # This may have to be revisited, in case too many
+         # convenience libraries get linked in and end up exceeding
+         # the spec.
+         if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+         fi
+         save_output=$output
+         func_basename "$output"
+         output_la=$func_basename_result
+
+         # Clear the reloadable object creation command queue and
+         # initialize k to one.
+         test_cmds=
+         concat_cmds=
+         objlist=
+         last_robj=
+         k=1
+
+         if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+           output=${output_objdir}/${output_la}.lnkscript
+           func_verbose "creating GNU ld script: $output"
+           echo 'INPUT (' > $output
+           for obj in $save_libobjs
+           do
+             func_to_tool_file "$obj"
+             $ECHO "$func_to_tool_file_result" >> $output
+           done
+           echo ')' >> $output
+           func_append delfiles " $output"
+           func_to_tool_file "$output"
+           output=$func_to_tool_file_result
+         elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+           output=${output_objdir}/${output_la}.lnk
+           func_verbose "creating linker input file list: $output"
+           : > $output
+           set x $save_libobjs
+           shift
+           firstobj=
+           if test "$compiler_needs_object" = yes; then
+             firstobj="$1 "
+             shift
+           fi
+           for obj
+           do
+             func_to_tool_file "$obj"
+             $ECHO "$func_to_tool_file_result" >> $output
+           done
+           func_append delfiles " $output"
+           func_to_tool_file "$output"
+           output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+         else
+           if test -n "$save_libobjs"; then
+             func_verbose "creating reloadable object files..."
+             output=$output_objdir/$output_la-${k}.$objext
+             eval test_cmds=\"$reload_cmds\"
+             func_len " $test_cmds"
+             len0=$func_len_result
+             len=$len0
+
+             # Loop over the list of objects to be linked.
+             for obj in $save_libobjs
+             do
+               func_len " $obj"
+               func_arith $len + $func_len_result
+               len=$func_arith_result
+               if test "X$objlist" = X ||
+                  test "$len" -lt "$max_cmd_len"; then
+                 func_append objlist " $obj"
+               else
+                 # The command $test_cmds is almost too long, add a
+                 # command to the queue.
+                 if test "$k" -eq 1 ; then
+                   # The first file doesn't have a previous command to add.
+                   reload_objs=$objlist
+                   eval concat_cmds=\"$reload_cmds\"
+                 else
+                   # All subsequent reloadable object files will link in
+                   # the last one created.
+                   reload_objs="$objlist $last_robj"
+                   eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+                 fi
+                 last_robj=$output_objdir/$output_la-${k}.$objext
+                 func_arith $k + 1
+                 k=$func_arith_result
+                 output=$output_objdir/$output_la-${k}.$objext
+                 objlist=" $obj"
+                 func_len " $last_robj"
+                 func_arith $len0 + $func_len_result
+                 len=$func_arith_result
+               fi
+             done
+             # Handle the remaining objects by creating one last
+             # reloadable object file.  All subsequent reloadable object
+             # files will link in the last one created.
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             reload_objs="$objlist $last_robj"
+             eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+             if test -n "$last_robj"; then
+               eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+             fi
+             func_append delfiles " $output"
+
+           else
+             output=
+           fi
+
+           if ${skipped_export-false}; then
+             func_verbose "generating symbol list for \`$libname.la'"
+             export_symbols="$output_objdir/$libname.exp"
+             $opt_dry_run || $RM $export_symbols
+             libobjs=$output
+             # Append the command to create the export file.
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+             if test -n "$last_robj"; then
+               eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+             fi
+           fi
+
+           test -n "$save_libobjs" &&
+             func_verbose "creating a temporary reloadable object file: $output"
+
+           # Loop through the commands generated above and execute them.
+           save_ifs="$IFS"; IFS='~'
+           for cmd in $concat_cmds; do
+             IFS="$save_ifs"
+             $opt_silent || {
+                 func_quote_for_expand "$cmd"
+                 eval "func_echo $func_quote_for_expand_result"
+             }
+             $opt_dry_run || eval "$cmd" || {
+               lt_exit=$?
+
+               # Restore the uninstalled library and exit
+               if test "$opt_mode" = relink; then
+                 ( cd "$output_objdir" && \
+                   $RM "${realname}T" && \
+                   $MV "${realname}U" "$realname" )
+               fi
+
+               exit $lt_exit
+             }
+           done
+           IFS="$save_ifs"
+
+           if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+             func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+
+          if ${skipped_export-false}; then
+           if test -n "$export_symbols" && test -n "$include_expsyms"; then
+             tmp_export_symbols="$export_symbols"
+             test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+             $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+           fi
+
+           if test -n "$orig_export_symbols"; then
+             # The given exports_symbols file has to be filtered, so filter it.
+             func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+             # FIXME: $output_objdir/$libname.filter potentially contains lots of
+             # 's' commands which not all seds can handle. GNU sed should be fine
+             # though. Also, the filter scales superlinearly with the number of
+             # global variables. join(1) would be nice here, but unfortunately
+             # isn't a blessed tool.
+             $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+             func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+             export_symbols=$output_objdir/$libname.def
+             $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+           fi
+         fi
+
+         libobjs=$output
+         # Restore the value of output.
+         output=$save_output
+
+         if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+           test "X$libobjs" = "X " && libobjs=
+         fi
+         # Expand the library linking commands again to reset the
+         # value of $libobjs for piecewise linking.
+
+         # Do each of the archive commands.
+         if test "$module" = yes && test -n "$module_cmds" ; then
+           if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+             cmds=$module_expsym_cmds
+           else
+             cmds=$module_cmds
+           fi
+         else
+           if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+             cmds=$archive_expsym_cmds
+           else
+             cmds=$archive_cmds
+           fi
+         fi
+       fi
+
+       if test -n "$delfiles"; then
+         # Append the command to remove temporary files to $cmds.
+         eval cmds=\"\$cmds~\$RM $delfiles\"
+       fi
+
+       # Add any objects from preloaded convenience libraries
+       if test -n "$dlprefiles"; then
+         gentop="$output_objdir/${outputname}x"
+         func_append generated " $gentop"
+
+         func_extract_archives $gentop $dlprefiles
+         func_append libobjs " $func_extract_archives_result"
+         test "X$libobjs" = "X " && libobjs=
+       fi
+
+       save_ifs="$IFS"; IFS='~'
+       for cmd in $cmds; do
+         IFS="$save_ifs"
+         eval cmd=\"$cmd\"
+         $opt_silent || {
+           func_quote_for_expand "$cmd"
+           eval "func_echo $func_quote_for_expand_result"
+         }
+         $opt_dry_run || eval "$cmd" || {
+           lt_exit=$?
+
+           # Restore the uninstalled library and exit
+           if test "$opt_mode" = relink; then
+             ( cd "$output_objdir" && \
+               $RM "${realname}T" && \
+               $MV "${realname}U" "$realname" )
+           fi
+
+           exit $lt_exit
+         }
+       done
+       IFS="$save_ifs"
+
+       # Restore the uninstalled library and exit
+       if test "$opt_mode" = relink; then
+         $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+         if test -n "$convenience"; then
+           if test -z "$whole_archive_flag_spec"; then
+             func_show_eval '${RM}r "$gentop"'
+           fi
+         fi
+
+         exit $EXIT_SUCCESS
+       fi
+
+       # Create links to the real library.
+       for linkname in $linknames; do
+         if test "$realname" != "$linkname"; then
+           func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+         fi
+       done
+
+       # If -module or -export-dynamic was specified, set the dlname.
+       if test "$module" = yes || test "$export_dynamic" = yes; then
+         # On all known operating systems, these are identical.
+         dlname="$soname"
+       fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       func_warning "\`-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+       func_warning "\`-l' and \`-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+       func_warning "\`-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+       func_warning "\`-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+       func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+       test -n "$objs$old_deplibs" && \
+         func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+       libobj=$output
+       func_lo2o "$libobj"
+       obj=$func_lo2o_result
+       ;;
+      *)
+       libobj=
+       obj="$output"
+       ;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+       if test -n "$whole_archive_flag_spec"; then
+         eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+         reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+       else
+         gentop="$output_objdir/${obj}x"
+         func_append generated " $gentop"
+
+         func_extract_archives $gentop $convenience
+         reload_conv_objs="$reload_objs $func_extract_archives_result"
+       fi
+      fi
+
+      # If we're not building shared, we need to use non_pic_objs
+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+       if test -n "$gentop"; then
+         func_show_eval '${RM}r "$gentop"'
+       fi
+
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+       if test -n "$gentop"; then
+         func_show_eval '${RM}r "$gentop"'
+       fi
+
+       # Create an invalid libtool object if no PIC, so that we don't
+       # accidentally link it into a program.
+       # $show "echo timestamp > $libobj"
+       # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+       exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+       # Only do commands if we really have different PIC objects.
+       reload_objs="$libobjs $reload_conv_objs"
+       output="$libobj"
+       func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+       func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+       *cygwin*) func_stripname '' '.exe' "$output"
+                 output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+       func_warning "\`-version-info' is ignored for programs"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for programs"
+
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+       && test "$dlopen_self" = unknown \
+       && test "$dlopen_self_static" = unknown && \
+         func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+       # On Rhapsody replace the C library is the System framework
+       compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+       finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+       ;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+       # Don't allow lazy linking, it breaks C++ global constructors
+       # But is supposedly fixed on 10.4 or later (yay!).
+       if test "$tagname" = CXX ; then
+         case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+           10.[0123])
+             func_append compile_command " ${wl}-bind_at_load"
+             func_append finalize_command " ${wl}-bind_at_load"
+           ;;
+         esac
+       fi
+       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+       compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       ;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $compile_deplibs " in
+         *" -L$path/$objdir "*)
+           func_append new_libs " -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $compile_deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) func_append new_libs " $deplib" ;;
+         esac
+         ;;
+       *) func_append new_libs " $deplib" ;;
+       esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       for libdir in $rpath $xrpath; do
+         # This is the magic to use -rpath.
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) func_append finalize_rpath " $libdir" ;;
+         esac
+       done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           func_append rpath " $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$perm_rpath " in
+         *" $libdir "*) ;;
+         *) func_append perm_rpath " $libdir" ;;
+         esac
+       fi
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+         testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$libdir:"*) ;;
+         ::) dllsearchpath=$libdir;;
+         *) func_append dllsearchpath ":$libdir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         ::) dllsearchpath=$testbindir;;
+         *) func_append dllsearchpath ":$testbindir";;
+         esac
+         ;;
+       esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           func_append rpath " $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$finalize_perm_rpath " in
+         *" $libdir "*) ;;
+         *) func_append finalize_perm_rpath " $libdir" ;;
+         esac
+       fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+       # Transform all the library objects into standard objects.
+       compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+       finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+       func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=yes
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+       # Replace the output file specification.
+       compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+       link_command="$compile_command$compile_rpath"
+
+       # We have no uninstalled library dependencies, so finalize right now.
+       exit_status=0
+       func_show_eval "$link_command" 'exit_status=$?'
+
+       if test -n "$postlink_cmds"; then
+         func_to_tool_file "$output"
+         postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+         func_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
+       # Delete the generated files.
+       if test -f "$output_objdir/${outputname}S.${objext}"; then
+         func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+       fi
+
+       exit $exit_status
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+       compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+       finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+       if test -n "$perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $perm_rpath; do
+           func_append rpath "$dir:"
+         done
+         compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+       if test -n "$finalize_perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $finalize_perm_rpath; do
+           func_append rpath "$dir:"
+         done
+         finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+      fi
+
+      if test "$no_install" = yes; then
+       # We don't need to create a wrapper script.
+       link_command="$compile_var$compile_command$compile_rpath"
+       # Replace the output file specification.
+       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+       # Delete the old output file.
+       $opt_dry_run || $RM $output
+       # Link the executable and exit
+       func_show_eval "$link_command" 'exit $?'
+
+       if test -n "$postlink_cmds"; then
+         func_to_tool_file "$output"
+         postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+         func_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+       # Fast installation is not supported
+       link_command="$compile_var$compile_command$compile_rpath"
+       relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+       func_warning "this platform does not like uninstalled shared libraries"
+       func_warning "\`$output' will be relinked during installation"
+      else
+       if test "$fast_install" != no; then
+         link_command="$finalize_var$compile_command$finalize_rpath"
+         if test "$fast_install" = yes; then
+           relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+         else
+           # fast_install is set to needless
+           relink_command=
+         fi
+       else
+         link_command="$compile_var$compile_command$compile_rpath"
+         relink_command="$finalize_var$finalize_command$finalize_rpath"
+       fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      if test -n "$postlink_cmds"; then
+       func_to_tool_file "$output_objdir/$outputname"
+       postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+       func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+       # Preserve any variables that may affect compiler behavior
+       for var in $variables_saved_for_relink; do
+         if eval test -z \"\${$var+set}\"; then
+           relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+         elif eval var_value=\$$var; test -z "$var_value"; then
+           relink_command="$var=; export $var; $relink_command"
+         else
+           func_quote_for_eval "$var_value"
+           relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+         fi
+       done
+       relink_command="(cd `pwd`; $relink_command)"
+       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+       # win32 will think the script is a binary if it has
+       # a .exe suffix, so we strip it off here.
+       case $output in
+         *.exe) func_stripname '' '.exe' "$output"
+                output=$func_stripname_result ;;
+       esac
+       # test for cygwin because mv fails w/o .exe extensions
+       case $host in
+         *cygwin*)
+           exeext=.exe
+           func_stripname '' '.exe' "$outputname"
+           outputname=$func_stripname_result ;;
+         *) exeext= ;;
+       esac
+       case $host in
+         *cygwin* | *mingw* )
+           func_dirname_and_basename "$output" "" "."
+           output_name=$func_basename_result
+           output_path=$func_dirname_result
+           cwrappersource="$output_path/$objdir/lt-$output_name.c"
+           cwrapper="$output_path/$output_name.exe"
+           $RM $cwrappersource $cwrapper
+           trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+           func_emit_cwrapperexe_src > $cwrappersource
+
+           # The wrapper executable is built using the $host compiler,
+           # because it contains $host paths and files. If cross-
+           # compiling, it, like the target executable, must be
+           # executed on the $host or under an emulation environment.
+           $opt_dry_run || {
+             $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+             $STRIP $cwrapper
+           }
+
+           # Now, create the wrapper script for func_source use:
+           func_ltwrapper_scriptname $cwrapper
+           $RM $func_ltwrapper_scriptname_result
+           trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+           $opt_dry_run || {
+             # note: this script will not be executed, so do not chmod.
+             if test "x$build" = "x$host" ; then
+               $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+             else
+               func_emit_wrapper no > $func_ltwrapper_scriptname_result
+             fi
+           }
+         ;;
+         * )
+           $RM $output
+           trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+           func_emit_wrapper no > $output
+           chmod +x $output
+         ;;
+       esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+       oldobjs="$libobjs_save $symfileobj"
+       addlibs="$convenience"
+       build_libtool_libs=no
+      else
+       if test "$build_libtool_libs" = module; then
+         oldobjs="$libobjs_save"
+         build_libtool_libs=no
+       else
+         oldobjs="$old_deplibs $non_pic_objects"
+         if test "$preload" = yes && test -f "$symfileobj"; then
+           func_append oldobjs " $symfileobj"
+         fi
+       fi
+       addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+       gentop="$output_objdir/${outputname}x"
+       func_append generated " $gentop"
+
+       func_extract_archives $gentop $addlibs
+       func_append oldobjs " $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+
+       # Add any objects from preloaded convenience libraries
+       if test -n "$dlprefiles"; then
+         gentop="$output_objdir/${outputname}x"
+         func_append generated " $gentop"
+
+         func_extract_archives $gentop $dlprefiles
+         func_append oldobjs " $func_extract_archives_result"
+       fi
+
+       # POSIX demands no paths to be encoded in archives.  We have
+       # to avoid creating archives with duplicate basenames if we
+       # might have to extract them afterwards, e.g., when creating a
+       # static archive out of a convenience library, or when linking
+       # the entirety of a libtool archive into another (currently
+       # not supported by libtool).
+       if (for obj in $oldobjs
+           do
+             func_basename "$obj"
+             $ECHO "$func_basename_result"
+           done | sort | sort -uc >/dev/null 2>&1); then
+         :
+       else
+         echo "copying selected object files to avoid basename conflicts..."
+         gentop="$output_objdir/${outputname}x"
+         func_append generated " $gentop"
+         func_mkdir_p "$gentop"
+         save_oldobjs=$oldobjs
+         oldobjs=
+         counter=1
+         for obj in $save_oldobjs
+         do
+           func_basename "$obj"
+           objbase="$func_basename_result"
+           case " $oldobjs " in
+           " ") oldobjs=$obj ;;
+           *[\ /]"$objbase "*)
+             while :; do
+               # Make sure we don't pick an alternate name that also
+               # overlaps.
+               newobj=lt$counter-$objbase
+               func_arith $counter + 1
+               counter=$func_arith_result
+               case " $oldobjs " in
+               *[\ /]"$newobj "*) ;;
+               *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+               esac
+             done
+             func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+             func_append oldobjs " $gentop/$newobj"
+             ;;
+           *) func_append oldobjs " $obj" ;;
+           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"
+       len=$func_len_result
+       if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         cmds=$old_archive_cmds
+       elif test -n "$archiver_list_spec"; then
+         func_verbose "using command file archive linking..."
+         for obj in $oldobjs
+         do
+           func_to_tool_file "$obj"
+           $ECHO "$func_to_tool_file_result"
+         done > $output_objdir/$libname.libcmd
+         func_to_tool_file "$output_objdir/$libname.libcmd"
+         oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+         cmds=$old_archive_cmds
+       else
+         # the command line is too long to link in one step, link in parts
+         func_verbose "using piecewise archive linking..."
+         save_RANLIB=$RANLIB
+         RANLIB=:
+         objlist=
+         concat_cmds=
+         save_oldobjs=$oldobjs
+         oldobjs=
+         # Is there a better way of finding the last object in the list?
+         for obj in $save_oldobjs
+         do
+           last_oldobj=$obj
+         done
+         eval test_cmds=\"$old_archive_cmds\"
+         func_len " $test_cmds"
+         len0=$func_len_result
+         len=$len0
+         for obj in $save_oldobjs
+         do
+           func_len " $obj"
+           func_arith $len + $func_len_result
+           len=$func_arith_result
+           func_append objlist " $obj"
+           if test "$len" -lt "$max_cmd_len"; then
+             :
+           else
+             # the above command should be used before it gets too long
+             oldobjs=$objlist
+             if test "$obj" = "$last_oldobj" ; then
+               RANLIB=$save_RANLIB
+             fi
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+             objlist=
+             len=$len0
+           fi
+         done
+         RANLIB=$save_RANLIB
+         oldobjs=$objlist
+         if test "X$oldobjs" = "X" ; then
+           eval cmds=\"\$concat_cmds\"
+         else
+           eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+         fi
+       fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+       if eval test -z \"\${$var+set}\"; then
+         relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+       elif eval var_value=\$$var; test -z "$var_value"; then
+         relink_command="$var=; export $var; $relink_command"
+       else
+         func_quote_for_eval "$var_value"
+         relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+       fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+       relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+       for installed in no yes; do
+         if test "$installed" = yes; then
+           if test -z "$install_libdir"; then
+             break
+           fi
+           output="$output_objdir/$outputname"i
+           # Replace all uninstalled libtool libraries with the installed ones
+           newdependency_libs=
+           for deplib in $dependency_libs; do
+             case $deplib in
+             *.la)
+               func_basename "$deplib"
+               name="$func_basename_result"
+               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"
+               ;;
+             -L*)
+               func_stripname -L '' "$deplib"
+               func_replace_sysroot "$func_stripname_result"
+               func_append newdependency_libs " -L$func_replace_sysroot_result"
+               ;;
+             -R*)
+               func_stripname -R '' "$deplib"
+               func_replace_sysroot "$func_stripname_result"
+               func_append newdependency_libs " -R$func_replace_sysroot_result"
+               ;;
+             *) func_append newdependency_libs " $deplib" ;;
+             esac
+           done
+           dependency_libs="$newdependency_libs"
+           newdlfiles=
+
+           for lib in $dlfiles; do
+             case $lib in
+             *.la)
+               func_basename "$lib"
+               name="$func_basename_result"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "\`$lib' is not a valid libtool archive"
+               func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+               ;;
+             *) func_append newdlfiles " $lib" ;;
+             esac
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+             *.la)
+               # Only pass preopened files to the pseudo-archive (for
+               # eventual linking with the app. that links it) if we
+               # didn't already link the preopened objects directly into
+               # the library:
+               func_basename "$lib"
+               name="$func_basename_result"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "\`$lib' is not a valid libtool archive"
+               func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+               ;;
+             esac
+           done
+           dlprefiles="$newdlprefiles"
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             func_append newdlfiles " $abs"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             func_append newdlprefiles " $abs"
+           done
+           dlprefiles="$newdlprefiles"
+         fi
+         $RM $output
+         # place dlname in correct position for cygwin
+         # In fact, it would be nice if we could use this code for all target
+         # systems that can't hard-code library paths into their executables
+         # and that have no shared library path variable independent of PATH,
+         # but it turns out we can't easily determine that from inspecting
+         # libtool variables, so we have to hard-code the OSs to which it
+         # applies here; at the moment, that means platforms that use the PE
+         # object format with DLL files.  See the long comment at the top of
+         # tests/bindir.at for full details.
+         tdlname=$dlname
+         case $host,$output,$installed,$module,$dlname in
+           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+             # If a -bindir argument was supplied, place the dll there.
+             if test "x$bindir" != x ;
+             then
+               func_relative_path "$install_libdir" "$bindir"
+               tdlname=$func_relative_path_result$dlname
+             else
+               # Otherwise fall back on heuristic.
+               tdlname=../bin/$dlname
+             fi
+             ;;
+         esac
+         $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+         if test "$installed" = no && test "$need_relink" = yes; then
+           $ECHO >> $output "\
+relink_command=\"$relink_command\""
+         fi
+       done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+    func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) func_append RM " $arg"; rmforce=yes ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+       odir="$objdir"
+      else
+       odir="$dir/$objdir"
+      fi
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$opt_mode" = uninstall && odir="$dir"
+
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test "$opt_mode" = clean; then
+       case " $rmdirs " in
+         *" $odir "*) ;;
+         *) func_append rmdirs " $odir" ;;
+       esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+        { test -h "$file"; } >/dev/null 2>&1 ||
+        test -f "$file"; then
+       :
+      elif test -d "$file"; then
+       exit_status=1
+       continue
+      elif test "$rmforce" = yes; then
+       continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+       # Possibly a libtool archive, so verify it.
+       if func_lalib_p "$file"; then
+         func_source $dir/$name
+
+         # Delete the libtool libraries and symlinks.
+         for n in $library_names; do
+           func_append rmfiles " $odir/$n"
+         done
+         test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+         case "$opt_mode" in
+         clean)
+           case " $library_names " in
+           *" $dlname "*) ;;
+           *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+           esac
+           test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+           ;;
+         uninstall)
+           if test -n "$library_names"; then
+             # Do each command in the postuninstall commands.
+             func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+           fi
+
+           if test -n "$old_library"; then
+             # Do each command in the old_postuninstall commands.
+             func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+           fi
+           # FIXME: should reinstall the best remaining shared library.
+           ;;
+         esac
+       fi
+       ;;
+
+      *.lo)
+       # Possibly a libtool object, so verify it.
+       if func_lalib_p "$file"; then
+
+         # Read the .lo file
+         func_source $dir/$name
+
+         # Add PIC object to the list of files to remove.
+         if test -n "$pic_object" &&
+            test "$pic_object" != none; then
+           func_append rmfiles " $dir/$pic_object"
+         fi
+
+         # Add non-PIC object to the list of files to remove.
+         if test -n "$non_pic_object" &&
+            test "$non_pic_object" != none; then
+           func_append rmfiles " $dir/$non_pic_object"
+         fi
+       fi
+       ;;
+
+      *)
+       if test "$opt_mode" = clean ; then
+         noexename=$name
+         case $file in
+         *.exe)
+           func_stripname '' '.exe' "$file"
+           file=$func_stripname_result
+           func_stripname '' '.exe' "$name"
+           noexename=$func_stripname_result
+           # $file with .exe has already been added to rmfiles,
+           # add $file without .exe
+           func_append rmfiles " $file"
+           ;;
+         esac
+         # Do a test to see if this is a libtool program.
+         if func_ltwrapper_p "$file"; then
+           if func_ltwrapper_executable_p "$file"; then
+             func_ltwrapper_scriptname "$file"
+             relink_command=
+             func_source $func_ltwrapper_scriptname_result
+             func_append rmfiles " $func_ltwrapper_scriptname_result"
+           else
+             relink_command=
+             func_source $dir/$noexename
+           fi
+
+           # note $name still contains .exe if it was in $file originally
+           # as does the version of $file that was added into $rmfiles
+           func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+           if test "$fast_install" = yes && test -n "$relink_command"; then
+             func_append rmfiles " $odir/lt-$name"
+           fi
+           if test "X$noexename" != "X$name" ; then
+             func_append rmfiles " $odir/lt-${noexename}.c"
+           fi
+         fi
+       fi
+       ;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+       func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/spl/config/ltoptions.m4 b/spl/config/ltoptions.m4
new file mode 100644 (file)
index 0000000..5d9acd8
--- /dev/null
@@ -0,0 +1,384 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# 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 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+           [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+                     [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+                  [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+       [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+       [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+        [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# 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@<:@=PKGS@:>@],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [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])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+                [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+                [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+                [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+                [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+                [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/spl/config/ltsugar.m4 b/spl/config/ltsugar.m4
new file mode 100644 (file)
index 0000000..9000a05
--- /dev/null
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# 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 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+          m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+            [m4_foreach([_Lt_suffix],
+               ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+       [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+         [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+                [lt_append([$1], [$2], [$3])$4],
+                [$5])],
+         [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+       m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+       [$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+                     [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/spl/config/ltversion.m4 b/spl/config/ltversion.m4
new file mode 100644 (file)
index 0000000..07a8602
--- /dev/null
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers                      -*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# 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.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[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)
+])
diff --git a/spl/config/lt~obsolete.m4 b/spl/config/lt~obsolete.m4
new file mode 100644 (file)
index 0000000..c573da9
--- /dev/null
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# 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 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],  [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],             [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],        [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],         [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],    [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],           [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],             [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],    [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],           [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],       [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],               [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],        [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],    [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],    [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],         [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],            [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],  [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],             [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],            [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],    [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],   [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],          [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],            [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],           [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],  [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],    [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],          [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],          [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],                [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],     [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],          [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],   [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],           [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],           [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],           [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],      [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],    [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],    [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],    [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],     [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],         [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],       [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],                [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/spl/config/missing b/spl/config/missing
new file mode 100755 (executable)
index 0000000..f62bbae
--- /dev/null
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2013-10-28.13; # UTC
+
+# Copyright (C) 1996-2014 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 'autom4te' 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:
index daa9eb714897d090efb6492ed2311b243d151b19..b9c04a95e01d60aa6d92d81e49836d200085f542 100644 (file)
@@ -673,16 +673,19 @@ AC_DEFUN([SPL_AC_TEST_MODULE],
                fi
        ])
 
-       AC_RUN_IFELSE([
-               AC_LANG_PROGRAM([
-                       #include "$LINUX/include/linux/license.h"
+       AS_IF([test "x$cross_compiling" != xyes], [
+               AC_RUN_IFELSE([
+                       AC_LANG_PROGRAM([
+                               #include "$LINUX/include/linux/license.h"
+                       ], [
+                               return !license_is_gpl_compatible(
+                                   "$SPL_META_LICENSE");
+                       ])
+               ], [
+                       AC_DEFINE([SPL_IS_GPL_COMPATIBLE], [1],
+                           [Define to 1 if GPL-only symbols can be used])
                ], [
-                       return !license_is_gpl_compatible("$SPL_META_LICENSE");
                ])
-       ], [
-               AC_DEFINE([SPL_IS_GPL_COMPATIBLE], [1],
-                   [Define to 1 if GPL-only symbols can be used])
-       ], [
        ])
 ])
 
diff --git a/spl/configure b/spl/configure
new file mode 100755 (executable)
index 0000000..6f7fd98
--- /dev/null
@@ -0,0 +1,19478 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for spl 0.6.5.4.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  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
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+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'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# 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 :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $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
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # 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).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... 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 -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+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'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='spl'
+PACKAGE_TARNAME='spl'
+PACKAGE_VERSION='0.6.5.4'
+PACKAGE_STRING='spl 0.6.5.4'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+CONFIG_KERNEL_FALSE
+CONFIG_KERNEL_TRUE
+CONFIG_USER_FALSE
+CONFIG_USER_TRUE
+DEBUG_KMEM_TRACKING
+DEBUG_KMEM
+DEBUG_SPL
+DEBUG_CFLAGS
+KERNELCPPFLAGS
+KERNELMAKE_PARAMS
+LINUX_SYMBOLS
+LINUX_VERSION
+LINUX_OBJ
+LINUX
+SPL_CONFIG
+ALIEN_VERSION
+ALIEN
+HAVE_ALIEN
+DPKGBUILD_VERSION
+DPKGBUILD
+HAVE_DPKGBUILD
+DPKG_VERSION
+DPKG
+HAVE_DPKG
+SRPM_DEFINE_COMMON
+SRPM_DEFINE_DKMS
+SRPM_DEFINE_KMOD
+SRPM_DEFINE_UTIL
+RPM_DEFINE_COMMON
+RPM_DEFINE_DKMS
+RPM_DEFINE_KMOD
+RPM_DEFINE_UTIL
+RPM_SPEC_DIR
+RPMBUILD_VERSION
+RPMBUILD
+HAVE_RPMBUILD
+RPM_VERSION
+RPM
+HAVE_RPM
+DEFAULT_PACKAGE
+VENDOR
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+LIBTOOL
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+SPL_META_LT_AGE
+SPL_META_LT_REVISION
+SPL_META_LT_CURRENT
+SPL_META_AUTHOR
+SPL_META_DATA
+SPL_META_ALIAS
+SPL_META_LICENSE
+RELEASE
+SPL_META_RELEASE
+SPL_META_VERSION
+SPL_META_NAME
+AWK
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_silent_rules
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+with_spec
+with_config
+enable_linux_builtin
+with_linux
+with_linux_obj
+enable_debug
+enable_debug_kmem
+enable_debug_kmem_tracking
+enable_atomic_spinlocks
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir runstatedir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 spl 0.6.5.4 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/spl]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of spl 0.6.5.4:";;
+   esac
+  cat <<\_ACEOF
+
+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-maintainer-mode
+                          enable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-linux-builtin  Configure for builtin in-tree kernel modules
+                          [default=no]
+  --enable-debug          Enable generic debug support [default=no]
+  --enable-debug-kmem     Enable basic kmem accounting [default=no]
+  --enable-debug-kmem-tracking
+                          Enable detailed kmem tracking [default=no]
+  --enable-atomic-spinlocks
+                          Atomic types use spinlocks [default=check]
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --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
+                        (or the compiler's sysroot if not specified).
+  --with-spec=SPEC        Spec files 'generic|redhat'
+  --with-config=CONFIG    Config file 'kernel|user|all|srpm'
+  --with-linux=PATH       Path to kernel source
+  --with-linux-obj=PATH   Path to kernel build objects
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+spl configure 0.6.5.4
+generated by GNU Autoconf 2.69
+
+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
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+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 spl $as_me 0.6.5.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+       for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking metadata" >&5
+$as_echo_n "checking metadata... " >&6; }
+
+       META="$srcdir/META"
+       _spl_ac_meta_type="none"
+       if test -f "$META"; then
+               _spl_ac_meta_type="META file"
+
+               SPL_META_NAME=`$AWK -F ':[ \t]+' '$1 ~ /^ *(Name|Project|Package)$/ { print $2; exit }' $META`;
+               if test -n "$SPL_META_NAME"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_NAME "$SPL_META_NAME"
+_ACEOF
+
+
+               fi
+
+               SPL_META_VERSION=`$AWK -F ':[ \t]+' '$1 ~ /^ *Version$/ { print $2; exit }' $META`;
+               if test -n "$SPL_META_VERSION"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_VERSION "$SPL_META_VERSION"
+_ACEOF
+
+
+               fi
+
+               SPL_META_RELEASE=`$AWK -F ':[ \t]+' '$1 ~ /^ *Release$/ { print $2; exit }' $META`;
+               if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
+                       _match="${SPL_META_NAME}-${SPL_META_VERSION}"
+                       _alias=$(git describe --match=${_match} 2>/dev/null)
+                       _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')
+                       if test -n "${_release}"; then
+                               SPL_META_RELEASE=${_release}
+                               _spl_ac_meta_type="git describe"
+                       fi
+               fi
+
+               if test -n "$SPL_META_RELEASE"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_RELEASE "$SPL_META_RELEASE"
+_ACEOF
+
+
+
+                       RELEASE="$SPL_META_RELEASE"
+
+               fi
+
+               SPL_META_LICENSE=`$AWK -F ':[ \t]+' '$1 ~ /^ *License$/ { print $2; exit }' $META`;
+               if test -n "$SPL_META_LICENSE"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_LICENSE "$SPL_META_LICENSE"
+_ACEOF
+
+
+               fi
+
+               if test -n "$SPL_META_NAME" -a -n "$SPL_META_VERSION"; then
+                               SPL_META_ALIAS="$SPL_META_NAME-$SPL_META_VERSION"
+                               test -n "$SPL_META_RELEASE" &&
+                                       SPL_META_ALIAS="$SPL_META_ALIAS-$SPL_META_RELEASE"
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_ALIAS "$SPL_META_ALIAS"
+_ACEOF
+
+
+               fi
+
+               SPL_META_DATA=`$AWK -F ':[ \t]+' '$1 ~ /^ *Date$/ { print $2; exit }' $META`;
+               if test -n "$SPL_META_DATA"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_DATA "$SPL_META_DATA"
+_ACEOF
+
+
+               fi
+
+               SPL_META_AUTHOR=`$AWK -F ':[ \t]+' '$1 ~ /^ *Author$/ { print $2; exit }' $META`;
+               if test -n "$SPL_META_AUTHOR"; then
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_AUTHOR "$SPL_META_AUTHOR"
+_ACEOF
+
+
+               fi
+
+
+               SPL_META_LT_CURRENT=`$AWK -F ':[ \t]+' '$1 ~ /^ *LT_Current$/ { print $2; exit }' $META`;
+               SPL_META_LT_REVISION=`$AWK -F ':[ \t]+' '$1 ~ /^ *LT_Revision$/ { print $2; exit }' $META`;
+               SPL_META_LT_AGE=`$AWK -F ':[ \t]+' '$1 ~ /^ *LT_Age$/ { print $2; exit }' $META`;
+               if test -n "$SPL_META_LT_CURRENT" \
+                                -o -n "$SPL_META_LT_REVISION" \
+                                -o -n "$SPL_META_LT_AGE"; then
+                       test -n "$SPL_META_LT_CURRENT" || SPL_META_LT_CURRENT="0"
+                       test -n "$SPL_META_LT_REVISION" || SPL_META_LT_REVISION="0"
+                       test -n "$SPL_META_LT_AGE" || SPL_META_LT_AGE="0"
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_LT_CURRENT "$SPL_META_LT_CURRENT"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_LT_REVISION "$SPL_META_LT_REVISION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define SPL_META_LT_AGE "$SPL_META_LT_AGE"
+_ACEOF
+
+
+
+
+               fi
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_spl_ac_meta_type" >&5
+$as_echo "$_spl_ac_meta_type" >&6; }
+
+
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if ${ac_cv_target+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+# 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=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='\'
+
+am__api_version='1.15'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if 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.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# 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 (
+   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
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# 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.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
+    $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
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip"
+    $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_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  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
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='spl'
+ VERSION='0.6.5.4'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+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 (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+# 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}'
+
+
+# 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 -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
+ac_config_headers="$ac_config_headers spl_config.h"
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="${ac_tool_prefix}gcc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="gcc"
+    $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_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="${ac_tool_prefix}cc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+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=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+case `pwd` in
+  *\ * | *\    *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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"
+      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
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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"
+      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
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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"
+      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
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 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
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  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
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    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
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # 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"`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump"
+    $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
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; 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_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump"
+    $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool"
+    $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
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; 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_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool"
+    $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+       if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
+    $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
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip"
+    $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_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  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
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
+    $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
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib"
+    $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_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  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
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # 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};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         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
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+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
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         powerpcle-*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*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
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      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"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $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
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; 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_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt"
+    $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
+  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
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
+else
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $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
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; 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_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil"
+    $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  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
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit"
+    $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
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; 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_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit"
+    $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  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
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo"
+    $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
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; 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_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo"
+    $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_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  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
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool"
+    $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
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; 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_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool"
+    $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  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
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64"
+    $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
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; 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_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64"
+    $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  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
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # 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
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi
+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 :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       LDFLAGS="$save_LDFLAGS"
+
+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 :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_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 -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
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[012]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  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
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## 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_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='--shared'
+       lt_prog_compiler_static='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       lt_prog_compiler_wl='-Wl,-Wl,,'
+       lt_prog_compiler_pic='-PIC'
+       lt_prog_compiler_static='-Bstatic'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-qpic'
+       lt_prog_compiler_static='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *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
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       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='${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~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+       link_all_deplibs=no
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec='$convenience'
+         fi
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       always_export_symbols=yes
+       file_list_spec='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+         else
+           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+         fi~
+         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+         linknames='
+       # 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'
+       postlink_cmds='lt_outputfile="@OUTPUT@"~
+         lt_tool_outputfile="@TOOL_OUTPUT@"~
+         case $lt_outputfile in
+           *.exe|*.EXE) ;;
+           *)
+             lt_outputfile="$lt_outputfile.exe"
+             lt_tool_outputfile="$lt_tool_outputfile.exe"
+             ;;
+         esac~
+         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+           $RM "$lt_outputfile.manifest";
+         fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       old_archive_from_new_cmds='true'
+       # FIXME: Should let the user specify the lib program.
+       old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       enable_shared_with_static_runtimes=yes
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  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
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=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
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+       hardcode_direct=yes
+       hardcode_direct_absolute=yes
+       export_dynamic_flag_spec='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         hardcode_direct_absolute=yes
+         export_dynamic_flag_spec='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+       if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+       fi
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+       hardcode_direct_absolute=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl
+         pic_flag=$lt_prog_compiler_pic
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag
+         allow_undefined_flag=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc=no
+         else
+           lt_cv_archive_cmds_need_lc=yes
+         fi
+         allow_undefined_flag=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  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
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  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
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  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"
+  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=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  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'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux # correct to gnu/linux during the next big refactor
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsdelf*-gnu)
+  version_type=linux
+  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
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  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
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  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
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  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=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  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
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    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
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/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}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  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
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl author" >&5
+$as_echo_n "checking spl author... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SPL_META_AUTHOR" >&5
+$as_echo "$SPL_META_AUTHOR" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl license" >&5
+$as_echo_n "checking spl license... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SPL_META_LICENSE" >&5
+$as_echo "$SPL_META_LICENSE" >&6; }
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking linux distribution" >&5
+$as_echo_n "checking linux distribution... " >&6; }
+       if test -f /etc/toss-release ; then
+               VENDOR=toss ;
+       elif test -f /etc/fedora-release ; then
+               VENDOR=fedora ;
+       elif test -f /etc/redhat-release ; then
+               VENDOR=redhat ;
+       elif test -f /etc/gentoo-release ; then
+               VENDOR=gentoo ;
+       elif test -f /etc/arch-release ; then
+               VENDOR=arch ;
+       elif test -f /etc/SuSE-release ; then
+               VENDOR=sles ;
+       elif test -f /etc/slackware-version ; then
+               VENDOR=slackware ;
+       elif test -f /etc/lunar.release ; then
+               VENDOR=lunar ;
+       elif test -f /etc/lsb-release ; then
+               VENDOR=ubuntu ;
+       elif test -f /etc/debian_version ; then
+               VENDOR=debian ;
+       else
+               VENDOR= ;
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VENDOR" >&5
+$as_echo "$VENDOR" >&6; }
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking default package type" >&5
+$as_echo_n "checking default package type... " >&6; }
+       case "$VENDOR" in
+               toss)       DEFAULT_PACKAGE=rpm  ;;
+               redhat)     DEFAULT_PACKAGE=rpm  ;;
+               fedora)     DEFAULT_PACKAGE=rpm  ;;
+               gentoo)     DEFAULT_PACKAGE=tgz  ;;
+               arch)       DEFAULT_PACKAGE=tgz  ;;
+               sles)       DEFAULT_PACKAGE=rpm  ;;
+               slackware)  DEFAULT_PACKAGE=tgz  ;;
+               lunar)      DEFAULT_PACKAGE=tgz  ;;
+               ubuntu)     DEFAULT_PACKAGE=deb  ;;
+               debian)     DEFAULT_PACKAGE=deb  ;;
+               *)          DEFAULT_PACKAGE=rpm  ;;
+       esac
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_PACKAGE" >&5
+$as_echo "$DEFAULT_PACKAGE" >&6; }
+
+
+
+       RPM=rpm
+       RPMBUILD=rpmbuild
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $RPM is available" >&5
+$as_echo_n "checking whether $RPM is available... " >&6; }
+       if tmp=$($RPM --version 2>/dev/null); then :
+
+               RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $3 }')
+               HAVE_RPM=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPM ($RPM_VERSION)" >&5
+$as_echo "$HAVE_RPM ($RPM_VERSION)" >&6; }
+
+else
+
+               HAVE_RPM=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPM" >&5
+$as_echo "$HAVE_RPM" >&6; }
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $RPMBUILD is available" >&5
+$as_echo_n "checking whether $RPMBUILD is available... " >&6; }
+       if tmp=$($RPMBUILD --version 2>/dev/null); then :
+
+               RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $3 }')
+               HAVE_RPMBUILD=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPMBUILD ($RPMBUILD_VERSION)" >&5
+$as_echo "$HAVE_RPMBUILD ($RPMBUILD_VERSION)" >&6; }
+
+else
+
+               HAVE_RPMBUILD=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPMBUILD" >&5
+$as_echo "$HAVE_RPMBUILD" >&6; }
+
+fi
+
+       RPM_DEFINE_COMMON='--define "$(DEBUG_SPL) 1" --define "$(DEBUG_KMEM) 1" --define "$(DEBUG_KMEM_TRACKING) 1"'
+       RPM_DEFINE_UTIL=
+       RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)"'
+       RPM_DEFINE_DKMS=
+
+       SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
+       SRPM_DEFINE_UTIL=
+       SRPM_DEFINE_KMOD=
+       SRPM_DEFINE_DKMS=
+
+       RPM_SPEC_DIR="rpm/generic"
+
+# Check whether --with-spec was given.
+if test "${with_spec+set}" = set; then :
+  withval=$with_spec; RPM_SPEC_DIR="rpm/$withval"
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether spec files are available" >&5
+$as_echo_n "checking whether spec files are available... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($RPM_SPEC_DIR/*.spec.in)" >&5
+$as_echo "yes ($RPM_SPEC_DIR/*.spec.in)" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+       DPKG=dpkg
+       DPKGBUILD=dpkg-buildpackage
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $DPKG is available" >&5
+$as_echo_n "checking whether $DPKG is available... " >&6; }
+       if tmp=$($DPKG --version 2>/dev/null); then :
+
+               DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $7 }')
+               HAVE_DPKG=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKG ($DPKG_VERSION)" >&5
+$as_echo "$HAVE_DPKG ($DPKG_VERSION)" >&6; }
+
+else
+
+               HAVE_DPKG=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKG" >&5
+$as_echo "$HAVE_DPKG" >&6; }
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $DPKGBUILD is available" >&5
+$as_echo_n "checking whether $DPKGBUILD is available... " >&6; }
+       if tmp=$($DPKGBUILD --version 2>/dev/null); then :
+
+               DPKGBUILD_VERSION=$(echo $tmp | \
+                   $AWK '/Debian/ { print $4 }' | cut -f-4 -d'.')
+               HAVE_DPKGBUILD=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKGBUILD ($DPKGBUILD_VERSION)" >&5
+$as_echo "$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)" >&6; }
+
+else
+
+               HAVE_DPKGBUILD=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKGBUILD" >&5
+$as_echo "$HAVE_DPKGBUILD" >&6; }
+
+fi
+
+
+
+
+
+
+
+
+
+
+       ALIEN=alien
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ALIEN is available" >&5
+$as_echo_n "checking whether $ALIEN is available... " >&6; }
+       if tmp=$($ALIEN --version 2>/dev/null); then :
+
+               ALIEN_VERSION=$(echo $tmp | $AWK '{ print $3 }')
+               HAVE_ALIEN=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ALIEN ($ALIEN_VERSION)" >&5
+$as_echo "$HAVE_ALIEN ($ALIEN_VERSION)" >&6; }
+
+else
+
+               HAVE_ALIEN=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ALIEN" >&5
+$as_echo "$HAVE_ALIEN" >&6; }
+
+fi
+
+
+
+
+
+
+
+       SPL_CONFIG=all
+
+# Check whether --with-config was given.
+if test "${with_config+set}" = set; then :
+  withval=$with_config; SPL_CONFIG="$withval"
+fi
+
+       # Check whether --enable-linux-builtin was given.
+if test "${enable_linux_builtin+set}" = set; then :
+  enableval=$enable_linux_builtin;
+else
+  enable_linux_builtin=no
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl config" >&5
+$as_echo_n "checking spl config... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SPL_CONFIG" >&5
+$as_echo "$SPL_CONFIG" >&6; };
+
+
+       case "$SPL_CONFIG" in
+               kernel)
+
+
+# Check whether --with-linux was given.
+if test "${with_linux+set}" = set; then :
+  withval=$with_linux; kernelsrc="$withval"
+fi
+
+
+
+# Check whether --with-linux-obj was given.
+if test "${with_linux_obj+set}" = set; then :
+  withval=$with_linux_obj; kernelbuild="$withval"
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source directory" >&5
+$as_echo_n "checking kernel source directory... " >&6; }
+       if test -z "$kernelsrc"; then
+               if test -e "/lib/modules/$(uname -r)/source"; then
+                       headersdir="/lib/modules/$(uname -r)/source"
+                       sourcelink=$(readlink -f "$headersdir")
+               elif test -e "/lib/modules/$(uname -r)/build"; then
+                       headersdir="/lib/modules/$(uname -r)/build"
+                       sourcelink=$(readlink -f "$headersdir")
+               else
+                       sourcelink=$(ls -1d /usr/src/kernels/* \
+                                    /usr/src/linux-* \
+                                    2>/dev/null | grep -v obj | tail -1)
+               fi
+
+               if test -n "$sourcelink" && test -e ${sourcelink}; then
+                       kernelsrc=`readlink -f ${sourcelink}`
+               else
+                       kernelsrc="Not found"
+               fi
+       else
+               if test "$kernelsrc" = "NONE"; then
+                       kernsrcver=NONE
+               fi
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelsrc" >&5
+$as_echo "$kernelsrc" >&6; }
+       if test ! -d "$kernelsrc"; then
+               as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed and then try again.  If that fails, you can specify the
+       *** location of the kernel source with the '--with-linux=PATH' option." "$LINENO" 5
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel build directory" >&5
+$as_echo_n "checking kernel build directory... " >&6; }
+       if test -z "$kernelbuild"; then
+               if test -e "/lib/modules/$(uname -r)/build"; then
+                       kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
+               elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+               elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+               elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+                       kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
+               else
+                       kernelbuild=${kernelsrc}
+               fi
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelbuild" >&5
+$as_echo "$kernelbuild" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source version" >&5
+$as_echo_n "checking kernel source version... " >&6; }
+       utsrelease1=$kernelbuild/include/linux/version.h
+       utsrelease2=$kernelbuild/include/linux/utsrelease.h
+       utsrelease3=$kernelbuild/include/generated/utsrelease.h
+       if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then
+               utsrelease=linux/version.h
+       elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+               utsrelease=linux/utsrelease.h
+       elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+               utsrelease=generated/utsrelease.h
+       fi
+
+       if test "$utsrelease"; then
+               kernsrcver=`(echo "#include <$utsrelease>";
+                            echo "kernsrcver=UTS_RELEASE") |
+                            cpp -I $kernelbuild/include |
+                            grep "^kernsrcver=" | cut -d \" -f 2`
+
+               if test -z "$kernsrcver"; then
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+                       as_fn_error $? "*** Cannot determine kernel version." "$LINENO" 5
+               fi
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Cannot find UTS_RELEASE definition." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Cannot find UTS_RELEASE definition.
+       *** Please run 'make prepare' inside the kernel source tree." "$LINENO" 5
+               fi
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernsrcver" >&5
+$as_echo "$kernsrcver" >&6; }
+
+       LINUX=${kernelsrc}
+       LINUX_OBJ=${kernelbuild}
+       LINUX_VERSION=${kernsrcver}
+
+
+
+
+
+
+       modpost=$LINUX/scripts/Makefile.modpost
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel file name for module symbols" >&5
+$as_echo_n "checking kernel file name for module symbols... " >&6; }
+       if test "x$enable_linux_builtin" != xyes -a -f "$modpost"; then
+               if grep -q Modules.symvers $modpost; then
+                       LINUX_SYMBOLS=Modules.symvers
+               else
+                       LINUX_SYMBOLS=Module.symvers
+               fi
+
+               if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+                       as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If you are building with a custom kernel, make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." "$LINENO" 5
+               fi
+       else
+               LINUX_SYMBOLS=NONE
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_SYMBOLS" >&5
+$as_echo "$LINUX_SYMBOLS" >&6; }
+
+
+
+
+       if test "${LINUX_OBJ}" != "${LINUX}"; then
+               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+       fi
+
+
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging is enabled" >&5
+$as_echo_n "checking whether debugging is enabled... " >&6; }
+       # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug;
+else
+  enable_debug=no
+fi
+
+
+       if test "x$enable_debug" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
+               DEBUG_CFLAGS="-DDEBUG -Werror"
+               DEBUG_SPL="_with_debug"
+
+else
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG"
+               DEBUG_CFLAGS="-DNDEBUG"
+               DEBUG_SPL="_without_debug"
+
+fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5
+$as_echo "$enable_debug" >&6; }
+
+
+       # Check whether --enable-debug-kmem was given.
+if test "${enable_debug_kmem+set}" = set; then :
+  enableval=$enable_debug_kmem;
+else
+  enable_debug_kmem=no
+fi
+
+
+       if test "x$enable_debug_kmem" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"
+               DEBUG_KMEM="_with_debug_kmem"
+
+$as_echo "#define DEBUG_KMEM 1" >>confdefs.h
+
+
+else
+
+               DEBUG_KMEM="_without_debug_kmem"
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether basic kmem accounting is enabled" >&5
+$as_echo_n "checking whether basic kmem accounting is enabled... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem" >&5
+$as_echo "$enable_debug_kmem" >&6; }
+
+
+       # Check whether --enable-debug-kmem-tracking was given.
+if test "${enable_debug_kmem_tracking+set}" = set; then :
+  enableval=$enable_debug_kmem_tracking;
+else
+  enable_debug_kmem_tracking=no
+fi
+
+
+       if test "x$enable_debug_kmem_tracking" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING"
+               DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking"
+
+$as_echo "#define DEBUG_KMEM_TRACKING 1" >>confdefs.h
+
+
+else
+
+               DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking"
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether detailed kmem tracking is enabled" >&5
+$as_echo_n "checking whether detailed kmem tracking is enabled... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem_tracking" >&5
+$as_echo "$enable_debug_kmem_tracking" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modules can be built" >&5
+$as_echo_n "checking whether modules can be built... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Unable to build an empty module." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Unable to build an empty module.
+       *** Please run 'make scripts' inside the kernel source tree." "$LINENO" 5
+               fi
+
+
+
+fi
+       rm -Rf build
+
+
+
+       if test "x$cross_compiling" != xyes; 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 "$LINUX/include/linux/license.h"
+
+int
+main ()
+{
+
+                               return !license_is_gpl_compatible(
+                                   "$SPL_META_LICENSE");
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+
+$as_echo "#define SPL_IS_GPL_COMPATIBLE 1" >>confdefs.h
+
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+
+
+       # Check whether --enable-atomic-spinlocks was given.
+if test "${enable_atomic_spinlocks+set}" = set; then :
+  enableval=$enable_atomic_spinlocks;
+else
+  enable_atomic_spinlocks=check
+fi
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               atomic64_t *ptr __attribute__ ((unused));
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               have_atomic64_t=yes
+
+$as_echo "#define HAVE_ATOMIC64_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               have_atomic64_t=no
+
+
+
+fi
+       rm -Rf build
+
+
+
+       if test "x$enable_atomic_spinlocks" = xcheck; then :
+
+               if test "x$have_atomic64_t" = xyes; then :
+
+                       enable_atomic_spinlocks=no
+
+else
+
+                       enable_atomic_spinlocks=yes
+
+fi
+
+fi
+
+       if test "x$enable_atomic_spinlocks" = xyes; then :
+
+
+$as_echo "#define ATOMIC_SPINLOCK 1" >>confdefs.h
+
+
+else
+
+               if test "x$have_atomic64_t" = xno; 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 $? "--disable-atomic-spinlocks given but required atomic64 support is unavailable
+See \`config.log' for more details" "$LINENO" 5; }
+
+fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether atomic types use spinlocks" >&5
+$as_echo_n "checking whether atomic types use spinlocks... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_spinlocks" >&5
+$as_echo "$enable_atomic_spinlocks" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines atomic64_t" >&5
+$as_echo_n "checking whether kernel defines atomic64_t... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_atomic64_t" >&5
+$as_echo "$have_atomic64_t" >&6; }
+
+
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 2-argument shrinker exists" >&5
+$as_echo_n "checking whether old 2-argument shrinker exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/mm.h>
+
+               int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
+
+int
+main (void)
+{
+
+               struct shrinker cache_shrinker = {
+                       .shrink = shrinker_cb,
+                       .seeks = DEFAULT_SEEKS,
+               };
+               register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_OLD_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 3-argument shrinker exists" >&5
+$as_echo_n "checking whether old 3-argument shrinker exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/mm.h>
+
+                       int shrinker_cb(struct shrinker *, int nr_to_scan,
+                                       gfp_t gfp_mask);
+
+int
+main (void)
+{
+
+                       struct shrinker cache_shrinker = {
+                               .shrink = shrinker_cb,
+                               .seeks = DEFAULT_SEEKS,
+                       };
+                       register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether new 2-argument shrinker exists" >&5
+$as_echo_n "checking whether new 2-argument shrinker exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                               #include <linux/mm.h>
+
+                               int shrinker_cb(struct shrinker *,
+                                               struct shrink_control *sc);
+
+int
+main (void)
+{
+
+                               struct shrinker cache_shrinker = {
+                                       .shrink = shrinker_cb,
+                                       .seeks = DEFAULT_SEEKS,
+                               };
+                               register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_NEW_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ->count_objects callback exists" >&5
+$as_echo_n "checking whether ->count_objects callback exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                                       #include <linux/mm.h>
+
+                                       unsigned long shrinker_cb(
+                                               struct shrinker *,
+                                               struct shrink_control *sc);
+
+int
+main (void)
+{
+
+                                       struct shrinker cache_shrinker = {
+                                               .count_objects = shrinker_cb,
+                                               .scan_objects = shrinker_cb,
+                                               .seeks = DEFAULT_SEEKS,
+                                       };
+                                       register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SPLIT_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                                       as_fn_error $? "error" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct ctl_table has ctl_name" >&5
+$as_echo_n "checking whether struct ctl_table has ctl_name... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sysctl.h>
+
+int
+main (void)
+{
+
+               struct ctl_table ctl __attribute__ ((unused));
+               ctl.ctl_name = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CTL_NAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether PDE_DATA() is available" >&5
+$as_echo_n "checking whether PDE_DATA() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/proc_fs.h>
+
+int
+main (void)
+{
+
+               PDE_DATA(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]PDE_DATA[[:space:]]' \
+               $LINUX_OBJ/Module*.symvers 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in ; do
+                       grep -q -E "EXPORT_SYMBOL.*(PDE_DATA)" \
+                               "$LINUX_OBJ/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PDE_DATA 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether set_fs_pwd() requires const struct path *" >&5
+$as_echo_n "checking whether set_fs_pwd() requires const struct path *... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/spinlock.h>
+               #include <linux/fs_struct.h>
+               #include <linux/path.h>
+               void (*const set_fs_pwd_func)
+                       (struct fs_struct *, const struct path *)
+                       = set_fs_pwd;
+
+int
+main (void)
+{
+
+               return 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SET_FS_PWD_WITH_CONST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/spinlock.h>
+                       #include <linux/fs_struct.h>
+                       #include <linux/path.h>
+                       void (*const set_fs_pwd_func)
+                               (struct fs_struct *, struct path *)
+                               = set_fs_pwd;
+
+int
+main (void)
+{
+
+                       return 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "unknown" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 2 args" >&5
+$as_echo_n "checking whether vfs_unlink() wants 2 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_VFS_UNLINK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 3 args" >&5
+$as_echo_n "checking whether vfs_unlink() wants 3 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                       vfs_unlink((struct inode *) NULL,
+                               (struct dentry *) NULL,
+                               (struct inode **) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_VFS_UNLINK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 4 args" >&5
+$as_echo_n "checking whether vfs_rename() wants 4 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
+                       (struct inode *) NULL, (struct dentry *) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_4ARGS_VFS_RENAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 5 args" >&5
+$as_echo_n "checking whether vfs_rename() wants 5 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                       vfs_rename((struct inode *) NULL,
+                               (struct dentry *) NULL,
+                               (struct inode *) NULL,
+                               (struct dentry *) NULL,
+                               (struct inode **) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_5ARGS_VFS_RENAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                                                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 6 args" >&5
+$as_echo_n "checking whether vfs_rename() wants 6 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                               vfs_rename((struct inode *) NULL,
+                                       (struct dentry *) NULL,
+                                       (struct inode *) NULL,
+                                       (struct dentry *) NULL,
+                                       (struct inode **) NULL,
+                                       (unsigned int) 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_6ARGS_VFS_RENAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                               as_fn_error $? "no" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_fsync() wants 2 args" >&5
+$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_fsync(NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_VFS_FSYNC 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncate_range() inode operation is available" >&5
+$as_echo_n "checking whether truncate_range() inode operation is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode_operations ops;
+               ops.truncate_range = NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_TRUNCATE_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct fs_struct uses spinlock_t" >&5
+$as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+               #include <linux/fs_struct.h>
+
+int
+main (void)
+{
+
+               static struct fs_struct fs;
+               spin_lock_init(&fs.lock);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FS_STRUCT_SPINLOCK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kuid_t/kgid_t is available" >&5
+$as_echo_n "checking whether kuid_t/kgid_t is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/uidgid.h>
+
+int
+main (void)
+{
+
+               kuid_t userid = KUIDT_INIT(0);
+               kgid_t groupid = KGIDT_INIT(0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/uidgid.h>
+
+int
+main (void)
+{
+
+                       kuid_t userid = 0;
+                       kgid_t groupid = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; optional" >&5
+$as_echo "yes; optional" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; mandatory" >&5
+$as_echo "yes; mandatory" >&6; }
+
+$as_echo "#define HAVE_KUIDGID_T 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __put_task_struct() is available" >&5
+$as_echo_n "checking whether __put_task_struct() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+
+int
+main (void)
+{
+
+               __put_task_struct(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]__put_task_struct[[:space:]]' \
+               $LINUX_OBJ/Module*.symvers 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in ; do
+                       grep -q -E "EXPORT_SYMBOL.*(__put_task_struct)" \
+                               "$LINUX_OBJ/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PUT_TASK_STRUCT 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+               struct file_operations fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->fallocate() exists" >&5
+$as_echo_n "checking whether iops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
+               struct inode_operations fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+               struct file_operations_no_const fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_INFLATE is defined" >&5
+$as_echo_n "checking whether CONFIG_ZLIB_INFLATE is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #if !defined(CONFIG_ZLIB_INFLATE) && \
+                   !defined(CONFIG_ZLIB_INFLATE_MODULE)
+               #error CONFIG_ZLIB_INFLATE not defined
+               #endif
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               as_fn_error $? "
+       *** This kernel does not include the required zlib inflate support.
+       *** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set." "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_DEFLATE is defined" >&5
+$as_echo_n "checking whether CONFIG_ZLIB_DEFLATE is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #if !defined(CONFIG_ZLIB_DEFLATE) && \
+                   !defined(CONFIG_ZLIB_DEFLATE_MODULE)
+               #error CONFIG_ZLIB_DEFLATE not defined
+               #endif
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               as_fn_error $? "
+       *** This kernel does not include the required zlib deflate support.
+       *** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set." "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether zlib_deflate_workspacesize() wants 2 args" >&5
+$as_echo_n "checking whether zlib_deflate_workspacesize() wants 2 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/zlib.h>
+
+int
+main (void)
+{
+
+               return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct shrink_control exists" >&5
+$as_echo_n "checking whether struct shrink_control exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/mm.h>
+
+int
+main (void)
+{
+
+               struct shrink_control sc __attribute__ ((unused));
+
+               sc.nr_to_scan = 0;
+               sc.gfp_mask = GFP_KERNEL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SHRINK_CONTROL_STRUCT 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore member wait_lock is raw" >&5
+$as_echo_n "checking whether struct rw_semaphore member wait_lock is raw... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/rwsem.h>
+
+int
+main (void)
+{
+
+               struct rw_semaphore dummy_semaphore __attribute__ ((unused));
+               raw_spinlock_t dummy_lock __attribute__ ((unused));
+               dummy_semaphore.wait_lock = dummy_lock;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define RWSEM_SPINLOCK_IS_RAW 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether header linux/sched/rt.h exists" >&5
+$as_echo_n "checking whether header linux/sched/rt.h exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+               #include <linux/sched/rt.h>
+
+int
+main (void)
+{
+
+               return 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+
+$as_echo "#define HAVE_SCHED_RT_HEADER 1" >>confdefs.h
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants" >&5
+$as_echo_n "checking whether vfs_getattr() wants... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_getattr((struct path *) NULL,
+                       (struct kstat *)NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2 args" >&5
+$as_echo "2 args" >&6; }
+
+$as_echo "#define HAVE_2ARGS_VFS_GETATTR 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                       vfs_getattr((struct vfsmount *)NULL,
+                               (struct dentry *)NULL,
+                               (struct kstat *)NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: 3 args" >&5
+$as_echo "3 args" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "unknown" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether usleep_range() is available" >&5
+$as_echo_n "checking whether usleep_range() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/delay.h>
+
+int
+main (void)
+{
+
+               usleep_range(0, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_USLEEP_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has allocflags" >&5
+$as_echo_n "checking whether struct kmem_cache has allocflags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/slab.h>
+
+int
+main (void)
+{
+
+               struct kmem_cache cachep __attribute__ ((unused));
+               cachep.allocflags = GFP_KERNEL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_KMEM_CACHE_ALLOCFLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has gfpflags" >&5
+$as_echo_n "checking whether struct kmem_cache has gfpflags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/slab.h>
+
+int
+main (void)
+{
+
+                       struct kmem_cache cachep __attribute__ ((unused));
+                       cachep.gfpflags = GFP_KERNEL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_KMEM_CACHE_GFPFLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wait_on_bit() takes an action" >&5
+$as_echo_n "checking whether wait_on_bit() takes an action... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/wait.h>
+
+int
+main (void)
+{
+
+               int (*action)(void *) = NULL;
+               wait_on_bit(NULL, 0, action, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_WAIT_ON_BIT_ACTION 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+ ;;
+               user)      ;;
+               all)
+
+
+# Check whether --with-linux was given.
+if test "${with_linux+set}" = set; then :
+  withval=$with_linux; kernelsrc="$withval"
+fi
+
+
+
+# Check whether --with-linux-obj was given.
+if test "${with_linux_obj+set}" = set; then :
+  withval=$with_linux_obj; kernelbuild="$withval"
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source directory" >&5
+$as_echo_n "checking kernel source directory... " >&6; }
+       if test -z "$kernelsrc"; then
+               if test -e "/lib/modules/$(uname -r)/source"; then
+                       headersdir="/lib/modules/$(uname -r)/source"
+                       sourcelink=$(readlink -f "$headersdir")
+               elif test -e "/lib/modules/$(uname -r)/build"; then
+                       headersdir="/lib/modules/$(uname -r)/build"
+                       sourcelink=$(readlink -f "$headersdir")
+               else
+                       sourcelink=$(ls -1d /usr/src/kernels/* \
+                                    /usr/src/linux-* \
+                                    2>/dev/null | grep -v obj | tail -1)
+               fi
+
+               if test -n "$sourcelink" && test -e ${sourcelink}; then
+                       kernelsrc=`readlink -f ${sourcelink}`
+               else
+                       kernelsrc="Not found"
+               fi
+       else
+               if test "$kernelsrc" = "NONE"; then
+                       kernsrcver=NONE
+               fi
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelsrc" >&5
+$as_echo "$kernelsrc" >&6; }
+       if test ! -d "$kernelsrc"; then
+               as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed and then try again.  If that fails, you can specify the
+       *** location of the kernel source with the '--with-linux=PATH' option." "$LINENO" 5
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel build directory" >&5
+$as_echo_n "checking kernel build directory... " >&6; }
+       if test -z "$kernelbuild"; then
+               if test -e "/lib/modules/$(uname -r)/build"; then
+                       kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
+               elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+               elif test -d ${kernelsrc}-obj/${target_cpu}/default; then
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+               elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then
+                       kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
+               else
+                       kernelbuild=${kernelsrc}
+               fi
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelbuild" >&5
+$as_echo "$kernelbuild" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source version" >&5
+$as_echo_n "checking kernel source version... " >&6; }
+       utsrelease1=$kernelbuild/include/linux/version.h
+       utsrelease2=$kernelbuild/include/linux/utsrelease.h
+       utsrelease3=$kernelbuild/include/generated/utsrelease.h
+       if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then
+               utsrelease=linux/version.h
+       elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then
+               utsrelease=linux/utsrelease.h
+       elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then
+               utsrelease=generated/utsrelease.h
+       fi
+
+       if test "$utsrelease"; then
+               kernsrcver=`(echo "#include <$utsrelease>";
+                            echo "kernsrcver=UTS_RELEASE") |
+                            cpp -I $kernelbuild/include |
+                            grep "^kernsrcver=" | cut -d \" -f 2`
+
+               if test -z "$kernsrcver"; then
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+                       as_fn_error $? "*** Cannot determine kernel version." "$LINENO" 5
+               fi
+       else
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Cannot find UTS_RELEASE definition." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Cannot find UTS_RELEASE definition.
+       *** Please run 'make prepare' inside the kernel source tree." "$LINENO" 5
+               fi
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernsrcver" >&5
+$as_echo "$kernsrcver" >&6; }
+
+       LINUX=${kernelsrc}
+       LINUX_OBJ=${kernelbuild}
+       LINUX_VERSION=${kernsrcver}
+
+
+
+
+
+
+       modpost=$LINUX/scripts/Makefile.modpost
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel file name for module symbols" >&5
+$as_echo_n "checking kernel file name for module symbols... " >&6; }
+       if test "x$enable_linux_builtin" != xyes -a -f "$modpost"; then
+               if grep -q Modules.symvers $modpost; then
+                       LINUX_SYMBOLS=Modules.symvers
+               else
+                       LINUX_SYMBOLS=Module.symvers
+               fi
+
+               if ! test -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then
+                       as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If you are building with a custom kernel, make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." "$LINENO" 5
+               fi
+       else
+               LINUX_SYMBOLS=NONE
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_SYMBOLS" >&5
+$as_echo "$LINUX_SYMBOLS" >&6; }
+
+
+
+
+       if test "${LINUX_OBJ}" != "${LINUX}"; then
+               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+       fi
+
+
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -Wstrict-prototypes"
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging is enabled" >&5
+$as_echo_n "checking whether debugging is enabled... " >&6; }
+       # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug;
+else
+  enable_debug=no
+fi
+
+
+       if test "x$enable_debug" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
+               DEBUG_CFLAGS="-DDEBUG -Werror"
+               DEBUG_SPL="_with_debug"
+
+else
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG"
+               DEBUG_CFLAGS="-DNDEBUG"
+               DEBUG_SPL="_without_debug"
+
+fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5
+$as_echo "$enable_debug" >&6; }
+
+
+       # Check whether --enable-debug-kmem was given.
+if test "${enable_debug_kmem+set}" = set; then :
+  enableval=$enable_debug_kmem;
+else
+  enable_debug_kmem=no
+fi
+
+
+       if test "x$enable_debug_kmem" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM"
+               DEBUG_KMEM="_with_debug_kmem"
+
+$as_echo "#define DEBUG_KMEM 1" >>confdefs.h
+
+
+else
+
+               DEBUG_KMEM="_without_debug_kmem"
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether basic kmem accounting is enabled" >&5
+$as_echo_n "checking whether basic kmem accounting is enabled... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem" >&5
+$as_echo "$enable_debug_kmem" >&6; }
+
+
+       # Check whether --enable-debug-kmem-tracking was given.
+if test "${enable_debug_kmem_tracking+set}" = set; then :
+  enableval=$enable_debug_kmem_tracking;
+else
+  enable_debug_kmem_tracking=no
+fi
+
+
+       if test "x$enable_debug_kmem_tracking" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_KMEM_TRACKING"
+               DEBUG_KMEM_TRACKING="_with_debug_kmem_tracking"
+
+$as_echo "#define DEBUG_KMEM_TRACKING 1" >>confdefs.h
+
+
+else
+
+               DEBUG_KMEM_TRACKING="_without_debug_kmem_tracking"
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether detailed kmem tracking is enabled" >&5
+$as_echo_n "checking whether detailed kmem tracking is enabled... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_kmem_tracking" >&5
+$as_echo "$enable_debug_kmem_tracking" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modules can be built" >&5
+$as_echo_n "checking whether modules can be built... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Unable to build an empty module." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Unable to build an empty module.
+       *** Please run 'make scripts' inside the kernel source tree." "$LINENO" 5
+               fi
+
+
+
+fi
+       rm -Rf build
+
+
+
+       if test "x$cross_compiling" != xyes; 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 "$LINUX/include/linux/license.h"
+
+int
+main ()
+{
+
+                               return !license_is_gpl_compatible(
+                                   "$SPL_META_LICENSE");
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+
+$as_echo "#define SPL_IS_GPL_COMPATIBLE 1" >>confdefs.h
+
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+fi
+
+
+       # Check whether --enable-atomic-spinlocks was given.
+if test "${enable_atomic_spinlocks+set}" = set; then :
+  enableval=$enable_atomic_spinlocks;
+else
+  enable_atomic_spinlocks=check
+fi
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               atomic64_t *ptr __attribute__ ((unused));
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               have_atomic64_t=yes
+
+$as_echo "#define HAVE_ATOMIC64_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               have_atomic64_t=no
+
+
+
+fi
+       rm -Rf build
+
+
+
+       if test "x$enable_atomic_spinlocks" = xcheck; then :
+
+               if test "x$have_atomic64_t" = xyes; then :
+
+                       enable_atomic_spinlocks=no
+
+else
+
+                       enable_atomic_spinlocks=yes
+
+fi
+
+fi
+
+       if test "x$enable_atomic_spinlocks" = xyes; then :
+
+
+$as_echo "#define ATOMIC_SPINLOCK 1" >>confdefs.h
+
+
+else
+
+               if test "x$have_atomic64_t" = xno; 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 $? "--disable-atomic-spinlocks given but required atomic64 support is unavailable
+See \`config.log' for more details" "$LINENO" 5; }
+
+fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether atomic types use spinlocks" >&5
+$as_echo_n "checking whether atomic types use spinlocks... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_atomic_spinlocks" >&5
+$as_echo "$enable_atomic_spinlocks" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines atomic64_t" >&5
+$as_echo_n "checking whether kernel defines atomic64_t... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $have_atomic64_t" >&5
+$as_echo "$have_atomic64_t" >&6; }
+
+
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 2-argument shrinker exists" >&5
+$as_echo_n "checking whether old 2-argument shrinker exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/mm.h>
+
+               int shrinker_cb(int nr_to_scan, gfp_t gfp_mask);
+
+int
+main (void)
+{
+
+               struct shrinker cache_shrinker = {
+                       .shrink = shrinker_cb,
+                       .seeks = DEFAULT_SEEKS,
+               };
+               register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_OLD_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether old 3-argument shrinker exists" >&5
+$as_echo_n "checking whether old 3-argument shrinker exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/mm.h>
+
+                       int shrinker_cb(struct shrinker *, int nr_to_scan,
+                                       gfp_t gfp_mask);
+
+int
+main (void)
+{
+
+                       struct shrinker cache_shrinker = {
+                               .shrink = shrinker_cb,
+                               .seeks = DEFAULT_SEEKS,
+                       };
+                       register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether new 2-argument shrinker exists" >&5
+$as_echo_n "checking whether new 2-argument shrinker exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                               #include <linux/mm.h>
+
+                               int shrinker_cb(struct shrinker *,
+                                               struct shrink_control *sc);
+
+int
+main (void)
+{
+
+                               struct shrinker cache_shrinker = {
+                                       .shrink = shrinker_cb,
+                                       .seeks = DEFAULT_SEEKS,
+                               };
+                               register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_NEW_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ->count_objects callback exists" >&5
+$as_echo_n "checking whether ->count_objects callback exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                                       #include <linux/mm.h>
+
+                                       unsigned long shrinker_cb(
+                                               struct shrinker *,
+                                               struct shrink_control *sc);
+
+int
+main (void)
+{
+
+                                       struct shrinker cache_shrinker = {
+                                               .count_objects = shrinker_cb,
+                                               .scan_objects = shrinker_cb,
+                                               .seeks = DEFAULT_SEEKS,
+                                       };
+                                       register_shrinker(&cache_shrinker);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SPLIT_SHRINKER_CALLBACK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                                       as_fn_error $? "error" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct ctl_table has ctl_name" >&5
+$as_echo_n "checking whether struct ctl_table has ctl_name... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sysctl.h>
+
+int
+main (void)
+{
+
+               struct ctl_table ctl __attribute__ ((unused));
+               ctl.ctl_name = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CTL_NAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether PDE_DATA() is available" >&5
+$as_echo_n "checking whether PDE_DATA() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/proc_fs.h>
+
+int
+main (void)
+{
+
+               PDE_DATA(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]PDE_DATA[[:space:]]' \
+               $LINUX_OBJ/Module*.symvers 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in ; do
+                       grep -q -E "EXPORT_SYMBOL.*(PDE_DATA)" \
+                               "$LINUX_OBJ/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PDE_DATA 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether set_fs_pwd() requires const struct path *" >&5
+$as_echo_n "checking whether set_fs_pwd() requires const struct path *... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/spinlock.h>
+               #include <linux/fs_struct.h>
+               #include <linux/path.h>
+               void (*const set_fs_pwd_func)
+                       (struct fs_struct *, const struct path *)
+                       = set_fs_pwd;
+
+int
+main (void)
+{
+
+               return 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SET_FS_PWD_WITH_CONST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/spinlock.h>
+                       #include <linux/fs_struct.h>
+                       #include <linux/path.h>
+                       void (*const set_fs_pwd_func)
+                               (struct fs_struct *, struct path *)
+                               = set_fs_pwd;
+
+int
+main (void)
+{
+
+                       return 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "unknown" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 2 args" >&5
+$as_echo_n "checking whether vfs_unlink() wants 2 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_unlink((struct inode *) NULL, (struct dentry *) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_VFS_UNLINK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_unlink() wants 3 args" >&5
+$as_echo_n "checking whether vfs_unlink() wants 3 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                       vfs_unlink((struct inode *) NULL,
+                               (struct dentry *) NULL,
+                               (struct inode **) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_VFS_UNLINK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 4 args" >&5
+$as_echo_n "checking whether vfs_rename() wants 4 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_rename((struct inode *) NULL, (struct dentry *) NULL,
+                       (struct inode *) NULL, (struct dentry *) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_4ARGS_VFS_RENAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 5 args" >&5
+$as_echo_n "checking whether vfs_rename() wants 5 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                       vfs_rename((struct inode *) NULL,
+                               (struct dentry *) NULL,
+                               (struct inode *) NULL,
+                               (struct dentry *) NULL,
+                               (struct inode **) NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_5ARGS_VFS_RENAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                                                                                                                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_rename() wants 6 args" >&5
+$as_echo_n "checking whether vfs_rename() wants 6 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                               vfs_rename((struct inode *) NULL,
+                                       (struct dentry *) NULL,
+                                       (struct inode *) NULL,
+                                       (struct dentry *) NULL,
+                                       (struct inode **) NULL,
+                                       (unsigned int) 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_6ARGS_VFS_RENAME 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                               as_fn_error $? "no" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_fsync() wants 2 args" >&5
+$as_echo_n "checking whether vfs_fsync() wants 2 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_fsync(NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_VFS_FSYNC 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncate_range() inode operation is available" >&5
+$as_echo_n "checking whether truncate_range() inode operation is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode_operations ops;
+               ops.truncate_range = NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_TRUNCATE_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct fs_struct uses spinlock_t" >&5
+$as_echo_n "checking whether struct fs_struct uses spinlock_t... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+               #include <linux/fs_struct.h>
+
+int
+main (void)
+{
+
+               static struct fs_struct fs;
+               spin_lock_init(&fs.lock);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FS_STRUCT_SPINLOCK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kuid_t/kgid_t is available" >&5
+$as_echo_n "checking whether kuid_t/kgid_t is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/uidgid.h>
+
+int
+main (void)
+{
+
+               kuid_t userid = KUIDT_INIT(0);
+               kgid_t groupid = KGIDT_INIT(0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/uidgid.h>
+
+int
+main (void)
+{
+
+                       kuid_t userid = 0;
+                       kgid_t groupid = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; optional" >&5
+$as_echo "yes; optional" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes; mandatory" >&5
+$as_echo "yes; mandatory" >&6; }
+
+$as_echo "#define HAVE_KUIDGID_T 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __put_task_struct() is available" >&5
+$as_echo_n "checking whether __put_task_struct() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+
+int
+main (void)
+{
+
+               __put_task_struct(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]__put_task_struct[[:space:]]' \
+               $LINUX_OBJ/Module*.symvers 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in ; do
+                       grep -q -E "EXPORT_SYMBOL.*(__put_task_struct)" \
+                               "$LINUX_OBJ/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PUT_TASK_STRUCT 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+               struct file_operations fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->fallocate() exists" >&5
+$as_echo_n "checking whether iops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               long (*fallocate) (struct inode *, int, loff_t, loff_t) = NULL;
+               struct inode_operations fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               long (*fallocate) (struct file *, int, loff_t, loff_t) = NULL;
+               struct file_operations_no_const fops __attribute__ ((unused)) = {
+                       .fallocate = fallocate,
+               };
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_INFLATE is defined" >&5
+$as_echo_n "checking whether CONFIG_ZLIB_INFLATE is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #if !defined(CONFIG_ZLIB_INFLATE) && \
+                   !defined(CONFIG_ZLIB_INFLATE_MODULE)
+               #error CONFIG_ZLIB_INFLATE not defined
+               #endif
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               as_fn_error $? "
+       *** This kernel does not include the required zlib inflate support.
+       *** Rebuild the kernel with CONFIG_ZLIB_INFLATE=y|m set." "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether CONFIG_ZLIB_DEFLATE is defined" >&5
+$as_echo_n "checking whether CONFIG_ZLIB_DEFLATE is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #if !defined(CONFIG_ZLIB_DEFLATE) && \
+                   !defined(CONFIG_ZLIB_DEFLATE_MODULE)
+               #error CONFIG_ZLIB_DEFLATE not defined
+               #endif
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               as_fn_error $? "
+       *** This kernel does not include the required zlib deflate support.
+       *** Rebuild the kernel with CONFIG_ZLIB_DEFLATE=y|m set." "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether zlib_deflate_workspacesize() wants 2 args" >&5
+$as_echo_n "checking whether zlib_deflate_workspacesize() wants 2 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/zlib.h>
+
+int
+main (void)
+{
+
+               return zlib_deflate_workspacesize(MAX_WBITS, MAX_MEM_LEVEL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct shrink_control exists" >&5
+$as_echo_n "checking whether struct shrink_control exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/mm.h>
+
+int
+main (void)
+{
+
+               struct shrink_control sc __attribute__ ((unused));
+
+               sc.nr_to_scan = 0;
+               sc.gfp_mask = GFP_KERNEL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SHRINK_CONTROL_STRUCT 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct rw_semaphore member wait_lock is raw" >&5
+$as_echo_n "checking whether struct rw_semaphore member wait_lock is raw... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-Werror"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/rwsem.h>
+
+int
+main (void)
+{
+
+               struct rw_semaphore dummy_semaphore __attribute__ ((unused));
+               raw_spinlock_t dummy_lock __attribute__ ((unused));
+               dummy_semaphore.wait_lock = dummy_lock;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define RWSEM_SPINLOCK_IS_RAW 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether header linux/sched/rt.h exists" >&5
+$as_echo_n "checking whether header linux/sched/rt.h exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+               #include <linux/sched/rt.h>
+
+int
+main (void)
+{
+
+               return 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+
+$as_echo "#define HAVE_SCHED_RT_HEADER 1" >>confdefs.h
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether vfs_getattr() wants" >&5
+$as_echo_n "checking whether vfs_getattr() wants... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               vfs_getattr((struct path *) NULL,
+                       (struct kstat *)NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: 2 args" >&5
+$as_echo "2 args" >&6; }
+
+$as_echo "#define HAVE_2ARGS_VFS_GETATTR 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+
+int
+main (void)
+{
+
+                       vfs_getattr((struct vfsmount *)NULL,
+                               (struct dentry *)NULL,
+                               (struct kstat *)NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: 3 args" >&5
+$as_echo "3 args" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "unknown" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether usleep_range() is available" >&5
+$as_echo_n "checking whether usleep_range() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/delay.h>
+
+int
+main (void)
+{
+
+               usleep_range(0, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_USLEEP_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has allocflags" >&5
+$as_echo_n "checking whether struct kmem_cache has allocflags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/slab.h>
+
+int
+main (void)
+{
+
+               struct kmem_cache cachep __attribute__ ((unused));
+               cachep.allocflags = GFP_KERNEL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_KMEM_CACHE_ALLOCFLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether struct kmem_cache has gfpflags" >&5
+$as_echo_n "checking whether struct kmem_cache has gfpflags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/slab.h>
+
+int
+main (void)
+{
+
+                       struct kmem_cache cachep __attribute__ ((unused));
+                       cachep.gfpflags = GFP_KERNEL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_KMEM_CACHE_GFPFLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether wait_on_bit() takes an action" >&5
+$as_echo_n "checking whether wait_on_bit() takes an action... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/wait.h>
+
+int
+main (void)
+{
+
+               int (*action)(void *) = NULL;
+               wait_on_bit(NULL, 0, action, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror-implicit-function-declaration $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_WAIT_ON_BIT_ACTION 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+                          ;;
+               srpm)                        ;;
+               *)
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Error!" >&5
+$as_echo "Error!" >&6; }
+               as_fn_error $? "Bad value \"$SPL_CONFIG\" for --with-config,
+                            user kernel|user|all|srpm" "$LINENO" 5 ;;
+       esac
+
+        if test "$SPL_CONFIG" = user -o "$SPL_CONFIG" = all; then
+  CONFIG_USER_TRUE=
+  CONFIG_USER_FALSE='#'
+else
+  CONFIG_USER_TRUE='#'
+  CONFIG_USER_FALSE=
+fi
+
+        if test "$SPL_CONFIG" = kernel -o "$SPL_CONFIG" = all &&
+                      test "x$enable_linux_builtin" != xyes ; then
+  CONFIG_KERNEL_TRUE=
+  CONFIG_KERNEL_FALSE='#'
+else
+  CONFIG_KERNEL_TRUE='#'
+  CONFIG_KERNEL_FALSE=
+fi
+
+
+
+ac_config_files="$ac_config_files Makefile man/Makefile man/man1/Makefile man/man5/Makefile lib/Makefile cmd/Makefile module/Makefile module/spl/Makefile module/splat/Makefile include/Makefile include/fs/Makefile include/linux/Makefile include/rpc/Makefile include/sharefs/Makefile include/sys/Makefile include/sys/fm/Makefile include/sys/fs/Makefile include/sys/sysevent/Makefile include/util/Makefile include/vm/Makefile scripts/Makefile rpm/Makefile rpm/redhat/Makefile rpm/redhat/spl.spec rpm/redhat/spl-kmod.spec rpm/redhat/spl-dkms.spec rpm/generic/Makefile rpm/generic/spl.spec rpm/generic/spl-kmod.spec rpm/generic/spl-dkms.spec spl.release"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+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$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+{ $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='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CONFIG_USER_TRUE}" && test -z "${CONFIG_USER_FALSE}"; then
+  as_fn_error $? "conditional \"CONFIG_USER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CONFIG_KERNEL_TRUE}" && test -z "${CONFIG_KERNEL_FALSE}"; then
+  as_fn_error $? "conditional \"CONFIG_KERNEL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... 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 -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# 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'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by spl $as_me 0.6.5.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+spl config.status 0.6.5.4
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+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."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+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
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+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"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+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_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"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "spl_config.h") CONFIG_HEADERS="$CONFIG_HEADERS spl_config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+    "man/man1/Makefile") CONFIG_FILES="$CONFIG_FILES man/man1/Makefile" ;;
+    "man/man5/Makefile") CONFIG_FILES="$CONFIG_FILES man/man5/Makefile" ;;
+    "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+    "cmd/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/Makefile" ;;
+    "module/Makefile") CONFIG_FILES="$CONFIG_FILES module/Makefile" ;;
+    "module/spl/Makefile") CONFIG_FILES="$CONFIG_FILES module/spl/Makefile" ;;
+    "module/splat/Makefile") CONFIG_FILES="$CONFIG_FILES module/splat/Makefile" ;;
+    "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+    "include/fs/Makefile") CONFIG_FILES="$CONFIG_FILES include/fs/Makefile" ;;
+    "include/linux/Makefile") CONFIG_FILES="$CONFIG_FILES include/linux/Makefile" ;;
+    "include/rpc/Makefile") CONFIG_FILES="$CONFIG_FILES include/rpc/Makefile" ;;
+    "include/sharefs/Makefile") CONFIG_FILES="$CONFIG_FILES include/sharefs/Makefile" ;;
+    "include/sys/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/Makefile" ;;
+    "include/sys/fm/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/fm/Makefile" ;;
+    "include/sys/fs/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/fs/Makefile" ;;
+    "include/sys/sysevent/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/sysevent/Makefile" ;;
+    "include/util/Makefile") CONFIG_FILES="$CONFIG_FILES include/util/Makefile" ;;
+    "include/vm/Makefile") CONFIG_FILES="$CONFIG_FILES include/vm/Makefile" ;;
+    "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
+    "rpm/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/Makefile" ;;
+    "rpm/redhat/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/redhat/Makefile" ;;
+    "rpm/redhat/spl.spec") CONFIG_FILES="$CONFIG_FILES rpm/redhat/spl.spec" ;;
+    "rpm/redhat/spl-kmod.spec") CONFIG_FILES="$CONFIG_FILES rpm/redhat/spl-kmod.spec" ;;
+    "rpm/redhat/spl-dkms.spec") CONFIG_FILES="$CONFIG_FILES rpm/redhat/spl-dkms.spec" ;;
+    "rpm/generic/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/generic/Makefile" ;;
+    "rpm/generic/spl.spec") CONFIG_FILES="$CONFIG_FILES rpm/generic/spl.spec" ;;
+    "rpm/generic/spl-kmod.spec") CONFIG_FILES="$CONFIG_FILES rpm/generic/spl-kmod.spec" ;;
+    "rpm/generic/spl-dkms.spec") CONFIG_FILES="$CONFIG_FILES rpm/generic/spl-dkms.spec" ;;
+    "spl.release") CONFIG_FILES="$CONFIG_FILES spl.release" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "spl_config.h":H)
+       (mv spl_config.h spl_config.h.tmp &&
+       awk -f ${ac_srcdir}/config/config.awk spl_config.h.tmp >spl_config.h &&
+       rm spl_config.h.tmp) || exit 1 ;;
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# 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, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+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
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  if test x"$xsi_shell" = xyes; then
+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\    # positional parameters, so assign one to ordinary parameter first.\
+\    func_stripname_result=${3}\
+\    func_stripname_result=${func_stripname_result#"${1}"}\
+\    func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\    func_split_long_opt_name=${1%%=*}\
+\    func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\    func_split_short_opt_arg=${1#??}\
+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\    case ${1} in\
+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\      *)    func_lo2o_result=${1} ;;\
+\    esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+    func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+    func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+    func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+    eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\    func_quote_for_eval "${2}"\
+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
index cd98b7a862fa20dd4f077081f53670d3c68b1ae1..aa4307386688e9c2971abaf7ee345e731d6c6d81 100755 (executable)
@@ -56,6 +56,8 @@ adjust_obj_paths()
 for MODULE in "${MODULES[@]}"
 do
        adjust_obj_paths "$KERNEL_DIR/spl/$MODULE/Makefile"
+       sed -i.bak '/obj =/d' "$KERNEL_DIR/spl/$MODULE/Makefile"
+       sed -i.bak '/src =/d' "$KERNEL_DIR/spl/$MODULE/Makefile"
 done
 
 cat > "$KERNEL_DIR/spl/Kconfig" <<"EOF"
@@ -112,8 +114,9 @@ add_after()
 }
 
 add_after "$KERNEL_DIR/Kconfig" 'source "arch/$SRCARCH/Kconfig"' 'source "spl/Kconfig"'
-# We must take care to build SPL before ZFS, else module initialization order will be wrong
-sed -i 's#kernel/ mm/ fs/#kernel/ mm/ spl/ fs/#' "$KERNEL_DIR/Makefile"
+# We must take care to build SPL before ZFS, otherwise the symbols required
+# to link ZFS will not be available.
+sed -i 's#+= kernel/#+= kernel/ spl/#' "$KERNEL_DIR/Makefile"
 
 echo >&2
 echo "    $0: done." >&2
diff --git a/spl/cp b/spl/cp
new file mode 100755 (executable)
index 0000000..46ff2c9
--- /dev/null
+++ b/spl/cp
@@ -0,0 +1,2 @@
+#!/bin/sh
+cp "$@"
diff --git a/spl/dkms.conf b/spl/dkms.conf
new file mode 100644 (file)
index 0000000..7825923
--- /dev/null
@@ -0,0 +1,35 @@
+AUTOINSTALL="yes"
+PACKAGE_NAME="spl"
+PACKAGE_VERSION="0.6.5.4"
+PRE_BUILD="configure
+  --prefix=/usr
+  --with-config=kernel
+  --with-linux=$(case `lsb_release -is` in
+                   (Debian)
+                     if [ -e ${kernel_source_dir/%build/source} ]
+                     then
+                       echo ${kernel_source_dir/%build/source}
+                     else
+                       # This is a kpkg exception for Proxmox 2.0
+                      echo ${kernel_source_dir}
+                     fi
+                     ;;
+                   (*)
+                     echo ${kernel_source_dir}
+                     ;;
+                 esac)
+  --with-linux-obj=${kernel_source_dir}
+"
+POST_INSTALL="cp
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/spl_config.h
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/module/Module.symvers
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/${kernelver}/${arch}/
+"
+REMAKE_INITRD="no"
+MAKE[0]="make"
+BUILT_MODULE_NAME[0]="spl"
+BUILT_MODULE_LOCATION[0]="module/spl/"
+DEST_MODULE_LOCATION[0]="/extra/spl/spl"
+BUILT_MODULE_NAME[1]="splat"
+BUILT_MODULE_LOCATION[1]="module/splat/"
+DEST_MODULE_LOCATION[1]="/extra/splat/splat"
diff --git a/spl/include/Makefile.in b/spl/include/Makefile.in
new file mode 100644 (file)
index 0000000..83050a4
--- /dev/null
@@ -0,0 +1,742 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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__kernel_HEADERS_DIST = $(top_srcdir)/include/splat-ctl.h \
+       $(top_srcdir)/include/spl-ctl.h \
+       $(top_srcdir)/include/strings.h $(top_srcdir)/include/unistd.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = fs linux rpc sharefs sys util vm
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/splat-ctl.h \
+       $(top_srcdir)/include/spl-ctl.h \
+       $(top_srcdir)/include/strings.h \
+       $(top_srcdir)/include/unistd.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-kernelHEADERS install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/fs/Makefile.in b/spl/include/fs/Makefile.in
new file mode 100644 (file)
index 0000000..da6b889
--- /dev/null
@@ -0,0 +1,620 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/fs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/fs/fs_subr.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/fs/fs_subr.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/fs
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/fs/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/fs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/linux/Makefile.in b/spl/include/linux/Makefile.in
new file mode 100644 (file)
index 0000000..5735014
--- /dev/null
@@ -0,0 +1,640 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/linux
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/linux/bitops_compat.h \
+       $(top_srcdir)/include/linux/compiler_compat.h \
+       $(top_srcdir)/include/linux/delay_compat.h \
+       $(top_srcdir)/include/linux/file_compat.h \
+       $(top_srcdir)/include/linux/list_compat.h \
+       $(top_srcdir)/include/linux/math64_compat.h \
+       $(top_srcdir)/include/linux/mm_compat.h \
+       $(top_srcdir)/include/linux/proc_compat.h \
+       $(top_srcdir)/include/linux/rwsem_compat.h \
+       $(top_srcdir)/include/linux/wait_compat.h \
+       $(top_srcdir)/include/linux/zlib_compat.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/linux/bitops_compat.h \
+       $(top_srcdir)/include/linux/compiler_compat.h \
+       $(top_srcdir)/include/linux/delay_compat.h \
+       $(top_srcdir)/include/linux/file_compat.h \
+       $(top_srcdir)/include/linux/list_compat.h \
+       $(top_srcdir)/include/linux/math64_compat.h \
+       $(top_srcdir)/include/linux/mm_compat.h \
+       $(top_srcdir)/include/linux/proc_compat.h \
+       $(top_srcdir)/include/linux/rwsem_compat.h \
+       $(top_srcdir)/include/linux/wait_compat.h \
+       $(top_srcdir)/include/linux/zlib_compat.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/linux
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/linux/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/linux/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/rpc/Makefile.in b/spl/include/rpc/Makefile.in
new file mode 100644 (file)
index 0000000..2bdc296
--- /dev/null
@@ -0,0 +1,622 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/rpc
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/rpc/types.h \
+       $(top_srcdir)/include/rpc/xdr.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/rpc/types.h \
+       $(top_srcdir)/include/rpc/xdr.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/rpc
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/rpc/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/rpc/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/sharefs/Makefile.in b/spl/include/sharefs/Makefile.in
new file mode 100644 (file)
index 0000000..b677378
--- /dev/null
@@ -0,0 +1,620 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sharefs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/sharefs/share.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/sharefs/share.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/sharefs
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sharefs/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sharefs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/sys/Makefile.in b/spl/include/sys/Makefile.in
new file mode 100644 (file)
index 0000000..bd9037d
--- /dev/null
@@ -0,0 +1,931 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/acl.h \
+       $(top_srcdir)/include/sys/acl_impl.h \
+       $(top_srcdir)/include/sys/atomic.h \
+       $(top_srcdir)/include/sys/attr.h \
+       $(top_srcdir)/include/sys/bitmap.h \
+       $(top_srcdir)/include/sys/bootconf.h \
+       $(top_srcdir)/include/sys/bootprops.h \
+       $(top_srcdir)/include/sys/buf.h \
+       $(top_srcdir)/include/sys/byteorder.h \
+       $(top_srcdir)/include/sys/callb.h \
+       $(top_srcdir)/include/sys/callo.h \
+       $(top_srcdir)/include/sys/cmn_err.h \
+       $(top_srcdir)/include/sys/compress.h \
+       $(top_srcdir)/include/sys/condvar.h \
+       $(top_srcdir)/include/sys/conf.h \
+       $(top_srcdir)/include/sys/console.h \
+       $(top_srcdir)/include/sys/cpupart.h \
+       $(top_srcdir)/include/sys/cpuvar.h \
+       $(top_srcdir)/include/sys/crc32.h \
+       $(top_srcdir)/include/sys/cred.h \
+       $(top_srcdir)/include/sys/ctype.h \
+       $(top_srcdir)/include/sys/ddi.h \
+       $(top_srcdir)/include/sys/debug.h \
+       $(top_srcdir)/include/sys/dirent.h \
+       $(top_srcdir)/include/sys/disp.h \
+       $(top_srcdir)/include/sys/dkio.h \
+       $(top_srcdir)/include/sys/dklabel.h \
+       $(top_srcdir)/include/sys/dnlc.h \
+       $(top_srcdir)/include/sys/dumphdr.h \
+       $(top_srcdir)/include/sys/efi_partition.h \
+       $(top_srcdir)/include/sys/errno.h \
+       $(top_srcdir)/include/sys/extdirent.h \
+       $(top_srcdir)/include/sys/fcntl.h \
+       $(top_srcdir)/include/sys/file.h \
+       $(top_srcdir)/include/sys/idmap.h \
+       $(top_srcdir)/include/sys/int_limits.h \
+       $(top_srcdir)/include/sys/int_types.h \
+       $(top_srcdir)/include/sys/inttypes.h \
+       $(top_srcdir)/include/sys/isa_defs.h \
+       $(top_srcdir)/include/sys/kidmap.h \
+       $(top_srcdir)/include/sys/kmem.h \
+       $(top_srcdir)/include/sys/kmem_cache.h \
+       $(top_srcdir)/include/sys/kobj.h \
+       $(top_srcdir)/include/sys/kstat.h \
+       $(top_srcdir)/include/sys/list.h \
+       $(top_srcdir)/include/sys/mkdev.h \
+       $(top_srcdir)/include/sys/mntent.h \
+       $(top_srcdir)/include/sys/modctl.h \
+       $(top_srcdir)/include/sys/mode.h \
+       $(top_srcdir)/include/sys/mount.h \
+       $(top_srcdir)/include/sys/mutex.h \
+       $(top_srcdir)/include/sys/note.h \
+       $(top_srcdir)/include/sys/open.h \
+       $(top_srcdir)/include/sys/param.h \
+       $(top_srcdir)/include/sys/pathname.h \
+       $(top_srcdir)/include/sys/policy.h \
+       $(top_srcdir)/include/sys/pool.h \
+       $(top_srcdir)/include/sys/priv_impl.h \
+       $(top_srcdir)/include/sys/processor.h \
+       $(top_srcdir)/include/sys/proc.h \
+       $(top_srcdir)/include/sys/pset.h \
+       $(top_srcdir)/include/sys/random.h \
+       $(top_srcdir)/include/sys/refstr.h \
+       $(top_srcdir)/include/sys/resource.h \
+       $(top_srcdir)/include/sys/rwlock.h \
+       $(top_srcdir)/include/sys/sdt.h \
+       $(top_srcdir)/include/sys/sid.h \
+       $(top_srcdir)/include/sys/signal.h \
+       $(top_srcdir)/include/sys/stat.h \
+       $(top_srcdir)/include/sys/stropts.h \
+       $(top_srcdir)/include/sys/sunddi.h \
+       $(top_srcdir)/include/sys/sunldi.h \
+       $(top_srcdir)/include/sys/sysdc.h \
+       $(top_srcdir)/include/sys/sysevent.h \
+       $(top_srcdir)/include/sys/sysmacros.h \
+       $(top_srcdir)/include/sys/systeminfo.h \
+       $(top_srcdir)/include/sys/systm.h \
+       $(top_srcdir)/include/sys/taskq.h \
+       $(top_srcdir)/include/sys/thread.h \
+       $(top_srcdir)/include/sys/time.h \
+       $(top_srcdir)/include/sys/timer.h \
+       $(top_srcdir)/include/sys/t_lock.h \
+       $(top_srcdir)/include/sys/tsd.h \
+       $(top_srcdir)/include/sys/types32.h \
+       $(top_srcdir)/include/sys/types.h \
+       $(top_srcdir)/include/sys/u8_textprep.h \
+       $(top_srcdir)/include/sys/uio.h \
+       $(top_srcdir)/include/sys/unistd.h \
+       $(top_srcdir)/include/sys/user.h \
+       $(top_srcdir)/include/sys/va_list.h \
+       $(top_srcdir)/include/sys/varargs.h \
+       $(top_srcdir)/include/sys/vfs.h \
+       $(top_srcdir)/include/sys/vfs_opreg.h \
+       $(top_srcdir)/include/sys/vmem.h \
+       $(top_srcdir)/include/sys/vmsystm.h \
+       $(top_srcdir)/include/sys/vnode.h \
+       $(top_srcdir)/include/sys/zmod.h \
+       $(top_srcdir)/include/sys/zone.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = fm fs sysevent
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/sys/acl.h \
+       $(top_srcdir)/include/sys/acl_impl.h \
+       $(top_srcdir)/include/sys/atomic.h \
+       $(top_srcdir)/include/sys/attr.h \
+       $(top_srcdir)/include/sys/bitmap.h \
+       $(top_srcdir)/include/sys/bootconf.h \
+       $(top_srcdir)/include/sys/bootprops.h \
+       $(top_srcdir)/include/sys/buf.h \
+       $(top_srcdir)/include/sys/byteorder.h \
+       $(top_srcdir)/include/sys/callb.h \
+       $(top_srcdir)/include/sys/callo.h \
+       $(top_srcdir)/include/sys/cmn_err.h \
+       $(top_srcdir)/include/sys/compress.h \
+       $(top_srcdir)/include/sys/condvar.h \
+       $(top_srcdir)/include/sys/conf.h \
+       $(top_srcdir)/include/sys/console.h \
+       $(top_srcdir)/include/sys/cpupart.h \
+       $(top_srcdir)/include/sys/cpuvar.h \
+       $(top_srcdir)/include/sys/crc32.h \
+       $(top_srcdir)/include/sys/cred.h \
+       $(top_srcdir)/include/sys/ctype.h \
+       $(top_srcdir)/include/sys/ddi.h \
+       $(top_srcdir)/include/sys/debug.h \
+       $(top_srcdir)/include/sys/dirent.h \
+       $(top_srcdir)/include/sys/disp.h \
+       $(top_srcdir)/include/sys/dkio.h \
+       $(top_srcdir)/include/sys/dklabel.h \
+       $(top_srcdir)/include/sys/dnlc.h \
+       $(top_srcdir)/include/sys/dumphdr.h \
+       $(top_srcdir)/include/sys/efi_partition.h \
+       $(top_srcdir)/include/sys/errno.h \
+       $(top_srcdir)/include/sys/extdirent.h \
+       $(top_srcdir)/include/sys/fcntl.h \
+       $(top_srcdir)/include/sys/file.h \
+       $(top_srcdir)/include/sys/idmap.h \
+       $(top_srcdir)/include/sys/int_limits.h \
+       $(top_srcdir)/include/sys/int_types.h \
+       $(top_srcdir)/include/sys/inttypes.h \
+       $(top_srcdir)/include/sys/isa_defs.h \
+       $(top_srcdir)/include/sys/kidmap.h \
+       $(top_srcdir)/include/sys/kmem.h \
+       $(top_srcdir)/include/sys/kmem_cache.h \
+       $(top_srcdir)/include/sys/kobj.h \
+       $(top_srcdir)/include/sys/kstat.h \
+       $(top_srcdir)/include/sys/list.h \
+       $(top_srcdir)/include/sys/mkdev.h \
+       $(top_srcdir)/include/sys/mntent.h \
+       $(top_srcdir)/include/sys/modctl.h \
+       $(top_srcdir)/include/sys/mode.h \
+       $(top_srcdir)/include/sys/mount.h \
+       $(top_srcdir)/include/sys/mutex.h \
+       $(top_srcdir)/include/sys/note.h \
+       $(top_srcdir)/include/sys/open.h \
+       $(top_srcdir)/include/sys/param.h \
+       $(top_srcdir)/include/sys/pathname.h \
+       $(top_srcdir)/include/sys/policy.h \
+       $(top_srcdir)/include/sys/pool.h \
+       $(top_srcdir)/include/sys/priv_impl.h \
+       $(top_srcdir)/include/sys/processor.h \
+       $(top_srcdir)/include/sys/proc.h \
+       $(top_srcdir)/include/sys/pset.h \
+       $(top_srcdir)/include/sys/random.h \
+       $(top_srcdir)/include/sys/refstr.h \
+       $(top_srcdir)/include/sys/resource.h \
+       $(top_srcdir)/include/sys/rwlock.h \
+       $(top_srcdir)/include/sys/sdt.h \
+       $(top_srcdir)/include/sys/sid.h \
+       $(top_srcdir)/include/sys/signal.h \
+       $(top_srcdir)/include/sys/stat.h \
+       $(top_srcdir)/include/sys/stropts.h \
+       $(top_srcdir)/include/sys/sunddi.h \
+       $(top_srcdir)/include/sys/sunldi.h \
+       $(top_srcdir)/include/sys/sysdc.h \
+       $(top_srcdir)/include/sys/sysevent.h \
+       $(top_srcdir)/include/sys/sysmacros.h \
+       $(top_srcdir)/include/sys/systeminfo.h \
+       $(top_srcdir)/include/sys/systm.h \
+       $(top_srcdir)/include/sys/taskq.h \
+       $(top_srcdir)/include/sys/thread.h \
+       $(top_srcdir)/include/sys/time.h \
+       $(top_srcdir)/include/sys/timer.h \
+       $(top_srcdir)/include/sys/t_lock.h \
+       $(top_srcdir)/include/sys/tsd.h \
+       $(top_srcdir)/include/sys/types32.h \
+       $(top_srcdir)/include/sys/types.h \
+       $(top_srcdir)/include/sys/u8_textprep.h \
+       $(top_srcdir)/include/sys/uio.h \
+       $(top_srcdir)/include/sys/unistd.h \
+       $(top_srcdir)/include/sys/user.h \
+       $(top_srcdir)/include/sys/va_list.h \
+       $(top_srcdir)/include/sys/varargs.h \
+       $(top_srcdir)/include/sys/vfs.h \
+       $(top_srcdir)/include/sys/vfs_opreg.h \
+       $(top_srcdir)/include/sys/vmem.h \
+       $(top_srcdir)/include/sys/vmsystm.h \
+       $(top_srcdir)/include/sys/vnode.h \
+       $(top_srcdir)/include/sys/zmod.h \
+       $(top_srcdir)/include/sys/zone.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/sys
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-kernelHEADERS install-man install-pdf install-pdf-am \
+       install-ps install-ps-am install-strip installcheck \
+       installcheck-am installdirs installdirs-am maintainer-clean \
+       maintainer-clean-generic mostlyclean mostlyclean-generic \
+       mostlyclean-libtool pdf pdf-am ps ps-am tags tags-am uninstall \
+       uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/sys/fm/Makefile.in b/spl/include/sys/fm/Makefile.in
new file mode 100644 (file)
index 0000000..6ab6312
--- /dev/null
@@ -0,0 +1,622 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys/fm
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/fm/protocol.h \
+       $(top_srcdir)/include/sys/fm/util.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/sys/fm/protocol.h \
+       $(top_srcdir)/include/sys/fm/util.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/fm
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/fm/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/fm/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/sys/fs/Makefile.in b/spl/include/sys/fs/Makefile.in
new file mode 100644 (file)
index 0000000..03ef945
--- /dev/null
@@ -0,0 +1,620 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys/fs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/fs/swapnode.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/sys/fs/swapnode.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/fs
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/fs/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/fs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index aa5ae43c2683224e2bd912cbd5a449038e42a07f..7e15b93211444e99a4fcee54592cbb17394716ef 100644 (file)
@@ -60,7 +60,7 @@
 #endif
 
 /* powerpc (ppc64) arch specific defines */
-#elif defined(__powerpc) || defined(__powerpc__)
+#elif defined(__powerpc) || defined(__powerpc__) || defined(__powerpc64__)
 
 #if !defined(__powerpc)
 #define __powerpc
 #define __powerpc__
 #endif
 
+#if defined(__powerpc64__)
 #if !defined(_LP64)
 #define _LP64
 #endif
+#else
+#if !defined(_ILP32)
+#define _ILP32
+#endif
+#endif
 
 /* arm arch specific defines */
 #elif defined(__arm) || defined(__arm__) || defined(__aarch64__)
 #define __arm__
 #endif
 
+#if defined(__aarch64__)
+#if !defined(_LP64)
+#define _LP64
+#endif
+#else
+#if !defined(_ILP32)
+#define _ILP32
+#endif
+#endif
+
 #if defined(__ARMEL__) || defined(__AARCH64EL__)
 #define _LITTLE_ENDIAN
 #else
 #define __sparc__
 #endif
 
-#define _BIG_ENDIAN
-#define _SUNOS_VTOC_16
-
-/* sparc64 arch specific defines */
-#elif defined(__sparc64) || defined(__sparc64__)
-
-#if !defined(__sparc64)
-#define __sparc64
+#if defined(__arch64__)
+#if !defined(_LP64)
+#define _LP64
+#endif
+#else
+#if !defined(_ILP32)
+#define _ILP32
 #endif
-
-#if !defined(__sparc64__)
-#define __sparc64__
 #endif
 
 #define _BIG_ENDIAN
 #error "Both _ILP32 and _LP64 are defined"
 #endif
 
+#if !defined(_ILP32) && !defined(_LP64)
+#error "Neither _ILP32 or _LP64 are defined"
+#endif
+
 #include <sys/byteorder.h>
 
 #if defined(__LITTLE_ENDIAN) && !defined(_LITTLE_ENDIAN)
index 6f7d611b6e985f7741c7043eefbee587ca03dabb..7064e8f1f2018a162ceae6097bf7b80a49948fdd 100644 (file)
 #include <linux/rwsem_compat.h>
 
 typedef enum {
-       RW_DRIVER       = 2,
-       RW_DEFAULT      = 4
+        RW_DRIVER  = 2,
+        RW_DEFAULT = 4
 } krw_type_t;
 
 typedef enum {
-       RW_NONE         = 0,
-       RW_WRITER       = 1,
-       RW_READER       = 2
+        RW_NONE   = 0,
+        RW_WRITER = 1,
+        RW_READER = 2
 } krw_t;
 
-/*
- * If CONFIG_RWSEM_SPIN_ON_OWNER is defined, rw_semaphore will have an owner
- * field, so we don't need our own.
- */
 typedef struct {
-       struct rw_semaphore rw_rwlock;
-#ifndef CONFIG_RWSEM_SPIN_ON_OWNER
-       kthread_t *rw_owner;
-#endif
+        struct rw_semaphore rw_rwlock;
+        kthread_t *rw_owner;
 } krwlock_t;
 
-#define SEM(rwp)       (&(rwp)->rw_rwlock)
+#define SEM(rwp)                        ((struct rw_semaphore *)(rwp))
 
 static inline void
 spl_rw_set_owner(krwlock_t *rwp)
 {
-/*
- * If CONFIG_RWSEM_SPIN_ON_OWNER is defined, down_write, up_write,
- * downgrade_write and __init_rwsem will set/clear owner for us.
- */
-#ifndef CONFIG_RWSEM_SPIN_ON_OWNER
-       rwp->rw_owner = current;
-#endif
+        unsigned long flags;
+
+        spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, flags);
+        rwp->rw_owner = current;
+        spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, flags);
 }
 
 static inline void
 spl_rw_clear_owner(krwlock_t *rwp)
 {
-#ifndef CONFIG_RWSEM_SPIN_ON_OWNER
-       rwp->rw_owner = NULL;
-#endif
+        unsigned long flags;
+
+        spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, flags);
+        rwp->rw_owner = NULL;
+        spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, flags);
 }
 
 static inline kthread_t *
 rw_owner(krwlock_t *rwp)
 {
-#ifdef CONFIG_RWSEM_SPIN_ON_OWNER
-       return SEM(rwp)->owner;
-#else
-       return rwp->rw_owner;
-#endif
+        unsigned long flags;
+        kthread_t *owner;
+
+        spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, flags);
+        owner = rwp->rw_owner;
+        spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, flags);
+
+        return owner;
 }
 
 static inline int
@@ -92,7 +89,7 @@ RW_READ_HELD(krwlock_t *rwp)
 static inline int
 RW_WRITE_HELD(krwlock_t *rwp)
 {
-       return (rw_owner(rwp) == current);
+       return (spl_rwsem_is_locked(SEM(rwp)) && rw_owner(rwp) == current);
 }
 
 static inline int
@@ -107,73 +104,70 @@ RW_LOCK_HELD(krwlock_t *rwp)
  * will be correctly located in the users code which is important
  * for the built in kernel lock analysis tools
  */
-#define rw_init(rwp, name, type, arg)                                  \
-({                                                                     \
-       static struct lock_class_key __key;                             \
-                                                                       \
-       __init_rwsem(SEM(rwp), #rwp, &__key);                           \
-       spl_rw_clear_owner(rwp);                                        \
+#define rw_init(rwp, name, type, arg)                                   \
+({                                                                      \
+        static struct lock_class_key __key;                             \
+                                                                        \
+        __init_rwsem(SEM(rwp), #rwp, &__key);                           \
+        spl_rw_clear_owner(rwp);                                        \
 })
 
-#define rw_destroy(rwp)                                                        \
-({                                                                     \
-       VERIFY(!RW_LOCK_HELD(rwp));                                     \
+#define rw_destroy(rwp)                                                 \
+({                                                                      \
+        VERIFY(!RW_LOCK_HELD(rwp));                                     \
 })
 
-#define rw_tryenter(rwp, rw)                                           \
-({                                                                     \
-       int _rc_ = 0;                                                   \
-                                                                       \
-       switch (rw) {                                                   \
-       case RW_READER:                                                 \
-               _rc_ = down_read_trylock(SEM(rwp));                     \
-               break;                                                  \
-       case RW_WRITER:                                                 \
-               if ((_rc_ = down_write_trylock(SEM(rwp))))              \
-                       spl_rw_set_owner(rwp);                          \
-               break;                                                  \
-       default:                                                        \
-               VERIFY(0);                                              \
-       }                                                               \
-       _rc_;                                                           \
+#define rw_tryenter(rwp, rw)                                            \
+({                                                                      \
+        int _rc_ = 0;                                                   \
+                                                                        \
+        switch (rw) {                                                   \
+        case RW_READER:                                                 \
+                _rc_ = down_read_trylock(SEM(rwp));                     \
+                break;                                                  \
+        case RW_WRITER:                                                 \
+                if ((_rc_ = down_write_trylock(SEM(rwp))))              \
+                        spl_rw_set_owner(rwp);                          \
+                break;                                                  \
+        default:                                                        \
+                VERIFY(0);                                              \
+        }                                                               \
+        _rc_;                                                           \
 })
 
-#define rw_enter(rwp, rw)                                              \
-({                                                                     \
-       switch (rw) {                                                   \
-       case RW_READER:                                                 \
-               down_read(SEM(rwp));                                    \
-               break;                                                  \
-       case RW_WRITER:                                                 \
-               down_write(SEM(rwp));                                   \
-               spl_rw_set_owner(rwp);                                  \
-               break;                                                  \
-       default:                                                        \
-               VERIFY(0);                                              \
-       }                                                               \
+#define rw_enter(rwp, rw)                                               \
+({                                                                      \
+        switch (rw) {                                                   \
+        case RW_READER:                                                 \
+                down_read(SEM(rwp));                                    \
+                break;                                                  \
+        case RW_WRITER:                                                 \
+                down_write(SEM(rwp));                                   \
+                spl_rw_set_owner(rwp);                                  \
+                break;                                                  \
+        default:                                                        \
+                VERIFY(0);                                              \
+        }                                                               \
 })
 
-#define rw_exit(rwp)                                                   \
-({                                                                     \
-       if (RW_WRITE_HELD(rwp)) {                                       \
-               spl_rw_clear_owner(rwp);                                \
-               up_write(SEM(rwp));                                     \
-       } else {                                                        \
-               ASSERT(RW_READ_HELD(rwp));                              \
-               up_read(SEM(rwp));                                      \
-       }                                                               \
+#define rw_exit(rwp)                                                    \
+({                                                                      \
+        if (RW_WRITE_HELD(rwp)) {                                       \
+                spl_rw_clear_owner(rwp);                                \
+                up_write(SEM(rwp));                                     \
+        } else {                                                        \
+                ASSERT(RW_READ_HELD(rwp));                              \
+                up_read(SEM(rwp));                                      \
+        }                                                               \
 })
 
-#define rw_downgrade(rwp)                                              \
-({                                                                     \
-       spl_rw_clear_owner(rwp);                                        \
-       downgrade_write(SEM(rwp));                                      \
+#define rw_downgrade(rwp)                                               \
+({                                                                      \
+        spl_rw_clear_owner(rwp);                                        \
+        downgrade_write(SEM(rwp));                                      \
 })
 
 #if defined(CONFIG_RWSEM_GENERIC_SPINLOCK)
-#ifdef CONFIG_RWSEM_SPIN_ON_OWNER
-#error spinlock rwsem should not have spin on owner
-#endif
 /*
  * For the generic implementations of rw-semaphores the following is
  * true.  If your semaphore implementation internally represents the
@@ -186,20 +180,20 @@ RW_LOCK_HELD(krwlock_t *rwp)
 extern void __up_read_locked(struct rw_semaphore *);
 extern int __down_write_trylock_locked(struct rw_semaphore *);
 
-#define rw_tryupgrade(rwp)                                             \
-({                                                                     \
-       unsigned long _flags_;                                          \
-       int _rc_ = 0;                                                   \
-                                                                       \
-       spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, _flags_);          \
-       if ((list_empty(&SEM(rwp)->wait_list)) &&                       \
-           (SEM(rwp)->activity == 1)) {                                \
-               __up_read_locked(SEM(rwp));                             \
-               VERIFY(_rc_ = __down_write_trylock_locked(SEM(rwp)));   \
-               (rwp)->rw_owner = current;                              \
-       }                                                               \
-       spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, _flags_);     \
-       _rc_;                                                           \
+#define rw_tryupgrade(rwp)                                              \
+({                                                                      \
+        unsigned long _flags_;                                          \
+        int _rc_ = 0;                                                   \
+                                                                        \
+        spl_rwsem_lock_irqsave(&SEM(rwp)->wait_lock, _flags_);           \
+        if ((list_empty(&SEM(rwp)->wait_list)) &&                       \
+            (SEM(rwp)->activity == 1)) {                                \
+                __up_read_locked(SEM(rwp));                             \
+                VERIFY(_rc_ = __down_write_trylock_locked(SEM(rwp)));   \
+                (rwp)->rw_owner = current;                              \
+        }                                                               \
+        spl_rwsem_unlock_irqrestore(&SEM(rwp)->wait_lock, _flags_);      \
+        _rc_;                                                           \
 })
 #else
 /*
@@ -209,7 +203,7 @@ extern int __down_write_trylock_locked(struct rw_semaphore *);
  * rwsem would be safe.  For now that's not worth the trouble so in this
  * case rw_tryupgrade() has just been disabled.
  */
-#define rw_tryupgrade(rwp)     ({ 0; })
+#define rw_tryupgrade(rwp)      ({ 0; })
 #endif
 
 int spl_rw_init(void);
diff --git a/spl/include/sys/sysevent/Makefile.in b/spl/include/sys/sysevent/Makefile.in
new file mode 100644 (file)
index 0000000..6c32550
--- /dev/null
@@ -0,0 +1,621 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys/sysevent
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST =  \
+       $(top_srcdir)/include/sys/sysevent/eventdefs.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/sys/sysevent/eventdefs.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/sys/sysevent
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/sysevent/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/sysevent/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index 76ce5f03c769dfd51b462875783a270b5dffe258..650166145b1accc1699a6d333cd836ef68edf956 100644 (file)
@@ -46,7 +46,7 @@
 #define        MSEC2NSEC(m)    ((hrtime_t)(m) * (NANOSEC / MILLISEC))
 #define        NSEC2MSEC(n)    ((n) / (NANOSEC / MILLISEC))
 
-#define        hz                              HZ
+static const int hz = HZ;
 
 #define        TIMESPEC_OVERFLOW(ts)           \
        ((ts)->tv_sec < TIME_MIN || (ts)->tv_sec > TIME_MAX)
index eb482805206190de4fb2c041c92720c82e10479e..a9b12eeb9619aa2ba47d0528ad4a7188d52154aa 100644 (file)
@@ -36,7 +36,6 @@ extern vmem_t *zio_alloc_arena;
 extern vmem_t *zio_arena;
 
 extern size_t vmem_size(vmem_t *vmp, int typemask);
-extern void *spl_vmalloc(unsigned long size, gfp_t lflags, pgprot_t prot);
 
 /*
  * Memory allocation interfaces
diff --git a/spl/include/util/Makefile.in b/spl/include/util/Makefile.in
new file mode 100644 (file)
index 0000000..765bfb0
--- /dev/null
@@ -0,0 +1,622 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/util
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/util/qsort.h \
+       $(top_srcdir)/include/util/sscanf.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/util/qsort.h \
+       $(top_srcdir)/include/util/sscanf.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/util
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/util/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/util/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/include/vm/Makefile.in b/spl/include/vm/Makefile.in
new file mode 100644 (file)
index 0000000..fdb3314
--- /dev/null
@@ -0,0 +1,624 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/vm
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/vm/anon.h \
+       $(top_srcdir)/include/vm/pvn.h \
+       $(top_srcdir)/include/vm/seg_kmem.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)"
+HEADERS = $(kernel_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/vm/anon.h \
+       $(top_srcdir)/include/vm/pvn.h \
+       $(top_srcdir)/include/vm/seg_kmem.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/spl-$(VERSION)/include/vm
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/vm/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/vm/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS 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 tags-am uninstall uninstall-am uninstall-kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/lib/Makefile.in b/spl/lib/Makefile.in
new file mode 100644 (file)
index 0000000..26d813e
--- /dev/null
@@ -0,0 +1,654 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+###############################################################################
+# Copyright (C) 2007-2010 Lawrence Livermore National Security, LLC.
+# Copyright (C) 2007 The Regents of the University of California.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Common rules for user space components.
+###############################################################################
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = lib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+LTLIBRARIES = $(noinst_LTLIBRARIES)
+libcommon_la_LIBADD =
+am_libcommon_la_OBJECTS = list.lo
+libcommon_la_OBJECTS = $(am_libcommon_la_OBJECTS)
+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 = 
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+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_@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_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo "  CCLD    " $@;
+am__v_CCLD_1 = 
+SOURCES = $(libcommon_la_SOURCES)
+DIST_SOURCES = $(libcommon_la_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
+am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/config/Rules.am \
+       $(top_srcdir)/config/depcomp
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+DEFAULT_INCLUDES = -include ${top_builddir}/spl_config.h
+AM_LIBTOOLFLAGS = --silent
+AM_CPPFLAGS = -D__USE_LARGEFILE64
+AM_CFLAGS = -Wall -Wshadow -Wstrict-prototypes -fno-strict-aliasing \
+       ${DEBUG_CFLAGS}
+noinst_LTLIBRARIES = libcommon.la
+libcommon_la_SOURCES = list.c
+EXTRA_DIST = list.h
+all: all-am
+
+.SUFFIXES:
+.SUFFIXES: .c .lo .o .obj
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/config/Rules.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu lib/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu lib/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+$(top_srcdir)/config/Rules.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+clean-noinstLTLIBRARIES:
+       -test -z "$(noinst_LTLIBRARIES)" || rm -f $(noinst_LTLIBRARIES)
+       @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}; \
+       }
+
+libcommon.la: $(libcommon_la_OBJECTS) $(libcommon_la_DEPENDENCIES) $(EXTRA_libcommon_la_DEPENDENCIES) 
+       $(AM_V_CCLD)$(LINK)  $(libcommon_la_OBJECTS) $(libcommon_la_LIBADD) $(LIBS)
+
+mostlyclean-compile:
+       -rm -f *.$(OBJEXT)
+
+distclean-compile:
+       -rm -f *.tab.c
+
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/list.Plo@am__quote@
+
+.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
+@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@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
+
+.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
+@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@  $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(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
+@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@  $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(LTLIBRARIES)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool clean-noinstLTLIBRARIES \
+       mostlyclean-am
+
+distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+distclean-am: clean-am distclean-compile distclean-generic \
+       distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \
+       mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       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-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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/man/Makefile.in b/spl/man/Makefile.in
new file mode 100644 (file)
index 0000000..9bca3d4
--- /dev/null
@@ -0,0 +1,672 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = man
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = man1 man5
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu man/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/man/man1/Makefile.in b/spl/man/man1/Makefile.in
new file mode 100644 (file)
index 0000000..e7cfa31
--- /dev/null
@@ -0,0 +1,575 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = man/man1
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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 = $(dist_man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+dist_man_MANS = splat.1
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/man1/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu man/man1/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man1: $(dist_man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(dist_man_MANS)'; \
+       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"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man1dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man1dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man1dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man1dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man1:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man1dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.1[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+       for dir in "$(DESTDIR)$(man1dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man1
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man
+
+uninstall-man: uninstall-man1
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       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-data-local 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
+
+.PRECIOUS: Makefile
+
+
+install-data-local:
+       $(INSTALL) -d -m 0755 "$(DESTDIR)$(mandir)/man1"
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/man/man5/Makefile.in b/spl/man/man5/Makefile.in
new file mode 100644 (file)
index 0000000..255b02c
--- /dev/null
@@ -0,0 +1,575 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = man/man5
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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; }; \
+  }
+man5dir = $(mandir)/man5
+am__installdirs = "$(DESTDIR)$(man5dir)"
+NROFF = nroff
+MANS = $(dist_man_MANS)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(dist_man_MANS) $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+dist_man_MANS = spl-module-parameters.5
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu man/man5/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu man/man5/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-man5: $(dist_man_MANS)
+       @$(NORMAL_INSTALL)
+       @list1=''; \
+       list2='$(dist_man_MANS)'; \
+       test -n "$(man5dir)" \
+         && test -n "`echo $$list1$$list2`" \
+         || exit 0; \
+       echo " $(MKDIR_P) '$(DESTDIR)$(man5dir)'"; \
+       $(MKDIR_P) "$(DESTDIR)$(man5dir)" || 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 '/\.5[a-z]*$$/p'; \
+       fi; \
+       } | while read p; do \
+         if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; echo "$$p"; \
+       done | \
+       sed -e 'n;s,.*/,,;p;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,' | \
+       sed 'N;N;s,\n, ,g' | { \
+       list=; while read file base inst; do \
+         if test "$$base" = "$$inst"; then list="$$list $$file"; else \
+           echo " $(INSTALL_DATA) '$$file' '$(DESTDIR)$(man5dir)/$$inst'"; \
+           $(INSTALL_DATA) "$$file" "$(DESTDIR)$(man5dir)/$$inst" || exit $$?; \
+         fi; \
+       done; \
+       for i in $$list; do echo "$$i"; done | $(am__base_list) | \
+       while read files; do \
+         test -z "$$files" || { \
+           echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(man5dir)'"; \
+           $(INSTALL_DATA) $$files "$(DESTDIR)$(man5dir)" || exit $$?; }; \
+       done; }
+
+uninstall-man5:
+       @$(NORMAL_UNINSTALL)
+       @list=''; test -n "$(man5dir)" || exit 0; \
+       files=`{ for i in $$list; do echo "$$i"; done; \
+       l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
+         sed -n '/\.5[a-z]*$$/p'; \
+       } | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^5][0-9a-z]*$$,5,;x' \
+             -e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
+       dir='$(DESTDIR)$(man5dir)'; $(am__uninstall_files_from_dir)
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(MANS)
+installdirs:
+       for dir in "$(DESTDIR)$(man5dir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-data-local install-man
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man: install-man5
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-man
+
+uninstall-man: uninstall-man5
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       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-data-local install-dvi install-dvi-am install-exec \
+       install-exec-am install-html install-html-am install-info \
+       install-info-am install-man install-man5 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-man5
+
+.PRECIOUS: Makefile
+
+
+install-data-local:
+       $(INSTALL) -d -m 0755 "$(DESTDIR)$(mandir)/man5"
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index 41c10101ed26f6104fcbf8649d2b25d6517c53af..d4e62e152193c28eb3afd65a3249e74cf229b65e 100644 (file)
@@ -26,7 +26,7 @@ modules_install:
                KERNELRELEASE=@LINUX_VERSION@
        @# Remove extraneous build products when packaging
        kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
-       if [ -n $$kmoddir ]; then \
+       if [ -n "$(DESTDIR)" ]; then \
                find $$kmoddir -name 'modules.*' | xargs $(RM); \
        fi
        sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
index 4d9846cf5702e85eaaa261d93b790d9f04209756..f87b7b9d8f64acff1c9b91a79019a726965b18bb 100644 (file)
@@ -416,8 +416,12 @@ hostid_read(void)
 
        file = kobj_open_file(spl_hostid_path);
 
-       if (file == (struct _buf *)-1)
+       if (file == (struct _buf *)-1) {
+               printk(KERN_WARNING
+                      "SPL: The %s file is not found.\n",
+                      spl_hostid_path);
                return -1;
+       }
 
        result = kobj_get_filesize(file, &size);
 
index dea4053b26c9da10ca5848d8a807a0f19c5d6101..323711df4fc97ca1964d9cfe72b5c64c4f6c92e0 100644 (file)
@@ -31,6 +31,7 @@
 #include <linux/swap.h>
 #include <linux/mm_compat.h>
 #include <linux/wait_compat.h>
+#include <linux/prefetch.h>
 
 /*
  * Within the scope of spl-kmem.c file the kmem_cache_* definitions
@@ -87,7 +88,7 @@ MODULE_PARM_DESC(spl_kmem_cache_expire, "By age (0x1) or low memory (0x2)");
 unsigned int spl_kmem_cache_magazine_size = 0;
 module_param(spl_kmem_cache_magazine_size, uint, 0444);
 MODULE_PARM_DESC(spl_kmem_cache_magazine_size,
-       "Default magazine size (2-256), set automatically (0)");
+       "Default magazine size (2-256), set automatically (0)\n");
 
 /*
  * The default behavior is to report the number of objects remaining in the
@@ -200,7 +201,7 @@ kv_alloc(spl_kmem_cache_t *skc, int size, int flags)
                ASSERT(ISP2(size));
                ptr = (void *)__get_free_pages(lflags, get_order(size));
        } else {
-               ptr = spl_vmalloc(size, lflags | __GFP_HIGHMEM, PAGE_KERNEL);
+               ptr = __vmalloc(size, lflags | __GFP_HIGHMEM, PAGE_KERNEL);
        }
 
        /* Resulting allocated memory will be page aligned */
@@ -1155,15 +1156,10 @@ spl_cache_grow_work(void *data)
        spl_kmem_cache_t *skc = ska->ska_cache;
        spl_kmem_slab_t *sks;
 
-#if defined(PF_MEMALLOC_NOIO)
-       unsigned noio_flag = memalloc_noio_save();
-       sks = spl_slab_alloc(skc, ska->ska_flags);
-       memalloc_noio_restore(noio_flag);
-#else
        fstrans_cookie_t cookie = spl_fstrans_mark();
        sks = spl_slab_alloc(skc, ska->ska_flags);
        spl_fstrans_unmark(cookie);
-#endif
+
        spin_lock(&skc->skc_lock);
        if (sks) {
                skc->skc_slab_total++;
@@ -1634,11 +1630,16 @@ spl_kmem_cache_reap_now(spl_kmem_cache_t *skc, int count)
        atomic_inc(&skc->skc_ref);
 
        /*
-        * Execute the registered reclaim callback if it exists.
+        * Execute the registered reclaim callback if it exists.  The
+        * per-cpu caches will be drained when is set KMC_EXPIRE_MEM.
         */
        if (skc->skc_flags & KMC_SLAB) {
                if (skc->skc_reclaim)
                        skc->skc_reclaim(skc->skc_private);
+
+               if (spl_kmem_cache_expire & KMC_EXPIRE_MEM)
+                       kmem_cache_shrink(skc->skc_linux_cache);
+
                goto out;
        }
 
index 92263f8f4ec4d8fce3514276a52ef01849a77b25..0931fdfcfd4e1291787356f4a10bae7ddaf23983 100644 (file)
@@ -185,7 +185,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
                 */
                if ((size > spl_kmem_alloc_max) || use_vmem) {
                        if (flags & KM_VMEM) {
-                               ptr = spl_vmalloc(size, lflags, PAGE_KERNEL);
+                               ptr = __vmalloc(size, lflags, PAGE_KERNEL);
                        } else {
                                return (NULL);
                        }
@@ -198,7 +198,7 @@ spl_kmem_alloc_impl(size_t size, int flags, int node)
 
                /*
                 * For vmem_alloc() and vmem_zalloc() callers retry immediately
-                * using spl_vmalloc() which is unlikely to fail.
+                * using __vmalloc() which is unlikely to fail.
                 */
                if ((flags & KM_VMEM) && (use_vmem == 0))  {
                        use_vmem = 1;
index 429f68f531499ff7f2bd967b6f30ebdbbd3f418e..7d233c23e40d2425f252165c22ca0d3495ac1986 100644 (file)
@@ -813,9 +813,7 @@ taskq_thread(void *args)
        tq = tqt->tqt_tq;
        current->flags |= PF_NOFREEZE;
 
-       #if defined(PF_MEMALLOC_NOIO)
-       (void) memalloc_noio_save();
-       #endif
+       (void) spl_fstrans_mark();
 
        sigfillset(&blocked);
        sigprocmask(SIG_BLOCK, &blocked, NULL);
index bca27f263d91cd2d82b5bfc074cddfe6084e3a4e..e177988a7e2d06a509c1815058fc701e89914307 100644 (file)
@@ -97,31 +97,6 @@ spl_vmem_free(const void *buf, size_t size)
 }
 EXPORT_SYMBOL(spl_vmem_free);
 
-/*
- * Public vmalloc() interface designed to be safe to be called during I/O.
- */
-void *
-spl_vmalloc(unsigned long size, gfp_t lflags, pgprot_t prot)
-{
-#if defined(PF_MEMALLOC_NOIO)
-       void *ptr;
-       unsigned noio_flag = 0;
-
-       if (spl_fstrans_check())
-               noio_flag = memalloc_noio_save();
-
-       ptr =  __vmalloc(size, lflags, prot);
-
-       if (spl_fstrans_check())
-               memalloc_noio_restore(noio_flag);
-
-       return (ptr);
-#else
-       return (__vmalloc(size, lflags, prot));
-#endif
-}
-EXPORT_SYMBOL(spl_vmalloc);
-
 int
 spl_vmem_init(void)
 {
index 28811227816b5598bb5cf4ae51cd470b832dd88f..b3fd1a84dc871a4d95deaafcf9c88dfd6986860d 100644 (file)
@@ -590,9 +590,6 @@ splat_kmem_cache_test(struct file *file, void *arg, char *name,
        kmem_cache_data_t **kcd = NULL;
        int i, rc = 0, objs = 0;
 
-       /* Limit size for low memory machines (1/128 of memory) */
-       size = MIN(size, (physmem * PAGE_SIZE) >> 7);
-
        splat_vprint(file, name,
            "Testing size=%d, align=%d, flags=0x%04x\n",
            size, align, flags);
@@ -622,7 +619,7 @@ splat_kmem_cache_test(struct file *file, void *arg, char *name,
         * it to a single slab for the purposes of this test.
         */
 #ifdef _LP64
-       objs = kcp->kcp_cache->skc_slab_objs * 4;
+       objs = SPL_KMEM_CACHE_OBJ_PER_SLAB * 4;
 #else
        objs = 1;
 #endif
diff --git a/spl/rpm/Makefile.in b/spl/rpm/Makefile.in
new file mode 100644 (file)
index 0000000..03402b5
--- /dev/null
@@ -0,0 +1,672 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = rpm
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+SUBDIRS = generic redhat
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu rpm/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu rpm/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/rpm/generic/Makefile.in b/spl/rpm/generic/Makefile.in
new file mode 100644 (file)
index 0000000..54cba79
--- /dev/null
@@ -0,0 +1,499 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = rpm/generic
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES = spl.spec spl-kmod.spec spl-dkms.spec
+CONFIG_CLEAN_VPATH_FILES =
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/spl-dkms.spec.in \
+       $(srcdir)/spl-kmod.spec.in $(srcdir)/spl.spec.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = spl.spec.in spl-kmod.spec.in spl-dkms.spec.in
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu rpm/generic/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu rpm/generic/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+spl.spec: $(top_builddir)/config.status $(srcdir)/spl.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+spl-kmod.spec: $(top_builddir)/config.status $(srcdir)/spl-kmod.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+spl-dkms.spec: $(top_builddir)/config.status $(srcdir)/spl-dkms.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index ac0ddd3693ee37222cbd1c49dfa6334a24961d51..949660ebc024d171b5eaa545381412442728ef5b 100644 (file)
@@ -62,15 +62,8 @@ echo -e "support or upgrade DKMS to a more current version."
 exit 1
 
 %preun
-CONFIG_H="/var/lib/dkms/%{module}/%{version}/*/*/%{module}_config.h"
-SPEC_META_ALIAS="@PACKAGE@-@VERSION@-@RELEASE@"
-DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
-    awk -F'"' '/META_ALIAS/ { print $2; exit 0 }'`
-if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
-    echo -e
-    echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"
-    dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
-fi
+echo -e "Uninstall of %{module} module (version %{version}) beginning:"
+dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
 exit 0
 
 %changelog
index 5f5854a3be32742ad4f0225c6a4fae70c2145b91..d4441b88d1309cbac7a3bbbc13b85d61cd719492 100644 (file)
@@ -160,6 +160,12 @@ chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
 rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Fri Jan  8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
+- Build fixes on SPARC and some kernels
+- Fix taskq dynamic spawning deadlock
+- Fix builtin kernel builds
+- Fix crash due to overflow in P2ROUNDUP macro
+- Fix deadlock during direct memory reclaim
 * Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
 - Fix CPU hotplug zfsonlinux/spl#482
 - Disable dynamic taskqs by default to avoid deadlock zfsonlinux/spl#484
index ca68723ff906c4f91a8e4100633c92caf1752bc2..6beebb15c595c2b2af0f6fc1d099d4cabfbad708 100644 (file)
@@ -38,6 +38,12 @@ make install DESTDIR=%{?buildroot}
 %{_mandir}/man5/*
 
 %changelog
+* Fri Jan  8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
+- Build fixes on SPARC and some kernels
+- Fix taskq dynamic spawning deadlock
+- Fix builtin kernel builds
+- Fix crash due to overflow in P2ROUNDUP macro
+- Fix deadlock during direct memory reclaim
 * Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
 - Fix CPU hotplug zfsonlinux/spl#482
 - Disable dynamic taskqs by default to avoid deadlock zfsonlinux/spl#484
diff --git a/spl/rpm/redhat/Makefile.in b/spl/rpm/redhat/Makefile.in
new file mode 100644 (file)
index 0000000..ba0359c
--- /dev/null
@@ -0,0 +1,499 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = rpm/redhat
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES = spl.spec spl-kmod.spec spl-dkms.spec
+CONFIG_CLEAN_VPATH_FILES =
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/spl-dkms.spec.in \
+       $(srcdir)/spl-kmod.spec.in $(srcdir)/spl.spec.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = spl.spec.in spl-kmod.spec.in spl-dkms.spec.in
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu rpm/redhat/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu rpm/redhat/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+spl.spec: $(top_builddir)/config.status $(srcdir)/spl.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+spl-kmod.spec: $(top_builddir)/config.status $(srcdir)/spl-kmod.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+spl-dkms.spec: $(top_builddir)/config.status $(srcdir)/spl-dkms.spec.in
+       cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
deleted file mode 120000 (symlink)
index 900f524aadc8c794e6838db652d0b1f03161d3e5..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../generic/spl-dkms.spec.in
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..949660ebc024d171b5eaa545381412442728ef5b
--- /dev/null
@@ -0,0 +1,71 @@
+%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
+
+%define module  @PACKAGE@
+%define mkconf  scripts/dkms.mkconf
+
+Name:           %{module}-dkms
+
+Version:        @VERSION@
+Release:        @RELEASE@%{?dist}
+Summary:        Kernel module(s) (dkms)
+
+Group:          System Environment/Kernel
+License:        GPLv2+
+URL:            http://zfsonlinux.org/
+Source0:        %{module}-%{version}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+BuildArch:      noarch
+
+Requires:       dkms >= 2.2.0.2
+Requires:       gcc, make, perl
+Requires:       kernel-devel
+Provides:       %{module}-kmod = %{version}
+
+%description
+This package contains the dkms kernel modules required to emulate
+several interfaces provided by the Solaris kernel.
+
+%prep
+%setup -q -n %{module}-%{version}
+
+%build
+%{mkconf} -n %{module} -v %{version} -f dkms.conf
+
+%install
+if [ "$RPM_BUILD_ROOT" != "/" ]; then
+    rm -rf $RPM_BUILD_ROOT
+fi
+mkdir -p $RPM_BUILD_ROOT/usr/src/
+cp -rf ${RPM_BUILD_DIR}/%{module}-%{version} $RPM_BUILD_ROOT/usr/src/
+
+%clean
+if [ "$RPM_BUILD_ROOT" != "/" ]; then
+    rm -rf $RPM_BUILD_ROOT
+fi
+
+%files
+%defattr(-,root,root)
+/usr/src/%{module}-%{version}
+
+%post
+for POSTINST in /usr/lib/dkms/common.postinst; do
+    if [ -f $POSTINST ]; then
+        $POSTINST %{module} %{version}
+        exit $?
+    fi
+    echo "WARNING: $POSTINST does not exist."
+done
+echo -e "ERROR: DKMS version is too old and %{module} was not"
+echo -e "built with legacy DKMS support."
+echo -e "You must either rebuild %{module} with legacy postinst"
+echo -e "support or upgrade DKMS to a more current version."
+exit 1
+
+%preun
+echo -e "Uninstall of %{module} module (version %{version}) beginning:"
+dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
+exit 0
+
+%changelog
+* %(date "+%a %b %d %Y") %packager %{version}-%{release}
+- Automatic build by DKMS
deleted file mode 120000 (symlink)
index d3276f0132037782ccee35728ba27278a0a2b3ce..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../generic/spl.spec.in
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..6beebb15c595c2b2af0f6fc1d099d4cabfbad708
--- /dev/null
@@ -0,0 +1,66 @@
+Name:           @PACKAGE@
+Version:        @VERSION@
+Release:        @RELEASE@%{?dist}
+Summary:        Commands to control the kernel modules
+
+Group:          System Environment/Kernel
+License:        GPLv2+
+URL:            http://zfsonlinux.org/
+Source0:        %{name}-%{version}.tar.gz
+BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
+ExclusiveArch:  i386 i686 x86_64
+
+# May build but untested on ppc/ppc64
+ExcludeArch:    ppc ppc64
+
+Requires:       %{name}-kmod = %{version}
+Provides:       %{name}-kmod-common = %{version}
+
+%description
+This package contains the commands to verify the SPL
+kernel modules are functioning properly.
+
+%prep
+%setup -q
+
+%build
+%configure --with-config=user
+make %{?_smp_mflags}
+
+%install
+%{__rm} -rf $RPM_BUILD_ROOT
+make install DESTDIR=%{?buildroot}
+
+%files
+%doc AUTHORS COPYING DISCLAIMER
+%{_sbindir}/*
+%{_mandir}/man1/*
+%{_mandir}/man5/*
+
+%changelog
+* Fri Jan  8 2016 Ned Bass <bass6@llnl.gov> - 0.6.5.4-1
+- Build fixes on SPARC and some kernels
+- Fix taskq dynamic spawning deadlock
+- Fix builtin kernel builds
+- Fix crash due to overflow in P2ROUNDUP macro
+- Fix deadlock during direct memory reclaim
+* Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
+- Fix CPU hotplug zfsonlinux/spl#482
+- Disable dynamic taskqs by default to avoid deadlock zfsonlinux/spl#484
+* Tue Sep 29 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.2-1
+- Released 0.6.5.2-1
+- Fix PAX Patch/Grsec SLAB_USERCOPY panic zfsonlinux/zfs#3796
+- Always remove during dkms uninstall/update zfsonlinux/spl#476
+* Thu Sep 19 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.1-1
+- Released 0.6.5.1-1, no changes from spl-0.6.5
+* Thu Sep 10 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5-1
+- Released 0.6.5-1, detailed release notes are available at:
+- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5
+* Wed Apr  8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
+- Released 0.6.4-1
+* Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
+- Released 0.6.3-1
+* Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
+- Released 0.6.2-1
+* Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
+- First official stable release.
diff --git a/spl/scripts/Makefile.in b/spl/scripts/Makefile.in
new file mode 100644 (file)
index 0000000..f61879e
--- /dev/null
@@ -0,0 +1,495 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = scripts
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/spl-build.m4 \
+       $(top_srcdir)/config/spl-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/spl_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_KMEM = @DEBUG_KMEM@
+DEBUG_KMEM_TRACKING = @DEBUG_KMEM_TRACKING@
+DEBUG_SPL = @DEBUG_SPL@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL_CONFIG = @SPL_CONFIG@
+SPL_META_ALIAS = @SPL_META_ALIAS@
+SPL_META_AUTHOR = @SPL_META_AUTHOR@
+SPL_META_DATA = @SPL_META_DATA@
+SPL_META_LICENSE = @SPL_META_LICENSE@
+SPL_META_LT_AGE = @SPL_META_LT_AGE@
+SPL_META_LT_CURRENT = @SPL_META_LT_CURRENT@
+SPL_META_LT_REVISION = @SPL_META_LT_REVISION@
+SPL_META_NAME = @SPL_META_NAME@
+SPL_META_RELEASE = @SPL_META_RELEASE@
+SPL_META_VERSION = @SPL_META_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+EXTRA_DIST = check.sh dkms.mkconf dkms.postbuild kmodtool
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu scripts/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu scripts/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       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
+
+.PRECIOUS: Makefile
+
+
+check:
+       scripts/check.sh
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/spl/spl_config.h.in b/spl/spl_config.h.in
new file mode 100644 (file)
index 0000000..cfd94db
--- /dev/null
@@ -0,0 +1,191 @@
+/* spl_config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Atomic types use spinlocks */
+#undef ATOMIC_SPINLOCK
+
+/* Define to 1 to enable basic kmem accounting */
+#undef DEBUG_KMEM
+
+/* Define to 1 to enable detailed kmem tracking */
+#undef DEBUG_KMEM_TRACKING
+
+/* new shrinker callback wants 2 args */
+#undef HAVE_2ARGS_NEW_SHRINKER_CALLBACK
+
+/* old shrinker callback wants 2 args */
+#undef HAVE_2ARGS_OLD_SHRINKER_CALLBACK
+
+/* vfs_fsync() wants 2 args */
+#undef HAVE_2ARGS_VFS_FSYNC
+
+/* vfs_getattr wants 2 args */
+#undef HAVE_2ARGS_VFS_GETATTR
+
+/* vfs_unlink() wants 2 args */
+#undef HAVE_2ARGS_VFS_UNLINK
+
+/* zlib_deflate_workspacesize() wants 2 args */
+#undef HAVE_2ARGS_ZLIB_DEFLATE_WORKSPACESIZE
+
+/* old shrinker callback wants 3 args */
+#undef HAVE_3ARGS_SHRINKER_CALLBACK
+
+/* vfs_unlink() wants 3 args */
+#undef HAVE_3ARGS_VFS_UNLINK
+
+/* vfs_rename() wants 4 args */
+#undef HAVE_4ARGS_VFS_RENAME
+
+/* vfs_rename() wants 5 args */
+#undef HAVE_5ARGS_VFS_RENAME
+
+/* vfs_rename() wants 6 args */
+#undef HAVE_6ARGS_VFS_RENAME
+
+/* kernel defines atomic64_t */
+#undef HAVE_ATOMIC64_T
+
+/* struct ctl_table has ctl_name */
+#undef HAVE_CTL_NAME
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* fops->fallocate() exists */
+#undef HAVE_FILE_FALLOCATE
+
+/* struct fs_struct uses spinlock_t */
+#undef HAVE_FS_STRUCT_SPINLOCK
+
+/* fops->fallocate() exists */
+#undef HAVE_INODE_FALLOCATE
+
+/* truncate_range() inode operation is available */
+#undef HAVE_INODE_TRUNCATE_RANGE
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* struct kmem_cache has allocflags */
+#undef HAVE_KMEM_CACHE_ALLOCFLAGS
+
+/* struct kmem_cache has gfpflags */
+#undef HAVE_KMEM_CACHE_GFPFLAGS
+
+/* kuid_t/kgid_t in use */
+#undef HAVE_KUIDGID_T
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* yes */
+#undef HAVE_PDE_DATA
+
+/* __put_task_struct() is available */
+#undef HAVE_PUT_TASK_STRUCT
+
+/* linux/sched/rt.h exists */
+#undef HAVE_SCHED_RT_HEADER
+
+/* set_fs_pwd() needs const path * */
+#undef HAVE_SET_FS_PWD_WITH_CONST
+
+/* struct shrink_control exists */
+#undef HAVE_SHRINK_CONTROL_STRUCT
+
+/* ->count_objects exists */
+#undef HAVE_SPLIT_SHRINKER_CALLBACK
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_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/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* usleep_range is available */
+#undef HAVE_USLEEP_RANGE
+
+/* yes */
+#undef HAVE_WAIT_ON_BIT_ACTION
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* struct rw_semaphore member wait_lock is raw_spinlock_t */
+#undef RWSEM_SPINLOCK_IS_RAW
+
+/* Define to 1 if GPL-only symbols can be used */
+#undef SPL_IS_GPL_COMPATIBLE
+
+/* Define the project alias string. */
+#undef SPL_META_ALIAS
+
+/* Define the project author. */
+#undef SPL_META_AUTHOR
+
+/* Define the project release date. */
+#undef SPL_META_DATA
+
+/* Define the project license. */
+#undef SPL_META_LICENSE
+
+/* Define the libtool library 'age' version information. */
+#undef SPL_META_LT_AGE
+
+/* Define the libtool library 'current' version information. */
+#undef SPL_META_LT_CURRENT
+
+/* Define the libtool library 'revision' version information. */
+#undef SPL_META_LT_REVISION
+
+/* Define the project name. */
+#undef SPL_META_NAME
+
+/* Define the project release. */
+#undef SPL_META_RELEASE
+
+/* Define the project version. */
+#undef SPL_META_VERSION
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
diff --git a/zfs/.gitignore b/zfs/.gitignore
deleted file mode 100644 (file)
index eab3d97..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#
-# N.B.
-# This is the toplevel .gitignore file.
-# This is not the place for entries that are specific to
-# a subdirectory.  Instead add those files to the
-# .gitignore file in that subdirectory.
-#
-# N.B.
-# Please use 'git ls-files -i --exclude-standard'
-# command after changing this file, to see if there are
-# any tracked files which get ignored after the change.
-
-#
-# Normal rules
-#
-*.[oa]
-*.lo
-*.la
-*.mod.c
-*~
-*.swp
-.deps
-.libs
-.DS_Store
-modules.order
-Makefile
-Makefile.in
-
-#
-# Top level generated files specific to this top level dir
-#
-/configure
-/config.log
-/config.status
-/libtool
-/zfs_config.h
-/zfs_config.h.in
-/zfs.release
-/stamp-h1
-/.script-config
-/zfs-script-config.sh
-/aclocal.m4
-/autom4te.cache
-
-#
-# Top level generic files
-#
-!.gitignore
-tags
-TAGS
-cscope.*
-*.rpm
-*.deb
-*.tar.gz
index aa3c1da588862d91cf592fd4d36331ed1c829931..1629557581ed481b5d2cb5c74fceb143c7eea397 100644 (file)
--- a/zfs/META
+++ b/zfs/META
@@ -1,8 +1,8 @@
 Meta:         1
 Name:         zfs
 Branch:       1.0
-Version:      0.6.5.3
-Release:      1
+Version:      0.6.5.4
+Release:      0ubuntu1
 Release-Tags: relext
 License:      CDDL
 Author:       OpenZFS on Linux
diff --git a/zfs/Makefile.in b/zfs/Makefile.in
new file mode 100644 (file)
index 0000000..7f5692d
--- /dev/null
@@ -0,0 +1,1304 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+###############################################################################
+# Copyright (C) 2007-2013 Lawrence Livermore National Security, LLC.
+# Copyright (C) 2007 The Regents of the University of California.
+# Written by Brian Behlendorf <behlendorf1@llnl.gov>.
+###############################################################################
+# Build targets for RPM packages.
+###############################################################################
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+@CONFIG_USER_TRUE@am__append_1 = udev etc man scripts lib cmd contrib
+@CONFIG_KERNEL_TRUE@am__append_2 = module
+subdir = .
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \
+       $(am__configure_deps) $(am__extra_HEADERS_DIST) \
+       $(am__DIST_COMMON)
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
+ configure.lineno config.status.lineno
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = zfs_config.h
+CONFIG_CLEAN_FILES = module/Makefile module/avl/Makefile \
+       module/nvpair/Makefile module/unicode/Makefile \
+       module/zcommon/Makefile module/zfs/Makefile \
+       module/zpios/Makefile zfs-script-config.sh zfs.release
+CONFIG_CLEAN_VPATH_FILES =
+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 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__extra_HEADERS_DIST = zfs.release.in zfs_config.h.in
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(extradir)" "$(DESTDIR)$(kerneldir)"
+HEADERS = $(extra_HEADERS) $(nodist_kernel_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)zfs_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 = include rpm udev etc man scripts lib cmd contrib module
+am__DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/config/deb.am \
+       $(srcdir)/config/rpm.am $(srcdir)/config/tgz.am \
+       $(srcdir)/zfs-script-config.sh.in $(srcdir)/zfs.release.in \
+       $(srcdir)/zfs_config.h.in $(top_srcdir)/config/compile \
+       $(top_srcdir)/config/config.guess \
+       $(top_srcdir)/config/config.sub \
+       $(top_srcdir)/config/install-sh $(top_srcdir)/config/ltmain.sh \
+       $(top_srcdir)/config/missing $(top_srcdir)/module/Makefile.in \
+       $(top_srcdir)/module/avl/Makefile.in \
+       $(top_srcdir)/module/nvpair/Makefile.in \
+       $(top_srcdir)/module/unicode/Makefile.in \
+       $(top_srcdir)/module/zcommon/Makefile.in \
+       $(top_srcdir)/module/zfs/Makefile.in \
+       $(top_srcdir)/module/zpios/Makefile.in AUTHORS config/compile \
+       config/config.guess config/config.sub config/depcomp \
+       config/install-sh config/ltmain.sh config/missing
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+distdir = $(PACKAGE)-$(VERSION)
+top_distdir = $(distdir)
+am__remove_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,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  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
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+ACLOCAL_AMFLAGS = -I config
+SUBDIRS = include rpm $(am__append_1) $(am__append_2)
+@CONFIG_KERNEL_TRUE@extradir = @prefix@/src/zfs-$(VERSION)
+@CONFIG_KERNEL_TRUE@extra_HEADERS = zfs.release.in zfs_config.h.in
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/zfs-$(VERSION)/$(LINUX_VERSION)
+@CONFIG_KERNEL_TRUE@nodist_kernel_HEADERS = zfs.release zfs_config.h module/$(LINUX_SYMBOLS)
+AUTOMAKE_OPTIONS = foreign
+EXTRA_DIST = autogen.sh copy-builtin config/config.awk config/rpm.am \
+       config/deb.am config/tgz.am META DISCLAIMER COPYRIGHT \
+       README.markdown OPENSOLARIS.LICENSE
+all: zfs_config.h
+       $(MAKE) $(AM_MAKEFLAGS) all-recursive
+
+.SUFFIXES:
+am--refresh: Makefile
+       @:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(srcdir)/config/rpm.am $(srcdir)/config/deb.am $(srcdir)/config/tgz.am $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \
+             $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \
+               && exit 0; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --foreign Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           echo ' $(SHELL) ./config.status'; \
+           $(SHELL) ./config.status;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
+       esac;
+$(srcdir)/config/rpm.am $(srcdir)/config/deb.am $(srcdir)/config/tgz.am $(am__empty):
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       $(SHELL) ./config.status --recheck
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       $(am__cd) $(srcdir) && $(AUTOCONF)
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
+$(am__aclocal_m4_deps):
+
+zfs_config.h: stamp-h1
+       @test -f $@ || rm -f stamp-h1
+       @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
+
+stamp-h1: $(srcdir)/zfs_config.h.in $(top_builddir)/config.status
+       @rm -f stamp-h1
+       cd $(top_builddir) && $(SHELL) ./config.status zfs_config.h
+$(srcdir)/zfs_config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) 
+       ($(am__cd) $(top_srcdir) && $(AUTOHEADER))
+       rm -f stamp-h1
+       touch $@
+
+distclean-hdr:
+       -rm -f zfs_config.h stamp-h1
+module/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/avl/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/avl/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/nvpair/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/nvpair/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/unicode/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/unicode/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/zcommon/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/zcommon/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/zfs/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/zfs/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+module/zpios/Makefile: $(top_builddir)/config.status $(top_srcdir)/module/zpios/Makefile.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+zfs-script-config.sh: $(top_builddir)/config.status $(srcdir)/zfs-script-config.sh.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+zfs.release: $(top_builddir)/config.status $(srcdir)/zfs.release.in
+       cd $(top_builddir) && $(SHELL) ./config.status $@
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+
+distclean-libtool:
+       -rm -f libtool config.lt
+install-extraHEADERS: $(extra_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(extra_HEADERS)'; test -n "$(extradir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(extradir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(extradir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(extradir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(extradir)" || exit $$?; \
+       done
+
+uninstall-extraHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(extra_HEADERS)'; test -n "$(extradir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(extradir)'; $(am__uninstall_files_from_dir)
+install-nodist_kernelHEADERS: $(nodist_kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(nodist_kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-nodist_kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(nodist_kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+
+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
+
+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)
+       test -d "$(distdir)" || mkdir "$(distdir)"
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+       $(MAKE) $(AM_MAKEFLAGS) \
+         top_distdir="$(top_distdir)" distdir="$(distdir)" \
+         dist-hook
+       -test -n "$(am__skip_mode_fix)" \
+       || find "$(distdir)" -type d ! -perm -755 \
+               -exec chmod u+rwx,go+rx {} \; -o \
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \
+         ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \
+       || chmod -R a+r "$(distdir)"
+dist-gzip: distdir
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
+       $(am__post_remove_distdir)
+
+dist-bzip2: distdir
+       tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+       $(am__post_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_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+       $(am__post_remove_distdir)
+
+dist-tarZ: distdir
+       @echo WARNING: "Support for distribution archives compressed with" \
+                      "legacy program 'compress' is deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
+       $(am__post_remove_distdir)
+
+dist-shar: distdir
+       @echo WARNING: "Support for shar distribution archives is" \
+                      "deprecated." >&2
+       @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
+       $(am__post_remove_distdir)
+
+dist-zip: distdir
+       -rm -f $(distdir).zip
+       zip -rq $(distdir).zip $(distdir)
+       $(am__post_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
+# tarfile.
+distcheck: dist
+       case '$(DIST_ARCHIVES)' in \
+       *.tar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
+       *.tar.bz2*) \
+         bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
+       *.tar.lz*) \
+         lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
+       *.tar.xz*) \
+         xz -dc $(distdir).tar.xz | $(am__untar) ;;\
+       *.tar.Z*) \
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\
+       *.shar.gz*) \
+         GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\
+       *.zip*) \
+         unzip $(distdir).zip ;;\
+       esac
+       chmod -R a-w $(distdir)
+       chmod u+w $(distdir)
+       mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst
+       chmod a-w $(distdir)
+       test -d $(distdir)/_build || exit 0; \
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \
+         && am__cwd=`pwd` \
+         && $(am__cd) $(distdir)/_build/sub \
+         && ../../configure \
+           $(AM_DISTCHECK_CONFIGURE_FLAGS) \
+           $(DISTCHECK_CONFIGURE_FLAGS) \
+           --srcdir=../.. --prefix="$$dc_install_base" \
+         && $(MAKE) $(AM_MAKEFLAGS) \
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \
+         && $(MAKE) $(AM_MAKEFLAGS) check \
+         && $(MAKE) $(AM_MAKEFLAGS) install \
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \
+               distuninstallcheck \
+         && chmod -R a-w "$$dc_install_base" \
+         && ({ \
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \
+         && rm -rf "$$dc_destdir" \
+         && $(MAKE) $(AM_MAKEFLAGS) dist \
+         && rm -rf $(DIST_ARCHIVES) \
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
+         && cd "$$am__cwd" \
+         || exit 1
+       $(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:
+       @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)"; \
+               fi ; \
+               $(distuninstallcheck_listfiles) ; \
+               exit 1; } >&2
+distcleancheck: distclean
+       @if test '$(srcdir)' = . ; then \
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \
+         exit 1 ; \
+       fi
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \
+         || { echo "ERROR: files left in build directory after distclean:" ; \
+              $(distcleancheck_listfiles) ; \
+              exit 1; } >&2
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS) zfs_config.h
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(extradir)" "$(DESTDIR)$(kerneldir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-hdr \
+       distclean-libtool distclean-local distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-extraHEADERS install-nodist_kernelHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)
+       -rm -rf $(top_srcdir)/autom4te.cache
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-extraHEADERS uninstall-nodist_kernelHEADERS
+
+.MAKE: $(am__recursive_targets) all install-am install-strip
+
+.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-hook 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-dvi \
+       install-dvi-am install-exec install-exec-am \
+       install-extraHEADERS install-html install-html-am install-info \
+       install-info-am install-man install-nodist_kernelHEADERS \
+       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-extraHEADERS uninstall-nodist_kernelHEADERS
+
+.PRECIOUS: Makefile
+
+
+srpm-kmod:
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \
+               def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_KMOD}' srpm-common
+
+srpm-dkms:
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
+               def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_DKMS}' srpm-common
+
+srpm-utils:
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
+               def='${SRPM_DEFINE_COMMON} ${SRPM_DEFINE_UTIL}' srpm-common
+
+srpm: srpm-kmod srpm-dkms srpm-utils
+srpms: srpm-kmod srpm-dkms srpm-utils
+
+rpm-kmod: srpm-kmod
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-kmod" \
+               def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_KMOD}' rpm-common
+
+rpm-dkms: srpm-dkms
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}-dkms" \
+               def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_DKMS}' rpm-common
+
+rpm-utils: srpm-utils
+       $(MAKE) $(AM_MAKEFLAGS) pkg="${PACKAGE}" \
+               def='${RPM_DEFINE_COMMON} ${RPM_DEFINE_UTIL}' rpm-common
+
+rpm: rpm-kmod rpm-dkms rpm-utils
+rpms: rpm-kmod rpm-dkms rpm-utils
+
+rpm-local:
+       @(if test "${HAVE_RPMBUILD}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${RPMBUILD} missing.  Please install the\n" \
+       "*** package for your distribution which provides ${RPMBUILD},\n" \
+       "*** re-run configure, and try again.\n"; \
+               exit 1; \
+       fi; \
+       mkdir -p $(rpmbuild)/TMP && \
+       mkdir -p $(rpmbuild)/BUILD && \
+       mkdir -p $(rpmbuild)/RPMS && \
+       mkdir -p $(rpmbuild)/SRPMS && \
+       mkdir -p $(rpmbuild)/SPECS && \
+       cp ${RPM_SPEC_DIR}/$(rpmspec) $(rpmbuild)/SPECS && \
+       mkdir -p $(rpmbuild)/SOURCES && \
+       cp $(top_srcdir)/scripts/kmodtool $(rpmbuild)/SOURCES && \
+       cp $(distdir).tar.gz $(rpmbuild)/SOURCES)
+
+srpm-common: dist
+       @(dist=`$(RPM) --eval %{?dist}`; \
+       rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \
+       rpmspec=$(pkg).spec; \
+       rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
+       $(MAKE) $(AM_MAKEFLAGS) \
+               rpmbuild="$$rpmbuild" \
+               rpmspec="$$rpmspec" \
+               rpm-local || exit 1; \
+       LANG=C $(RPMBUILD) \
+               --define "_tmppath $$rpmbuild/TMP" \
+               --define "_topdir $$rpmbuild" \
+               $(def) -bs $$rpmbuild/SPECS/$$rpmspec || exit 1; \
+       cp $$rpmbuild/SRPMS/$$rpmpkg . || exit 1; \
+       rm -R $$rpmbuild)
+
+rpm-common: 
+       @(dist=`$(RPM) --eval %{?dist}`; \
+       rpmpkg=$(pkg)-$(VERSION)-$(RELEASE)$$dist*src.rpm; \
+       rpmspec=$(pkg).spec; \
+       rpmbuild=`mktemp -t -d $(PACKAGE)-build-$$USER-XXXXXXXX`; \
+       $(MAKE) $(AM_MAKEFLAGS) \
+               rpmbuild="$$rpmbuild" \
+               rpmspec="$$rpmspec" \
+               rpm-local || exit 1; \
+       LANG=C ${RPMBUILD} \
+               --define "_tmppath $$rpmbuild/TMP" \
+               --define "_topdir $$rpmbuild" \
+               $(def) --rebuild $$rpmpkg || exit 1; \
+       cp $$rpmbuild/RPMS/*/* . || exit 1; \
+       rm -R $$rpmbuild)
+deb-local:
+       @(if test "${HAVE_DPKGBUILD}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${DPKGBUILD} missing.  Please install the\n" \
+        "*** package for your distribution which provides ${DPKGBUILD},\n" \
+       "*** re-run configure, and try again.\n"; \
+                exit 1; \
+       fi; \
+       if test "${HAVE_ALIEN}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${ALIEN} missing.  Please install the\n" \
+        "*** package for your distribution which provides ${ALIEN},\n" \
+       "*** re-run configure, and try again.\n"; \
+                exit 1; \
+       fi)
+
+deb-kmod: deb-local rpm-kmod
+@CONFIG_KERNEL_TRUE@   name=${PACKAGE}; \
+@CONFIG_KERNEL_TRUE@   version=${VERSION}-${RELEASE}; \
+@CONFIG_KERNEL_TRUE@   arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_KERNEL_TRUE@   pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
+@CONFIG_KERNEL_TRUE@   fakeroot $(ALIEN) --bump=0 --scripts --to-deb $$pkg1; \
+@CONFIG_KERNEL_TRUE@   $(RM) $$pkg1
+
+deb-utils: deb-local rpm-utils
+@CONFIG_USER_TRUE@     name=${PACKAGE}; \
+@CONFIG_USER_TRUE@     version=${VERSION}-${RELEASE}; \
+@CONFIG_USER_TRUE@     arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_USER_TRUE@     pkg1=$${name}-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg2=libnvpair1-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg3=libuutil1-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg4=libzfs2-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg5=libzpool2-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg6=libzfs2-devel-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg7=$${name}-test-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg8=$${name}-dracut-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg9=$${name}-initramfs-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     fakeroot $(ALIEN) --bump=0 --scripts --to-deb \
+@CONFIG_USER_TRUE@         $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
+@CONFIG_USER_TRUE@         $$pkg8 $$pkg9;
+@CONFIG_USER_TRUE@     $(RM) $$pkg1 $$pkg2 $$pkg3 $$pkg4 $$pkg5 $$pkg6 $$pkg7 \
+@CONFIG_USER_TRUE@         $$pkg8 $$pkg9;
+
+deb: deb-kmod deb-utils
+tgz-local:
+       @(if test "${HAVE_ALIEN}" = "no"; then \
+               echo -e "\n" \
+       "*** Required util ${ALIEN} missing.  Please install the\n" \
+        "*** package for your distribution which provides ${ALIEN},\n" \
+       "*** re-run configure, and try again.\n"; \
+                exit 1; \
+       fi)
+
+tgz-kmod: tgz-local rpm-kmod
+@CONFIG_KERNEL_TRUE@   name=${PACKAGE}; \
+@CONFIG_KERNEL_TRUE@   version=${VERSION}-${RELEASE}; \
+@CONFIG_KERNEL_TRUE@   arch=`$(RPM) -qp $${name}-kmod-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_KERNEL_TRUE@   pkg1=kmod-$${name}*$${version}.$${arch}.rpm; \
+@CONFIG_KERNEL_TRUE@   fakeroot $(ALIEN) --scripts --to-tgz $$pkg1; \
+@CONFIG_KERNEL_TRUE@   $(RM) $$pkg1
+
+tgz-utils: tgz-local rpm-utils
+@CONFIG_USER_TRUE@     name=${PACKAGE}; \
+@CONFIG_USER_TRUE@     version=${VERSION}-${RELEASE}; \
+@CONFIG_USER_TRUE@     arch=`$(RPM) -qp $${name}-$${version}.src.rpm --qf %{arch} | tail -1`; \
+@CONFIG_USER_TRUE@     pkg1=$${name}-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg2=$${name}-devel-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     pkg3=$${name}-test-$${version}.$${arch}.rpm; \
+@CONFIG_USER_TRUE@     fakeroot $(ALIEN) --scripts --to-tgz $$pkg1 $$pkg2 $$pkg3; \
+@CONFIG_USER_TRUE@     $(RM) $$pkg1 $$pkg2 $$pkg3
+
+tgz: tgz-kmod tgz-utils
+
+distclean-local::
+       -$(RM) -R autom4te*.cache
+       -find . \( -name SCCS -o -name BitKeeper -o -name .svn -o -name CVS \
+               -o -name .pc -o -name .hg -o -name .git \) -prune -o \
+               \( -name '*.orig' -o -name '*.rej' -o -name '*~' \
+               -o -name '*.bak' -o -name '#*#' -o -name '.*.orig' \
+               -o -name '.*.rej' -o -name '.script-config' -o -size 0 \
+               -o -name '*%' -o -name '.*.cmd' -o -name 'core' \
+               -o -name 'Makefile' -o -name 'Module.symvers' \
+               -o -name '*.order' -o -name '*.markers' \) \
+               -type f -print | xargs $(RM)
+
+dist-hook:
+       sed -i 's/Release:[[:print:]]*/Release:      $(RELEASE)/' \
+               $(distdir)/META
+
+checkstyle: cstyle shellcheck
+
+cstyle:
+       @find ${top_srcdir} -name '*.[hc]' ! -name 'zfs_config.*' \
+               ! -name '*.mod.c' -type f -exec scripts/cstyle.pl {} \+
+
+shellcheck:
+       @if type shellcheck > /dev/null 2>&1; then \
+               (find ${top_srcdir} -type f -name '*.sh.in' -o -type f \
+                -name '*.sh'; find etc/init.d/zfs*.in -type f) | \
+                grep -v 'zfs-script-config' | \
+                while read file; do \
+                       shellcheck --format gcc "$$file"; \
+                done; \
+        fi
+
+ctags:
+       $(RM) tags
+       find $(top_srcdir) -name .git -prune -o -name '*.[hc]' | xargs ctags
+
+etags:
+       $(RM) TAGS
+       find $(top_srcdir) -name .pc -prune -o -name '*.[hc]' | xargs etags -a
+
+tags: ctags etags
+
+pkg: @DEFAULT_PACKAGE@
+pkg-kmod: @DEFAULT_PACKAGE@-kmod
+pkg-utils: @DEFAULT_PACKAGE@-utils
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/TEST b/zfs/TEST
deleted file mode 100644 (file)
index eba35a3..0000000
--- a/zfs/TEST
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-### prepare
-#TEST_PREPARE_WATCHDOG="no"
-
-### SPLAT
-#TEST_SPLAT_SKIP="yes"
-#TEST_SPLAT_OPTIONS="-acvx"
-
-### ztest
-#TEST_ZTEST_SKIP="yes"
-#TEST_ZTEST_TIMEOUT=1800
-#TEST_ZTEST_DIR="/var/tmp/"
-#TEST_ZTEST_OPTIONS="-V"
-
-### ziltest
-#TEST_ZILTEST_SKIP="yes"
-#TEST_ZILTEST_OPTIONS=""
-
-### zconfig
-#TEST_ZCONFIG_SKIP="yes"
-TEST_ZCONFIG_OPTIONS="-c -s10"
-
-### zimport
-#TEST_ZIMPORT_SKIP="yes"
-#TEST_ZIMPORT_DIR="/var/tmp/zimport"
-#TEST_ZIMPORT_VERSIONS="master installed"
-#TEST_ZIMPORT_POOLS="zol-0.6.1 zol-0.6.2 master installed"
-#TEST_ZIMPORT_OPTIONS="-c"
-
-### xfstests
-#TEST_XFSTESTS_SKIP="yes"
-#TEST_XFSTESTS_URL="https://github.com/behlendorf/xfstests/archive/"
-#TEST_XFSTESTS_VER="zfs.tar.gz"
-#TEST_XFSTESTS_POOL="tank"
-#TEST_XFSTESTS_FS="xfstests"
-#TEST_XFSTESTS_VDEV="/var/tmp/vdev"
-#TEST_XFSTESTS_OPTIONS=""
-
-### filebench
-#TEST_FILEBENCH_SKIP="yes"
-#TEST_FILEBENCH_URL="http://build.zfsonlinux.org/"
-#TEST_FILEBENCH_VER="filebench-1.4.9.1.tar.gz"
-#TEST_FILEBENCH_RUNTIME=10
-#TEST_FILEBENCH_POOL="tank"
-#TEST_FILEBENCH_FS="filebench"
-#TEST_FILEBENCH_VDEV="/var/tmp/vdev"
-#TEST_FILEBENCH_DIR="/$TEST_FILEBENCH_POOL/$TEST_FILEBENCH_FS"
-#TEST_FILEBENCH_OPTIONS=""
-
-### zfsstress
-#TEST_ZFSSTRESS_SKIP="yes"
-#TEST_ZFSSTRESS_URL="https://github.com/nedbass/zfsstress/archive/"
-#TEST_ZFSSTRESS_VER="master.tar.gz"
-#TEST_ZFSSTRESS_RUNTIME=300
-#TEST_ZFSSTRESS_POOL="tank"
-#TEST_ZFSSTRESS_FS="fish"
-#TEST_ZFSSTRESS_VDEV="/var/tmp/vdev"
-#TEST_ZFSSTRESS_DIR="/$TEST_ZFSSTRESS_POOL/$TEST_ZFSSTRESS_FS"
-#TEST_ZFSSTRESS_OPTIONS=""
-
-### per-builder customization
-#
-# BB_NAME=builder-name <distribution-version-architecture-type>
-# - distribution=Amazon,Debian,Fedora,RHEL,SUSE,Ubuntu
-# - version=x.y
-# - architecture=x86_64,i686,arm,aarch64
-# - type=build,test
-#
-case "$BB_NAME" in
-Amazon*)
-    ;;
-CentOS*)
-    # Sporadic segmentation faults
-    TEST_ZTEST_SKIP="yes"
-    # Sporadic VERIFY(!zilog_is_dirty(zilog)) failed
-    TEST_ZILTEST_SKIP="yes"
-    ;;
-Debian*)
-    ;;
-Fedora*)
-    ;;
-RHEL*)
-    ;;
-SUSE*)
-    ;;
-Ubuntu*)
-    ;;
-*)
-    ;;
-esac
diff --git a/zfs/aclocal.m4 b/zfs/aclocal.m4
new file mode 100644 (file)
index 0000000..758cbec
--- /dev/null
@@ -0,0 +1,1295 @@
+# generated automatically by aclocal 1.15 -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# 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.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'.])])
+
+# Copyright (C) 2002-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_AUTOMAKE_VERSION(VERSION)
+# ----------------------------
+# Automake X.Y traces this macro to ensure aclocal.m4 has been
+# generated from the m4 files accompanying Automake X.Y.
+# (This private macro should not be called outside this file.)
+AC_DEFUN([AM_AUTOMAKE_VERSION],
+[am__api_version='1.15'
+dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
+dnl require some minimum version.  Point them to the right macro.
+m4_if([$1], [1.15], [],
+      [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
+])
+
+# _AM_AUTOCONF_VERSION(VERSION)
+# -----------------------------
+# aclocal traces this macro to find the Autoconf version.
+# This is a private macro too.  Using m4_define simplifies
+# the logic in aclocal, which can simply ignore this definition.
+m4_define([_AM_AUTOCONF_VERSION], [])
+
+# AM_SET_CURRENT_AUTOMAKE_VERSION
+# -------------------------------
+# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
+# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
+AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
+[AM_AUTOMAKE_VERSION([1.15])dnl
+m4_ifndef([AC_AUTOCONF_VERSION],
+  [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
+_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
+
+# Figure out how to run the assembler.                      -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_AS
+# ----------
+AC_DEFUN([AM_PROG_AS],
+[# By default we simply use the C compiler to build assembly code.
+AC_REQUIRE([AC_PROG_CC])
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+AC_ARG_VAR([CCAS],      [assembler compiler command (defaults to CC)])
+AC_ARG_VAR([CCASFLAGS], [assembler compiler flags (defaults to CFLAGS)])
+_AM_IF_OPTION([no-dependencies],, [_AM_DEPENDENCIES([CCAS])])dnl
+])
+
+# AM_AUX_DIR_EXPAND                                         -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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/../..'.
+#
+# Of course, Automake must honor this variable whenever it calls a
+# tool from the auxiliary directory.  The problem is that $srcdir (and
+# therefore $ac_aux_dir as well) can be either absolute or relative,
+# depending on how configure is run.  This is pretty annoying, since
+# it makes $ac_aux_dir quite unusable in subdirectories: in the top
+# source directory, any form will work fine, but in subdirectories a
+# relative path needs to be adjusted first.
+#
+# $ac_aux_dir/missing
+#    fails when called from a subdirectory if $ac_aux_dir is relative
+# $top_srcdir/$ac_aux_dir/missing
+#    fails if $ac_aux_dir is absolute,
+#    fails when called from a subdirectory in a VPATH build with
+#          a relative $ac_aux_dir
+#
+# 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
+# start a VPATH build or use an absolute $srcdir.
+#
+# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
+# iff we strip the leading $srcdir from $ac_aux_dir.  That would be:
+#   am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
+# and then we would define $MISSING as
+#   MISSING="\${SHELL} $am_aux_dir/missing"
+# This will work as long as MISSING is not called from configure, because
+# unfortunately $(top_srcdir) has no meaning in configure.
+# However there are other variables, like CC, which are often used in
+# configure, and could therefore not use this "fixed" $ac_aux_dir.
+#
+# Another solution, used here, is to always expand $ac_aux_dir to an
+# absolute PATH.  The drawback is that using absolute paths prevent a
+# configured tree to be moved without reconfiguration.
+
+AC_DEFUN([AM_AUX_DIR_EXPAND],
+[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+])
+
+# AM_CONDITIONAL                                            -*- Autoconf -*-
+
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_CONDITIONAL(NAME, SHELL-CONDITION)
+# -------------------------------------
+# Define a conditional.
+AC_DEFUN([AM_CONDITIONAL],
+[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
+_AM_SUBST_NOTMAKE([$1_FALSE])dnl
+m4_define([_AM_COND_VALUE_$1], [$2])dnl
+if $2; then
+  $1_TRUE=
+  $1_FALSE='#'
+else
+  $1_TRUE='#'
+  $1_FALSE=
+fi
+AC_CONFIG_COMMANDS_PRE(
+[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
+  AC_MSG_ERROR([[conditional "$1" was never defined.
+Usually this means the macro was only invoked conditionally.]])
+fi])])
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# 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
+# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
+
+
+# _AM_DEPENDENCIES(NAME)
+# ----------------------
+# See how the compiler implements dependency checking.
+# 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
+# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
+# dependency, and given that the user is not expected to run this macro,
+# just rely on AC_PROG_CC.
+AC_DEFUN([_AM_DEPENDENCIES],
+[AC_REQUIRE([AM_SET_DEPDIR])dnl
+AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
+AC_REQUIRE([AM_MAKE_INCLUDE])dnl
+AC_REQUIRE([AM_DEP_TRACK])dnl
+
+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],
+[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_$1_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
+  fi
+  am__universal=false
+  m4_case([$1], [CC],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac],
+    [CXX],
+    [case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac])
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_$1_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_$1_dependencies_compiler_type=none
+fi
+])
+AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
+AM_CONDITIONAL([am__fastdep$1], [
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_$1_dependencies_compiler_type" = gcc3])
+])
+
+
+# AM_SET_DEPDIR
+# -------------
+# Choose a directory name for dependency files.
+# 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
+])
+
+
+# AM_DEP_TRACK
+# ------------
+AC_DEFUN([AM_DEP_TRACK],
+[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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+
+# _AM_OUTPUT_DEPENDENCY_COMMANDS
+# ------------------------------
+AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
+[{
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`AS_DIRNAME("$mf")`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`AS_DIRNAME(["$file"])`
+      AS_MKDIR_P([$dirpart/$fdir])
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+])# _AM_OUTPUT_DEPENDENCY_COMMANDS
+
+
+# AM_OUTPUT_DEPENDENCY_COMMANDS
+# -----------------------------
+# This macro should only be invoked once -- use via AC_REQUIRE.
+#
+# This code is only required when automatic dependency tracking
+# is enabled.  FIXME.  This creates each '.P' file that we will
+# need in order to bootstrap the dependency handling code.
+AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
+[AC_CONFIG_COMMANDS([depfiles],
+     [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
+     [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
+])
+
+# Do all the work for Automake.                             -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# 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.
+
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
+# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
+# AM_INIT_AUTOMAKE([OPTIONS])
+# -----------------------------------------------
+# The call with PACKAGE and VERSION arguments is the old style
+# call (pre autoconf-2.50), which is being phased out.  PACKAGE
+# and VERSION should now be passed to AC_INIT and removed from
+# the call to AM_INIT_AUTOMAKE.
+# We support both call styles for the transition.  After
+# the next Automake release, Autoconf can make the AC_INIT
+# 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.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
+AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
+AC_REQUIRE([AC_PROG_INSTALL])dnl
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+AC_SUBST([CYGPATH_W])
+
+# Define the identity of the package.
+dnl Distinguish between old-style and new-style calls.
+m4_ifval([$2],
+[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], [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
+
+# 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])
+AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
+AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility.  To be removed once Automake 1.9.x
+# dies out for good.  For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
+# We need awk for the "check" target (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([AC_PROG_MAKE_SET])dnl
+AC_REQUIRE([AM_SET_LEADING_DOT])dnl
+_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
+             [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
+                            [_AM_PROG_TAR([v7])])])
+_AM_IF_OPTION([no-dependencies],,
+[AC_PROVIDE_IFELSE([AC_PROG_CC],
+                 [_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])],
+                 [m4_define([AC_PROG_CXX],
+                            m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJC],
+                 [_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
+])
+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
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+  fi
+fi
+dnl The trailing newline in this macro's definition is deliberate, for
+dnl backward compatibility and to allow trailing 'dnl'-style comments
+dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841.
+])
+
+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],
+m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
+
+# When config.status generates a header, we must update the stamp-h file.
+# This file resides in the same directory as the config header
+# that is generated.  The stamp files are numbered to have different names.
+
+# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
+# loop where config.status creates the headers, so we can generate
+# our stamp files there.
+AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
+[# Compute $1's index in $config_headers.
+_am_arg=$1
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_SH
+# ------------------
+# Define $install_sh.
+AC_DEFUN([AM_PROG_INSTALL_SH],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+AC_SUBST([install_sh])])
+
+# Copyright (C) 2003-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# Check whether the underlying file-system supports filenames
+# with a leading dot.  For instance MS-DOS doesn't.
+AC_DEFUN([AM_SET_LEADING_DOT],
+[rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+AC_SUBST([am__leading_dot])])
+
+# Add --enable-maintainer-mode option to configure.         -*- Autoconf -*-
+# From Jim Meyering
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAINTAINER_MODE([DEFAULT-MODE])
+# ----------------------------------
+# Control maintainer-specific portions of Makefiles.
+# Default is to disable them, unless 'enable' is passed literally.
+# For symmetry, 'disable' may be passed as well.  Anyway, the user
+# can override the default with the --enable/--disable switch.
+AC_DEFUN([AM_MAINTAINER_MODE],
+[m4_case(m4_default([$1], [disable]),
+       [enable], [m4_define([am_maintainer_other], [disable])],
+       [disable], [m4_define([am_maintainer_other], [enable])],
+       [m4_define([am_maintainer_other], [enable])
+        m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
+AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles])
+  dnl maintainer-mode's default is 'disable' unless 'enable' is passed
+  AC_ARG_ENABLE([maintainer-mode],
+    [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode],
+      am_maintainer_other[ make rules and dependencies not useful
+      (and sometimes confusing) to the casual installer])],
+    [USE_MAINTAINER_MODE=$enableval],
+    [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
+  AC_MSG_RESULT([$USE_MAINTAINER_MODE])
+  AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
+  MAINT=$MAINTAINER_MODE_TRUE
+  AC_SUBST([MAINT])dnl
+]
+)
+
+# Check to see how 'make' treats includes.                 -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MAKE_INCLUDE()
+# -----------------
+# Check to see how make treats includes.
+AC_DEFUN([AM_MAKE_INCLUDE],
+[am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+AC_MSG_CHECKING([for style of include used by $am_make])
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+AC_SUBST([am__include])
+AC_SUBST([am__quote])
+AC_MSG_RESULT([$_am_result])
+rm -f confinc confmf
+])
+
+# Fake the existence of programs that GNU maintainers use.  -*- Autoconf -*-
+
+# Copyright (C) 1997-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_MISSING_PROG(NAME, PROGRAM)
+# ------------------------------
+AC_DEFUN([AM_MISSING_PROG],
+[AC_REQUIRE([AM_MISSING_HAS_RUN])
+$1=${$1-"${am_missing_run}$2"}
+AC_SUBST($1)])
+
+# AM_MISSING_HAS_RUN
+# ------------------
+# 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
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  AC_MSG_WARN(['missing' script is too old or missing])
+fi
+])
+
+# Helper functions for option handling.                     -*- Autoconf -*-
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_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])])
+
+# _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)])])
+
+# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
+# -------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+AC_DEFUN([_AM_IF_OPTION],
+[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake.  We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+  [whether $CC understands -c and -o together],
+  [am_cv_prog_cc_c_o],
+  [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2014 Free Software Foundation, Inc.
+#
+# 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_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+   ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane.    -*- Autoconf -*-
+
+# Copyright (C) 1996-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SANITY_CHECK
+# ---------------
+AC_DEFUN([AM_SANITY_CHECK],
+[AC_MSG_CHECKING([whether build environment is sane])
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[[\\\"\#\$\&\'\`$am_lf]]*)
+    AC_MSG_ERROR([unsafe absolute working directory name]);;
+esac
+case $srcdir in
+  *[[\\\"\#\$\&\'\`$am_lf\ \   ]]*)
+    AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
+esac
+
+# 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 (
+   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
+   # Ok.
+   :
+else
+   AC_MSG_ERROR([newly created file is older than distributed files!
+Check your system clock])
+fi
+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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_PROG_INSTALL_STRIP
+# ---------------------
+# 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
+# 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
+# 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'.
+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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_SUBST_NOTMAKE(VARIABLE)
+# ---------------------------
+# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
+# This macro is traced by Automake.
+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-2014 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# _AM_PROG_TAR(FORMAT)
+# --------------------
+# Check how to create a tarball in format FORMAT.
+# 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
+# $tardir.
+#     tardir=directory && $(am__tar) > result.tar
+#
+# 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.  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'
+
+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],
+    [],
+
+  [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
+
+  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
+
+m4_include([config/always-no-bool-compare.m4])
+m4_include([config/always-no-unused-but-set-variable.m4])
+m4_include([config/dkms.m4])
+m4_include([config/kernel-acl.m4])
+m4_include([config/kernel-automount.m4])
+m4_include([config/kernel-bdev-block-device-operations.m4])
+m4_include([config/kernel-bdev-logical-size.m4])
+m4_include([config/kernel-bdev-physical-size.m4])
+m4_include([config/kernel-bdi-setup-and-register.m4])
+m4_include([config/kernel-bio-bvec-iter.m4])
+m4_include([config/kernel-bio-end-io-t-args.m4])
+m4_include([config/kernel-bio-failfast.m4])
+m4_include([config/kernel-bio-rw-barrier.m4])
+m4_include([config/kernel-bio-rw-discard.m4])
+m4_include([config/kernel-blk-queue-flush.m4])
+m4_include([config/kernel-blk-queue-max-hw-sectors.m4])
+m4_include([config/kernel-blk-queue-max-segments.m4])
+m4_include([config/kernel-blkdev-get-by-path.m4])
+m4_include([config/kernel-blkdev-get.m4])
+m4_include([config/kernel-block-device-operations-release-void.m4])
+m4_include([config/kernel-check-disk-size-change.m4])
+m4_include([config/kernel-clear-inode.m4])
+m4_include([config/kernel-commit-metadata.m4])
+m4_include([config/kernel-create-nameidata.m4])
+m4_include([config/kernel-current_bio_tail.m4])
+m4_include([config/kernel-d-make-root.m4])
+m4_include([config/kernel-d-obtain-alias.m4])
+m4_include([config/kernel-d-prune-aliases.m4])
+m4_include([config/kernel-declare-event-class.m4])
+m4_include([config/kernel-dentry-operations.m4])
+m4_include([config/kernel-dirty-inode.m4])
+m4_include([config/kernel-discard-granularity.m4])
+m4_include([config/kernel-elevator-change.m4])
+m4_include([config/kernel-encode-fh-inode.m4])
+m4_include([config/kernel-evict-inode.m4])
+m4_include([config/kernel-fallocate.m4])
+m4_include([config/kernel-file-inode.m4])
+m4_include([config/kernel-fmode-t.m4])
+m4_include([config/kernel-follow-down-one.m4])
+m4_include([config/kernel-follow-link-nameidata.m4])
+m4_include([config/kernel-fsync.m4])
+m4_include([config/kernel-generic_io_acct.m4])
+m4_include([config/kernel-get-disk-ro.m4])
+m4_include([config/kernel-get-gendisk.m4])
+m4_include([config/kernel-insert-inode-locked.m4])
+m4_include([config/kernel-invalidate-bdev-args.m4])
+m4_include([config/kernel-is_owner_or_cap.m4])
+m4_include([config/kernel-kmap-atomic-args.m4])
+m4_include([config/kernel-kobj-name-len.m4])
+m4_include([config/kernel-lookup-bdev.m4])
+m4_include([config/kernel-lookup-nameidata.m4])
+m4_include([config/kernel-lseek-execute.m4])
+m4_include([config/kernel-mk-request-fn.m4])
+m4_include([config/kernel-mkdir-umode-t.m4])
+m4_include([config/kernel-mount-nodev.m4])
+m4_include([config/kernel-open-bdev-exclusive.m4])
+m4_include([config/kernel-put-link-nameidata.m4])
+m4_include([config/kernel-security-inode-init.m4])
+m4_include([config/kernel-set-nlink.m4])
+m4_include([config/kernel-sget-args.m4])
+m4_include([config/kernel-show-options.m4])
+m4_include([config/kernel-shrink.m4])
+m4_include([config/kernel-truncate-range.m4])
+m4_include([config/kernel-truncate-setsize.m4])
+m4_include([config/kernel-vfs-iterate.m4])
+m4_include([config/kernel-vfs-rw-iterate.m4])
+m4_include([config/kernel-xattr-handler.m4])
+m4_include([config/kernel.m4])
+m4_include([config/libtool.m4])
+m4_include([config/ltoptions.m4])
+m4_include([config/ltsugar.m4])
+m4_include([config/ltversion.m4])
+m4_include([config/lt~obsolete.m4])
+m4_include([config/mount-helper.m4])
+m4_include([config/user-arch.m4])
+m4_include([config/user-dracut.m4])
+m4_include([config/user-frame-larger-than.m4])
+m4_include([config/user-libblkid.m4])
+m4_include([config/user-libuuid.m4])
+m4_include([config/user-runstatedir.m4])
+m4_include([config/user-systemd.m4])
+m4_include([config/user-sysvinit.m4])
+m4_include([config/user-udev.m4])
+m4_include([config/user-zlib.m4])
+m4_include([config/user.m4])
+m4_include([config/zfs-build.m4])
+m4_include([config/zfs-meta.m4])
diff --git a/zfs/cmd/Makefile.am b/zfs/cmd/Makefile.am
deleted file mode 100644 (file)
index 05f42a5..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-SUBDIRS  = zfs zpool zdb zhack zinject zstreamdump ztest zpios
-SUBDIRS += mount_zfs fsck_zfs zvol_id vdev_id arcstat dbufstat zed
-SUBDIRS += arc_summary
diff --git a/zfs/cmd/Makefile.in b/zfs/cmd/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/arc_summary/Makefile.am b/zfs/cmd/arc_summary/Makefile.am
deleted file mode 100644 (file)
index 815af3b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dist_bin_SCRIPTS = arc_summary.py
diff --git a/zfs/cmd/arc_summary/Makefile.in b/zfs/cmd/arc_summary/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/arc_summary/arc_summary.py b/zfs/cmd/arc_summary/arc_summary.py
deleted file mode 100755 (executable)
index 25238f3..0000000
+++ /dev/null
@@ -1,1148 +0,0 @@
-#!/usr/bin/python
-#
-# $Id: arc_summary.pl,v 388:e27800740aa2 2011-07-08 02:53:29Z jhell $
-#
-# Copyright (c) 2008 Ben Rockwood <benr@cuddletech.com>,
-# Copyright (c) 2010 Martin Matuska <mm@FreeBSD.org>,
-# Copyright (c) 2010-2011 Jason J. Hellenthal <jhell@DataIX.net>,
-# All rights reserved.
-#
-# Redistribution and use in source and binary forms, with or without
-# modification, are permitted provided that the following conditions
-# are met:
-#
-# 1. Redistributions of source code must retain the above copyright
-#    notice, this list of conditions and the following disclaimer.
-# 2. Redistributions in binary form must reproduce the above copyright
-#    notice, this list of conditions and the following disclaimer in the
-#    documentation and/or other materials provided with the distribution.
-#
-# THIS SOFTWARE IS PROVIDED BY AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-# ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
-# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-# SUCH DAMAGE.
-#
-# If you are having troubles when using this script from cron(8) please try
-# adjusting your PATH before reporting problems.
-#
-# /usr/bin & /sbin
-#
-# Binaries used are:
-#
-# dc(1), kldstat(8), sed(1), sysctl(8) & vmstat(8)
-#
-# Binaries that I am working on phasing out are:
-#
-# dc(1) & sed(1)
-
-import sys
-import time
-import getopt
-import re
-from os import listdir
-from subprocess import Popen, PIPE
-from decimal import Decimal as D
-
-
-usetunable = True
-show_tunable_descriptions = False
-alternate_tunable_layout = False
-kstat_pobj = re.compile("^([^:]+):\s+(.+)\s*$", flags=re.M)
-
-
-def get_Kstat():
-    def load_proc_kstats(fn, namespace):
-        kstats = [line.strip() for line in open(fn)]
-        del kstats[0:2]
-        for kstat in kstats:
-            kstat = kstat.strip()
-            name, unused, value = kstat.split()
-            Kstat[namespace + name] = D(value)
-
-    Kstats = [
-        "hw.pagesize",
-        "hw.physmem",
-        "kern.maxusers",
-        "vm.kmem_map_free",
-        "vm.kmem_map_size",
-        "vm.kmem_size",
-        "vm.kmem_size_max",
-        "vm.kmem_size_min",
-        "vm.kmem_size_scale",
-        "vm.stats",
-        "vm.swap_total",
-        "vm.swap_reserved",
-        "kstat.zfs",
-        "vfs.zfs"
-    ]
-    Kstat = {}
-    load_proc_kstats('/proc/spl/kstat/zfs/arcstats',
-            'kstat.zfs.misc.arcstats.')
-    load_proc_kstats('/proc/spl/kstat/zfs/zfetchstats',
-            'kstat.zfs.misc.zfetchstats.')
-    load_proc_kstats('/proc/spl/kstat/zfs/vdev_cache_stats',
-            'kstat.zfs.misc.vdev_cache_stats.')
-
-    return Kstat
-
-def div1():
-    sys.stdout.write("\n")
-    for i in xrange(18):
-        sys.stdout.write("%s" % "----")
-    sys.stdout.write("\n")
-
-
-def div2():
-    sys.stdout.write("\n")
-
-
-def fBytes(Bytes=0, Decimal=2):
-    kbytes = (2 ** 10)
-    mbytes = (2 ** 20)
-    gbytes = (2 ** 30)
-    tbytes = (2 ** 40)
-    pbytes = (2 ** 50)
-    ebytes = (2 ** 60)
-    zbytes = (2 ** 70)
-    ybytes = (2 ** 80)
-
-    if Bytes >= ybytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / ybytes) + "\tYiB"
-    elif Bytes >= zbytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / zbytes) + "\tZiB"
-    elif Bytes >= ebytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / ebytes) + "\tEiB"
-    elif Bytes >= pbytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / pbytes) + "\tPiB"
-    elif Bytes >= tbytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / tbytes) + "\tTiB"
-    elif Bytes >= gbytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / gbytes) + "\tGiB"
-    elif Bytes >= mbytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / mbytes) + "\tMiB"
-    elif Bytes >= kbytes:
-        return str("%0." + str(Decimal) + "f") % (Bytes / kbytes) + "\tKiB"
-    elif Bytes == 0:
-        return str("%d" % 0) + "\tBytes"
-    else:
-        return str("%d" % Bytes) + "\tBytes"
-
-
-def fHits(Hits=0, Decimal=2):
-    khits = (10 ** 3)
-    mhits = (10 ** 6)
-    bhits = (10 ** 9)
-    thits = (10 ** 12)
-    qhits = (10 ** 15)
-    Qhits = (10 ** 18)
-    shits = (10 ** 21)
-    Shits = (10 ** 24)
-
-    if Hits >= Shits:
-        return str("%0." + str(Decimal) + "f") % (Hits / Shits) + "S"
-    elif Hits >= shits:
-        return str("%0." + str(Decimal) + "f") % (Hits / shits) + "s"
-    elif Hits >= Qhits:
-        return str("%0." + str(Decimal) + "f") % (Hits / Qhits) + "Q"
-    elif Hits >= qhits:
-        return str("%0." + str(Decimal) + "f") % (Hits / qhits) + "q"
-    elif Hits >= thits:
-        return str("%0." + str(Decimal) + "f") % (Hits / thits) + "t"
-    elif Hits >= bhits:
-        return str("%0." + str(Decimal) + "f") % (Hits / bhits) + "b"
-    elif Hits >= mhits:
-        return str("%0." + str(Decimal) + "f") % (Hits / mhits) + "m"
-    elif Hits >= khits:
-        return str("%0." + str(Decimal) + "f") % (Hits / khits) + "k"
-    elif Hits == 0:
-        return str("%d" % 0)
-    else:
-        return str("%d" % Hits)
-
-
-def fPerc(lVal=0, rVal=0, Decimal=2):
-    if rVal > 0:
-        return str("%0." + str(Decimal) + "f") % (100 * (lVal / rVal)) + "%"
-    else:
-        return str("%0." + str(Decimal) + "f") % 100 + "%"
-
-
-def get_arc_summary(Kstat):
-
-    output = {}
-    memory_throttle_count = Kstat[
-        "kstat.zfs.misc.arcstats.memory_throttle_count"
-        ]
-
-    if memory_throttle_count > 0:
-        output['health'] = 'THROTTLED'
-    else:
-        output['health'] = 'HEALTHY'
-
-    output['memory_throttle_count'] = fHits(memory_throttle_count)
-
-    ### ARC Misc. ###
-    deleted = Kstat["kstat.zfs.misc.arcstats.deleted"]
-    mutex_miss = Kstat["kstat.zfs.misc.arcstats.mutex_miss"]
-
-    ### ARC Misc. ###
-    output["arc_misc"] = {}
-    output["arc_misc"]["deleted"] = fHits(deleted)
-    output["arc_misc"]['mutex_miss'] = fHits(mutex_miss)
-    output["arc_misc"]['evict_skips'] = fHits(mutex_miss)
-
-    ### ARC Sizing ###
-    arc_size = Kstat["kstat.zfs.misc.arcstats.size"]
-    mru_size = Kstat["kstat.zfs.misc.arcstats.p"]
-    target_max_size = Kstat["kstat.zfs.misc.arcstats.c_max"]
-    target_min_size = Kstat["kstat.zfs.misc.arcstats.c_min"]
-    target_size = Kstat["kstat.zfs.misc.arcstats.c"]
-
-    target_size_ratio = (target_max_size / target_min_size)
-
-    ### ARC Sizing ###
-    output['arc_sizing'] = {}
-    output['arc_sizing']['arc_size'] = {
-        'per': fPerc(arc_size, target_max_size),
-        'num': fBytes(arc_size),
-    }
-    output['arc_sizing']['target_max_size'] = {
-        'ratio': target_size_ratio,
-        'num': fBytes(target_max_size),
-    }
-    output['arc_sizing']['target_min_size'] = {
-        'per': fPerc(target_min_size, target_max_size),
-        'num': fBytes(target_min_size),
-    }
-    output['arc_sizing']['target_size'] = {
-        'per': fPerc(target_size, target_max_size),
-        'num': fBytes(target_size),
-    }
-
-    ### ARC Hash Breakdown ###
-    output['arc_hash_break'] = {}
-    output['arc_hash_break']['hash_chain_max'] = Kstat[
-        "kstat.zfs.misc.arcstats.hash_chain_max"
-        ]
-    output['arc_hash_break']['hash_chains'] = Kstat[
-        "kstat.zfs.misc.arcstats.hash_chains"
-        ]
-    output['arc_hash_break']['hash_collisions'] = Kstat[
-        "kstat.zfs.misc.arcstats.hash_collisions"
-        ]
-    output['arc_hash_break']['hash_elements'] = Kstat[
-        "kstat.zfs.misc.arcstats.hash_elements"
-        ]
-    output['arc_hash_break']['hash_elements_max'] = Kstat[
-        "kstat.zfs.misc.arcstats.hash_elements_max"
-        ]
-
-    output['arc_size_break'] = {}
-    if arc_size > target_size:
-        mfu_size = (arc_size - mru_size)
-        output['arc_size_break']['recently_used_cache_size'] = {
-            'per': fPerc(mru_size, arc_size),
-            'num': fBytes(mru_size),
-        }
-        output['arc_size_break']['frequently_used_cache_size'] = {
-            'per': fPerc(mfu_size, arc_size),
-            'num': fBytes(mfu_size),
-        }
-
-    elif arc_size < target_size:
-        mfu_size = (target_size - mru_size)
-        output['arc_size_break']['recently_used_cache_size'] = {
-            'per': fPerc(mru_size, target_size),
-            'num': fBytes(mru_size),
-        }
-        output['arc_size_break']['frequently_used_cache_size'] = {
-            'per': fPerc(mfu_size, target_size),
-            'num': fBytes(mfu_size),
-        }
-
-    ### ARC Hash Breakdown ###
-    hash_chain_max = Kstat["kstat.zfs.misc.arcstats.hash_chain_max"]
-    hash_chains = Kstat["kstat.zfs.misc.arcstats.hash_chains"]
-    hash_collisions = Kstat["kstat.zfs.misc.arcstats.hash_collisions"]
-    hash_elements = Kstat["kstat.zfs.misc.arcstats.hash_elements"]
-    hash_elements_max = Kstat["kstat.zfs.misc.arcstats.hash_elements_max"]
-
-    output['arc_hash_break'] = {}
-    output['arc_hash_break']['elements_max'] = fHits(hash_elements_max)
-    output['arc_hash_break']['elements_current'] = {
-        'per': fPerc(hash_elements, hash_elements_max),
-        'num': fHits(hash_elements),
-        }
-    output['arc_hash_break']['collisions'] = fHits(hash_collisions)
-    output['arc_hash_break']['chain_max'] = fHits(hash_chain_max)
-    output['arc_hash_break']['chains'] = fHits(hash_chains)
-
-    return output
-
-
-def _arc_summary(Kstat):
-    ### ARC Sizing ###
-    arc = get_arc_summary(Kstat)
-
-    sys.stdout.write("ARC Summary: (%s)\n" % arc['health'])
-
-    sys.stdout.write("\tMemory Throttle Count:\t\t\t%s\n" %
-            arc['memory_throttle_count'])
-    sys.stdout.write("\n")
-
-    ### ARC Misc. ###
-    sys.stdout.write("ARC Misc:\n")
-    sys.stdout.write("\tDeleted:\t\t\t\t%s\n" % arc['arc_misc']['deleted'])
-    sys.stdout.write("\tMutex Misses:\t\t\t\t%s\n" %
-            arc['arc_misc']['mutex_miss'])
-    sys.stdout.write("\tEvict Skips:\t\t\t\t%s\n" %
-            arc['arc_misc']['mutex_miss'])
-    sys.stdout.write("\n")
-
-    ### ARC Sizing ###
-    sys.stdout.write("ARC Size:\t\t\t\t%s\t%s\n" % (
-        arc['arc_sizing']['arc_size']['per'],
-        arc['arc_sizing']['arc_size']['num']
-        )
-    )
-    sys.stdout.write("\tTarget Size: (Adaptive)\t\t%s\t%s\n" % (
-        arc['arc_sizing']['target_size']['per'],
-        arc['arc_sizing']['target_size']['num'],
-        )
-    )
-
-    sys.stdout.write("\tMin Size (Hard Limit):\t\t%s\t%s\n" % (
-        arc['arc_sizing']['target_min_size']['per'],
-        arc['arc_sizing']['target_min_size']['num'],
-        )
-    )
-
-    sys.stdout.write("\tMax Size (High Water):\t\t%d:1\t%s\n" % (
-        arc['arc_sizing']['target_max_size']['ratio'],
-        arc['arc_sizing']['target_max_size']['num'],
-        )
-    )
-
-    sys.stdout.write("\nARC Size Breakdown:\n")
-    sys.stdout.write("\tRecently Used Cache Size:\t%s\t%s\n" % (
-        arc['arc_size_break']['recently_used_cache_size']['per'],
-        arc['arc_size_break']['recently_used_cache_size']['num'],
-        )
-    )
-    sys.stdout.write("\tFrequently Used Cache Size:\t%s\t%s\n" % (
-        arc['arc_size_break']['frequently_used_cache_size']['per'],
-        arc['arc_size_break']['frequently_used_cache_size']['num'],
-        )
-    )
-
-    sys.stdout.write("\n")
-
-    ### ARC Hash Breakdown ###
-    sys.stdout.write("ARC Hash Breakdown:\n")
-    sys.stdout.write("\tElements Max:\t\t\t\t%s\n" %
-            arc['arc_hash_break']['elements_max'])
-    sys.stdout.write("\tElements Current:\t\t%s\t%s\n" % (
-        arc['arc_hash_break']['elements_current']['per'],
-        arc['arc_hash_break']['elements_current']['num'],
-        )
-    )
-    sys.stdout.write("\tCollisions:\t\t\t\t%s\n" %
-            arc['arc_hash_break']['collisions'])
-    sys.stdout.write("\tChain Max:\t\t\t\t%s\n" %
-            arc['arc_hash_break']['chain_max'])
-    sys.stdout.write("\tChains:\t\t\t\t\t%s\n" %
-            arc['arc_hash_break']['chains'])
-
-
-def get_arc_efficiency(Kstat):
-    output = {}
-
-    arc_hits = Kstat["kstat.zfs.misc.arcstats.hits"]
-    arc_misses = Kstat["kstat.zfs.misc.arcstats.misses"]
-    demand_data_hits = Kstat["kstat.zfs.misc.arcstats.demand_data_hits"]
-    demand_data_misses = Kstat["kstat.zfs.misc.arcstats.demand_data_misses"]
-    demand_metadata_hits = Kstat[
-        "kstat.zfs.misc.arcstats.demand_metadata_hits"
-        ]
-    demand_metadata_misses = Kstat[
-        "kstat.zfs.misc.arcstats.demand_metadata_misses"
-        ]
-    mfu_ghost_hits = Kstat["kstat.zfs.misc.arcstats.mfu_ghost_hits"]
-    mfu_hits = Kstat["kstat.zfs.misc.arcstats.mfu_hits"]
-    mru_ghost_hits = Kstat["kstat.zfs.misc.arcstats.mru_ghost_hits"]
-    mru_hits = Kstat["kstat.zfs.misc.arcstats.mru_hits"]
-    prefetch_data_hits = Kstat["kstat.zfs.misc.arcstats.prefetch_data_hits"]
-    prefetch_data_misses = Kstat[
-        "kstat.zfs.misc.arcstats.prefetch_data_misses"
-        ]
-    prefetch_metadata_hits = Kstat[
-        "kstat.zfs.misc.arcstats.prefetch_metadata_hits"
-        ]
-    prefetch_metadata_misses = Kstat[
-        "kstat.zfs.misc.arcstats.prefetch_metadata_misses"
-        ]
-
-    anon_hits = arc_hits - (
-        mfu_hits + mru_hits + mfu_ghost_hits + mru_ghost_hits
-        )
-    arc_accesses_total = (arc_hits + arc_misses)
-    demand_data_total = (demand_data_hits + demand_data_misses)
-    prefetch_data_total = (prefetch_data_hits + prefetch_data_misses)
-    real_hits = (mfu_hits + mru_hits)
-
-    output["total_accesses"] = fHits(arc_accesses_total)
-    output["cache_hit_ratio"] = {
-        'per': fPerc(arc_hits, arc_accesses_total),
-        'num': fHits(arc_hits),
-    }
-    output["cache_miss_ratio"] = {
-        'per': fPerc(arc_misses, arc_accesses_total),
-        'num': fHits(arc_misses),
-    }
-    output["actual_hit_ratio"] = {
-        'per': fPerc(real_hits, arc_accesses_total),
-        'num': fHits(real_hits),
-    }
-    output["data_demand_efficiency"] = {
-        'per': fPerc(demand_data_hits, demand_data_total),
-        'num': fHits(demand_data_total),
-    }
-
-    if prefetch_data_total > 0:
-        output["data_prefetch_efficiency"] = {
-            'per': fPerc(prefetch_data_hits, prefetch_data_total),
-            'num': fHits(prefetch_data_total),
-        }
-
-    if anon_hits > 0:
-        output["cache_hits_by_cache_list"] = {}
-        output["cache_hits_by_cache_list"]["anonymously_used"] = {
-            'per': fPerc(anon_hits, arc_hits),
-            'num': fHits(anon_hits),
-        }
-
-    output["most_recently_used"] = {
-        'per': fPerc(mru_hits, arc_hits),
-        'num': fHits(mru_hits),
-    }
-    output["most_frequently_used"] = {
-        'per': fPerc(mfu_hits, arc_hits),
-        'num': fHits(mfu_hits),
-    }
-    output["most_recently_used_ghost"] = {
-        'per': fPerc(mru_ghost_hits, arc_hits),
-        'num': fHits(mru_ghost_hits),
-    }
-    output["most_frequently_used_ghost"] = {
-        'per': fPerc(mfu_ghost_hits, arc_hits),
-        'num': fHits(mfu_ghost_hits),
-    }
-
-    output["cache_hits_by_data_type"] = {}
-    output["cache_hits_by_data_type"]["demand_data"] = {
-        'per': fPerc(demand_data_hits, arc_hits),
-        'num': fHits(demand_data_hits),
-    }
-    output["cache_hits_by_data_type"]["prefetch_data"] = {
-        'per': fPerc(prefetch_data_hits, arc_hits),
-        'num': fHits(prefetch_data_hits),
-    }
-    output["cache_hits_by_data_type"]["demand_metadata"] = {
-        'per': fPerc(demand_metadata_hits, arc_hits),
-        'num': fHits(demand_metadata_hits),
-    }
-    output["cache_hits_by_data_type"]["prefetch_metadata"] = {
-        'per': fPerc(prefetch_metadata_hits, arc_hits),
-        'num': fHits(prefetch_metadata_hits),
-    }
-
-    output["cache_misses_by_data_type"] = {}
-    output["cache_misses_by_data_type"]["demand_data"] = {
-        'per': fPerc(demand_data_misses, arc_misses),
-        'num': fHits(demand_data_misses),
-    }
-    output["cache_misses_by_data_type"]["prefetch_data"] = {
-        'per': fPerc(prefetch_data_misses, arc_misses),
-        'num': fHits(prefetch_data_misses),
-    }
-    output["cache_misses_by_data_type"]["demand_metadata"] = {
-        'per': fPerc(demand_metadata_misses, arc_misses),
-        'num': fHits(demand_metadata_misses),
-    }
-    output["cache_misses_by_data_type"]["prefetch_metadata"] = {
-        'per': fPerc(prefetch_metadata_misses, arc_misses),
-        'num': fHits(prefetch_metadata_misses),
-    }
-
-    return output
-
-
-def _arc_efficiency(Kstat):
-    arc = get_arc_efficiency(Kstat)
-
-    sys.stdout.write("ARC Total accesses:\t\t\t\t\t%s\n" %
-            arc['total_accesses'])
-    sys.stdout.write("\tCache Hit Ratio:\t\t%s\t%s\n" % (
-        arc['cache_hit_ratio']['per'],
-        arc['cache_hit_ratio']['num'],
-        )
-    )
-    sys.stdout.write("\tCache Miss Ratio:\t\t%s\t%s\n" % (
-        arc['cache_miss_ratio']['per'],
-        arc['cache_miss_ratio']['num'],
-        )
-    )
-
-    sys.stdout.write("\tActual Hit Ratio:\t\t%s\t%s\n" % (
-        arc['actual_hit_ratio']['per'],
-        arc['actual_hit_ratio']['num'],
-        )
-    )
-
-    sys.stdout.write("\n")
-    sys.stdout.write("\tData Demand Efficiency:\t\t%s\t%s\n" % (
-        arc['data_demand_efficiency']['per'],
-        arc['data_demand_efficiency']['num'],
-        )
-    )
-
-    if 'data_prefetch_efficiency' in arc:
-        sys.stdout.write("\tData Prefetch Efficiency:\t%s\t%s\n" % (
-            arc['data_prefetch_efficiency']['per'],
-            arc['data_prefetch_efficiency']['num'],
-            )
-        )
-    sys.stdout.write("\n")
-
-    sys.stdout.write("\tCACHE HITS BY CACHE LIST:\n")
-    if 'cache_hits_by_cache_list' in arc:
-        sys.stdout.write("\t  Anonymously Used:\t\t%s\t%s\n" % (
-            arc['cache_hits_by_cache_list']['anonymously_used']['per'],
-            arc['cache_hits_by_cache_list']['anonymously_used']['num'],
-            )
-        )
-    sys.stdout.write("\t  Most Recently Used:\t\t%s\t%s\n" % (
-        arc['most_recently_used']['per'],
-        arc['most_recently_used']['num'],
-        )
-    )
-    sys.stdout.write("\t  Most Frequently Used:\t\t%s\t%s\n" % (
-        arc['most_frequently_used']['per'],
-        arc['most_frequently_used']['num'],
-        )
-    )
-    sys.stdout.write("\t  Most Recently Used Ghost:\t%s\t%s\n" % (
-        arc['most_recently_used_ghost']['per'],
-        arc['most_recently_used_ghost']['num'],
-        )
-    )
-    sys.stdout.write("\t  Most Frequently Used Ghost:\t%s\t%s\n" % (
-        arc['most_frequently_used_ghost']['per'],
-        arc['most_frequently_used_ghost']['num'],
-        )
-    )
-
-    sys.stdout.write("\n\tCACHE HITS BY DATA TYPE:\n")
-    sys.stdout.write("\t  Demand Data:\t\t\t%s\t%s\n" % (
-        arc["cache_hits_by_data_type"]['demand_data']['per'],
-        arc["cache_hits_by_data_type"]['demand_data']['num'],
-        )
-    )
-    sys.stdout.write("\t  Prefetch Data:\t\t%s\t%s\n" % (
-        arc["cache_hits_by_data_type"]['prefetch_data']['per'],
-        arc["cache_hits_by_data_type"]['prefetch_data']['num'],
-        )
-    )
-    sys.stdout.write("\t  Demand Metadata:\t\t%s\t%s\n" % (
-        arc["cache_hits_by_data_type"]['demand_metadata']['per'],
-        arc["cache_hits_by_data_type"]['demand_metadata']['num'],
-        )
-    )
-    sys.stdout.write("\t  Prefetch Metadata:\t\t%s\t%s\n" % (
-        arc["cache_hits_by_data_type"]['prefetch_metadata']['per'],
-        arc["cache_hits_by_data_type"]['prefetch_metadata']['num'],
-        )
-    )
-
-    sys.stdout.write("\n\tCACHE MISSES BY DATA TYPE:\n")
-    sys.stdout.write("\t  Demand Data:\t\t\t%s\t%s\n" % (
-        arc["cache_misses_by_data_type"]['demand_data']['per'],
-        arc["cache_misses_by_data_type"]['demand_data']['num'],
-        )
-    )
-    sys.stdout.write("\t  Prefetch Data:\t\t%s\t%s\n" % (
-        arc["cache_misses_by_data_type"]['prefetch_data']['per'],
-        arc["cache_misses_by_data_type"]['prefetch_data']['num'],
-        )
-    )
-    sys.stdout.write("\t  Demand Metadata:\t\t%s\t%s\n" % (
-        arc["cache_misses_by_data_type"]['demand_metadata']['per'],
-        arc["cache_misses_by_data_type"]['demand_metadata']['num'],
-        )
-    )
-    sys.stdout.write("\t  Prefetch Metadata:\t\t%s\t%s\n" % (
-        arc["cache_misses_by_data_type"]['prefetch_metadata']['per'],
-        arc["cache_misses_by_data_type"]['prefetch_metadata']['num'],
-        )
-    )
-
-
-def get_l2arc_summary(Kstat):
-    output = {}
-
-    l2_abort_lowmem = Kstat["kstat.zfs.misc.arcstats.l2_abort_lowmem"]
-    l2_cksum_bad = Kstat["kstat.zfs.misc.arcstats.l2_cksum_bad"]
-    l2_evict_lock_retry = Kstat["kstat.zfs.misc.arcstats.l2_evict_lock_retry"]
-    l2_evict_reading = Kstat["kstat.zfs.misc.arcstats.l2_evict_reading"]
-    l2_feeds = Kstat["kstat.zfs.misc.arcstats.l2_feeds"]
-    l2_free_on_write = Kstat["kstat.zfs.misc.arcstats.l2_free_on_write"]
-    l2_hdr_size = Kstat["kstat.zfs.misc.arcstats.l2_hdr_size"]
-    l2_hits = Kstat["kstat.zfs.misc.arcstats.l2_hits"]
-    l2_io_error = Kstat["kstat.zfs.misc.arcstats.l2_io_error"]
-    l2_misses = Kstat["kstat.zfs.misc.arcstats.l2_misses"]
-    l2_rw_clash = Kstat["kstat.zfs.misc.arcstats.l2_rw_clash"]
-    l2_size = Kstat["kstat.zfs.misc.arcstats.l2_size"]
-    l2_asize = Kstat["kstat.zfs.misc.arcstats.l2_asize"]
-    l2_writes_done = Kstat["kstat.zfs.misc.arcstats.l2_writes_done"]
-    l2_writes_error = Kstat["kstat.zfs.misc.arcstats.l2_writes_error"]
-    l2_writes_sent = Kstat["kstat.zfs.misc.arcstats.l2_writes_sent"]
-
-    l2_access_total = (l2_hits + l2_misses)
-    output['l2_health_count'] = (l2_writes_error + l2_cksum_bad + l2_io_error)
-
-    output['l2_access_total'] = l2_access_total
-    output['l2_size'] = l2_size
-    output['l2_asize'] = l2_asize
-
-    if l2_size > 0 and l2_access_total > 0:
-
-        if output['l2_health_count'] > 0:
-            output["health"] = "DEGRADED"
-        else:
-            output["health"] = "HEALTHY"
-
-        output["low_memory_aborts"] = fHits(l2_abort_lowmem)
-        output["free_on_write"] = fHits(l2_free_on_write)
-        output["rw_clashes"] = fHits(l2_rw_clash)
-        output["bad_checksums"] = fHits(l2_cksum_bad)
-        output["io_errors"] = fHits(l2_io_error)
-
-        output["l2_arc_size"] = {}
-        output["l2_arc_size"]["adative"] = fBytes(l2_size)
-        output["l2_arc_size"]["actual"] = {
-            'per': fPerc(l2_asize, l2_size),
-            'num': fBytes(l2_asize)
-            }
-        output["l2_arc_size"]["head_size"] = {
-            'per': fPerc(l2_hdr_size, l2_size),
-            'num': fBytes(l2_hdr_size),
-        }
-
-        output["l2_arc_evicts"] = {}
-        output["l2_arc_evicts"]['lock_retries'] = fHits(l2_evict_lock_retry)
-        output["l2_arc_evicts"]['reading'] = fHits(l2_evict_reading)
-
-        output['l2_arc_breakdown'] = {}
-        output['l2_arc_breakdown']['value'] = fHits(l2_access_total)
-        output['l2_arc_breakdown']['hit_ratio'] = {
-            'per': fPerc(l2_hits, l2_access_total),
-            'num': fHits(l2_hits),
-        }
-        output['l2_arc_breakdown']['miss_ratio'] = {
-            'per': fPerc(l2_misses, l2_access_total),
-            'num': fHits(l2_misses),
-        }
-        output['l2_arc_breakdown']['feeds'] = fHits(l2_feeds)
-
-        output['l2_arc_buffer'] = {}
-
-        output['l2_arc_writes'] = {}
-        output['l2_writes_done'] = l2_writes_done
-        output['l2_writes_sent'] = l2_writes_sent
-        if l2_writes_done != l2_writes_sent:
-            output['l2_arc_writes']['writes_sent'] = {
-                'value': "FAULTED",
-                'num': fHits(l2_writes_sent),
-            }
-            output['l2_arc_writes']['done_ratio'] = {
-                'per': fPerc(l2_writes_done, l2_writes_sent),
-                'num': fHits(l2_writes_done),
-            }
-            output['l2_arc_writes']['error_ratio'] = {
-                'per': fPerc(l2_writes_error, l2_writes_sent),
-                'num': fHits(l2_writes_error),
-            }
-        else:
-            output['l2_arc_writes']['writes_sent'] = {
-                'per': fPerc(100),
-                'num': fHits(l2_writes_sent),
-            }
-
-    return output
-
-
-def _l2arc_summary(Kstat):
-
-    arc = get_l2arc_summary(Kstat)
-
-    if arc['l2_size'] > 0 and arc['l2_access_total'] > 0:
-        sys.stdout.write("L2 ARC Summary: ")
-        if arc['l2_health_count'] > 0:
-            sys.stdout.write("(DEGRADED)\n")
-        else:
-            sys.stdout.write("(HEALTHY)\n")
-        sys.stdout.write("\tLow Memory Aborts:\t\t\t%s\n" %
-                arc['low_memory_aborts'])
-        sys.stdout.write("\tFree on Write:\t\t\t\t%s\n" % arc['free_on_write'])
-        sys.stdout.write("\tR/W Clashes:\t\t\t\t%s\n" % arc['rw_clashes'])
-        sys.stdout.write("\tBad Checksums:\t\t\t\t%s\n" % arc['bad_checksums'])
-        sys.stdout.write("\tIO Errors:\t\t\t\t%s\n" % arc['io_errors'])
-        sys.stdout.write("\n")
-
-        sys.stdout.write("L2 ARC Size: (Adaptive)\t\t\t\t%s\n" %
-                arc["l2_arc_size"]["adative"])
-        sys.stdout.write("\tCompressed:\t\t\t%s\t%s\n" % (
-            arc["l2_arc_size"]["actual"]["per"],
-            arc["l2_arc_size"]["actual"]["num"],
-            )
-        )
-        sys.stdout.write("\tHeader Size:\t\t\t%s\t%s\n" % (
-            arc["l2_arc_size"]["head_size"]["per"],
-            arc["l2_arc_size"]["head_size"]["num"],
-            )
-        )
-        sys.stdout.write("\n")
-
-        if arc["l2_arc_evicts"]['lock_retries'] + \
-                arc["l2_arc_evicts"]["reading"] > 0:
-            sys.stdout.write("L2 ARC Evicts:\n")
-            sys.stdout.write("\tLock Retries:\t\t\t\t%s\n" %
-                    arc["l2_arc_evicts"]['lock_retries'])
-            sys.stdout.write("\tUpon Reading:\t\t\t\t%s\n" %
-                    arc["l2_arc_evicts"]["reading"])
-            sys.stdout.write("\n")
-
-        sys.stdout.write("L2 ARC Breakdown:\t\t\t\t%s\n" %
-                arc['l2_arc_breakdown']['value'])
-        sys.stdout.write("\tHit Ratio:\t\t\t%s\t%s\n" % (
-            arc['l2_arc_breakdown']['hit_ratio']['per'],
-            arc['l2_arc_breakdown']['hit_ratio']['num'],
-            )
-        )
-
-        sys.stdout.write("\tMiss Ratio:\t\t\t%s\t%s\n" % (
-            arc['l2_arc_breakdown']['miss_ratio']['per'],
-            arc['l2_arc_breakdown']['miss_ratio']['num'],
-            )
-        )
-
-        sys.stdout.write("\tFeeds:\t\t\t\t\t%s\n" %
-                arc['l2_arc_breakdown']['feeds'])
-        sys.stdout.write("\n")
-
-        sys.stdout.write("L2 ARC Writes:\n")
-        if arc['l2_writes_done'] != arc['l2_writes_sent']:
-            sys.stdout.write("\tWrites Sent: (%s)\t\t\t\t%s\n" % (
-                arc['l2_arc_writes']['writes_sent']['value'],
-                arc['l2_arc_writes']['writes_sent']['num'],
-                )
-            )
-            sys.stdout.write("\t  Done Ratio:\t\t\t%s\t%s\n" % (
-                arc['l2_arc_writes']['done_ratio']['per'],
-                arc['l2_arc_writes']['done_ratio']['num'],
-                )
-            )
-            sys.stdout.write("\t  Error Ratio:\t\t\t%s\t%s\n" % (
-                arc['l2_arc_writes']['error_ratio']['per'],
-                arc['l2_arc_writes']['error_ratio']['num'],
-                )
-            )
-        else:
-            sys.stdout.write("\tWrites Sent:\t\t\t%s\t%s\n" % (
-                arc['l2_arc_writes']['writes_sent']['per'],
-                arc['l2_arc_writes']['writes_sent']['num'],
-                )
-            )
-
-
-def get_dmu_summary(Kstat):
-    output = {}
-
-    zfetch_bogus_streams = Kstat["kstat.zfs.misc.zfetchstats.bogus_streams"]
-    zfetch_colinear_hits = Kstat["kstat.zfs.misc.zfetchstats.colinear_hits"]
-    zfetch_colinear_misses = \
-            Kstat["kstat.zfs.misc.zfetchstats.colinear_misses"]
-    zfetch_hits = Kstat["kstat.zfs.misc.zfetchstats.hits"]
-    zfetch_misses = Kstat["kstat.zfs.misc.zfetchstats.misses"]
-    zfetch_reclaim_failures = \
-            Kstat["kstat.zfs.misc.zfetchstats.reclaim_failures"]
-    zfetch_reclaim_successes = \
-            Kstat["kstat.zfs.misc.zfetchstats.reclaim_successes"]
-    zfetch_streams_noresets = \
-            Kstat["kstat.zfs.misc.zfetchstats.streams_noresets"]
-    zfetch_streams_resets = Kstat["kstat.zfs.misc.zfetchstats.streams_resets"]
-    zfetch_stride_hits = Kstat["kstat.zfs.misc.zfetchstats.stride_hits"]
-    zfetch_stride_misses = Kstat["kstat.zfs.misc.zfetchstats.stride_misses"]
-
-    zfetch_access_total = (zfetch_hits + zfetch_misses)
-    zfetch_colinear_total = (zfetch_colinear_hits + zfetch_colinear_misses)
-    zfetch_health_count = (zfetch_bogus_streams)
-    zfetch_reclaim_total = (zfetch_reclaim_successes + zfetch_reclaim_failures)
-    zfetch_streams_total = (zfetch_streams_resets + zfetch_streams_noresets +
-            zfetch_bogus_streams)
-    zfetch_stride_total = (zfetch_stride_hits + zfetch_stride_misses)
-    output['zfetch_access_total'] = zfetch_access_total
-
-    if zfetch_access_total > 0:
-
-        output['file_level_prefetch'] = {}
-        if zfetch_health_count > 0:
-            output['file_level_prefetch']['health'] = 'DEGRADED'
-        else:
-            output['file_level_prefetch']['health'] = 'HEALTHY'
-
-        output['dmu'] = {}
-        output['dmu']['efficiency'] = {}
-        output['dmu']['efficiency']['value'] = fHits(zfetch_access_total)
-        output['dmu']['efficiency']['hit_ratio'] = {
-            'per': fPerc(zfetch_hits, zfetch_access_total),
-            'num': fHits(zfetch_hits),
-        }
-        output['dmu']['efficiency']['miss_ratio'] = {
-            'per': fPerc(zfetch_misses, zfetch_access_total),
-            'num': fHits(zfetch_misses),
-        }
-
-        output['dmu']['colinear'] = {}
-        output['dmu']['colinear']['value'] = fHits(zfetch_colinear_total)
-        output['dmu']['colinear']['hit_ratio'] = {
-            'per': fPerc(zfetch_colinear_hits, zfetch_colinear_total),
-            'num': fHits(zfetch_colinear_hits),
-        }
-        output['dmu']['colinear']['miss_ratio'] = {
-            'per': fPerc(zfetch_colinear_misses, zfetch_colinear_total),
-            'num': fHits(zfetch_colinear_misses),
-        }
-
-        output['dmu']['stride'] = {}
-        output['dmu']['stride']['value'] = fHits(zfetch_stride_total)
-        output['dmu']['stride']['hit_ratio'] = {
-            'per': fPerc(zfetch_stride_hits, zfetch_stride_total),
-            'num': fHits(zfetch_stride_hits),
-        }
-        output['dmu']['stride']['miss_ratio'] = {
-            'per': fPerc(zfetch_stride_misses, zfetch_stride_total),
-            'num': fHits(zfetch_stride_misses),
-        }
-
-        output['dmu_misc'] = {}
-        if zfetch_health_count > 0:
-            output['dmu_misc']['status'] = "FAULTED"
-        else:
-            output['dmu_misc']['status'] = ""
-
-        output['dmu_misc']['reclaim'] = {}
-        output['dmu_misc']['reclaim']['value'] = fHits(zfetch_reclaim_total)
-        output['dmu_misc']['reclaim']['successes'] = {
-            'per': fPerc(zfetch_reclaim_successes, zfetch_reclaim_total),
-            'num': fHits(zfetch_reclaim_successes),
-        }
-        output['dmu_misc']['reclaim']['failure'] = {
-            'per': fPerc(zfetch_reclaim_failures, zfetch_reclaim_total),
-            'num': fHits(zfetch_reclaim_failures),
-        }
-
-        output['dmu_misc']['streams'] = {}
-        output['dmu_misc']['streams']['value'] = fHits(zfetch_streams_total)
-        output['dmu_misc']['streams']['plus_resets'] = {
-            'per': fPerc(zfetch_streams_resets, zfetch_streams_total),
-            'num': fHits(zfetch_streams_resets),
-        }
-        output['dmu_misc']['streams']['neg_resets'] = {
-            'per': fPerc(zfetch_streams_noresets, zfetch_streams_total),
-            'num': fHits(zfetch_streams_noresets),
-        }
-        output['dmu_misc']['streams']['bogus'] = fHits(zfetch_bogus_streams)
-
-    return output
-
-
-def _dmu_summary(Kstat):
-
-    arc = get_dmu_summary(Kstat)
-
-    if arc['zfetch_access_total'] > 0:
-        sys.stdout.write("File-Level Prefetch: (%s)" %
-                arc['file_level_prefetch']['health'])
-        sys.stdout.write("\n")
-
-        sys.stdout.write("DMU Efficiency:\t\t\t\t\t%s\n" %
-                arc['dmu']['efficiency']['value'])
-        sys.stdout.write("\tHit Ratio:\t\t\t%s\t%s\n" % (
-            arc['dmu']['efficiency']['hit_ratio']['per'],
-            arc['dmu']['efficiency']['hit_ratio']['num'],
-            )
-        )
-        sys.stdout.write("\tMiss Ratio:\t\t\t%s\t%s\n" % (
-            arc['dmu']['efficiency']['miss_ratio']['per'],
-            arc['dmu']['efficiency']['miss_ratio']['num'],
-            )
-        )
-
-        sys.stdout.write("\n")
-
-        sys.stdout.write("\tColinear:\t\t\t\t%s\n" %
-                arc['dmu']['colinear']['value'])
-        sys.stdout.write("\t  Hit Ratio:\t\t\t%s\t%s\n" % (
-            arc['dmu']['colinear']['hit_ratio']['per'],
-            arc['dmu']['colinear']['hit_ratio']['num'],
-            )
-        )
-
-        sys.stdout.write("\t  Miss Ratio:\t\t\t%s\t%s\n" % (
-            arc['dmu']['colinear']['miss_ratio']['per'],
-            arc['dmu']['colinear']['miss_ratio']['num'],
-            )
-        )
-
-        sys.stdout.write("\n")
-
-        sys.stdout.write("\tStride:\t\t\t\t\t%s\n" %
-                arc['dmu']['stride']['value'])
-        sys.stdout.write("\t  Hit Ratio:\t\t\t%s\t%s\n" % (
-            arc['dmu']['stride']['hit_ratio']['per'],
-            arc['dmu']['stride']['hit_ratio']['num'],
-            )
-        )
-
-        sys.stdout.write("\t  Miss Ratio:\t\t\t%s\t%s\n" % (
-            arc['dmu']['stride']['miss_ratio']['per'],
-            arc['dmu']['stride']['miss_ratio']['num'],
-            )
-        )
-
-        sys.stdout.write("\n")
-        sys.stdout.write("DMU Misc: %s\n" % arc['dmu_misc']['status'])
-
-        sys.stdout.write("\tReclaim:\t\t\t\t%s\n" %
-                arc['dmu_misc']['reclaim']['value'])
-        sys.stdout.write("\t  Successes:\t\t\t%s\t%s\n" % (
-            arc['dmu_misc']['reclaim']['successes']['per'],
-            arc['dmu_misc']['reclaim']['successes']['num'],
-            )
-        )
-
-        sys.stdout.write("\t  Failures:\t\t\t%s\t%s\n" % (
-            arc['dmu_misc']['reclaim']['failure']['per'],
-            arc['dmu_misc']['reclaim']['failure']['num'],
-            )
-        )
-
-        sys.stdout.write("\n\tStreams:\t\t\t\t%s\n" %
-                arc['dmu_misc']['streams']['value'])
-        sys.stdout.write("\t  +Resets:\t\t\t%s\t%s\n" % (
-            arc['dmu_misc']['streams']['plus_resets']['per'],
-            arc['dmu_misc']['streams']['plus_resets']['num'],
-            )
-        )
-
-        sys.stdout.write("\t  -Resets:\t\t\t%s\t%s\n" % (
-            arc['dmu_misc']['streams']['neg_resets']['per'],
-            arc['dmu_misc']['streams']['neg_resets']['num'],
-            )
-        )
-
-        sys.stdout.write("\t  Bogus:\t\t\t\t%s\n" %
-                arc['dmu_misc']['streams']['bogus'])
-
-
-def get_vdev_summary(Kstat):
-    output = {}
-
-    vdev_cache_delegations = \
-            Kstat["kstat.zfs.misc.vdev_cache_stats.delegations"]
-    vdev_cache_misses = Kstat["kstat.zfs.misc.vdev_cache_stats.misses"]
-    vdev_cache_hits = Kstat["kstat.zfs.misc.vdev_cache_stats.hits"]
-    vdev_cache_total = (vdev_cache_misses + vdev_cache_hits +
-            vdev_cache_delegations)
-
-    output['vdev_cache_total'] = vdev_cache_total
-
-    if vdev_cache_total > 0:
-        output['summary'] = fHits(vdev_cache_total)
-        output['hit_ratio'] = {
-            'per': fPerc(vdev_cache_hits, vdev_cache_total),
-            'num': fHits(vdev_cache_hits),
-        }
-        output['miss_ratio'] = {
-            'per': fPerc(vdev_cache_misses, vdev_cache_total),
-            'num': fHits(vdev_cache_misses),
-        }
-        output['delegations'] = {
-            'per': fPerc(vdev_cache_delegations, vdev_cache_total),
-            'num': fHits(vdev_cache_delegations),
-        }
-
-    return output
-
-
-def _vdev_summary(Kstat):
-    arc = get_vdev_summary(Kstat)
-
-    if arc['vdev_cache_total'] > 0:
-        sys.stdout.write("VDEV Cache Summary:\t\t\t\t%s\n" % arc['summary'])
-        sys.stdout.write("\tHit Ratio:\t\t\t%s\t%s\n" % (
-            arc['hit_ratio']['per'],
-            arc['hit_ratio']['num'],
-        ))
-        sys.stdout.write("\tMiss Ratio:\t\t\t%s\t%s\n" % (
-            arc['miss_ratio']['per'],
-            arc['miss_ratio']['num'],
-        ))
-        sys.stdout.write("\tDelegations:\t\t\t%s\t%s\n" % (
-            arc['delegations']['per'],
-            arc['delegations']['num'],
-        ))
-
-
-def _tunable_summary(Kstat):
-    global show_tunable_descriptions
-    global alternate_tunable_layout
-
-    names = listdir("/sys/module/zfs/parameters/")
-
-    values = {}
-    for name in names:
-        with open("/sys/module/zfs/parameters/" + name) as f: value = f.read()
-        values[name] = value.strip()
-
-    descriptions = {}
-
-    if show_tunable_descriptions:
-        try:
-            command = ["/sbin/modinfo", "zfs", "-0"]
-            p = Popen(command, stdin=PIPE, stdout=PIPE,
-                    stderr=PIPE, shell=False, close_fds=True)
-            p.wait()
-
-            description_list = p.communicate()[0].strip().split('\0')
-
-            if p.returncode == 0:
-                for tunable in description_list:
-                    if tunable[0:5] == 'parm:':
-                        tunable = tunable[5:].strip()
-                        name, description = tunable.split(':', 1)
-                        if not description:
-                            description = "Description unavailable"
-                        descriptions[name] = description
-            else:
-                sys.stderr.write("%s: '%s' exited with code %i\n" %
-                        (sys.argv[0], command[0], p.returncode))
-                sys.stderr.write("Tunable descriptions will be disabled.\n")
-        except OSError as e:
-            sys.stderr.write("%s: Cannot run '%s': %s\n" %
-                    (sys.argv[0], command[0], e.strerror))
-            sys.stderr.write("Tunable descriptions will be disabled.\n")
-
-    sys.stdout.write("ZFS Tunable:\n")
-    for name in names:
-        if not name:
-            continue
-
-        format = "\t%-50s%s\n"
-        if alternate_tunable_layout:
-            format = "\t%s=%s\n"
-
-        if show_tunable_descriptions and descriptions.has_key(name):
-            sys.stdout.write("\t# %s\n" % descriptions[name])
-
-        sys.stdout.write(format % (name, values[name]))
-
-
-unSub = [
-    _arc_summary,
-    _arc_efficiency,
-    _l2arc_summary,
-    _dmu_summary,
-    _vdev_summary,
-    _tunable_summary
-]
-
-
-def zfs_header():
-    daydate = time.strftime("%a %b %d %H:%M:%S %Y")
-
-    div1()
-    sys.stdout.write("ZFS Subsystem Report\t\t\t\t%s" % daydate)
-    div2()
-
-
-def usage():
-    sys.stdout.write("Usage: arc_summary.py [-h] [-a] [-d] [-p PAGE]\n\n")
-    sys.stdout.write("\t -h, --help           : "
-            "Print this help message and exit\n")
-    sys.stdout.write("\t -a, --alternate      : "
-            "Show an alternate sysctl layout\n")
-    sys.stdout.write("\t -d, --description    : "
-            "Show the sysctl descriptions\n")
-    sys.stdout.write("\t -p PAGE, --page=PAGE : "
-            "Select a single output page to display,\n")
-    sys.stdout.write("\t                        "
-            "should be an integer between 1 and " + str(len(unSub)) + "\n\n")
-    sys.stdout.write("Examples:\n")
-    sys.stdout.write("\tarc_summary.py -a\n")
-    sys.stdout.write("\tarc_summary.py -p 4\n")
-    sys.stdout.write("\tarc_summary.py -ad\n")
-    sys.stdout.write("\tarc_summary.py --page=2\n")
-
-def main():
-    global show_tunable_descriptions
-    global alternate_tunable_layout
-
-    opts, args = getopt.getopt(
-        sys.argv[1:], "adp:h", ["alternate", "description", "page=", "help"]
-    )
-
-    args = {}
-    for opt, arg in opts:
-        if opt in ('-a', '--alternate'):
-            args['a'] = True
-        if opt in ('-d', '--description'):
-            args['d'] = True
-        if opt in ('-p', '--page'):
-            args['p'] = arg
-        if opt in ('-h', '--help'):
-            usage()
-            sys.exit()
-
-    Kstat = get_Kstat()
-
-    alternate_tunable_layout = 'a' in args
-    show_tunable_descriptions = 'd' in args
-
-    pages = []
-
-    if 'p' in args:
-        try:
-            pages.append(unSub[int(args['p']) - 1])
-        except IndexError , e:
-            sys.stderr.write('the argument to -p must be between 1 and ' +
-                    str(len(unSub)) + '\n')
-            sys.exit()
-    else:
-        pages = unSub
-
-    zfs_header()
-    for page in pages:
-        page(Kstat)
-        div2()
-
-if __name__ == '__main__':
-    main()
diff --git a/zfs/cmd/arcstat/Makefile.am b/zfs/cmd/arcstat/Makefile.am
deleted file mode 100644 (file)
index 8987b24..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dist_bin_SCRIPTS = arcstat.py
diff --git a/zfs/cmd/arcstat/Makefile.in b/zfs/cmd/arcstat/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/arcstat/arcstat.py b/zfs/cmd/arcstat/arcstat.py
deleted file mode 100755 (executable)
index bbf4310..0000000
+++ /dev/null
@@ -1,457 +0,0 @@
-#!/usr/bin/python
-#
-# Print out ZFS ARC Statistics exported via kstat(1)
-# For a definition of fields, or usage, use arctstat.pl -v
-#
-# This script is a fork of the original arcstat.pl (0.1) by
-# Neelakanth Nadgir, originally published on his Sun blog on
-# 09/18/2007
-#     http://blogs.sun.com/realneel/entry/zfs_arc_statistics
-#
-# This version aims to improve upon the original by adding features
-# and fixing bugs as needed.  This version is maintained by
-# Mike Harsch and is hosted in a public open source repository:
-#    http://github.com/mharsch/arcstat
-#
-# Comments, Questions, or Suggestions are always welcome.
-# Contact the maintainer at ( mike at harschsystems dot com )
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Fields have a fixed width. Every interval, we fill the "v"
-# hash with its corresponding value (v[field]=value) using calculate().
-# @hdr is the array of fields that needs to be printed, so we
-# just iterate over this array and print the values using our pretty printer.
-#
-
-
-import sys
-import time
-import getopt
-import re
-import copy
-
-from decimal import Decimal
-from signal import signal, SIGINT, SIGWINCH, SIG_DFL
-
-cols = {
-    # HDR:        [Size, Scale, Description]
-    "time":       [8, -1, "Time"],
-    "hits":       [4, 1000, "ARC reads per second"],
-    "miss":       [4, 1000, "ARC misses per second"],
-    "read":       [4, 1000, "Total ARC accesses per second"],
-    "hit%":       [4, 100, "ARC Hit percentage"],
-    "miss%":      [5, 100, "ARC miss percentage"],
-    "dhit":       [4, 1000, "Demand hits per second"],
-    "dmis":       [4, 1000, "Demand misses per second"],
-    "dh%":        [3, 100, "Demand hit percentage"],
-    "dm%":        [3, 100, "Demand miss percentage"],
-    "phit":       [4, 1000, "Prefetch hits per second"],
-    "pmis":       [4, 1000, "Prefetch misses per second"],
-    "ph%":        [3, 100, "Prefetch hits percentage"],
-    "pm%":        [3, 100, "Prefetch miss percentage"],
-    "mhit":       [4, 1000, "Metadata hits per second"],
-    "mmis":       [4, 1000, "Metadata misses per second"],
-    "mread":      [4, 1000, "Metadata accesses per second"],
-    "mh%":        [3, 100, "Metadata hit percentage"],
-    "mm%":        [3, 100, "Metadata miss percentage"],
-    "arcsz":      [5, 1024, "ARC Size"],
-    "c":          [4, 1024, "ARC Target Size"],
-    "mfu":        [4, 1000, "MFU List hits per second"],
-    "mru":        [4, 1000, "MRU List hits per second"],
-    "mfug":       [4, 1000, "MFU Ghost List hits per second"],
-    "mrug":       [4, 1000, "MRU Ghost List hits per second"],
-    "eskip":      [5, 1000, "evict_skip per second"],
-    "mtxmis":     [6, 1000, "mutex_miss per second"],
-    "dread":      [5, 1000, "Demand accesses per second"],
-    "pread":      [5, 1000, "Prefetch accesses per second"],
-    "l2hits":     [6, 1000, "L2ARC hits per second"],
-    "l2miss":     [6, 1000, "L2ARC misses per second"],
-    "l2read":     [6, 1000, "Total L2ARC accesses per second"],
-    "l2hit%":     [6, 100, "L2ARC access hit percentage"],
-    "l2miss%":    [7, 100, "L2ARC access miss percentage"],
-    "l2asize":    [7, 1024, "Actual (compressed) size of the L2ARC"],
-    "l2size":     [6, 1024, "Size of the L2ARC"],
-    "l2bytes":    [7, 1024, "bytes read per second from the L2ARC"],
-}
-
-v = {}
-hdr = ["time", "read", "miss", "miss%", "dmis", "dm%", "pmis", "pm%", "mmis",
-       "mm%", "arcsz", "c"]
-xhdr = ["time", "mfu", "mru", "mfug", "mrug", "eskip", "mtxmis", "rmis",
-        "dread", "pread", "read"]
-sint = 1               # Default interval is 1 second
-count = 1              # Default count is 1
-hdr_intr = 20          # Print header every 20 lines of output
-opfile = None
-sep = "  "              # Default separator is 2 spaces
-version = "0.4"
-l2exist = False
-cmd = ("Usage: arcstat.py [-hvx] [-f fields] [-o file] [-s string] [interval "
-       "[count]]\n")
-cur = {}
-d = {}
-out = None
-kstat = None
-float_pobj = re.compile("^[0-9]+(\.[0-9]+)?$")
-
-
-def detailed_usage():
-    sys.stderr.write("%s\n" % cmd)
-    sys.stderr.write("Field definitions are as follows:\n")
-    for key in cols:
-        sys.stderr.write("%11s : %s\n" % (key, cols[key][2]))
-    sys.stderr.write("\n")
-
-    sys.exit(1)
-
-
-def usage():
-    sys.stderr.write("%s\n" % cmd)
-    sys.stderr.write("\t -h : Print this help message\n")
-    sys.stderr.write("\t -v : List all possible field headers and definitions"
-                     "\n")
-    sys.stderr.write("\t -x : Print extended stats\n")
-    sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n")
-    sys.stderr.write("\t -o : Redirect output to the specified file\n")
-    sys.stderr.write("\t -s : Override default field separator with custom "
-                     "character or string\n")
-    sys.stderr.write("\nExamples:\n")
-    sys.stderr.write("\tarcstat.py -o /tmp/a.log 2 10\n")
-    sys.stderr.write("\tarcstat.py -s \",\" -o /tmp/a.log 2 10\n")
-    sys.stderr.write("\tarcstat.py -v\n")
-    sys.stderr.write("\tarcstat.py -f time,hit%,dh%,ph%,mh% 1\n")
-    sys.stderr.write("\n")
-
-    sys.exit(1)
-
-
-def kstat_update():
-    global kstat
-
-    k = [line.strip() for line in open('/proc/spl/kstat/zfs/arcstats')]
-
-    if not k:
-        sys.exit(1)
-
-    del k[0:2]
-    kstat = {}
-
-    for s in k:
-        if not s:
-            continue
-
-        name, unused, value = s.split()
-        kstat[name] = Decimal(value)
-
-
-def snap_stats():
-    global cur
-    global kstat
-
-    prev = copy.deepcopy(cur)
-    kstat_update()
-
-    cur = kstat
-    for key in cur:
-        if re.match(key, "class"):
-            continue
-        if key in prev:
-            d[key] = cur[key] - prev[key]
-        else:
-            d[key] = cur[key]
-
-
-def prettynum(sz, scale, num=0):
-    suffix = [' ', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']
-    index = 0
-    save = 0
-
-    # Special case for date field
-    if scale == -1:
-        return "%s" % num
-
-    # Rounding error, return 0
-    elif 0 < num < 1:
-        num = 0
-
-    while num > scale and index < 5:
-        save = num
-        num = num / scale
-        index += 1
-
-    if index == 0:
-        return "%*d" % (sz, num)
-
-    if (save / scale) < 10:
-        return "%*.1f%s" % (sz - 1, num, suffix[index])
-    else:
-        return "%*d%s" % (sz - 1, num, suffix[index])
-
-
-def print_values():
-    global hdr
-    global sep
-    global v
-
-    for col in hdr:
-        sys.stdout.write("%s%s" % (
-            prettynum(cols[col][0], cols[col][1], v[col]),
-            sep
-        ))
-    sys.stdout.write("\n")
-
-
-def print_header():
-    global hdr
-    global sep
-
-    for col in hdr:
-        sys.stdout.write("%*s%s" % (cols[col][0], col, sep))
-    sys.stdout.write("\n")
-
-def get_terminal_lines():
-    try:
-        import fcntl, termios, struct
-        data = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, '1234')
-        sz = struct.unpack('hh', data)
-        return sz[0]
-    except:
-        pass
-
-def update_hdr_intr():
-    global hdr_intr
-
-    lines = get_terminal_lines()
-    if lines and lines > 3:
-        hdr_intr = lines - 3
-
-def resize_handler(signum, frame):
-    update_hdr_intr()
-
-
-def init():
-    global sint
-    global count
-    global hdr
-    global xhdr
-    global opfile
-    global sep
-    global out
-    global l2exist
-
-    desired_cols = None
-    xflag = False
-    hflag = False
-    vflag = False
-    i = 1
-
-    try:
-        opts, args = getopt.getopt(
-            sys.argv[1:],
-            "xo:hvs:f:",
-            [
-                "extended",
-                "outfile",
-                "help",
-                "verbose",
-                "seperator",
-                "columns"
-            ]
-        )
-    except getopt.error as msg:
-        sys.stderr.write(msg)
-        usage()
-        opts = None
-
-    for opt, arg in opts:
-        if opt in ('-x', '--extended'):
-            xflag = True
-        if opt in ('-o', '--outfile'):
-            opfile = arg
-            i += 1
-        if opt in ('-h', '--help'):
-            hflag = True
-        if opt in ('-v', '--verbose'):
-            vflag = True
-        if opt in ('-s', '--seperator'):
-            sep = arg
-            i += 1
-        if opt in ('-f', '--columns'):
-            desired_cols = arg
-            i += 1
-        i += 1
-
-    argv = sys.argv[i:]
-    sint = Decimal(argv[0]) if argv else sint
-    count = int(argv[1]) if len(argv) > 1 else count
-
-    if len(argv) > 1:
-        sint = Decimal(argv[0])
-        count = int(argv[1])
-
-    elif len(argv) > 0:
-        sint = Decimal(argv[0])
-        count = 0
-
-    if hflag or (xflag and desired_cols):
-        usage()
-
-    if vflag:
-        detailed_usage()
-
-    if xflag:
-        hdr = xhdr
-
-    update_hdr_intr()
-
-    # check if L2ARC exists
-    snap_stats()
-    l2_size = cur.get("l2_size")
-    if l2_size:
-        l2exist = True
-
-    if desired_cols:
-        hdr = desired_cols.split(",")
-
-        invalid = []
-        incompat = []
-        for ele in hdr:
-            if ele not in cols:
-                invalid.append(ele)
-            elif not l2exist and ele.startswith("l2"):
-                sys.stdout.write("No L2ARC Here\n%s\n" % ele)
-                incompat.append(ele)
-
-        if len(invalid) > 0:
-            sys.stderr.write("Invalid column definition! -- %s\n" % invalid)
-            usage()
-
-        if len(incompat) > 0:
-            sys.stderr.write("Incompatible field specified! -- %s\n" %
-                             incompat)
-            usage()
-
-    if opfile:
-        try:
-            out = open(opfile, "w")
-            sys.stdout = out
-
-        except IOError:
-            sys.stderr.write("Cannot open %s for writing\n" % opfile)
-            sys.exit(1)
-
-
-def calculate():
-    global d
-    global v
-    global l2exist
-
-    v = dict()
-    v["time"] = time.strftime("%H:%M:%S", time.localtime())
-    v["hits"] = d["hits"] / sint
-    v["miss"] = d["misses"] / sint
-    v["read"] = v["hits"] + v["miss"]
-    v["hit%"] = 100 * v["hits"] / v["read"] if v["read"] > 0 else 0
-    v["miss%"] = 100 - v["hit%"] if v["read"] > 0 else 0
-
-    v["dhit"] = (d["demand_data_hits"] + d["demand_metadata_hits"]) / sint
-    v["dmis"] = (d["demand_data_misses"] + d["demand_metadata_misses"]) / sint
-
-    v["dread"] = v["dhit"] + v["dmis"]
-    v["dh%"] = 100 * v["dhit"] / v["dread"] if v["dread"] > 0 else 0
-    v["dm%"] = 100 - v["dh%"] if v["dread"] > 0 else 0
-
-    v["phit"] = (d["prefetch_data_hits"] + d["prefetch_metadata_hits"]) / sint
-    v["pmis"] = (d["prefetch_data_misses"] +
-                 d["prefetch_metadata_misses"]) / sint
-
-    v["pread"] = v["phit"] + v["pmis"]
-    v["ph%"] = 100 * v["phit"] / v["pread"] if v["pread"] > 0 else 0
-    v["pm%"] = 100 - v["ph%"] if v["pread"] > 0 else 0
-
-    v["mhit"] = (d["prefetch_metadata_hits"] +
-                 d["demand_metadata_hits"]) / sint
-    v["mmis"] = (d["prefetch_metadata_misses"] +
-                 d["demand_metadata_misses"]) / sint
-
-    v["mread"] = v["mhit"] + v["mmis"]
-    v["mh%"] = 100 * v["mhit"] / v["mread"] if v["mread"] > 0 else 0
-    v["mm%"] = 100 - v["mh%"] if v["mread"] > 0 else 0
-
-    v["arcsz"] = cur["size"]
-    v["c"] = cur["c"]
-    v["mfu"] = d["mfu_hits"] / sint
-    v["mru"] = d["mru_hits"] / sint
-    v["mrug"] = d["mru_ghost_hits"] / sint
-    v["mfug"] = d["mfu_ghost_hits"] / sint
-    v["eskip"] = d["evict_skip"] / sint
-    v["mtxmis"] = d["mutex_miss"] / sint
-
-    if l2exist:
-        v["l2hits"] = d["l2_hits"] / sint
-        v["l2miss"] = d["l2_misses"] / sint
-        v["l2read"] = v["l2hits"] + v["l2miss"]
-        v["l2hit%"] = 100 * v["l2hits"] / v["l2read"] if v["l2read"] > 0 else 0
-
-        v["l2miss%"] = 100 - v["l2hit%"] if v["l2read"] > 0 else 0
-        v["l2asize"] = cur["l2_asize"]
-        v["l2size"] = cur["l2_size"]
-        v["l2bytes"] = d["l2_read_bytes"] / sint
-
-
-def main():
-    global sint
-    global count
-    global hdr_intr
-
-    i = 0
-    count_flag = 0
-
-    init()
-    if count > 0:
-        count_flag = 1
-
-    signal(SIGINT, SIG_DFL)
-    signal(SIGWINCH, resize_handler)
-    while True:
-        if i == 0:
-            print_header()
-
-        snap_stats()
-        calculate()
-        print_values()
-
-        if count_flag == 1:
-            if count <= 1:
-                break
-            count -= 1
-
-        i = 0 if i >= hdr_intr else i + 1
-        time.sleep(sint)
-
-    if out:
-        out.close()
-
-
-if __name__ == '__main__':
-    main()
diff --git a/zfs/cmd/dbufstat/Makefile.am b/zfs/cmd/dbufstat/Makefile.am
deleted file mode 100644 (file)
index 19bffb0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dist_bin_SCRIPTS = dbufstat.py
diff --git a/zfs/cmd/dbufstat/Makefile.in b/zfs/cmd/dbufstat/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/dbufstat/dbufstat.py b/zfs/cmd/dbufstat/dbufstat.py
deleted file mode 100755 (executable)
index 5f75376..0000000
+++ /dev/null
@@ -1,582 +0,0 @@
-#!/usr/bin/python
-#
-# Print out statistics for all cached dmu buffers.  This information
-# is available through the dbufs kstat and may be post-processed as
-# needed by the script.
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-# Copyright (C) 2013 Lawrence Livermore National Security, LLC.
-# Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
-#
-
-import sys
-import getopt
-import errno
-
-bhdr = ["pool", "objset", "object", "level", "blkid", "offset", "dbsize"]
-bxhdr = ["pool", "objset", "object", "level", "blkid", "offset", "dbsize",
-         "meta", "state", "dbholds", "list", "atype", "index", "flags",
-         "count", "asize", "access", "mru", "gmru", "mfu", "gmfu", "l2",
-         "l2_dattr", "l2_asize", "l2_comp", "aholds", "dtype", "btype",
-         "data_bs", "meta_bs", "bsize", "lvls", "dholds", "blocks", "dsize"]
-bincompat = ["cached", "direct", "indirect", "bonus", "spill"]
-
-dhdr = ["pool", "objset", "object", "dtype", "cached"]
-dxhdr = ["pool", "objset", "object", "dtype", "btype", "data_bs", "meta_bs",
-         "bsize", "lvls", "dholds", "blocks", "dsize", "cached", "direct",
-         "indirect", "bonus", "spill"]
-dincompat = ["level", "blkid", "offset", "dbsize", "meta", "state", "dbholds",
-             "list", "atype", "index", "flags", "count", "asize", "access",
-             "mru", "gmru", "mfu", "gmfu", "l2", "l2_dattr", "l2_asize",
-             "l2_comp", "aholds"]
-
-thdr = ["pool", "objset", "dtype", "cached"]
-txhdr = ["pool", "objset", "dtype", "cached", "direct", "indirect",
-         "bonus", "spill"]
-tincompat = ["object", "level", "blkid", "offset", "dbsize", "meta", "state",
-             "dbholds", "list", "atype", "index", "flags", "count", "asize",
-             "access", "mru", "gmru", "mfu", "gmfu", "l2", "l2_dattr",
-             "l2_asize", "l2_comp", "aholds", "btype", "data_bs", "meta_bs",
-             "bsize", "lvls", "dholds", "blocks", "dsize"]
-
-cols = {
-    # hdr:        [size, scale, description]
-    "pool":       [15,   -1, "pool name"],
-    "objset":     [6,    -1, "dataset identification number"],
-    "object":     [10,   -1, "object number"],
-    "level":      [5,    -1, "indirection level of buffer"],
-    "blkid":      [8,    -1, "block number of buffer"],
-    "offset":     [12, 1024, "offset in object of buffer"],
-    "dbsize":     [7,  1024, "size of buffer"],
-    "meta":       [4,    -1, "is this buffer metadata?"],
-    "state":      [5,    -1, "state of buffer (read, cached, etc)"],
-    "dbholds":    [7,  1000, "number of holds on buffer"],
-    "list":       [4,    -1, "which ARC list contains this buffer"],
-    "atype":      [7,    -1, "ARC header type (data or metadata)"],
-    "index":      [5,    -1, "buffer's index into its ARC list"],
-    "flags":      [8,    -1, "ARC read flags"],
-    "count":      [5,    -1, "ARC data count"],
-    "asize":      [7,  1024, "size of this ARC buffer"],
-    "access":     [10,   -1, "time this ARC buffer was last accessed"],
-    "mru":        [5,  1000, "hits while on the ARC's MRU list"],
-    "gmru":       [5,  1000, "hits while on the ARC's MRU ghost list"],
-    "mfu":        [5,  1000, "hits while on the ARC's MFU list"],
-    "gmfu":       [5,  1000, "hits while on the ARC's MFU ghost list"],
-    "l2":         [5,  1000, "hits while on the L2ARC"],
-    "l2_dattr":   [8,    -1, "L2ARC disk address/offset"],
-    "l2_asize":   [8,  1024, "L2ARC alloc'd size (depending on compression)"],
-    "l2_comp":    [21,   -1, "L2ARC compression algorithm for buffer"],
-    "aholds":     [6,  1000, "number of holds on this ARC buffer"],
-    "dtype":      [27,   -1, "dnode type"],
-    "btype":      [27,   -1, "bonus buffer type"],
-    "data_bs":    [7,  1024, "data block size"],
-    "meta_bs":    [7,  1024, "metadata block size"],
-    "bsize":      [6,  1024, "bonus buffer size"],
-    "lvls":       [6,    -1, "number of indirection levels"],
-    "dholds":     [6,  1000, "number of holds on dnode"],
-    "blocks":     [8,  1000, "number of allocated blocks"],
-    "dsize":      [12, 1024, "size of dnode"],
-    "cached":     [6,  1024, "bytes cached for all blocks"],
-    "direct":     [6,  1024, "bytes cached for direct blocks"],
-    "indirect":   [8,  1024, "bytes cached for indirect blocks"],
-    "bonus":      [5,  1024, "bytes cached for bonus buffer"],
-    "spill":      [5,  1024, "bytes cached for spill block"],
-}
-
-hdr = None
-xhdr = None
-sep = "  "  # Default separator is 2 spaces
-cmd = ("Usage: dbufstat.py [-bdhrtvx] [-i file] [-f fields] [-o file] "
-       "[-s string]\n")
-raw = 0
-
-
-def print_incompat_helper(incompat):
-    cnt = 0
-    for key in sorted(incompat):
-        if cnt is 0:
-            sys.stderr.write("\t")
-        elif cnt > 8:
-            sys.stderr.write(",\n\t")
-            cnt = 0
-        else:
-            sys.stderr.write(", ")
-
-        sys.stderr.write("%s" % key)
-        cnt += 1
-
-    sys.stderr.write("\n\n")
-
-
-def detailed_usage():
-    sys.stderr.write("%s\n" % cmd)
-
-    sys.stderr.write("Field definitions incompatible with '-b' option:\n")
-    print_incompat_helper(bincompat)
-
-    sys.stderr.write("Field definitions incompatible with '-d' option:\n")
-    print_incompat_helper(dincompat)
-
-    sys.stderr.write("Field definitions incompatible with '-t' option:\n")
-    print_incompat_helper(tincompat)
-
-    sys.stderr.write("Field definitions are as follows:\n")
-    for key in sorted(cols.keys()):
-        sys.stderr.write("%11s : %s\n" % (key, cols[key][2]))
-    sys.stderr.write("\n")
-
-    sys.exit(1)
-
-
-def usage():
-    sys.stderr.write("%s\n" % cmd)
-    sys.stderr.write("\t -b : Print table of information for each dbuf\n")
-    sys.stderr.write("\t -d : Print table of information for each dnode\n")
-    sys.stderr.write("\t -h : Print this help message\n")
-    sys.stderr.write("\t -r : Print raw values\n")
-    sys.stderr.write("\t -t : Print table of information for each dnode type"
-                     "\n")
-    sys.stderr.write("\t -v : List all possible field headers and definitions"
-                     "\n")
-    sys.stderr.write("\t -x : Print extended stats\n")
-    sys.stderr.write("\t -i : Redirect input from the specified file\n")
-    sys.stderr.write("\t -f : Specify specific fields to print (see -v)\n")
-    sys.stderr.write("\t -o : Redirect output to the specified file\n")
-    sys.stderr.write("\t -s : Override default field separator with custom "
-                     "character or string\n")
-    sys.stderr.write("\nExamples:\n")
-    sys.stderr.write("\tdbufstat.py -d -o /tmp/d.log\n")
-    sys.stderr.write("\tdbufstat.py -t -s \",\" -o /tmp/t.log\n")
-    sys.stderr.write("\tdbufstat.py -v\n")
-    sys.stderr.write("\tdbufstat.py -d -f pool,object,objset,dsize,cached\n")
-    sys.stderr.write("\n")
-
-    sys.exit(1)
-
-
-def prettynum(sz, scale, num=0):
-    global raw
-
-    suffix = [' ', 'K', 'M', 'G', 'T', 'P', 'E', 'Z']
-    index = 0
-    save = 0
-
-    if raw or scale == -1:
-        return "%*s" % (sz, num)
-
-    # Rounding error, return 0
-    elif 0 < num < 1:
-        num = 0
-
-    while num > scale and index < 5:
-        save = num
-        num = num / scale
-        index += 1
-
-    if index == 0:
-        return "%*d" % (sz, num)
-
-    if (save / scale) < 10:
-        return "%*.1f%s" % (sz - 1, num, suffix[index])
-    else:
-        return "%*d%s" % (sz - 1, num, suffix[index])
-
-
-def print_values(v):
-    global hdr
-    global sep
-
-    try:
-        for col in hdr:
-            sys.stdout.write("%s%s" % (
-                prettynum(cols[col][0], cols[col][1], v[col]), sep))
-        sys.stdout.write("\n")
-    except IOError as e:
-        if e.errno == errno.EPIPE:
-            sys.exit(1)
-
-
-def print_header():
-    global hdr
-    global sep
-
-    try:
-        for col in hdr:
-            sys.stdout.write("%*s%s" % (cols[col][0], col, sep))
-        sys.stdout.write("\n")
-    except IOError as e:
-        if e.errno == errno.EPIPE:
-            sys.exit(1)
-
-
-def get_typestring(t):
-    type_strings = ["DMU_OT_NONE",
-                    # general:
-                    "DMU_OT_OBJECT_DIRECTORY",
-                    "DMU_OT_OBJECT_ARRAY",
-                    "DMU_OT_PACKED_NVLIST",
-                    "DMU_OT_PACKED_NVLIST_SIZE",
-                    "DMU_OT_BPOBJ",
-                    "DMU_OT_BPOBJ_HDR",
-                    # spa:
-                    "DMU_OT_SPACE_MAP_HEADER",
-                    "DMU_OT_SPACE_MAP",
-                    # zil:
-                    "DMU_OT_INTENT_LOG",
-                    # dmu:
-                    "DMU_OT_DNODE",
-                    "DMU_OT_OBJSET",
-                    # dsl:
-                    "DMU_OT_DSL_DIR",
-                    "DMU_OT_DSL_DIR_CHILD_MAP",
-                    "DMU_OT_DSL_DS_SNAP_MAP",
-                    "DMU_OT_DSL_PROPS",
-                    "DMU_OT_DSL_DATASET",
-                    # zpl:
-                    "DMU_OT_ZNODE",
-                    "DMU_OT_OLDACL",
-                    "DMU_OT_PLAIN_FILE_CONTENTS",
-                    "DMU_OT_DIRECTORY_CONTENTS",
-                    "DMU_OT_MASTER_NODE",
-                    "DMU_OT_UNLINKED_SET",
-                    # zvol:
-                    "DMU_OT_ZVOL",
-                    "DMU_OT_ZVOL_PROP",
-                    # other; for testing only!
-                    "DMU_OT_PLAIN_OTHER",
-                    "DMU_OT_UINT64_OTHER",
-                    "DMU_OT_ZAP_OTHER",
-                    # new object types:
-                    "DMU_OT_ERROR_LOG",
-                    "DMU_OT_SPA_HISTORY",
-                    "DMU_OT_SPA_HISTORY_OFFSETS",
-                    "DMU_OT_POOL_PROPS",
-                    "DMU_OT_DSL_PERMS",
-                    "DMU_OT_ACL",
-                    "DMU_OT_SYSACL",
-                    "DMU_OT_FUID",
-                    "DMU_OT_FUID_SIZE",
-                    "DMU_OT_NEXT_CLONES",
-                    "DMU_OT_SCAN_QUEUE",
-                    "DMU_OT_USERGROUP_USED",
-                    "DMU_OT_USERGROUP_QUOTA",
-                    "DMU_OT_USERREFS",
-                    "DMU_OT_DDT_ZAP",
-                    "DMU_OT_DDT_STATS",
-                    "DMU_OT_SA",
-                    "DMU_OT_SA_MASTER_NODE",
-                    "DMU_OT_SA_ATTR_REGISTRATION",
-                    "DMU_OT_SA_ATTR_LAYOUTS",
-                    "DMU_OT_SCAN_XLATE",
-                    "DMU_OT_DEDUP",
-                    "DMU_OT_DEADLIST",
-                    "DMU_OT_DEADLIST_HDR",
-                    "DMU_OT_DSL_CLONES",
-                    "DMU_OT_BPOBJ_SUBOBJ"]
-
-    # If "-rr" option is used, don't convert to string representation
-    if raw > 1:
-        return "%i" % t
-
-    try:
-        return type_strings[t]
-    except IndexError:
-        return "%i" % t
-
-
-def get_compstring(c):
-    comp_strings = ["ZIO_COMPRESS_INHERIT", "ZIO_COMPRESS_ON",
-                    "ZIO_COMPRESS_OFF",     "ZIO_COMPRESS_LZJB",
-                    "ZIO_COMPRESS_EMPTY",   "ZIO_COMPRESS_GZIP_1",
-                    "ZIO_COMPRESS_GZIP_2",  "ZIO_COMPRESS_GZIP_3",
-                    "ZIO_COMPRESS_GZIP_4",  "ZIO_COMPRESS_GZIP_5",
-                    "ZIO_COMPRESS_GZIP_6",  "ZIO_COMPRESS_GZIP_7",
-                    "ZIO_COMPRESS_GZIP_8",  "ZIO_COMPRESS_GZIP_9",
-                    "ZIO_COMPRESS_ZLE",     "ZIO_COMPRESS_LZ4",
-                    "ZIO_COMPRESS_FUNCTION"]
-
-    # If "-rr" option is used, don't convert to string representation
-    if raw > 1:
-        return "%i" % c
-
-    try:
-        return comp_strings[c]
-    except IndexError:
-        return "%i" % c
-
-
-def parse_line(line, labels):
-    global hdr
-
-    new = dict()
-    val = None
-    for col in hdr:
-        # These are "special" fields computed in the update_dict
-        # function, prevent KeyError exception on labels[col] for these.
-        if col not in ['bonus', 'cached', 'direct', 'indirect', 'spill']:
-            val = line[labels[col]]
-
-        if col in ['pool', 'flags']:
-            new[col] = str(val)
-        elif col in ['dtype', 'btype']:
-            new[col] = get_typestring(int(val))
-        elif col in ['l2_comp']:
-            new[col] = get_compstring(int(val))
-        else:
-            new[col] = int(val)
-
-    return new
-
-
-def update_dict(d, k, line, labels):
-    pool = line[labels['pool']]
-    objset = line[labels['objset']]
-    key = line[labels[k]]
-
-    dbsize = int(line[labels['dbsize']])
-    blkid = int(line[labels['blkid']])
-    level = int(line[labels['level']])
-
-    if pool not in d:
-        d[pool] = dict()
-
-    if objset not in d[pool]:
-        d[pool][objset] = dict()
-
-    if key not in d[pool][objset]:
-        d[pool][objset][key] = parse_line(line, labels)
-        d[pool][objset][key]['bonus'] = 0
-        d[pool][objset][key]['cached'] = 0
-        d[pool][objset][key]['direct'] = 0
-        d[pool][objset][key]['indirect'] = 0
-        d[pool][objset][key]['spill'] = 0
-
-    d[pool][objset][key]['cached'] += dbsize
-
-    if blkid == -1:
-        d[pool][objset][key]['bonus'] += dbsize
-    elif blkid == -2:
-        d[pool][objset][key]['spill'] += dbsize
-    else:
-        if level == 0:
-            d[pool][objset][key]['direct'] += dbsize
-        else:
-            d[pool][objset][key]['indirect'] += dbsize
-
-    return d
-
-
-def print_dict(d):
-    print_header()
-    for pool in d.keys():
-        for objset in d[pool].keys():
-            for v in d[pool][objset].values():
-                print_values(v)
-
-
-def dnodes_build_dict(filehandle):
-    labels = dict()
-    dnodes = dict()
-
-    # First 3 lines are header information, skip the first two
-    for i in range(2):
-        next(filehandle)
-
-    # The third line contains the labels and index locations
-    for i, v in enumerate(next(filehandle).split()):
-        labels[v] = i
-
-    # The rest of the file is buffer information
-    for line in filehandle:
-        update_dict(dnodes, 'object', line.split(), labels)
-
-    return dnodes
-
-
-def types_build_dict(filehandle):
-    labels = dict()
-    types = dict()
-
-    # First 3 lines are header information, skip the first two
-    for i in range(2):
-        next(filehandle)
-
-    # The third line contains the labels and index locations
-    for i, v in enumerate(next(filehandle).split()):
-        labels[v] = i
-
-    # The rest of the file is buffer information
-    for line in filehandle:
-        update_dict(types, 'dtype', line.split(), labels)
-
-    return types
-
-
-def buffers_print_all(filehandle):
-    labels = dict()
-
-    # First 3 lines are header information, skip the first two
-    for i in range(2):
-        next(filehandle)
-
-    # The third line contains the labels and index locations
-    for i, v in enumerate(next(filehandle).split()):
-        labels[v] = i
-
-    print_header()
-
-    # The rest of the file is buffer information
-    for line in filehandle:
-        print_values(parse_line(line.split(), labels))
-
-
-def main():
-    global hdr
-    global sep
-    global raw
-
-    desired_cols = None
-    bflag = False
-    dflag = False
-    hflag = False
-    ifile = None
-    ofile = None
-    tflag = False
-    vflag = False
-    xflag = False
-
-    try:
-        opts, args = getopt.getopt(
-            sys.argv[1:],
-            "bdf:hi:o:rs:tvx",
-            [
-                "buffers",
-                "dnodes",
-                "columns",
-                "help",
-                "infile",
-                "outfile",
-                "seperator",
-                "types",
-                "verbose",
-                "extended"
-            ]
-        )
-    except getopt.error:
-        usage()
-        opts = None
-
-    for opt, arg in opts:
-        if opt in ('-b', '--buffers'):
-            bflag = True
-        if opt in ('-d', '--dnodes'):
-            dflag = True
-        if opt in ('-f', '--columns'):
-            desired_cols = arg
-        if opt in ('-h', '--help'):
-            hflag = True
-        if opt in ('-i', '--infile'):
-            ifile = arg
-        if opt in ('-o', '--outfile'):
-            ofile = arg
-        if opt in ('-r', '--raw'):
-            raw += 1
-        if opt in ('-s', '--seperator'):
-            sep = arg
-        if opt in ('-t', '--types'):
-            tflag = True
-        if opt in ('-v', '--verbose'):
-            vflag = True
-        if opt in ('-x', '--extended'):
-            xflag = True
-
-    if hflag or (xflag and desired_cols):
-        usage()
-
-    if vflag:
-        detailed_usage()
-
-    # Ensure at most only one of b, d, or t flags are set
-    if (bflag and dflag) or (bflag and tflag) or (dflag and tflag):
-        usage()
-
-    if bflag:
-        hdr = bxhdr if xflag else bhdr
-    elif tflag:
-        hdr = txhdr if xflag else thdr
-    else:  # Even if dflag is False, it's the default if none set
-        dflag = True
-        hdr = dxhdr if xflag else dhdr
-
-    if desired_cols:
-        hdr = desired_cols.split(",")
-
-        invalid = []
-        incompat = []
-        for ele in hdr:
-            if ele not in cols:
-                invalid.append(ele)
-            elif ((bflag and bincompat and ele in bincompat) or
-                  (dflag and dincompat and ele in dincompat) or
-                  (tflag and tincompat and ele in tincompat)):
-                    incompat.append(ele)
-
-        if len(invalid) > 0:
-            sys.stderr.write("Invalid column definition! -- %s\n" % invalid)
-            usage()
-
-        if len(incompat) > 0:
-            sys.stderr.write("Incompatible field specified! -- %s\n" %
-                             incompat)
-            usage()
-
-    if ofile:
-        try:
-            tmp = open(ofile, "w")
-            sys.stdout = tmp
-
-        except IOError:
-            sys.stderr.write("Cannot open %s for writing\n" % ofile)
-            sys.exit(1)
-
-    if not ifile:
-        ifile = '/proc/spl/kstat/zfs/dbufs'
-
-    if ifile is not "-":
-        try:
-            tmp = open(ifile, "r")
-            sys.stdin = tmp
-        except IOError:
-            sys.stderr.write("Cannot open %s for reading\n" % ifile)
-            sys.exit(1)
-
-    if bflag:
-        buffers_print_all(sys.stdin)
-
-    if dflag:
-        print_dict(dnodes_build_dict(sys.stdin))
-
-    if tflag:
-        print_dict(types_build_dict(sys.stdin))
-
-if __name__ == '__main__':
-    main()
diff --git a/zfs/cmd/fsck_zfs/Makefile.am b/zfs/cmd/fsck_zfs/Makefile.am
deleted file mode 100644 (file)
index 2380f56..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dist_sbin_SCRIPTS = fsck.zfs
diff --git a/zfs/cmd/fsck_zfs/Makefile.in b/zfs/cmd/fsck_zfs/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/fsck_zfs/fsck.zfs b/zfs/cmd/fsck_zfs/fsck.zfs
deleted file mode 100755 (executable)
index f1685db..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-#!/bin/sh
-#
-# fsck.zfs: A fsck helper to accomidate distributions that expect
-# to be able to execute a fsck on all filesystem types.  Currently
-# this script does nothing but it could be extended to act as a
-# compatibility wrapper for 'zpool scrub'.
-#
-
-exit 0
diff --git a/zfs/cmd/mount_zfs/.gitignore b/zfs/cmd/mount_zfs/.gitignore
deleted file mode 100644 (file)
index cd9254b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-mount.zfs
diff --git a/zfs/cmd/mount_zfs/Makefile.am b/zfs/cmd/mount_zfs/Makefile.am
deleted file mode 100644 (file)
index b1d9389..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-#
-# Ignore the prefix for the mount helper.  It must be installed in /sbin/
-# because this path is hardcoded in the mount(8) for security reasons.
-#
-sbindir=$(mounthelperdir)
-sbin_PROGRAMS = mount.zfs
-
-mount_zfs_SOURCES = \
-       mount_zfs.c
-
-mount_zfs_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
diff --git a/zfs/cmd/mount_zfs/Makefile.in b/zfs/cmd/mount_zfs/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/mount_zfs/mount_zfs.c b/zfs/cmd/mount_zfs/mount_zfs.c
deleted file mode 100644 (file)
index af589bb..0000000
+++ /dev/null
@@ -1,622 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 Lawrence Livermore National Security, LLC.
- */
-
-#include <libintl.h>
-#include <unistd.h>
-#include <sys/file.h>
-#include <sys/mount.h>
-#include <sys/mntent.h>
-#include <sys/stat.h>
-#include <libzfs.h>
-#include <locale.h>
-
-#define        ZS_COMMENT      0x00000000      /* comment */
-#define        ZS_ZFSUTIL      0x00000001      /* caller is zfs(8) */
-
-libzfs_handle_t *g_zfs;
-
-typedef struct option_map {
-       const char *name;
-       unsigned long mntmask;
-       unsigned long zfsmask;
-} option_map_t;
-
-static const option_map_t option_map[] = {
-       /* Canonicalized filesystem independent options from mount(8) */
-       { MNTOPT_NOAUTO,        MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_DEFAULTS,      MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_NODEVICES,     MS_NODEV,       ZS_COMMENT      },
-       { MNTOPT_DIRSYNC,       MS_DIRSYNC,     ZS_COMMENT      },
-       { MNTOPT_NOEXEC,        MS_NOEXEC,      ZS_COMMENT      },
-       { MNTOPT_GROUP,         MS_GROUP,       ZS_COMMENT      },
-       { MNTOPT_NETDEV,        MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_NOFAIL,        MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_NOSUID,        MS_NOSUID,      ZS_COMMENT      },
-       { MNTOPT_OWNER,         MS_OWNER,       ZS_COMMENT      },
-       { MNTOPT_REMOUNT,       MS_REMOUNT,     ZS_COMMENT      },
-       { MNTOPT_RO,            MS_RDONLY,      ZS_COMMENT      },
-       { MNTOPT_RW,            MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_SYNC,          MS_SYNCHRONOUS, ZS_COMMENT      },
-       { MNTOPT_USER,          MS_USERS,       ZS_COMMENT      },
-       { MNTOPT_USERS,         MS_USERS,       ZS_COMMENT      },
-       /* acl flags passed with util-linux-2.24 mount command */
-       { MNTOPT_ACL,           MS_POSIXACL,    ZS_COMMENT      },
-       { MNTOPT_NOACL,         MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_POSIXACL,      MS_POSIXACL,    ZS_COMMENT      },
-#ifdef MS_NOATIME
-       { MNTOPT_NOATIME,       MS_NOATIME,     ZS_COMMENT      },
-#endif
-#ifdef MS_NODIRATIME
-       { MNTOPT_NODIRATIME,    MS_NODIRATIME,  ZS_COMMENT      },
-#endif
-#ifdef MS_RELATIME
-       { MNTOPT_RELATIME,      MS_RELATIME,    ZS_COMMENT      },
-#endif
-#ifdef MS_STRICTATIME
-       { MNTOPT_DFRATIME,      MS_STRICTATIME, ZS_COMMENT      },
-#endif
-       { MNTOPT_CONTEXT,       MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_FSCONTEXT,     MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_DEFCONTEXT,    MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_ROOTCONTEXT,   MS_COMMENT,     ZS_COMMENT      },
-#ifdef MS_I_VERSION
-       { MNTOPT_IVERSION,      MS_I_VERSION,   ZS_COMMENT      },
-#endif
-#ifdef MS_MANDLOCK
-       { MNTOPT_NBMAND,        MS_MANDLOCK,    ZS_COMMENT      },
-#endif
-       /* Valid options not found in mount(8) */
-       { MNTOPT_BIND,          MS_BIND,        ZS_COMMENT      },
-#ifdef MS_REC
-       { MNTOPT_RBIND,         MS_BIND|MS_REC, ZS_COMMENT      },
-#endif
-       { MNTOPT_COMMENT,       MS_COMMENT,     ZS_COMMENT      },
-#ifdef MS_NOSUB
-       { MNTOPT_NOSUB,         MS_NOSUB,       ZS_COMMENT      },
-#endif
-#ifdef MS_SILENT
-       { MNTOPT_QUIET,         MS_SILENT,      ZS_COMMENT      },
-#endif
-       /* Custom zfs options */
-       { MNTOPT_DIRXATTR,      MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_SAXATTR,       MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_XATTR,         MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_NOXATTR,       MS_COMMENT,     ZS_COMMENT      },
-       { MNTOPT_ZFSUTIL,       MS_COMMENT,     ZS_ZFSUTIL      },
-       { NULL,                 0,              0               } };
-
-/*
- * Break the mount option in to a name/value pair.  The name is
- * validated against the option map and mount flags set accordingly.
- */
-static int
-parse_option(char *mntopt, unsigned long *mntflags,
-    unsigned long *zfsflags, int sloppy)
-{
-       const option_map_t *opt;
-       char *ptr, *name, *value = NULL;
-       int error = 0;
-
-       name = strdup(mntopt);
-       if (name == NULL)
-               return (ENOMEM);
-
-       for (ptr = name; ptr && *ptr; ptr++) {
-               if (*ptr == '=') {
-                       *ptr = '\0';
-                       value = ptr+1;
-                       VERIFY3P(value, !=, NULL);
-                       break;
-               }
-       }
-
-       for (opt = option_map; opt->name != NULL; opt++) {
-               if (strncmp(name, opt->name, strlen(name)) == 0) {
-                       *mntflags |= opt->mntmask;
-                       *zfsflags |= opt->zfsmask;
-                       error = 0;
-                       goto out;
-               }
-       }
-
-       if (!sloppy)
-               error = ENOENT;
-out:
-       /* If required further process on the value may be done here */
-       free(name);
-       return (error);
-}
-
-/*
- * Translate the mount option string in to MS_* mount flags for the
- * kernel vfs.  When sloppy is non-zero unknown options will be ignored
- * otherwise they are considered fatal are copied in to badopt.
- */
-static int
-parse_options(char *mntopts, unsigned long *mntflags, unsigned long *zfsflags,
-    int sloppy, char *badopt, char *mtabopt)
-{
-       int error = 0, quote = 0, flag = 0, count = 0;
-       char *ptr, *opt, *opts;
-
-       opts = strdup(mntopts);
-       if (opts == NULL)
-               return (ENOMEM);
-
-       *mntflags = 0;
-       opt = NULL;
-
-       /*
-        * Scan through all mount options which must be comma delimited.
-        * We must be careful to notice regions which are double quoted
-        * and skip commas in these regions.  Each option is then checked
-        * to determine if it is a known option.
-        */
-       for (ptr = opts; ptr && !flag; ptr++) {
-               if (opt == NULL)
-                       opt = ptr;
-
-               if (*ptr == '"')
-                       quote = !quote;
-
-               if (quote)
-                       continue;
-
-               if (*ptr == '\0')
-                       flag = 1;
-
-               if ((*ptr == ',') || (*ptr == '\0')) {
-                       *ptr = '\0';
-
-                       error = parse_option(opt, mntflags, zfsflags, sloppy);
-                       if (error) {
-                               strcpy(badopt, opt);
-                               goto out;
-
-                       }
-
-                       if (!(*mntflags & MS_REMOUNT) &&
-                           !(*zfsflags & ZS_ZFSUTIL)) {
-                               if (count > 0)
-                                       strlcat(mtabopt, ",", MNT_LINE_MAX);
-
-                               strlcat(mtabopt, opt, MNT_LINE_MAX);
-                               count++;
-                       }
-
-                       opt = NULL;
-               }
-       }
-
-out:
-       free(opts);
-       return (error);
-}
-
-/*
- * Return the pool/dataset to mount given the name passed to mount.  This
- * is expected to be of the form pool/dataset, however may also refer to
- * a block device if that device contains a valid zfs label.
- */
-static char *
-parse_dataset(char *dataset)
-{
-       char cwd[PATH_MAX];
-       struct stat64 statbuf;
-       int error;
-       int len;
-
-       /*
-        * We expect a pool/dataset to be provided, however if we're
-        * given a device which is a member of a zpool we attempt to
-        * extract the pool name stored in the label.  Given the pool
-        * name we can mount the root dataset.
-        */
-       error = stat64(dataset, &statbuf);
-       if (error == 0) {
-               nvlist_t *config;
-               char *name;
-               int fd;
-
-               fd = open(dataset, O_RDONLY);
-               if (fd < 0)
-                       goto out;
-
-               error = zpool_read_label(fd, &config, NULL);
-               (void) close(fd);
-               if (error)
-                       goto out;
-
-               error = nvlist_lookup_string(config,
-                   ZPOOL_CONFIG_POOL_NAME, &name);
-               if (error) {
-                       nvlist_free(config);
-               } else {
-                       dataset = strdup(name);
-                       nvlist_free(config);
-                       return (dataset);
-               }
-       }
-out:
-       /*
-        * If a file or directory in your current working directory is
-        * named 'dataset' then mount(8) will prepend your current working
-        * directory to the dataset.  There is no way to prevent this
-        * behavior so we simply check for it and strip the prepended
-        * patch when it is added.
-        */
-       if (getcwd(cwd, PATH_MAX) == NULL)
-               return (dataset);
-
-       len = strlen(cwd);
-
-       /* Do not add one when cwd already ends in a trailing '/' */
-       if (strncmp(cwd, dataset, len) == 0)
-               return (dataset + len + (cwd[len-1] != '/'));
-
-       return (dataset);
-}
-
-/*
- * Update the mtab_* code to use the libmount library when it is commonly
- * available otherwise fallback to legacy mode.  The mount(8) utility will
- * manage the lock file for us to prevent racing updates to /etc/mtab.
- */
-static int
-mtab_is_writeable(void)
-{
-       struct stat st;
-       int error, fd;
-
-       error = lstat(MNTTAB, &st);
-       if (error || S_ISLNK(st.st_mode))
-               return (0);
-
-       fd = open(MNTTAB, O_RDWR | O_CREAT, 0644);
-       if (fd < 0)
-               return (0);
-
-       close(fd);
-       return (1);
-}
-
-static int
-mtab_update(char *dataset, char *mntpoint, char *type, char *mntopts)
-{
-       struct mntent mnt;
-       FILE *fp;
-       int error;
-
-       mnt.mnt_fsname = dataset;
-       mnt.mnt_dir = mntpoint;
-       mnt.mnt_type = type;
-       mnt.mnt_opts = mntopts ? mntopts : "";
-       mnt.mnt_freq = 0;
-       mnt.mnt_passno = 0;
-
-       fp = setmntent(MNTTAB, "a+");
-       if (!fp) {
-               (void) fprintf(stderr, gettext(
-                   "filesystem '%s' was mounted, but %s "
-                   "could not be opened due to error %d\n"),
-                   dataset, MNTTAB, errno);
-               return (MOUNT_FILEIO);
-       }
-
-       error = addmntent(fp, &mnt);
-       if (error) {
-               (void) fprintf(stderr, gettext(
-                   "filesystem '%s' was mounted, but %s "
-                   "could not be updated due to error %d\n"),
-                   dataset, MNTTAB, errno);
-               return (MOUNT_FILEIO);
-       }
-
-       (void) endmntent(fp);
-
-       return (MOUNT_SUCCESS);
-}
-
-static void
-append_mntopt(const char *name, const char *val, char *mntopts,
-    char *mtabopt, boolean_t quote)
-{
-       char tmp[MNT_LINE_MAX];
-
-       snprintf(tmp, MNT_LINE_MAX, quote ? ",%s=\"%s\"" : ",%s=%s", name, val);
-
-       if (mntopts)
-               strlcat(mntopts, tmp, MNT_LINE_MAX);
-
-       if (mtabopt)
-               strlcat(mtabopt, tmp, MNT_LINE_MAX);
-}
-
-static void
-zfs_selinux_setcontext(zfs_handle_t *zhp, zfs_prop_t zpt, const char *name,
-    char *mntopts, char *mtabopt)
-{
-       char context[ZFS_MAXPROPLEN];
-
-       if (zfs_prop_get(zhp, zpt, context, sizeof (context),
-           NULL, NULL, 0, B_FALSE) == 0) {
-               if (strcmp(context, "none") != 0)
-                   append_mntopt(name, context, mntopts, mtabopt, B_TRUE);
-       }
-}
-
-int
-main(int argc, char **argv)
-{
-       zfs_handle_t *zhp;
-       char prop[ZFS_MAXPROPLEN];
-       uint64_t zfs_version = 0;
-       char mntopts[MNT_LINE_MAX] = { '\0' };
-       char badopt[MNT_LINE_MAX] = { '\0' };
-       char mtabopt[MNT_LINE_MAX] = { '\0' };
-       char mntpoint[PATH_MAX];
-       char *dataset;
-       unsigned long mntflags = 0, zfsflags = 0, remount = 0;
-       int sloppy = 0, fake = 0, verbose = 0, nomtab = 0, zfsutil = 0;
-       int error, c;
-
-       (void) setlocale(LC_ALL, "");
-       (void) textdomain(TEXT_DOMAIN);
-
-       opterr = 0;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "sfnvo:h?")) != -1) {
-               switch (c) {
-               case 's':
-                       sloppy = 1;
-                       break;
-               case 'f':
-                       fake = 1;
-                       break;
-               case 'n':
-                       nomtab = 1;
-                       break;
-               case 'v':
-                       verbose++;
-                       break;
-               case 'o':
-                       (void) strlcpy(mntopts, optarg, sizeof (mntopts));
-                       break;
-               case 'h':
-               case '?':
-                       (void) fprintf(stderr, gettext("Invalid option '%c'\n"),
-                           optopt);
-                       (void) fprintf(stderr, gettext("Usage: mount.zfs "
-                           "[-sfnv] [-o options] <dataset> <mountpoint>\n"));
-                       return (MOUNT_USAGE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check that we only have two arguments */
-       if (argc != 2) {
-               if (argc == 0)
-                       (void) fprintf(stderr, gettext("missing dataset "
-                           "argument\n"));
-               else if (argc == 1)
-                       (void) fprintf(stderr,
-                           gettext("missing mountpoint argument\n"));
-               else
-                       (void) fprintf(stderr, gettext("too many arguments\n"));
-               (void) fprintf(stderr, "usage: mount <dataset> <mountpoint>\n");
-               return (MOUNT_USAGE);
-       }
-
-       dataset = parse_dataset(argv[0]);
-
-       /* canonicalize the mount point */
-       if (realpath(argv[1], mntpoint) == NULL) {
-               (void) fprintf(stderr, gettext("filesystem '%s' cannot be "
-                   "mounted at '%s' due to canonicalization error %d.\n"),
-                   dataset, argv[1], errno);
-               return (MOUNT_SYSERR);
-       }
-
-       /* validate mount options and set mntflags */
-       error = parse_options(mntopts, &mntflags, &zfsflags, sloppy,
-           badopt, mtabopt);
-       if (error) {
-               switch (error) {
-               case ENOMEM:
-                       (void) fprintf(stderr, gettext("filesystem '%s' "
-                           "cannot be mounted due to a memory allocation "
-                           "failure.\n"), dataset);
-                       return (MOUNT_SYSERR);
-               case ENOENT:
-                       (void) fprintf(stderr, gettext("filesystem '%s' "
-                           "cannot be mounted due to invalid option "
-                           "'%s'.\n"), dataset, badopt);
-                       (void) fprintf(stderr, gettext("Use the '-s' option "
-                           "to ignore the bad mount option.\n"));
-                       return (MOUNT_USAGE);
-               default:
-                       (void) fprintf(stderr, gettext("filesystem '%s' "
-                           "cannot be mounted due to internal error %d.\n"),
-                           dataset, error);
-                       return (MOUNT_SOFTWARE);
-               }
-       }
-
-       if (verbose)
-               (void) fprintf(stdout, gettext("mount.zfs:\n"
-                   "  dataset:    \"%s\"\n  mountpoint: \"%s\"\n"
-                   "  mountflags: 0x%lx\n  zfsflags:   0x%lx\n"
-                   "  mountopts:  \"%s\"\n  mtabopts:   \"%s\"\n"),
-                   dataset, mntpoint, mntflags, zfsflags, mntopts, mtabopt);
-
-       if (mntflags & MS_REMOUNT) {
-               nomtab = 1;
-               remount = 1;
-       }
-
-       if (zfsflags & ZS_ZFSUTIL)
-               zfsutil = 1;
-
-       if ((g_zfs = libzfs_init()) == NULL) {
-               (void) fprintf(stderr, "%s", libzfs_error_init(errno));
-               return (MOUNT_SYSERR);
-       }
-
-       /* try to open the dataset to access the mount point */
-       if ((zhp = zfs_open(g_zfs, dataset,
-           ZFS_TYPE_FILESYSTEM | ZFS_TYPE_SNAPSHOT)) == NULL) {
-               (void) fprintf(stderr, gettext("filesystem '%s' cannot be "
-                   "mounted, unable to open the dataset\n"), dataset);
-               libzfs_fini(g_zfs);
-               return (MOUNT_USAGE);
-       }
-
-       /*
-        * Checks to see if the ZFS_PROP_SELINUX_CONTEXT exists
-        * if it does, create a tmp variable in case it's needed
-        * checks to see if the selinux context is set to the default
-        * if it is, allow the setting of the other context properties
-        * this is needed because the 'context' property overrides others
-        * if it is not the default, set the 'context' property
-        */
-       if (zfs_prop_get(zhp, ZFS_PROP_SELINUX_CONTEXT, prop, sizeof (prop),
-           NULL, NULL, 0, B_FALSE) == 0) {
-               if (strcmp(prop, "none") == 0) {
-                       zfs_selinux_setcontext(zhp, ZFS_PROP_SELINUX_FSCONTEXT,
-                           MNTOPT_FSCONTEXT, mntopts, mtabopt);
-                       zfs_selinux_setcontext(zhp, ZFS_PROP_SELINUX_DEFCONTEXT,
-                           MNTOPT_DEFCONTEXT, mntopts, mtabopt);
-                       zfs_selinux_setcontext(zhp,
-                           ZFS_PROP_SELINUX_ROOTCONTEXT, MNTOPT_ROOTCONTEXT,
-                           mntopts, mtabopt);
-               } else {
-                       append_mntopt(MNTOPT_CONTEXT, prop,
-                           mntopts, mtabopt, B_TRUE);
-               }
-       }
-
-       /* A hint used to determine an auto-mounted snapshot mount point */
-       append_mntopt(MNTOPT_MNTPOINT, mntpoint, mntopts, NULL, B_FALSE);
-
-       /* treat all snapshots as legacy mount points */
-       if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT)
-               (void) strlcpy(prop, ZFS_MOUNTPOINT_LEGACY, ZFS_MAXPROPLEN);
-       else
-               (void) zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, prop,
-                   sizeof (prop), NULL, NULL, 0, B_FALSE);
-
-       /*
-        * Fetch the max supported zfs version in case we get ENOTSUP
-        * back from the mount command, since we need the zfs handle
-        * to do so.
-        */
-       zfs_version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
-       if (zfs_version == 0) {
-               fprintf(stderr, gettext("unable to fetch "
-                   "ZFS version for filesystem '%s'\n"), dataset);
-               return (MOUNT_SYSERR);
-       }
-
-       zfs_close(zhp);
-       libzfs_fini(g_zfs);
-
-       /*
-        * Legacy mount points may only be mounted using 'mount', never using
-        * 'zfs mount'.  However, since 'zfs mount' actually invokes 'mount'
-        * we differentiate the two cases using the 'zfsutil' mount option.
-        * This mount option should only be supplied by the 'zfs mount' util.
-        *
-        * The only exception to the above rule is '-o remount' which is
-        * always allowed for non-legacy datasets.  This is done because when
-        * using zfs as your root file system both rc.sysinit/umountroot and
-        * systemd depend on 'mount -o remount <mountpoint>' to work.
-        */
-       if (zfsutil && (strcmp(prop, ZFS_MOUNTPOINT_LEGACY) == 0)) {
-               (void) fprintf(stderr, gettext(
-                   "filesystem '%s' cannot be mounted using 'zfs mount'.\n"
-                   "Use 'zfs set mountpoint=%s' or 'mount -t zfs %s %s'.\n"
-                   "See zfs(8) for more information.\n"),
-                   dataset, mntpoint, dataset, mntpoint);
-               return (MOUNT_USAGE);
-       }
-
-       if (!zfsutil && !(remount || fake) &&
-           strcmp(prop, ZFS_MOUNTPOINT_LEGACY)) {
-               (void) fprintf(stderr, gettext(
-                   "filesystem '%s' cannot be mounted using 'mount'.\n"
-                   "Use 'zfs set mountpoint=%s' or 'zfs mount %s'.\n"
-                   "See zfs(8) for more information.\n"),
-                   dataset, "legacy", dataset);
-               return (MOUNT_USAGE);
-       }
-
-       if (!fake) {
-               error = mount(dataset, mntpoint, MNTTYPE_ZFS,
-                   mntflags, mntopts);
-       }
-
-       if (error) {
-               switch (errno) {
-               case ENOENT:
-                       (void) fprintf(stderr, gettext("mount point "
-                           "'%s' does not exist\n"), mntpoint);
-                       return (MOUNT_SYSERR);
-               case EBUSY:
-                       (void) fprintf(stderr, gettext("filesystem "
-                           "'%s' is already mounted\n"), dataset);
-                       return (MOUNT_BUSY);
-               case ENOTSUP:
-                       if (zfs_version > ZPL_VERSION) {
-                               (void) fprintf(stderr,
-                                   gettext("filesystem '%s' (v%d) is not "
-                                   "supported by this implementation of "
-                                   "ZFS (max v%d).\n"), dataset,
-                                   (int) zfs_version, (int) ZPL_VERSION);
-                       } else {
-                               (void) fprintf(stderr,
-                                   gettext("filesystem '%s' mount "
-                                   "failed for unknown reason.\n"), dataset);
-                       }
-                       return (MOUNT_SYSERR);
-               default:
-                       (void) fprintf(stderr, gettext("filesystem "
-                           "'%s' can not be mounted due to error "
-                           "%d\n"), dataset, errno);
-                       return (MOUNT_USAGE);
-               }
-       }
-
-       if (!nomtab && mtab_is_writeable()) {
-               error = mtab_update(dataset, mntpoint, MNTTYPE_ZFS, mtabopt);
-               if (error)
-                       return (error);
-       }
-
-       return (MOUNT_SUCCESS);
-}
diff --git a/zfs/cmd/vdev_id/Makefile.am b/zfs/cmd/vdev_id/Makefile.am
deleted file mode 100644 (file)
index fb815fa..0000000
+++ /dev/null
@@ -1 +0,0 @@
-dist_udev_SCRIPTS = vdev_id
diff --git a/zfs/cmd/vdev_id/Makefile.in b/zfs/cmd/vdev_id/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/vdev_id/vdev_id b/zfs/cmd/vdev_id/vdev_id
deleted file mode 100755 (executable)
index 0d617a8..0000000
+++ /dev/null
@@ -1,403 +0,0 @@
-#!/bin/sh
-#
-# vdev_id: udev helper to generate user-friendly names for JBOD disks
-#
-# This script parses the file /etc/zfs/vdev_id.conf to map a
-# physical path in a storage topology to a channel name.  The
-# channel name is combined with a disk enclosure slot number to
-# create an alias that reflects the physical location of the drive.
-# This is particularly helpful when it comes to tasks like replacing
-# failed drives.  Slot numbers may also be re-mapped in case the
-# default numbering is unsatisfactory.  The drive aliases will be
-# created as symbolic links in /dev/disk/by-vdev.
-#
-# The currently supported topologies are sas_direct and sas_switch.
-# A multipath mode is supported in which dm-mpath devices are
-# handled by examining the first-listed running component disk.  In
-# multipath mode the configuration file should contain a channel
-# definition with the same name for each path to a given enclosure.
-#
-# The alias keyword provides a simple way to map already-existing
-# device symlinks to more convenient names.  It is suitable for
-# small, static configurations or for sites that have some automated
-# way to generate the mapping file.
-#
-#
-# Some example configuration files are given below.
-
-# #
-# # Example vdev_id.conf - sas_direct.
-# #
-#
-# multipath     no
-# topology      sas_direct
-# phys_per_port 4
-# slot          bay
-#
-# #       PCI_ID  HBA PORT  CHANNEL NAME
-# channel 85:00.0 1         A
-# channel 85:00.0 0         B
-# channel 86:00.0 1         C
-# channel 86:00.0 0         D
-#
-# # Custom mapping for Channel A
-#
-# #    Linux      Mapped
-# #    Slot       Slot      Channel
-# slot 1          7         A
-# slot 2          10        A
-# slot 3          3         A
-# slot 4          6         A
-#
-# # Default mapping for B, C, and D
-# slot 1          4
-# slot 2          2
-# slot 3          1
-# slot 4          3
-
-# #
-# # Example vdev_id.conf - sas_switch
-# #
-#
-# topology      sas_switch
-#
-# #       SWITCH PORT  CHANNEL NAME
-# channel 1            A
-# channel 2            B
-# channel 3            C
-# channel 4            D
-
-# #
-# # Example vdev_id.conf - multipath
-# #
-#
-# multipath yes
-#
-# #       PCI_ID  HBA PORT  CHANNEL NAME
-# channel 85:00.0 1         A
-# channel 85:00.0 0         B
-# channel 86:00.0 1         A
-# channel 86:00.0 0         B
-
-# #
-# # Example vdev_id.conf - alias
-# #
-#
-# #     by-vdev
-# #     name     fully qualified or base name of device link
-# alias d1       /dev/disk/by-id/wwn-0x5000c5002de3b9ca
-# alias d2       wwn-0x5000c5002def789e
-
-PATH=/bin:/sbin:/usr/bin:/usr/sbin
-CONFIG=/etc/zfs/vdev_id.conf
-PHYS_PER_PORT=
-DEV=
-MULTIPATH=
-TOPOLOGY=
-BAY=
-
-usage() {
-       cat << EOF
-Usage: vdev_id [-h]
-       vdev_id <-d device> [-c config_file] [-p phys_per_port]
-               [-g sas_direct|sas_switch] [-m]
-
-  -c    specify name of alernate config file [default=$CONFIG]
-  -d    specify basename of device (i.e. sda)
-  -g    Storage network topology [default="$TOPOLOGY"]
-  -m    Run in multipath mode
-  -p    number of phy's per switch port [default=$PHYS_PER_PORT]
-  -h    show this summary
-EOF
-       exit 0
-}
-
-map_slot() {
-       local LINUX_SLOT=$1
-       local CHANNEL=$2
-       local MAPPED_SLOT=
-
-       MAPPED_SLOT=`awk "\\$1 == \"slot\" && \\$2 == ${LINUX_SLOT} && \
-                       \\$4 ~ /^${CHANNEL}$|^$/ { print \\$3; exit }" $CONFIG`
-       if [ -z "$MAPPED_SLOT" ] ; then
-               MAPPED_SLOT=$LINUX_SLOT
-       fi
-       printf "%d" ${MAPPED_SLOT}
-}
-
-map_channel() {
-       local MAPPED_CHAN=
-       local PCI_ID=$1
-       local PORT=$2
-
-       case $TOPOLOGY in
-               "sas_switch")
-               MAPPED_CHAN=`awk "\\$1 == \"channel\" && \\$2 == ${PORT} \
-                       { print \\$3; exit }" $CONFIG`
-               ;;
-               "sas_direct")
-               MAPPED_CHAN=`awk "\\$1 == \"channel\" && \
-                       \\$2 == \"${PCI_ID}\" && \\$3 == ${PORT} \
-                       { print \\$4; exit }" $CONFIG`
-               ;;
-       esac
-       printf "%s" ${MAPPED_CHAN}
-}
-
-sas_handler() {
-       if [ -z "$PHYS_PER_PORT" ] ; then
-               PHYS_PER_PORT=`awk "\\$1 == \"phys_per_port\" \
-                       {print \\$2; exit}" $CONFIG`
-       fi
-       PHYS_PER_PORT=${PHYS_PER_PORT:-4}
-       if ! echo $PHYS_PER_PORT | grep -q -E '^[0-9]+$' ; then
-               echo "Error: phys_per_port value $PHYS_PER_PORT is non-numeric"
-               exit 1
-       fi
-
-       if [ -z "$MULTIPATH_MODE" ] ; then
-               MULTIPATH_MODE=`awk "\\$1 == \"multipath\" \
-                       {print \\$2; exit}" $CONFIG`
-       fi
-
-       # Use first running component device if we're handling a dm-mpath device
-       if [ "$MULTIPATH_MODE" = "yes" ] ; then
-               # If udev didn't tell us the UUID via DM_NAME, check /dev/mapper
-               if [ -z "$DM_NAME" ] ; then
-                       DM_NAME=`ls -l --full-time /dev/mapper |
-                               awk "/\/$DEV$/{print \\$9}"`
-               fi
-
-               # For raw disks udev exports DEVTYPE=partition when
-               # handling partitions, and the rules can be written to
-               # take advantage of this to append a -part suffix.  For
-               # dm devices we get DEVTYPE=disk even for partitions so
-               # we have to append the -part suffix directly in the
-               # helper.
-               if [ "$DEVTYPE" != "partition" ] ; then
-                       PART=`echo $DM_NAME | awk -Fp '/p/{print "-part"$2}'`
-               fi
-
-               # Strip off partition information.
-               DM_NAME=`echo $DM_NAME | sed 's/p[0-9][0-9]*$//'`
-               if [ -z "$DM_NAME" ] ; then
-                       return
-               fi
-
-               # Get the raw scsi device name from multipath -l.  Strip off
-               # leading pipe symbols to make field numbering consistent.
-               DEV=`multipath -l $DM_NAME |
-                       awk '/running/{gsub("^[|]"," "); print $3 ; exit}'`
-               if [ -z "$DEV" ] ; then
-                       return
-               fi
-       fi
-
-       if echo $DEV | grep -q ^/devices/ ; then
-               sys_path=$DEV
-       else
-               sys_path=`udevadm info -q path -p /sys/block/$DEV 2>/dev/null`
-       fi
-
-       # Use positional parameters as an ad-hoc array
-       set -- $(echo "$sys_path" | tr / ' ')
-       num_dirs=$#
-       scsi_host_dir="/sys"
-
-       # Get path up to /sys/.../hostX
-       i=1
-       while [ $i -le $num_dirs ] ; do
-               d=$(eval echo \${$i})
-               scsi_host_dir="$scsi_host_dir/$d"
-               echo $d | grep -q -E '^host[0-9]+$' && break
-               i=$(($i + 1))
-       done
-
-       if [ $i = $num_dirs ] ; then
-               return
-       fi
-
-       PCI_ID=$(eval echo \${$(($i -1))} | awk -F: '{print $2":"$3}')
-
-       # In sas_switch mode, the directory four levels beneath
-       # /sys/.../hostX contains symlinks to phy devices that reveal
-       # the switch port number.  In sas_direct mode, the phy links one
-       # directory down reveal the HBA port.
-       port_dir=$scsi_host_dir
-       case $TOPOLOGY in
-               "sas_switch") j=$(($i + 4)) ;;
-               "sas_direct") j=$(($i + 1)) ;;
-       esac
-
-       i=$(($i + 1))
-       while [ $i -le $j ] ; do
-               port_dir="$port_dir/$(eval echo \${$i})"
-               i=$(($i + 1))
-       done
-
-       PHY=`ls -d $port_dir/phy* 2>/dev/null | head -1 | awk -F: '{print $NF}'`
-       if [ -z "$PHY" ] ; then
-               return
-       fi
-       PORT=$(( $PHY / $PHYS_PER_PORT ))
-
-       # Look in /sys/.../sas_device/end_device-X for the bay_identifier
-       # attribute.
-       end_device_dir=$port_dir
-       while [ $i -lt $num_dirs ] ; do
-               d=$(eval echo \${$i})
-               end_device_dir="$end_device_dir/$d"
-               if echo $d | grep -q '^end_device' ; then
-                       end_device_dir="$end_device_dir/sas_device/$d"
-                       break
-               fi
-               i=$(($i + 1))
-       done
-
-       SLOT=
-       case $BAY in
-       "bay")
-               SLOT=`cat $end_device_dir/bay_identifier 2>/dev/null`
-               ;;
-       "phy")
-               SLOT=`cat $end_device_dir/phy_identifier 2>/dev/null`
-               ;;
-       "id")
-               i=$(($i + 1))
-               d=$(eval echo \${$i})
-               SLOT=`echo $d | sed -e 's/^.*://'`
-               ;;
-       "lun")
-               i=$(($i + 2))
-               d=$(eval echo \${$i})
-               SLOT=`echo $d | sed -e 's/^.*://'`
-               ;;
-       esac
-       if [ -z "$SLOT" ] ; then
-               return
-       fi
-
-       CHAN=`map_channel $PCI_ID $PORT`
-       SLOT=`map_slot $SLOT $CHAN`
-       if [ -z "$CHAN" ] ; then
-               return
-       fi
-       echo ${CHAN}${SLOT}${PART}
-}
-
-alias_handler () {
-       # Special handling is needed to correctly append a -part suffix
-       # to partitions of device mapper devices.  The DEVTYPE attribute
-       # is normally set to "disk" instead of "partition" in this case,
-       # so the udev rules won't handle that for us as they do for
-       # "plain" block devices.
-       #
-       # For example, we may have the following links for a device and its
-       # partitions,
-       #
-       #  /dev/disk/by-id/dm-name-isw_dibgbfcije_ARRAY0   -> ../../dm-0
-       #  /dev/disk/by-id/dm-name-isw_dibgbfcije_ARRAY0p1 -> ../../dm-1
-       #  /dev/disk/by-id/dm-name-isw_dibgbfcije_ARRAY0p2 -> ../../dm-3
-       #
-       # and the following alias in vdev_id.conf.
-       #
-       #   alias A0 dm-name-isw_dibgbfcije_ARRAY0
-       #
-       # The desired outcome is for the following links to be created
-       # without having explicitly defined aliases for the partitions.
-       #
-       #  /dev/disk/by-vdev/A0       -> ../../dm-0
-       #  /dev/disk/by-vdev/A0-part1 -> ../../dm-1
-       #  /dev/disk/by-vdev/A0-part2 -> ../../dm-3
-       #
-       # Warning: The following grep pattern will misidentify whole-disk
-       #          devices whose names end with 'p' followed by a string of
-       #          digits as partitions, causing alias creation to fail. This
-       #          ambiguity seems unavoidable, so devices using this facility
-       #          must not use such names.
-       local DM_PART=
-       if echo $DM_NAME | grep -q -E 'p[0-9][0-9]*$' ; then
-               if [ "$DEVTYPE" != "partition" ] ; then
-                       DM_PART=`echo $DM_NAME | awk -Fp '/p/{print "-part"$2}'`
-               fi
-       fi
-
-       # DEVLINKS attribute must have been populated by already-run udev rules.
-       for link in $DEVLINKS ; do
-               # Remove partition information to match key of top-level device.
-               if [ -n "$DM_PART" ] ; then
-                       link=`echo $link | sed 's/p[0-9][0-9]*$//'`
-               fi
-               # Check both the fully qualified and the base name of link.
-               for l in $link `basename $link` ; do
-                       alias=`awk "\\$1 == \"alias\" && \\$3 == \"${l}\" \
-                                       { print \\$2; exit }" $CONFIG`
-                       if [ -n "$alias" ] ; then
-                               echo ${alias}${DM_PART}
-                               return
-                       fi
-               done
-       done
-}
-
-while getopts 'c:d:g:mp:h' OPTION; do
-       case ${OPTION} in
-       c)
-               CONFIG=${OPTARG}
-               ;;
-       d)
-               DEV=${OPTARG}
-               ;;
-       g)
-               TOPOLOGY=$OPTARG
-               ;;
-       p)
-               PHYS_PER_PORT=${OPTARG}
-               ;;
-       m)
-               MULTIPATH_MODE=yes
-               ;;
-       h)
-               usage
-               ;;
-       esac
-done
-
-if [ ! -r $CONFIG ] ; then
-       exit 0
-fi
-
-if [ -z "$DEV" ] ; then
-       echo "Error: missing required option -d"
-       exit 1
-fi
-
-if [ -z "$TOPOLOGY" ] ; then
-       TOPOLOGY=`awk "\\$1 == \"topology\" {print \\$2; exit}" $CONFIG`
-fi
-
-if [ -z "$BAY" ] ; then
-       BAY=`awk "\\$1 == \"slot\" {print \\$2; exit}" $CONFIG`
-fi
-
-# First check if an alias was defined for this device.
-ID_VDEV=`alias_handler`
-
-if [ -z "$ID_VDEV" ] ; then
-       BAY=${BAY:-bay}
-       TOPOLOGY=${TOPOLOGY:-sas_direct}
-       case $TOPOLOGY in
-               sas_direct|sas_switch)
-                       ID_VDEV=`sas_handler`
-                       ;;
-               *)
-                       echo "Error: unknown topology $TOPOLOGY"
-                       exit 1
-                       ;;
-       esac
-fi
-
-if [ -n "$ID_VDEV" ] ; then
-       echo "ID_VDEV=${ID_VDEV}"
-       echo "ID_VDEV_PATH=disk/by-vdev/${ID_VDEV}"
-fi
diff --git a/zfs/cmd/zdb/.gitignore b/zfs/cmd/zdb/.gitignore
deleted file mode 100644 (file)
index f64a3fc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zdb
diff --git a/zfs/cmd/zdb/Makefile.am b/zfs/cmd/zdb/Makefile.am
deleted file mode 100644 (file)
index bc47cff..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-sbin_PROGRAMS = zdb
-
-zdb_SOURCES = \
-       zdb.c \
-       zdb_il.c
-
-zdb_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
-
-zdb_LDADD += $(ZLIB)
diff --git a/zfs/cmd/zdb/Makefile.in b/zfs/cmd/zdb/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zdb/zdb.c b/zfs/cmd/zdb/zdb.c
deleted file mode 100644 (file)
index 18378c4..0000000
+++ /dev/null
@@ -1,3868 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
- * Copyright (c) 2015, Intel Corporation.
- */
-
-#include <stdio.h>
-#include <unistd.h>
-#include <stdio_ext.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/zfs_context.h>
-#include <sys/spa.h>
-#include <sys/spa_impl.h>
-#include <sys/dmu.h>
-#include <sys/zap.h>
-#include <sys/fs/zfs.h>
-#include <sys/zfs_znode.h>
-#include <sys/zfs_sa.h>
-#include <sys/sa.h>
-#include <sys/sa_impl.h>
-#include <sys/vdev.h>
-#include <sys/vdev_impl.h>
-#include <sys/metaslab_impl.h>
-#include <sys/dmu_objset.h>
-#include <sys/dsl_dir.h>
-#include <sys/dsl_dataset.h>
-#include <sys/dsl_pool.h>
-#include <sys/dbuf.h>
-#include <sys/zil.h>
-#include <sys/zil_impl.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
-#include <sys/dmu_traverse.h>
-#include <sys/zio_checksum.h>
-#include <sys/zio_compress.h>
-#include <sys/zfs_fuid.h>
-#include <sys/arc.h>
-#include <sys/ddt.h>
-#include <sys/zfeature.h>
-#include <zfs_comutil.h>
-#undef ZFS_MAXNAMELEN
-#include <libzfs.h>
-
-#define        ZDB_COMPRESS_NAME(idx) ((idx) < ZIO_COMPRESS_FUNCTIONS ?        \
-       zio_compress_table[(idx)].ci_name : "UNKNOWN")
-#define        ZDB_CHECKSUM_NAME(idx) ((idx) < ZIO_CHECKSUM_FUNCTIONS ?        \
-       zio_checksum_table[(idx)].ci_name : "UNKNOWN")
-#define        ZDB_OT_NAME(idx) ((idx) < DMU_OT_NUMTYPES ?     \
-       dmu_ot[(idx)].ot_name : DMU_OT_IS_VALID(idx) ?  \
-       dmu_ot_byteswap[DMU_OT_BYTESWAP(idx)].ob_name : "UNKNOWN")
-#define        ZDB_OT_TYPE(idx) ((idx) < DMU_OT_NUMTYPES ? (idx) :             \
-       (((idx) == DMU_OTN_ZAP_DATA || (idx) == DMU_OTN_ZAP_METADATA) ? \
-       DMU_OT_ZAP_OTHER : DMU_OT_NUMTYPES))
-
-#ifndef lint
-extern int zfs_recover;
-extern uint64_t zfs_arc_max, zfs_arc_meta_limit;
-extern int zfs_vdev_async_read_max_active;
-#else
-int zfs_recover;
-uint64_t zfs_arc_max, zfs_arc_meta_limit;
-int zfs_vdev_async_read_max_active;
-#endif
-
-const char cmdname[] = "zdb";
-uint8_t dump_opt[256];
-
-typedef void object_viewer_t(objset_t *, uint64_t, void *data, size_t size);
-
-extern void dump_intent_log(zilog_t *);
-uint64_t *zopt_object = NULL;
-int zopt_objects = 0;
-libzfs_handle_t *g_zfs;
-uint64_t max_inflight = 1000;
-
-static void snprintf_blkptr_compact(char *, size_t, const blkptr_t *);
-
-/*
- * These libumem hooks provide a reasonable set of defaults for the allocator's
- * debugging facilities.
- */
-const char *
-_umem_debug_init(void)
-{
-       return ("default,verbose"); /* $UMEM_DEBUG setting */
-}
-
-const char *
-_umem_logging_init(void)
-{
-       return ("fail,contents"); /* $UMEM_LOGGING setting */
-}
-
-static void
-usage(void)
-{
-       (void) fprintf(stderr,
-           "Usage: %s [-CumMdibcsDvhLXFPA] [-t txg] [-e [-p path...]] "
-           "[-U config] [-I inflight I/Os] poolname [object...]\n"
-           "       %s [-divPA] [-e -p path...] [-U config] dataset "
-           "[object...]\n"
-           "       %s -mM [-LXFPA] [-t txg] [-e [-p path...]] [-U config] "
-           "poolname [vdev [metaslab...]]\n"
-           "       %s -R [-A] [-e [-p path...]] poolname "
-           "vdev:offset:size[:flags]\n"
-           "       %s -S [-PA] [-e [-p path...]] [-U config] poolname\n"
-           "       %s -l [-uA] device\n"
-           "       %s -C [-A] [-U config]\n\n",
-           cmdname, cmdname, cmdname, cmdname, cmdname, cmdname, cmdname);
-
-       (void) fprintf(stderr, "    Dataset name must include at least one "
-           "separator character '/' or '@'\n");
-       (void) fprintf(stderr, "    If dataset name is specified, only that "
-           "dataset is dumped\n");
-       (void) fprintf(stderr, "    If object numbers are specified, only "
-           "those objects are dumped\n\n");
-       (void) fprintf(stderr, "    Options to control amount of output:\n");
-       (void) fprintf(stderr, "        -u uberblock\n");
-       (void) fprintf(stderr, "        -d dataset(s)\n");
-       (void) fprintf(stderr, "        -i intent logs\n");
-       (void) fprintf(stderr, "        -C config (or cachefile if alone)\n");
-       (void) fprintf(stderr, "        -h pool history\n");
-       (void) fprintf(stderr, "        -b block statistics\n");
-       (void) fprintf(stderr, "        -m metaslabs\n");
-       (void) fprintf(stderr, "        -M metaslab groups\n");
-       (void) fprintf(stderr, "        -c checksum all metadata (twice for "
-           "all data) blocks\n");
-       (void) fprintf(stderr, "        -s report stats on zdb's I/O\n");
-       (void) fprintf(stderr, "        -D dedup statistics\n");
-       (void) fprintf(stderr, "        -S simulate dedup to measure effect\n");
-       (void) fprintf(stderr, "        -v verbose (applies to all others)\n");
-       (void) fprintf(stderr, "        -l dump label contents\n");
-       (void) fprintf(stderr, "        -L disable leak tracking (do not "
-           "load spacemaps)\n");
-       (void) fprintf(stderr, "        -R read and display block from a "
-           "device\n\n");
-       (void) fprintf(stderr, "    Below options are intended for use "
-           "with other options (except -l):\n");
-       (void) fprintf(stderr, "        -A ignore assertions (-A), enable "
-           "panic recovery (-AA) or both (-AAA)\n");
-       (void) fprintf(stderr, "        -F attempt automatic rewind within "
-           "safe range of transaction groups\n");
-       (void) fprintf(stderr, "        -U <cachefile_path> -- use alternate "
-           "cachefile\n");
-       (void) fprintf(stderr, "        -X attempt extreme rewind (does not "
-           "work with dataset)\n");
-       (void) fprintf(stderr, "        -e pool is exported/destroyed/"
-           "has altroot/not in a cachefile\n");
-       (void) fprintf(stderr, "        -p <path> -- use one or more with "
-           "-e to specify path to vdev dir\n");
-       (void) fprintf(stderr, "        -P print numbers in parseable form\n");
-       (void) fprintf(stderr, "        -t <txg> -- highest txg to use when "
-           "searching for uberblocks\n");
-       (void) fprintf(stderr, "        -I <number of inflight I/Os> -- "
-           "specify the maximum number of checksumming I/Os "
-           "[default is 200]\n");
-       (void) fprintf(stderr, "Specify an option more than once (e.g. -bb) "
-           "to make only that option verbose\n");
-       (void) fprintf(stderr, "Default is to dump everything non-verbosely\n");
-       exit(1);
-}
-
-/*
- * Called for usage errors that are discovered after a call to spa_open(),
- * dmu_bonus_hold(), or pool_match().  abort() is called for other errors.
- */
-
-static void
-fatal(const char *fmt, ...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-       (void) fprintf(stderr, "%s: ", cmdname);
-       (void) vfprintf(stderr, fmt, ap);
-       va_end(ap);
-       (void) fprintf(stderr, "\n");
-
-       exit(1);
-}
-
-/* ARGSUSED */
-static void
-dump_packed_nvlist(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       nvlist_t *nv;
-       size_t nvsize = *(uint64_t *)data;
-       char *packed = umem_alloc(nvsize, UMEM_NOFAIL);
-
-       VERIFY(0 == dmu_read(os, object, 0, nvsize, packed, DMU_READ_PREFETCH));
-
-       VERIFY(nvlist_unpack(packed, nvsize, &nv, 0) == 0);
-
-       umem_free(packed, nvsize);
-
-       dump_nvlist(nv, 8);
-
-       nvlist_free(nv);
-}
-
-/* ARGSUSED */
-static void
-dump_history_offsets(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       spa_history_phys_t *shp = data;
-
-       if (shp == NULL)
-               return;
-
-       (void) printf("\t\tpool_create_len = %llu\n",
-           (u_longlong_t)shp->sh_pool_create_len);
-       (void) printf("\t\tphys_max_off = %llu\n",
-           (u_longlong_t)shp->sh_phys_max_off);
-       (void) printf("\t\tbof = %llu\n",
-           (u_longlong_t)shp->sh_bof);
-       (void) printf("\t\teof = %llu\n",
-           (u_longlong_t)shp->sh_eof);
-       (void) printf("\t\trecords_lost = %llu\n",
-           (u_longlong_t)shp->sh_records_lost);
-}
-
-static void
-zdb_nicenum(uint64_t num, char *buf)
-{
-       if (dump_opt['P'])
-               (void) sprintf(buf, "%llu", (longlong_t)num);
-       else
-               nicenum(num, buf);
-}
-
-const char histo_stars[] = "****************************************";
-const int histo_width = sizeof (histo_stars) - 1;
-
-static void
-dump_histogram(const uint64_t *histo, int size, int offset)
-{
-       int i;
-       int minidx = size - 1;
-       int maxidx = 0;
-       uint64_t max = 0;
-
-       for (i = 0; i < size; i++) {
-               if (histo[i] > max)
-                       max = histo[i];
-               if (histo[i] > 0 && i > maxidx)
-                       maxidx = i;
-               if (histo[i] > 0 && i < minidx)
-                       minidx = i;
-       }
-
-       if (max < histo_width)
-               max = histo_width;
-
-       for (i = minidx; i <= maxidx; i++) {
-               (void) printf("\t\t\t%3u: %6llu %s\n",
-                   i + offset, (u_longlong_t)histo[i],
-                   &histo_stars[(max - histo[i]) * histo_width / max]);
-       }
-}
-
-static void
-dump_zap_stats(objset_t *os, uint64_t object)
-{
-       int error;
-       zap_stats_t zs;
-
-       error = zap_get_stats(os, object, &zs);
-       if (error)
-               return;
-
-       if (zs.zs_ptrtbl_len == 0) {
-               ASSERT(zs.zs_num_blocks == 1);
-               (void) printf("\tmicrozap: %llu bytes, %llu entries\n",
-                   (u_longlong_t)zs.zs_blocksize,
-                   (u_longlong_t)zs.zs_num_entries);
-               return;
-       }
-
-       (void) printf("\tFat ZAP stats:\n");
-
-       (void) printf("\t\tPointer table:\n");
-       (void) printf("\t\t\t%llu elements\n",
-           (u_longlong_t)zs.zs_ptrtbl_len);
-       (void) printf("\t\t\tzt_blk: %llu\n",
-           (u_longlong_t)zs.zs_ptrtbl_zt_blk);
-       (void) printf("\t\t\tzt_numblks: %llu\n",
-           (u_longlong_t)zs.zs_ptrtbl_zt_numblks);
-       (void) printf("\t\t\tzt_shift: %llu\n",
-           (u_longlong_t)zs.zs_ptrtbl_zt_shift);
-       (void) printf("\t\t\tzt_blks_copied: %llu\n",
-           (u_longlong_t)zs.zs_ptrtbl_blks_copied);
-       (void) printf("\t\t\tzt_nextblk: %llu\n",
-           (u_longlong_t)zs.zs_ptrtbl_nextblk);
-
-       (void) printf("\t\tZAP entries: %llu\n",
-           (u_longlong_t)zs.zs_num_entries);
-       (void) printf("\t\tLeaf blocks: %llu\n",
-           (u_longlong_t)zs.zs_num_leafs);
-       (void) printf("\t\tTotal blocks: %llu\n",
-           (u_longlong_t)zs.zs_num_blocks);
-       (void) printf("\t\tzap_block_type: 0x%llx\n",
-           (u_longlong_t)zs.zs_block_type);
-       (void) printf("\t\tzap_magic: 0x%llx\n",
-           (u_longlong_t)zs.zs_magic);
-       (void) printf("\t\tzap_salt: 0x%llx\n",
-           (u_longlong_t)zs.zs_salt);
-
-       (void) printf("\t\tLeafs with 2^n pointers:\n");
-       dump_histogram(zs.zs_leafs_with_2n_pointers, ZAP_HISTOGRAM_SIZE, 0);
-
-       (void) printf("\t\tBlocks with n*5 entries:\n");
-       dump_histogram(zs.zs_blocks_with_n5_entries, ZAP_HISTOGRAM_SIZE, 0);
-
-       (void) printf("\t\tBlocks n/10 full:\n");
-       dump_histogram(zs.zs_blocks_n_tenths_full, ZAP_HISTOGRAM_SIZE, 0);
-
-       (void) printf("\t\tEntries with n chunks:\n");
-       dump_histogram(zs.zs_entries_using_n_chunks, ZAP_HISTOGRAM_SIZE, 0);
-
-       (void) printf("\t\tBuckets with n entries:\n");
-       dump_histogram(zs.zs_buckets_with_n_entries, ZAP_HISTOGRAM_SIZE, 0);
-}
-
-/*ARGSUSED*/
-static void
-dump_none(objset_t *os, uint64_t object, void *data, size_t size)
-{
-}
-
-/*ARGSUSED*/
-static void
-dump_unknown(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       (void) printf("\tUNKNOWN OBJECT TYPE\n");
-}
-
-/*ARGSUSED*/
-void
-dump_uint8(objset_t *os, uint64_t object, void *data, size_t size)
-{
-}
-
-/*ARGSUSED*/
-static void
-dump_uint64(objset_t *os, uint64_t object, void *data, size_t size)
-{
-}
-
-/*ARGSUSED*/
-static void
-dump_zap(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       zap_cursor_t zc;
-       zap_attribute_t attr;
-       void *prop;
-       int i;
-
-       dump_zap_stats(os, object);
-       (void) printf("\n");
-
-       for (zap_cursor_init(&zc, os, object);
-           zap_cursor_retrieve(&zc, &attr) == 0;
-           zap_cursor_advance(&zc)) {
-               (void) printf("\t\t%s = ", attr.za_name);
-               if (attr.za_num_integers == 0) {
-                       (void) printf("\n");
-                       continue;
-               }
-               prop = umem_zalloc(attr.za_num_integers *
-                   attr.za_integer_length, UMEM_NOFAIL);
-               (void) zap_lookup(os, object, attr.za_name,
-                   attr.za_integer_length, attr.za_num_integers, prop);
-               if (attr.za_integer_length == 1) {
-                       (void) printf("%s", (char *)prop);
-               } else {
-                       for (i = 0; i < attr.za_num_integers; i++) {
-                               switch (attr.za_integer_length) {
-                               case 2:
-                                       (void) printf("%u ",
-                                           ((uint16_t *)prop)[i]);
-                                       break;
-                               case 4:
-                                       (void) printf("%u ",
-                                           ((uint32_t *)prop)[i]);
-                                       break;
-                               case 8:
-                                       (void) printf("%lld ",
-                                           (u_longlong_t)((int64_t *)prop)[i]);
-                                       break;
-                               }
-                       }
-               }
-               (void) printf("\n");
-               umem_free(prop, attr.za_num_integers * attr.za_integer_length);
-       }
-       zap_cursor_fini(&zc);
-}
-
-static void
-dump_bpobj(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       bpobj_phys_t *bpop = data;
-       uint64_t i;
-       char bytes[32], comp[32], uncomp[32];
-
-       if (bpop == NULL)
-               return;
-
-       zdb_nicenum(bpop->bpo_bytes, bytes);
-       zdb_nicenum(bpop->bpo_comp, comp);
-       zdb_nicenum(bpop->bpo_uncomp, uncomp);
-
-       (void) printf("\t\tnum_blkptrs = %llu\n",
-           (u_longlong_t)bpop->bpo_num_blkptrs);
-       (void) printf("\t\tbytes = %s\n", bytes);
-       if (size >= BPOBJ_SIZE_V1) {
-               (void) printf("\t\tcomp = %s\n", comp);
-               (void) printf("\t\tuncomp = %s\n", uncomp);
-       }
-       if (size >= sizeof (*bpop)) {
-               (void) printf("\t\tsubobjs = %llu\n",
-                   (u_longlong_t)bpop->bpo_subobjs);
-               (void) printf("\t\tnum_subobjs = %llu\n",
-                   (u_longlong_t)bpop->bpo_num_subobjs);
-       }
-
-       if (dump_opt['d'] < 5)
-               return;
-
-       for (i = 0; i < bpop->bpo_num_blkptrs; i++) {
-               char blkbuf[BP_SPRINTF_LEN];
-               blkptr_t bp;
-
-               int err = dmu_read(os, object,
-                   i * sizeof (bp), sizeof (bp), &bp, 0);
-               if (err != 0) {
-                       (void) printf("got error %u from dmu_read\n", err);
-                       break;
-               }
-               snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), &bp);
-               (void) printf("\t%s\n", blkbuf);
-       }
-}
-
-/* ARGSUSED */
-static void
-dump_bpobj_subobjs(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       dmu_object_info_t doi;
-       int64_t i;
-
-       VERIFY0(dmu_object_info(os, object, &doi));
-       uint64_t *subobjs = kmem_alloc(doi.doi_max_offset, KM_SLEEP);
-
-       int err = dmu_read(os, object, 0, doi.doi_max_offset, subobjs, 0);
-       if (err != 0) {
-               (void) printf("got error %u from dmu_read\n", err);
-               kmem_free(subobjs, doi.doi_max_offset);
-               return;
-       }
-
-       int64_t last_nonzero = -1;
-       for (i = 0; i < doi.doi_max_offset / 8; i++) {
-               if (subobjs[i] != 0)
-                       last_nonzero = i;
-       }
-
-       for (i = 0; i <= last_nonzero; i++) {
-               (void) printf("\t%llu\n", (u_longlong_t)subobjs[i]);
-       }
-       kmem_free(subobjs, doi.doi_max_offset);
-}
-
-/*ARGSUSED*/
-static void
-dump_ddt_zap(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       dump_zap_stats(os, object);
-       /* contents are printed elsewhere, properly decoded */
-}
-
-/*ARGSUSED*/
-static void
-dump_sa_attrs(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       zap_cursor_t zc;
-       zap_attribute_t attr;
-
-       dump_zap_stats(os, object);
-       (void) printf("\n");
-
-       for (zap_cursor_init(&zc, os, object);
-           zap_cursor_retrieve(&zc, &attr) == 0;
-           zap_cursor_advance(&zc)) {
-               (void) printf("\t\t%s = ", attr.za_name);
-               if (attr.za_num_integers == 0) {
-                       (void) printf("\n");
-                       continue;
-               }
-               (void) printf(" %llx : [%d:%d:%d]\n",
-                   (u_longlong_t)attr.za_first_integer,
-                   (int)ATTR_LENGTH(attr.za_first_integer),
-                   (int)ATTR_BSWAP(attr.za_first_integer),
-                   (int)ATTR_NUM(attr.za_first_integer));
-       }
-       zap_cursor_fini(&zc);
-}
-
-/*ARGSUSED*/
-static void
-dump_sa_layouts(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       zap_cursor_t zc;
-       zap_attribute_t attr;
-       uint16_t *layout_attrs;
-       int i;
-
-       dump_zap_stats(os, object);
-       (void) printf("\n");
-
-       for (zap_cursor_init(&zc, os, object);
-           zap_cursor_retrieve(&zc, &attr) == 0;
-           zap_cursor_advance(&zc)) {
-               (void) printf("\t\t%s = [", attr.za_name);
-               if (attr.za_num_integers == 0) {
-                       (void) printf("\n");
-                       continue;
-               }
-
-               VERIFY(attr.za_integer_length == 2);
-               layout_attrs = umem_zalloc(attr.za_num_integers *
-                   attr.za_integer_length, UMEM_NOFAIL);
-
-               VERIFY(zap_lookup(os, object, attr.za_name,
-                   attr.za_integer_length,
-                   attr.za_num_integers, layout_attrs) == 0);
-
-               for (i = 0; i != attr.za_num_integers; i++)
-                       (void) printf(" %d ", (int)layout_attrs[i]);
-               (void) printf("]\n");
-               umem_free(layout_attrs,
-                   attr.za_num_integers * attr.za_integer_length);
-       }
-       zap_cursor_fini(&zc);
-}
-
-/*ARGSUSED*/
-static void
-dump_zpldir(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       zap_cursor_t zc;
-       zap_attribute_t attr;
-       const char *typenames[] = {
-               /* 0 */ "not specified",
-               /* 1 */ "FIFO",
-               /* 2 */ "Character Device",
-               /* 3 */ "3 (invalid)",
-               /* 4 */ "Directory",
-               /* 5 */ "5 (invalid)",
-               /* 6 */ "Block Device",
-               /* 7 */ "7 (invalid)",
-               /* 8 */ "Regular File",
-               /* 9 */ "9 (invalid)",
-               /* 10 */ "Symbolic Link",
-               /* 11 */ "11 (invalid)",
-               /* 12 */ "Socket",
-               /* 13 */ "Door",
-               /* 14 */ "Event Port",
-               /* 15 */ "15 (invalid)",
-       };
-
-       dump_zap_stats(os, object);
-       (void) printf("\n");
-
-       for (zap_cursor_init(&zc, os, object);
-           zap_cursor_retrieve(&zc, &attr) == 0;
-           zap_cursor_advance(&zc)) {
-               (void) printf("\t\t%s = %lld (type: %s)\n",
-                   attr.za_name, ZFS_DIRENT_OBJ(attr.za_first_integer),
-                   typenames[ZFS_DIRENT_TYPE(attr.za_first_integer)]);
-       }
-       zap_cursor_fini(&zc);
-}
-
-int
-get_dtl_refcount(vdev_t *vd)
-{
-       int refcount = 0;
-       int c;
-
-       if (vd->vdev_ops->vdev_op_leaf) {
-               space_map_t *sm = vd->vdev_dtl_sm;
-
-               if (sm != NULL &&
-                   sm->sm_dbuf->db_size == sizeof (space_map_phys_t))
-                       return (1);
-               return (0);
-       }
-
-       for (c = 0; c < vd->vdev_children; c++)
-               refcount += get_dtl_refcount(vd->vdev_child[c]);
-       return (refcount);
-}
-
-int
-get_metaslab_refcount(vdev_t *vd)
-{
-       int refcount = 0;
-       int c, m;
-
-       if (vd->vdev_top == vd && !vd->vdev_removing) {
-               for (m = 0; m < vd->vdev_ms_count; m++) {
-                       space_map_t *sm = vd->vdev_ms[m]->ms_sm;
-
-                       if (sm != NULL &&
-                           sm->sm_dbuf->db_size == sizeof (space_map_phys_t))
-                               refcount++;
-               }
-       }
-       for (c = 0; c < vd->vdev_children; c++)
-               refcount += get_metaslab_refcount(vd->vdev_child[c]);
-
-       return (refcount);
-}
-
-static int
-verify_spacemap_refcounts(spa_t *spa)
-{
-       uint64_t expected_refcount = 0;
-       uint64_t actual_refcount;
-
-       (void) feature_get_refcount(spa,
-           &spa_feature_table[SPA_FEATURE_SPACEMAP_HISTOGRAM],
-           &expected_refcount);
-       actual_refcount = get_dtl_refcount(spa->spa_root_vdev);
-       actual_refcount += get_metaslab_refcount(spa->spa_root_vdev);
-
-       if (expected_refcount != actual_refcount) {
-               (void) printf("space map refcount mismatch: expected %lld != "
-                   "actual %lld\n",
-                   (longlong_t)expected_refcount,
-                   (longlong_t)actual_refcount);
-               return (2);
-       }
-       return (0);
-}
-
-static void
-dump_spacemap(objset_t *os, space_map_t *sm)
-{
-       uint64_t alloc, offset, entry;
-       char *ddata[] = { "ALLOC", "FREE", "CONDENSE", "INVALID",
-                           "INVALID", "INVALID", "INVALID", "INVALID" };
-
-       if (sm == NULL)
-               return;
-
-       /*
-        * Print out the freelist entries in both encoded and decoded form.
-        */
-       alloc = 0;
-       for (offset = 0; offset < space_map_length(sm);
-           offset += sizeof (entry)) {
-               uint8_t mapshift = sm->sm_shift;
-
-               VERIFY0(dmu_read(os, space_map_object(sm), offset,
-                   sizeof (entry), &entry, DMU_READ_PREFETCH));
-               if (SM_DEBUG_DECODE(entry)) {
-
-                       (void) printf("\t    [%6llu] %s: txg %llu, pass %llu\n",
-                           (u_longlong_t)(offset / sizeof (entry)),
-                           ddata[SM_DEBUG_ACTION_DECODE(entry)],
-                           (u_longlong_t)SM_DEBUG_TXG_DECODE(entry),
-                           (u_longlong_t)SM_DEBUG_SYNCPASS_DECODE(entry));
-               } else {
-                       (void) printf("\t    [%6llu]    %c  range:"
-                           " %010llx-%010llx  size: %06llx\n",
-                           (u_longlong_t)(offset / sizeof (entry)),
-                           SM_TYPE_DECODE(entry) == SM_ALLOC ? 'A' : 'F',
-                           (u_longlong_t)((SM_OFFSET_DECODE(entry) <<
-                           mapshift) + sm->sm_start),
-                           (u_longlong_t)((SM_OFFSET_DECODE(entry) <<
-                           mapshift) + sm->sm_start +
-                           (SM_RUN_DECODE(entry) << mapshift)),
-                           (u_longlong_t)(SM_RUN_DECODE(entry) << mapshift));
-                       if (SM_TYPE_DECODE(entry) == SM_ALLOC)
-                               alloc += SM_RUN_DECODE(entry) << mapshift;
-                       else
-                               alloc -= SM_RUN_DECODE(entry) << mapshift;
-               }
-       }
-       if (alloc != space_map_allocated(sm)) {
-               (void) printf("space_map_object alloc (%llu) INCONSISTENT "
-                   "with space map summary (%llu)\n",
-                   (u_longlong_t)space_map_allocated(sm), (u_longlong_t)alloc);
-       }
-}
-
-static void
-dump_metaslab_stats(metaslab_t *msp)
-{
-       char maxbuf[32];
-       range_tree_t *rt = msp->ms_tree;
-       avl_tree_t *t = &msp->ms_size_tree;
-       int free_pct = range_tree_space(rt) * 100 / msp->ms_size;
-
-       zdb_nicenum(metaslab_block_maxsize(msp), maxbuf);
-
-       (void) printf("\t %25s %10lu   %7s  %6s   %4s %4d%%\n",
-           "segments", avl_numnodes(t), "maxsize", maxbuf,
-           "freepct", free_pct);
-       (void) printf("\tIn-memory histogram:\n");
-       dump_histogram(rt->rt_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0);
-}
-
-static void
-dump_metaslab(metaslab_t *msp)
-{
-       vdev_t *vd = msp->ms_group->mg_vd;
-       spa_t *spa = vd->vdev_spa;
-       space_map_t *sm = msp->ms_sm;
-       char freebuf[32];
-
-       zdb_nicenum(msp->ms_size - space_map_allocated(sm), freebuf);
-
-       (void) printf(
-           "\tmetaslab %6llu   offset %12llx   spacemap %6llu   free    %5s\n",
-           (u_longlong_t)msp->ms_id, (u_longlong_t)msp->ms_start,
-           (u_longlong_t)space_map_object(sm), freebuf);
-
-       if (dump_opt['m'] > 2 && !dump_opt['L']) {
-               mutex_enter(&msp->ms_lock);
-               metaslab_load_wait(msp);
-               if (!msp->ms_loaded) {
-                       VERIFY0(metaslab_load(msp));
-                       range_tree_stat_verify(msp->ms_tree);
-               }
-               dump_metaslab_stats(msp);
-               metaslab_unload(msp);
-               mutex_exit(&msp->ms_lock);
-       }
-
-       if (dump_opt['m'] > 1 && sm != NULL &&
-           spa_feature_is_active(spa, SPA_FEATURE_SPACEMAP_HISTOGRAM)) {
-               /*
-                * The space map histogram represents free space in chunks
-                * of sm_shift (i.e. bucket 0 refers to 2^sm_shift).
-                */
-               (void) printf("\tOn-disk histogram:\t\tfragmentation %llu\n",
-                   (u_longlong_t)msp->ms_fragmentation);
-               dump_histogram(sm->sm_phys->smp_histogram,
-                   SPACE_MAP_HISTOGRAM_SIZE, sm->sm_shift);
-       }
-
-       if (dump_opt['d'] > 5 || dump_opt['m'] > 3) {
-               ASSERT(msp->ms_size == (1ULL << vd->vdev_ms_shift));
-
-               mutex_enter(&msp->ms_lock);
-               dump_spacemap(spa->spa_meta_objset, msp->ms_sm);
-               mutex_exit(&msp->ms_lock);
-       }
-}
-
-static void
-print_vdev_metaslab_header(vdev_t *vd)
-{
-       (void) printf("\tvdev %10llu\n\t%-10s%5llu   %-19s   %-15s   %-10s\n",
-           (u_longlong_t)vd->vdev_id,
-           "metaslabs", (u_longlong_t)vd->vdev_ms_count,
-           "offset", "spacemap", "free");
-       (void) printf("\t%15s   %19s   %15s   %10s\n",
-           "---------------", "-------------------",
-           "---------------", "-------------");
-}
-
-static void
-dump_metaslab_groups(spa_t *spa)
-{
-       vdev_t *rvd = spa->spa_root_vdev;
-       metaslab_class_t *mc = spa_normal_class(spa);
-       uint64_t fragmentation;
-       int c;
-
-       metaslab_class_histogram_verify(mc);
-
-       for (c = 0; c < rvd->vdev_children; c++) {
-               vdev_t *tvd = rvd->vdev_child[c];
-               metaslab_group_t *mg = tvd->vdev_mg;
-
-               if (mg->mg_class != mc)
-                       continue;
-
-               metaslab_group_histogram_verify(mg);
-               mg->mg_fragmentation = metaslab_group_fragmentation(mg);
-
-               (void) printf("\tvdev %10llu\t\tmetaslabs%5llu\t\t"
-                   "fragmentation",
-                   (u_longlong_t)tvd->vdev_id,
-                   (u_longlong_t)tvd->vdev_ms_count);
-               if (mg->mg_fragmentation == ZFS_FRAG_INVALID) {
-                       (void) printf("%3s\n", "-");
-               } else {
-                       (void) printf("%3llu%%\n",
-                           (u_longlong_t)mg->mg_fragmentation);
-               }
-               dump_histogram(mg->mg_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0);
-       }
-
-       (void) printf("\tpool %s\tfragmentation", spa_name(spa));
-       fragmentation = metaslab_class_fragmentation(mc);
-       if (fragmentation == ZFS_FRAG_INVALID)
-               (void) printf("\t%3s\n", "-");
-       else
-               (void) printf("\t%3llu%%\n", (u_longlong_t)fragmentation);
-       dump_histogram(mc->mc_histogram, RANGE_TREE_HISTOGRAM_SIZE, 0);
-}
-
-static void
-dump_metaslabs(spa_t *spa)
-{
-       vdev_t *vd, *rvd = spa->spa_root_vdev;
-       uint64_t m, c = 0, children = rvd->vdev_children;
-
-       (void) printf("\nMetaslabs:\n");
-
-       if (!dump_opt['d'] && zopt_objects > 0) {
-               c = zopt_object[0];
-
-               if (c >= children)
-                       (void) fatal("bad vdev id: %llu", (u_longlong_t)c);
-
-               if (zopt_objects > 1) {
-                       vd = rvd->vdev_child[c];
-                       print_vdev_metaslab_header(vd);
-
-                       for (m = 1; m < zopt_objects; m++) {
-                               if (zopt_object[m] < vd->vdev_ms_count)
-                                       dump_metaslab(
-                                           vd->vdev_ms[zopt_object[m]]);
-                               else
-                                       (void) fprintf(stderr, "bad metaslab "
-                                           "number %llu\n",
-                                           (u_longlong_t)zopt_object[m]);
-                       }
-                       (void) printf("\n");
-                       return;
-               }
-               children = c + 1;
-       }
-       for (; c < children; c++) {
-               vd = rvd->vdev_child[c];
-               print_vdev_metaslab_header(vd);
-
-               for (m = 0; m < vd->vdev_ms_count; m++)
-                       dump_metaslab(vd->vdev_ms[m]);
-               (void) printf("\n");
-       }
-}
-
-static void
-dump_dde(const ddt_t *ddt, const ddt_entry_t *dde, uint64_t index)
-{
-       const ddt_phys_t *ddp = dde->dde_phys;
-       const ddt_key_t *ddk = &dde->dde_key;
-       char *types[4] = { "ditto", "single", "double", "triple" };
-       char blkbuf[BP_SPRINTF_LEN];
-       blkptr_t blk;
-       int p;
-
-       for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) {
-               if (ddp->ddp_phys_birth == 0)
-                       continue;
-               ddt_bp_create(ddt->ddt_checksum, ddk, ddp, &blk);
-               snprintf_blkptr(blkbuf, sizeof (blkbuf), &blk);
-               (void) printf("index %llx refcnt %llu %s %s\n",
-                   (u_longlong_t)index, (u_longlong_t)ddp->ddp_refcnt,
-                   types[p], blkbuf);
-       }
-}
-
-static void
-dump_dedup_ratio(const ddt_stat_t *dds)
-{
-       double rL, rP, rD, D, dedup, compress, copies;
-
-       if (dds->dds_blocks == 0)
-               return;
-
-       rL = (double)dds->dds_ref_lsize;
-       rP = (double)dds->dds_ref_psize;
-       rD = (double)dds->dds_ref_dsize;
-       D = (double)dds->dds_dsize;
-
-       dedup = rD / D;
-       compress = rL / rP;
-       copies = rD / rP;
-
-       (void) printf("dedup = %.2f, compress = %.2f, copies = %.2f, "
-           "dedup * compress / copies = %.2f\n\n",
-           dedup, compress, copies, dedup * compress / copies);
-}
-
-static void
-dump_ddt(ddt_t *ddt, enum ddt_type type, enum ddt_class class)
-{
-       char name[DDT_NAMELEN];
-       ddt_entry_t dde;
-       uint64_t walk = 0;
-       dmu_object_info_t doi;
-       uint64_t count, dspace, mspace;
-       int error;
-
-       error = ddt_object_info(ddt, type, class, &doi);
-
-       if (error == ENOENT)
-               return;
-       ASSERT(error == 0);
-
-       error = ddt_object_count(ddt, type, class, &count);
-       ASSERT(error == 0);
-       if (count == 0)
-               return;
-
-       dspace = doi.doi_physical_blocks_512 << 9;
-       mspace = doi.doi_fill_count * doi.doi_data_block_size;
-
-       ddt_object_name(ddt, type, class, name);
-
-       (void) printf("%s: %llu entries, size %llu on disk, %llu in core\n",
-           name,
-           (u_longlong_t)count,
-           (u_longlong_t)(dspace / count),
-           (u_longlong_t)(mspace / count));
-
-       if (dump_opt['D'] < 3)
-               return;
-
-       zpool_dump_ddt(NULL, &ddt->ddt_histogram[type][class]);
-
-       if (dump_opt['D'] < 4)
-               return;
-
-       if (dump_opt['D'] < 5 && class == DDT_CLASS_UNIQUE)
-               return;
-
-       (void) printf("%s contents:\n\n", name);
-
-       while ((error = ddt_object_walk(ddt, type, class, &walk, &dde)) == 0)
-               dump_dde(ddt, &dde, walk);
-
-       ASSERT(error == ENOENT);
-
-       (void) printf("\n");
-}
-
-static void
-dump_all_ddts(spa_t *spa)
-{
-       ddt_histogram_t ddh_total;
-       ddt_stat_t dds_total;
-       enum zio_checksum c;
-       enum ddt_type type;
-       enum ddt_class class;
-
-       bzero(&ddh_total, sizeof (ddt_histogram_t));
-       bzero(&dds_total, sizeof (ddt_stat_t));
-
-       for (c = 0; c < ZIO_CHECKSUM_FUNCTIONS; c++) {
-               ddt_t *ddt = spa->spa_ddt[c];
-               for (type = 0; type < DDT_TYPES; type++) {
-                       for (class = 0; class < DDT_CLASSES;
-                           class++) {
-                               dump_ddt(ddt, type, class);
-                       }
-               }
-       }
-
-       ddt_get_dedup_stats(spa, &dds_total);
-
-       if (dds_total.dds_blocks == 0) {
-               (void) printf("All DDTs are empty\n");
-               return;
-       }
-
-       (void) printf("\n");
-
-       if (dump_opt['D'] > 1) {
-               (void) printf("DDT histogram (aggregated over all DDTs):\n");
-               ddt_get_dedup_histogram(spa, &ddh_total);
-               zpool_dump_ddt(&dds_total, &ddh_total);
-       }
-
-       dump_dedup_ratio(&dds_total);
-}
-
-static void
-dump_dtl_seg(void *arg, uint64_t start, uint64_t size)
-{
-       char *prefix = arg;
-
-       (void) printf("%s [%llu,%llu) length %llu\n",
-           prefix,
-           (u_longlong_t)start,
-           (u_longlong_t)(start + size),
-           (u_longlong_t)(size));
-}
-
-static void
-dump_dtl(vdev_t *vd, int indent)
-{
-       spa_t *spa = vd->vdev_spa;
-       boolean_t required;
-       char *name[DTL_TYPES] = { "missing", "partial", "scrub", "outage" };
-       char prefix[256];
-       int c, t;
-
-       spa_vdev_state_enter(spa, SCL_NONE);
-       required = vdev_dtl_required(vd);
-       (void) spa_vdev_state_exit(spa, NULL, 0);
-
-       if (indent == 0)
-               (void) printf("\nDirty time logs:\n\n");
-
-       (void) printf("\t%*s%s [%s]\n", indent, "",
-           vd->vdev_path ? vd->vdev_path :
-           vd->vdev_parent ? vd->vdev_ops->vdev_op_type : spa_name(spa),
-           required ? "DTL-required" : "DTL-expendable");
-
-       for (t = 0; t < DTL_TYPES; t++) {
-               range_tree_t *rt = vd->vdev_dtl[t];
-               if (range_tree_space(rt) == 0)
-                       continue;
-               (void) snprintf(prefix, sizeof (prefix), "\t%*s%s",
-                   indent + 2, "", name[t]);
-               mutex_enter(rt->rt_lock);
-               range_tree_walk(rt, dump_dtl_seg, prefix);
-               mutex_exit(rt->rt_lock);
-               if (dump_opt['d'] > 5 && vd->vdev_children == 0)
-                       dump_spacemap(spa->spa_meta_objset,
-                           vd->vdev_dtl_sm);
-       }
-
-       for (c = 0; c < vd->vdev_children; c++)
-               dump_dtl(vd->vdev_child[c], indent + 4);
-}
-
-static void
-dump_history(spa_t *spa)
-{
-       nvlist_t **events = NULL;
-       char *buf;
-       uint64_t resid, len, off = 0;
-       uint_t num = 0;
-       int error;
-       time_t tsec;
-       struct tm t;
-       char tbuf[30];
-       char internalstr[MAXPATHLEN];
-       int i;
-
-       if ((buf = malloc(SPA_OLD_MAXBLOCKSIZE)) == NULL) {
-               (void) fprintf(stderr, "%s: unable to allocate I/O buffer\n",
-                   __func__);
-               return;
-       }
-
-       do {
-               len = SPA_OLD_MAXBLOCKSIZE;
-
-               if ((error = spa_history_get(spa, &off, &len, buf)) != 0) {
-                       (void) fprintf(stderr, "Unable to read history: "
-                           "error %d\n", error);
-                       free(buf);
-                       return;
-               }
-
-               if (zpool_history_unpack(buf, len, &resid, &events, &num) != 0)
-                       break;
-
-               off -= resid;
-       } while (len != 0);
-
-       (void) printf("\nHistory:\n");
-       for (i = 0; i < num; i++) {
-               uint64_t time, txg, ievent;
-               char *cmd, *intstr;
-               boolean_t printed = B_FALSE;
-
-               if (nvlist_lookup_uint64(events[i], ZPOOL_HIST_TIME,
-                   &time) != 0)
-                       goto next;
-               if (nvlist_lookup_string(events[i], ZPOOL_HIST_CMD,
-                   &cmd) != 0) {
-                       if (nvlist_lookup_uint64(events[i],
-                           ZPOOL_HIST_INT_EVENT, &ievent) != 0)
-                               goto next;
-                       verify(nvlist_lookup_uint64(events[i],
-                           ZPOOL_HIST_TXG, &txg) == 0);
-                       verify(nvlist_lookup_string(events[i],
-                           ZPOOL_HIST_INT_STR, &intstr) == 0);
-                       if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS)
-                               goto next;
-
-                       (void) snprintf(internalstr,
-                           sizeof (internalstr),
-                           "[internal %s txg:%lld] %s",
-                           zfs_history_event_names[ievent],
-                           (longlong_t)txg, intstr);
-                       cmd = internalstr;
-               }
-               tsec = time;
-               (void) localtime_r(&tsec, &t);
-               (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t);
-               (void) printf("%s %s\n", tbuf, cmd);
-               printed = B_TRUE;
-
-next:
-               if (dump_opt['h'] > 1) {
-                       if (!printed)
-                               (void) printf("unrecognized record:\n");
-                       dump_nvlist(events[i], 2);
-               }
-       }
-       free(buf);
-}
-
-/*ARGSUSED*/
-static void
-dump_dnode(objset_t *os, uint64_t object, void *data, size_t size)
-{
-}
-
-static uint64_t
-blkid2offset(const dnode_phys_t *dnp, const blkptr_t *bp,
-    const zbookmark_phys_t *zb)
-{
-       if (dnp == NULL) {
-               ASSERT(zb->zb_level < 0);
-               if (zb->zb_object == 0)
-                       return (zb->zb_blkid);
-               return (zb->zb_blkid * BP_GET_LSIZE(bp));
-       }
-
-       ASSERT(zb->zb_level >= 0);
-
-       return ((zb->zb_blkid <<
-           (zb->zb_level * (dnp->dn_indblkshift - SPA_BLKPTRSHIFT))) *
-           dnp->dn_datablkszsec << SPA_MINBLOCKSHIFT);
-}
-
-static void
-snprintf_blkptr_compact(char *blkbuf, size_t buflen, const blkptr_t *bp)
-{
-       const dva_t *dva = bp->blk_dva;
-       int ndvas = dump_opt['d'] > 5 ? BP_GET_NDVAS(bp) : 1;
-       int i;
-
-       if (dump_opt['b'] >= 6) {
-               snprintf_blkptr(blkbuf, buflen, bp);
-               return;
-       }
-
-       if (BP_IS_EMBEDDED(bp)) {
-               (void) sprintf(blkbuf,
-                   "EMBEDDED et=%u %llxL/%llxP B=%llu",
-                   (int)BPE_GET_ETYPE(bp),
-                   (u_longlong_t)BPE_GET_LSIZE(bp),
-                   (u_longlong_t)BPE_GET_PSIZE(bp),
-                   (u_longlong_t)bp->blk_birth);
-               return;
-       }
-
-       blkbuf[0] = '\0';
-
-       for (i = 0; i < ndvas; i++)
-               (void) snprintf(blkbuf + strlen(blkbuf),
-                   buflen - strlen(blkbuf), "%llu:%llx:%llx ",
-                   (u_longlong_t)DVA_GET_VDEV(&dva[i]),
-                   (u_longlong_t)DVA_GET_OFFSET(&dva[i]),
-                   (u_longlong_t)DVA_GET_ASIZE(&dva[i]));
-
-       if (BP_IS_HOLE(bp)) {
-               (void) snprintf(blkbuf + strlen(blkbuf),
-                   buflen - strlen(blkbuf),
-                   "%llxL B=%llu",
-                   (u_longlong_t)BP_GET_LSIZE(bp),
-                   (u_longlong_t)bp->blk_birth);
-       } else {
-               (void) snprintf(blkbuf + strlen(blkbuf),
-                   buflen - strlen(blkbuf),
-                   "%llxL/%llxP F=%llu B=%llu/%llu",
-                   (u_longlong_t)BP_GET_LSIZE(bp),
-                   (u_longlong_t)BP_GET_PSIZE(bp),
-                   (u_longlong_t)BP_GET_FILL(bp),
-                   (u_longlong_t)bp->blk_birth,
-                   (u_longlong_t)BP_PHYSICAL_BIRTH(bp));
-       }
-}
-
-static void
-print_indirect(blkptr_t *bp, const zbookmark_phys_t *zb,
-    const dnode_phys_t *dnp)
-{
-       char blkbuf[BP_SPRINTF_LEN];
-       int l;
-
-       if (!BP_IS_EMBEDDED(bp)) {
-               ASSERT3U(BP_GET_TYPE(bp), ==, dnp->dn_type);
-               ASSERT3U(BP_GET_LEVEL(bp), ==, zb->zb_level);
-       }
-
-       (void) printf("%16llx ", (u_longlong_t)blkid2offset(dnp, bp, zb));
-
-       ASSERT(zb->zb_level >= 0);
-
-       for (l = dnp->dn_nlevels - 1; l >= -1; l--) {
-               if (l == zb->zb_level) {
-                       (void) printf("L%llx", (u_longlong_t)zb->zb_level);
-               } else {
-                       (void) printf(" ");
-               }
-       }
-
-       snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), bp);
-       (void) printf("%s\n", blkbuf);
-}
-
-static int
-visit_indirect(spa_t *spa, const dnode_phys_t *dnp,
-    blkptr_t *bp, const zbookmark_phys_t *zb)
-{
-       int err = 0;
-
-       if (bp->blk_birth == 0)
-               return (0);
-
-       print_indirect(bp, zb, dnp);
-
-       if (BP_GET_LEVEL(bp) > 0 && !BP_IS_HOLE(bp)) {
-               arc_flags_t flags = ARC_FLAG_WAIT;
-               int i;
-               blkptr_t *cbp;
-               int epb = BP_GET_LSIZE(bp) >> SPA_BLKPTRSHIFT;
-               arc_buf_t *buf;
-               uint64_t fill = 0;
-
-               err = arc_read(NULL, spa, bp, arc_getbuf_func, &buf,
-                   ZIO_PRIORITY_ASYNC_READ, ZIO_FLAG_CANFAIL, &flags, zb);
-               if (err)
-                       return (err);
-               ASSERT(buf->b_data);
-
-               /* recursively visit blocks below this */
-               cbp = buf->b_data;
-               for (i = 0; i < epb; i++, cbp++) {
-                       zbookmark_phys_t czb;
-
-                       SET_BOOKMARK(&czb, zb->zb_objset, zb->zb_object,
-                           zb->zb_level - 1,
-                           zb->zb_blkid * epb + i);
-                       err = visit_indirect(spa, dnp, cbp, &czb);
-                       if (err)
-                               break;
-                       fill += BP_GET_FILL(cbp);
-               }
-               if (!err)
-                       ASSERT3U(fill, ==, BP_GET_FILL(bp));
-               (void) arc_buf_remove_ref(buf, &buf);
-       }
-
-       return (err);
-}
-
-/*ARGSUSED*/
-static void
-dump_indirect(dnode_t *dn)
-{
-       dnode_phys_t *dnp = dn->dn_phys;
-       int j;
-       zbookmark_phys_t czb;
-
-       (void) printf("Indirect blocks:\n");
-
-       SET_BOOKMARK(&czb, dmu_objset_id(dn->dn_objset),
-           dn->dn_object, dnp->dn_nlevels - 1, 0);
-       for (j = 0; j < dnp->dn_nblkptr; j++) {
-               czb.zb_blkid = j;
-               (void) visit_indirect(dmu_objset_spa(dn->dn_objset), dnp,
-                   &dnp->dn_blkptr[j], &czb);
-       }
-
-       (void) printf("\n");
-}
-
-/*ARGSUSED*/
-static void
-dump_dsl_dir(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       dsl_dir_phys_t *dd = data;
-       time_t crtime;
-       char nice[32];
-
-       if (dd == NULL)
-               return;
-
-       ASSERT3U(size, >=, sizeof (dsl_dir_phys_t));
-
-       crtime = dd->dd_creation_time;
-       (void) printf("\t\tcreation_time = %s", ctime(&crtime));
-       (void) printf("\t\thead_dataset_obj = %llu\n",
-           (u_longlong_t)dd->dd_head_dataset_obj);
-       (void) printf("\t\tparent_dir_obj = %llu\n",
-           (u_longlong_t)dd->dd_parent_obj);
-       (void) printf("\t\torigin_obj = %llu\n",
-           (u_longlong_t)dd->dd_origin_obj);
-       (void) printf("\t\tchild_dir_zapobj = %llu\n",
-           (u_longlong_t)dd->dd_child_dir_zapobj);
-       zdb_nicenum(dd->dd_used_bytes, nice);
-       (void) printf("\t\tused_bytes = %s\n", nice);
-       zdb_nicenum(dd->dd_compressed_bytes, nice);
-       (void) printf("\t\tcompressed_bytes = %s\n", nice);
-       zdb_nicenum(dd->dd_uncompressed_bytes, nice);
-       (void) printf("\t\tuncompressed_bytes = %s\n", nice);
-       zdb_nicenum(dd->dd_quota, nice);
-       (void) printf("\t\tquota = %s\n", nice);
-       zdb_nicenum(dd->dd_reserved, nice);
-       (void) printf("\t\treserved = %s\n", nice);
-       (void) printf("\t\tprops_zapobj = %llu\n",
-           (u_longlong_t)dd->dd_props_zapobj);
-       (void) printf("\t\tdeleg_zapobj = %llu\n",
-           (u_longlong_t)dd->dd_deleg_zapobj);
-       (void) printf("\t\tflags = %llx\n",
-           (u_longlong_t)dd->dd_flags);
-
-#define        DO(which) \
-       zdb_nicenum(dd->dd_used_breakdown[DD_USED_ ## which], nice); \
-       (void) printf("\t\tused_breakdown[" #which "] = %s\n", nice)
-       DO(HEAD);
-       DO(SNAP);
-       DO(CHILD);
-       DO(CHILD_RSRV);
-       DO(REFRSRV);
-#undef DO
-}
-
-/*ARGSUSED*/
-static void
-dump_dsl_dataset(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       dsl_dataset_phys_t *ds = data;
-       time_t crtime;
-       char used[32], compressed[32], uncompressed[32], unique[32];
-       char blkbuf[BP_SPRINTF_LEN];
-
-       if (ds == NULL)
-               return;
-
-       ASSERT(size == sizeof (*ds));
-       crtime = ds->ds_creation_time;
-       zdb_nicenum(ds->ds_referenced_bytes, used);
-       zdb_nicenum(ds->ds_compressed_bytes, compressed);
-       zdb_nicenum(ds->ds_uncompressed_bytes, uncompressed);
-       zdb_nicenum(ds->ds_unique_bytes, unique);
-       snprintf_blkptr(blkbuf, sizeof (blkbuf), &ds->ds_bp);
-
-       (void) printf("\t\tdir_obj = %llu\n",
-           (u_longlong_t)ds->ds_dir_obj);
-       (void) printf("\t\tprev_snap_obj = %llu\n",
-           (u_longlong_t)ds->ds_prev_snap_obj);
-       (void) printf("\t\tprev_snap_txg = %llu\n",
-           (u_longlong_t)ds->ds_prev_snap_txg);
-       (void) printf("\t\tnext_snap_obj = %llu\n",
-           (u_longlong_t)ds->ds_next_snap_obj);
-       (void) printf("\t\tsnapnames_zapobj = %llu\n",
-           (u_longlong_t)ds->ds_snapnames_zapobj);
-       (void) printf("\t\tnum_children = %llu\n",
-           (u_longlong_t)ds->ds_num_children);
-       (void) printf("\t\tuserrefs_obj = %llu\n",
-           (u_longlong_t)ds->ds_userrefs_obj);
-       (void) printf("\t\tcreation_time = %s", ctime(&crtime));
-       (void) printf("\t\tcreation_txg = %llu\n",
-           (u_longlong_t)ds->ds_creation_txg);
-       (void) printf("\t\tdeadlist_obj = %llu\n",
-           (u_longlong_t)ds->ds_deadlist_obj);
-       (void) printf("\t\tused_bytes = %s\n", used);
-       (void) printf("\t\tcompressed_bytes = %s\n", compressed);
-       (void) printf("\t\tuncompressed_bytes = %s\n", uncompressed);
-       (void) printf("\t\tunique = %s\n", unique);
-       (void) printf("\t\tfsid_guid = %llu\n",
-           (u_longlong_t)ds->ds_fsid_guid);
-       (void) printf("\t\tguid = %llu\n",
-           (u_longlong_t)ds->ds_guid);
-       (void) printf("\t\tflags = %llx\n",
-           (u_longlong_t)ds->ds_flags);
-       (void) printf("\t\tnext_clones_obj = %llu\n",
-           (u_longlong_t)ds->ds_next_clones_obj);
-       (void) printf("\t\tprops_obj = %llu\n",
-           (u_longlong_t)ds->ds_props_obj);
-       (void) printf("\t\tbp = %s\n", blkbuf);
-}
-
-/* ARGSUSED */
-static int
-dump_bptree_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
-{
-       char blkbuf[BP_SPRINTF_LEN];
-
-       if (bp->blk_birth != 0) {
-               snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
-               (void) printf("\t%s\n", blkbuf);
-       }
-       return (0);
-}
-
-static void
-dump_bptree(objset_t *os, uint64_t obj, char *name)
-{
-       char bytes[32];
-       bptree_phys_t *bt;
-       dmu_buf_t *db;
-
-       if (dump_opt['d'] < 3)
-               return;
-
-       VERIFY3U(0, ==, dmu_bonus_hold(os, obj, FTAG, &db));
-       bt = db->db_data;
-       zdb_nicenum(bt->bt_bytes, bytes);
-       (void) printf("\n    %s: %llu datasets, %s\n",
-           name, (unsigned long long)(bt->bt_end - bt->bt_begin), bytes);
-       dmu_buf_rele(db, FTAG);
-
-       if (dump_opt['d'] < 5)
-               return;
-
-       (void) printf("\n");
-
-       (void) bptree_iterate(os, obj, B_FALSE, dump_bptree_cb, NULL, NULL);
-}
-
-/* ARGSUSED */
-static int
-dump_bpobj_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
-{
-       char blkbuf[BP_SPRINTF_LEN];
-
-       ASSERT(bp->blk_birth != 0);
-       snprintf_blkptr_compact(blkbuf, sizeof (blkbuf), bp);
-       (void) printf("\t%s\n", blkbuf);
-       return (0);
-}
-
-static void
-dump_full_bpobj(bpobj_t *bpo, char *name, int indent)
-{
-       char bytes[32];
-       char comp[32];
-       char uncomp[32];
-       uint64_t i;
-
-       if (dump_opt['d'] < 3)
-               return;
-
-       zdb_nicenum(bpo->bpo_phys->bpo_bytes, bytes);
-       if (bpo->bpo_havesubobj && bpo->bpo_phys->bpo_subobjs != 0) {
-               zdb_nicenum(bpo->bpo_phys->bpo_comp, comp);
-               zdb_nicenum(bpo->bpo_phys->bpo_uncomp, uncomp);
-               (void) printf("    %*s: object %llu, %llu local blkptrs, "
-                   "%llu subobjs in object, %llu, %s (%s/%s comp)\n",
-                   indent * 8, name,
-                   (u_longlong_t)bpo->bpo_object,
-                   (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs,
-                   (u_longlong_t)bpo->bpo_phys->bpo_num_subobjs,
-                   (u_longlong_t)bpo->bpo_phys->bpo_subobjs,
-                   bytes, comp, uncomp);
-
-               for (i = 0; i < bpo->bpo_phys->bpo_num_subobjs; i++) {
-                       uint64_t subobj;
-                       bpobj_t subbpo;
-                       int error;
-                       VERIFY0(dmu_read(bpo->bpo_os,
-                           bpo->bpo_phys->bpo_subobjs,
-                           i * sizeof (subobj), sizeof (subobj), &subobj, 0));
-                       error = bpobj_open(&subbpo, bpo->bpo_os, subobj);
-                       if (error != 0) {
-                               (void) printf("ERROR %u while trying to open "
-                                   "subobj id %llu\n",
-                                   error, (u_longlong_t)subobj);
-                               continue;
-                       }
-                       dump_full_bpobj(&subbpo, "subobj", indent + 1);
-               }
-       } else {
-               (void) printf("    %*s: object %llu, %llu blkptrs, %s\n",
-                   indent * 8, name,
-                   (u_longlong_t)bpo->bpo_object,
-                   (u_longlong_t)bpo->bpo_phys->bpo_num_blkptrs,
-                   bytes);
-       }
-
-       if (dump_opt['d'] < 5)
-               return;
-
-
-       if (indent == 0) {
-               (void) bpobj_iterate_nofree(bpo, dump_bpobj_cb, NULL, NULL);
-               (void) printf("\n");
-       }
-}
-
-static void
-dump_deadlist(dsl_deadlist_t *dl)
-{
-       dsl_deadlist_entry_t *dle;
-       uint64_t unused;
-       char bytes[32];
-       char comp[32];
-       char uncomp[32];
-
-       if (dump_opt['d'] < 3)
-               return;
-
-       if (dl->dl_oldfmt) {
-               dump_full_bpobj(&dl->dl_bpobj, "old-format deadlist", 0);
-               return;
-       }
-
-       zdb_nicenum(dl->dl_phys->dl_used, bytes);
-       zdb_nicenum(dl->dl_phys->dl_comp, comp);
-       zdb_nicenum(dl->dl_phys->dl_uncomp, uncomp);
-       (void) printf("\n    Deadlist: %s (%s/%s comp)\n",
-           bytes, comp, uncomp);
-
-       if (dump_opt['d'] < 4)
-               return;
-
-       (void) printf("\n");
-
-       /* force the tree to be loaded */
-       dsl_deadlist_space_range(dl, 0, UINT64_MAX, &unused, &unused, &unused);
-
-       for (dle = avl_first(&dl->dl_tree); dle;
-           dle = AVL_NEXT(&dl->dl_tree, dle)) {
-               if (dump_opt['d'] >= 5) {
-                       char buf[128];
-                       (void) snprintf(buf, sizeof (buf),
-                           "mintxg %llu -> obj %llu",
-                           (longlong_t)dle->dle_mintxg,
-                           (longlong_t)dle->dle_bpobj.bpo_object);
-
-                       dump_full_bpobj(&dle->dle_bpobj, buf, 0);
-               } else {
-                       (void) printf("mintxg %llu -> obj %llu\n",
-                           (longlong_t)dle->dle_mintxg,
-                           (longlong_t)dle->dle_bpobj.bpo_object);
-
-               }
-       }
-}
-
-static avl_tree_t idx_tree;
-static avl_tree_t domain_tree;
-static boolean_t fuid_table_loaded;
-static boolean_t sa_loaded;
-sa_attr_type_t *sa_attr_table;
-
-static void
-fuid_table_destroy(void)
-{
-       if (fuid_table_loaded) {
-               zfs_fuid_table_destroy(&idx_tree, &domain_tree);
-               fuid_table_loaded = B_FALSE;
-       }
-}
-
-/*
- * print uid or gid information.
- * For normal POSIX id just the id is printed in decimal format.
- * For CIFS files with FUID the fuid is printed in hex followed by
- * the domain-rid string.
- */
-static void
-print_idstr(uint64_t id, const char *id_type)
-{
-       if (FUID_INDEX(id)) {
-               char *domain;
-
-               domain = zfs_fuid_idx_domain(&idx_tree, FUID_INDEX(id));
-               (void) printf("\t%s     %llx [%s-%d]\n", id_type,
-                   (u_longlong_t)id, domain, (int)FUID_RID(id));
-       } else {
-               (void) printf("\t%s     %llu\n", id_type, (u_longlong_t)id);
-       }
-
-}
-
-static void
-dump_uidgid(objset_t *os, uint64_t uid, uint64_t gid)
-{
-       uint32_t uid_idx, gid_idx;
-
-       uid_idx = FUID_INDEX(uid);
-       gid_idx = FUID_INDEX(gid);
-
-       /* Load domain table, if not already loaded */
-       if (!fuid_table_loaded && (uid_idx || gid_idx)) {
-               uint64_t fuid_obj;
-
-               /* first find the fuid object.  It lives in the master node */
-               VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_FUID_TABLES,
-                   8, 1, &fuid_obj) == 0);
-               zfs_fuid_avl_tree_create(&idx_tree, &domain_tree);
-               (void) zfs_fuid_table_load(os, fuid_obj,
-                   &idx_tree, &domain_tree);
-               fuid_table_loaded = B_TRUE;
-       }
-
-       print_idstr(uid, "uid");
-       print_idstr(gid, "gid");
-}
-
-static void
-dump_znode_sa_xattr(sa_handle_t *hdl)
-{
-       nvlist_t *sa_xattr;
-       nvpair_t *elem = NULL;
-       int sa_xattr_size = 0;
-       int sa_xattr_entries = 0;
-       int error;
-       char *sa_xattr_packed;
-
-       error = sa_size(hdl, sa_attr_table[ZPL_DXATTR], &sa_xattr_size);
-       if (error || sa_xattr_size == 0)
-               return;
-
-       sa_xattr_packed = malloc(sa_xattr_size);
-       if (sa_xattr_packed == NULL)
-               return;
-
-       error = sa_lookup(hdl, sa_attr_table[ZPL_DXATTR],
-           sa_xattr_packed, sa_xattr_size);
-       if (error) {
-               free(sa_xattr_packed);
-               return;
-       }
-
-       error = nvlist_unpack(sa_xattr_packed, sa_xattr_size, &sa_xattr, 0);
-       if (error) {
-               free(sa_xattr_packed);
-               return;
-       }
-
-       while ((elem = nvlist_next_nvpair(sa_xattr, elem)) != NULL)
-               sa_xattr_entries++;
-
-       (void) printf("\tSA xattrs: %d bytes, %d entries\n\n",
-           sa_xattr_size, sa_xattr_entries);
-       while ((elem = nvlist_next_nvpair(sa_xattr, elem)) != NULL) {
-               uchar_t *value;
-               uint_t cnt, idx;
-
-               (void) printf("\t\t%s = ", nvpair_name(elem));
-               nvpair_value_byte_array(elem, &value, &cnt);
-               for (idx = 0; idx < cnt; ++idx) {
-                       if (isprint(value[idx]))
-                               (void) putchar(value[idx]);
-                       else
-                               (void) printf("\\%3.3o", value[idx]);
-               }
-               (void) putchar('\n');
-       }
-
-       nvlist_free(sa_xattr);
-       free(sa_xattr_packed);
-}
-
-/*ARGSUSED*/
-static void
-dump_znode(objset_t *os, uint64_t object, void *data, size_t size)
-{
-       char path[MAXPATHLEN * 2];      /* allow for xattr and failure prefix */
-       sa_handle_t *hdl;
-       uint64_t xattr, rdev, gen;
-       uint64_t uid, gid, mode, fsize, parent, links;
-       uint64_t pflags;
-       uint64_t acctm[2], modtm[2], chgtm[2], crtm[2];
-       time_t z_crtime, z_atime, z_mtime, z_ctime;
-       sa_bulk_attr_t bulk[12];
-       int idx = 0;
-       int error;
-
-       if (!sa_loaded) {
-               uint64_t sa_attrs = 0;
-               uint64_t version;
-
-               VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZPL_VERSION_STR,
-                   8, 1, &version) == 0);
-               if (version >= ZPL_VERSION_SA) {
-                       VERIFY(zap_lookup(os, MASTER_NODE_OBJ, ZFS_SA_ATTRS,
-                           8, 1, &sa_attrs) == 0);
-               }
-               if ((error = sa_setup(os, sa_attrs, zfs_attr_table,
-                   ZPL_END, &sa_attr_table)) != 0) {
-                       (void) printf("sa_setup failed errno %d, can't "
-                           "display znode contents\n", error);
-                       return;
-               }
-               sa_loaded = B_TRUE;
-       }
-
-       if (sa_handle_get(os, object, NULL, SA_HDL_PRIVATE, &hdl)) {
-               (void) printf("Failed to get handle for SA znode\n");
-               return;
-       }
-
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_UID], NULL, &uid, 8);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_GID], NULL, &gid, 8);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_LINKS], NULL,
-           &links, 8);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_GEN], NULL, &gen, 8);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_MODE], NULL,
-           &mode, 8);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_PARENT],
-           NULL, &parent, 8);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_SIZE], NULL,
-           &fsize, 8);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_ATIME], NULL,
-           acctm, 16);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_MTIME], NULL,
-           modtm, 16);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_CRTIME], NULL,
-           crtm, 16);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_CTIME], NULL,
-           chgtm, 16);
-       SA_ADD_BULK_ATTR(bulk, idx, sa_attr_table[ZPL_FLAGS], NULL,
-           &pflags, 8);
-
-       if (sa_bulk_lookup(hdl, bulk, idx)) {
-               (void) sa_handle_destroy(hdl);
-               return;
-       }
-
-       error = zfs_obj_to_path(os, object, path, sizeof (path));
-       if (error != 0) {
-               (void) snprintf(path, sizeof (path), "\?\?\?<object#%llu>",
-                   (u_longlong_t)object);
-       }
-       if (dump_opt['d'] < 3) {
-               (void) printf("\t%s\n", path);
-               (void) sa_handle_destroy(hdl);
-               return;
-       }
-
-       z_crtime = (time_t)crtm[0];
-       z_atime = (time_t)acctm[0];
-       z_mtime = (time_t)modtm[0];
-       z_ctime = (time_t)chgtm[0];
-
-       (void) printf("\tpath   %s\n", path);
-       dump_uidgid(os, uid, gid);
-       (void) printf("\tatime  %s", ctime(&z_atime));
-       (void) printf("\tmtime  %s", ctime(&z_mtime));
-       (void) printf("\tctime  %s", ctime(&z_ctime));
-       (void) printf("\tcrtime %s", ctime(&z_crtime));
-       (void) printf("\tgen    %llu\n", (u_longlong_t)gen);
-       (void) printf("\tmode   %llo\n", (u_longlong_t)mode);
-       (void) printf("\tsize   %llu\n", (u_longlong_t)fsize);
-       (void) printf("\tparent %llu\n", (u_longlong_t)parent);
-       (void) printf("\tlinks  %llu\n", (u_longlong_t)links);
-       (void) printf("\tpflags %llx\n", (u_longlong_t)pflags);
-       if (sa_lookup(hdl, sa_attr_table[ZPL_XATTR], &xattr,
-           sizeof (uint64_t)) == 0)
-               (void) printf("\txattr  %llu\n", (u_longlong_t)xattr);
-       if (sa_lookup(hdl, sa_attr_table[ZPL_RDEV], &rdev,
-           sizeof (uint64_t)) == 0)
-               (void) printf("\trdev   0x%016llx\n", (u_longlong_t)rdev);
-       dump_znode_sa_xattr(hdl);
-       sa_handle_destroy(hdl);
-}
-
-/*ARGSUSED*/
-static void
-dump_acl(objset_t *os, uint64_t object, void *data, size_t size)
-{
-}
-
-/*ARGSUSED*/
-static void
-dump_dmu_objset(objset_t *os, uint64_t object, void *data, size_t size)
-{
-}
-
-static object_viewer_t *object_viewer[DMU_OT_NUMTYPES + 1] = {
-       dump_none,              /* unallocated                  */
-       dump_zap,               /* object directory             */
-       dump_uint64,            /* object array                 */
-       dump_none,              /* packed nvlist                */
-       dump_packed_nvlist,     /* packed nvlist size           */
-       dump_none,              /* bpobj                        */
-       dump_bpobj,             /* bpobj header                 */
-       dump_none,              /* SPA space map header         */
-       dump_none,              /* SPA space map                */
-       dump_none,              /* ZIL intent log               */
-       dump_dnode,             /* DMU dnode                    */
-       dump_dmu_objset,        /* DMU objset                   */
-       dump_dsl_dir,           /* DSL directory                */
-       dump_zap,               /* DSL directory child map      */
-       dump_zap,               /* DSL dataset snap map         */
-       dump_zap,               /* DSL props                    */
-       dump_dsl_dataset,       /* DSL dataset                  */
-       dump_znode,             /* ZFS znode                    */
-       dump_acl,               /* ZFS V0 ACL                   */
-       dump_uint8,             /* ZFS plain file               */
-       dump_zpldir,            /* ZFS directory                */
-       dump_zap,               /* ZFS master node              */
-       dump_zap,               /* ZFS delete queue             */
-       dump_uint8,             /* zvol object                  */
-       dump_zap,               /* zvol prop                    */
-       dump_uint8,             /* other uint8[]                */
-       dump_uint64,            /* other uint64[]               */
-       dump_zap,               /* other ZAP                    */
-       dump_zap,               /* persistent error log         */
-       dump_uint8,             /* SPA history                  */
-       dump_history_offsets,   /* SPA history offsets          */
-       dump_zap,               /* Pool properties              */
-       dump_zap,               /* DSL permissions              */
-       dump_acl,               /* ZFS ACL                      */
-       dump_uint8,             /* ZFS SYSACL                   */
-       dump_none,              /* FUID nvlist                  */
-       dump_packed_nvlist,     /* FUID nvlist size             */
-       dump_zap,               /* DSL dataset next clones      */
-       dump_zap,               /* DSL scrub queue              */
-       dump_zap,               /* ZFS user/group used          */
-       dump_zap,               /* ZFS user/group quota         */
-       dump_zap,               /* snapshot refcount tags       */
-       dump_ddt_zap,           /* DDT ZAP object               */
-       dump_zap,               /* DDT statistics               */
-       dump_znode,             /* SA object                    */
-       dump_zap,               /* SA Master Node               */
-       dump_sa_attrs,          /* SA attribute registration    */
-       dump_sa_layouts,        /* SA attribute layouts         */
-       dump_zap,               /* DSL scrub translations       */
-       dump_none,              /* fake dedup BP                */
-       dump_zap,               /* deadlist                     */
-       dump_none,              /* deadlist hdr                 */
-       dump_zap,               /* dsl clones                   */
-       dump_bpobj_subobjs,     /* bpobj subobjs                */
-       dump_unknown,           /* Unknown type, must be last   */
-};
-
-static void
-dump_object(objset_t *os, uint64_t object, int verbosity, int *print_header)
-{
-       dmu_buf_t *db = NULL;
-       dmu_object_info_t doi;
-       dnode_t *dn;
-       void *bonus = NULL;
-       size_t bsize = 0;
-       char iblk[32], dblk[32], lsize[32], asize[32], fill[32];
-       char bonus_size[32];
-       char aux[50];
-       int error;
-
-       if (*print_header) {
-               (void) printf("\n%10s  %3s  %5s  %5s  %5s  %5s  %6s  %s\n",
-                   "Object", "lvl", "iblk", "dblk", "dsize", "lsize",
-                   "%full", "type");
-               *print_header = 0;
-       }
-
-       if (object == 0) {
-               dn = DMU_META_DNODE(os);
-       } else {
-               error = dmu_bonus_hold(os, object, FTAG, &db);
-               if (error)
-                       fatal("dmu_bonus_hold(%llu) failed, errno %u",
-                           object, error);
-               bonus = db->db_data;
-               bsize = db->db_size;
-               dn = DB_DNODE((dmu_buf_impl_t *)db);
-       }
-       dmu_object_info_from_dnode(dn, &doi);
-
-       zdb_nicenum(doi.doi_metadata_block_size, iblk);
-       zdb_nicenum(doi.doi_data_block_size, dblk);
-       zdb_nicenum(doi.doi_max_offset, lsize);
-       zdb_nicenum(doi.doi_physical_blocks_512 << 9, asize);
-       zdb_nicenum(doi.doi_bonus_size, bonus_size);
-       (void) sprintf(fill, "%6.2f", 100.0 * doi.doi_fill_count *
-           doi.doi_data_block_size / (object == 0 ? DNODES_PER_BLOCK : 1) /
-           doi.doi_max_offset);
-
-       aux[0] = '\0';
-
-       if (doi.doi_checksum != ZIO_CHECKSUM_INHERIT || verbosity >= 6) {
-               (void) snprintf(aux + strlen(aux), sizeof (aux), " (K=%s)",
-                   ZDB_CHECKSUM_NAME(doi.doi_checksum));
-       }
-
-       if (doi.doi_compress != ZIO_COMPRESS_INHERIT || verbosity >= 6) {
-               (void) snprintf(aux + strlen(aux), sizeof (aux), " (Z=%s)",
-                   ZDB_COMPRESS_NAME(doi.doi_compress));
-       }
-
-       (void) printf("%10lld  %3u  %5s  %5s  %5s  %5s  %6s  %s%s\n",
-           (u_longlong_t)object, doi.doi_indirection, iblk, dblk,
-           asize, lsize, fill, ZDB_OT_NAME(doi.doi_type), aux);
-
-       if (doi.doi_bonus_type != DMU_OT_NONE && verbosity > 3) {
-               (void) printf("%10s  %3s  %5s  %5s  %5s  %5s  %6s  %s\n",
-                   "", "", "", "", "", bonus_size, "bonus",
-                   ZDB_OT_NAME(doi.doi_bonus_type));
-       }
-
-       if (verbosity >= 4) {
-               (void) printf("\tdnode flags: %s%s%s\n",
-                   (dn->dn_phys->dn_flags & DNODE_FLAG_USED_BYTES) ?
-                   "USED_BYTES " : "",
-                   (dn->dn_phys->dn_flags & DNODE_FLAG_USERUSED_ACCOUNTED) ?
-                   "USERUSED_ACCOUNTED " : "",
-                   (dn->dn_phys->dn_flags & DNODE_FLAG_SPILL_BLKPTR) ?
-                   "SPILL_BLKPTR" : "");
-               (void) printf("\tdnode maxblkid: %llu\n",
-                   (longlong_t)dn->dn_phys->dn_maxblkid);
-
-               object_viewer[ZDB_OT_TYPE(doi.doi_bonus_type)](os, object,
-                   bonus, bsize);
-               object_viewer[ZDB_OT_TYPE(doi.doi_type)](os, object, NULL, 0);
-               *print_header = 1;
-       }
-
-       if (verbosity >= 5)
-               dump_indirect(dn);
-
-       if (verbosity >= 5) {
-               /*
-                * Report the list of segments that comprise the object.
-                */
-               uint64_t start = 0;
-               uint64_t end;
-               uint64_t blkfill = 1;
-               int minlvl = 1;
-
-               if (dn->dn_type == DMU_OT_DNODE) {
-                       minlvl = 0;
-                       blkfill = DNODES_PER_BLOCK;
-               }
-
-               for (;;) {
-                       char segsize[32];
-                       error = dnode_next_offset(dn,
-                           0, &start, minlvl, blkfill, 0);
-                       if (error)
-                               break;
-                       end = start;
-                       error = dnode_next_offset(dn,
-                           DNODE_FIND_HOLE, &end, minlvl, blkfill, 0);
-                       zdb_nicenum(end - start, segsize);
-                       (void) printf("\t\tsegment [%016llx, %016llx)"
-                           " size %5s\n", (u_longlong_t)start,
-                           (u_longlong_t)end, segsize);
-                       if (error)
-                               break;
-                       start = end;
-               }
-       }
-
-       if (db != NULL)
-               dmu_buf_rele(db, FTAG);
-}
-
-static char *objset_types[DMU_OST_NUMTYPES] = {
-       "NONE", "META", "ZPL", "ZVOL", "OTHER", "ANY" };
-
-static void
-dump_dir(objset_t *os)
-{
-       dmu_objset_stats_t dds;
-       uint64_t object, object_count;
-       uint64_t refdbytes, usedobjs, scratch;
-       char numbuf[32];
-       char blkbuf[BP_SPRINTF_LEN + 20];
-       char osname[MAXNAMELEN];
-       char *type = "UNKNOWN";
-       int verbosity = dump_opt['d'];
-       int print_header = 1;
-       int i, error;
-
-       dsl_pool_config_enter(dmu_objset_pool(os), FTAG);
-       dmu_objset_fast_stat(os, &dds);
-       dsl_pool_config_exit(dmu_objset_pool(os), FTAG);
-
-       if (dds.dds_type < DMU_OST_NUMTYPES)
-               type = objset_types[dds.dds_type];
-
-       if (dds.dds_type == DMU_OST_META) {
-               dds.dds_creation_txg = TXG_INITIAL;
-               usedobjs = BP_GET_FILL(os->os_rootbp);
-               refdbytes = dsl_dir_phys(os->os_spa->spa_dsl_pool->dp_mos_dir)->
-                   dd_used_bytes;
-       } else {
-               dmu_objset_space(os, &refdbytes, &scratch, &usedobjs, &scratch);
-       }
-
-       ASSERT3U(usedobjs, ==, BP_GET_FILL(os->os_rootbp));
-
-       zdb_nicenum(refdbytes, numbuf);
-
-       if (verbosity >= 4) {
-               (void) snprintf(blkbuf, sizeof (blkbuf), ", rootbp ");
-               (void) snprintf_blkptr(blkbuf + strlen(blkbuf),
-                   sizeof (blkbuf) - strlen(blkbuf), os->os_rootbp);
-       } else {
-               blkbuf[0] = '\0';
-       }
-
-       dmu_objset_name(os, osname);
-
-       (void) printf("Dataset %s [%s], ID %llu, cr_txg %llu, "
-           "%s, %llu objects%s\n",
-           osname, type, (u_longlong_t)dmu_objset_id(os),
-           (u_longlong_t)dds.dds_creation_txg,
-           numbuf, (u_longlong_t)usedobjs, blkbuf);
-
-       if (zopt_objects != 0) {
-               for (i = 0; i < zopt_objects; i++)
-                       dump_object(os, zopt_object[i], verbosity,
-                           &print_header);
-               (void) printf("\n");
-               return;
-       }
-
-       if (dump_opt['i'] != 0 || verbosity >= 2)
-               dump_intent_log(dmu_objset_zil(os));
-
-       if (dmu_objset_ds(os) != NULL)
-               dump_deadlist(&dmu_objset_ds(os)->ds_deadlist);
-
-       if (verbosity < 2)
-               return;
-
-       if (BP_IS_HOLE(os->os_rootbp))
-               return;
-
-       dump_object(os, 0, verbosity, &print_header);
-       object_count = 0;
-       if (DMU_USERUSED_DNODE(os) != NULL &&
-           DMU_USERUSED_DNODE(os)->dn_type != 0) {
-               dump_object(os, DMU_USERUSED_OBJECT, verbosity, &print_header);
-               dump_object(os, DMU_GROUPUSED_OBJECT, verbosity, &print_header);
-       }
-
-       object = 0;
-       while ((error = dmu_object_next(os, &object, B_FALSE, 0)) == 0) {
-               dump_object(os, object, verbosity, &print_header);
-               object_count++;
-       }
-
-       ASSERT3U(object_count, ==, usedobjs);
-
-       (void) printf("\n");
-
-       if (error != ESRCH) {
-               (void) fprintf(stderr, "dmu_object_next() = %d\n", error);
-               abort();
-       }
-}
-
-static void
-dump_uberblock(uberblock_t *ub, const char *header, const char *footer)
-{
-       time_t timestamp = ub->ub_timestamp;
-
-       (void) printf("%s", header ? header : "");
-       (void) printf("\tmagic = %016llx\n", (u_longlong_t)ub->ub_magic);
-       (void) printf("\tversion = %llu\n", (u_longlong_t)ub->ub_version);
-       (void) printf("\ttxg = %llu\n", (u_longlong_t)ub->ub_txg);
-       (void) printf("\tguid_sum = %llu\n", (u_longlong_t)ub->ub_guid_sum);
-       (void) printf("\ttimestamp = %llu UTC = %s",
-           (u_longlong_t)ub->ub_timestamp, asctime(localtime(&timestamp)));
-       if (dump_opt['u'] >= 3) {
-               char blkbuf[BP_SPRINTF_LEN];
-               snprintf_blkptr(blkbuf, sizeof (blkbuf), &ub->ub_rootbp);
-               (void) printf("\trootbp = %s\n", blkbuf);
-       }
-       (void) printf("%s", footer ? footer : "");
-}
-
-static void
-dump_config(spa_t *spa)
-{
-       dmu_buf_t *db;
-       size_t nvsize = 0;
-       int error = 0;
-
-
-       error = dmu_bonus_hold(spa->spa_meta_objset,
-           spa->spa_config_object, FTAG, &db);
-
-       if (error == 0) {
-               nvsize = *(uint64_t *)db->db_data;
-               dmu_buf_rele(db, FTAG);
-
-               (void) printf("\nMOS Configuration:\n");
-               dump_packed_nvlist(spa->spa_meta_objset,
-                   spa->spa_config_object, (void *)&nvsize, 1);
-       } else {
-               (void) fprintf(stderr, "dmu_bonus_hold(%llu) failed, errno %d",
-                   (u_longlong_t)spa->spa_config_object, error);
-       }
-}
-
-static void
-dump_cachefile(const char *cachefile)
-{
-       int fd;
-       struct stat64 statbuf;
-       char *buf;
-       nvlist_t *config;
-
-       if ((fd = open64(cachefile, O_RDONLY)) < 0) {
-               (void) printf("cannot open '%s': %s\n", cachefile,
-                   strerror(errno));
-               exit(1);
-       }
-
-       if (fstat64(fd, &statbuf) != 0) {
-               (void) printf("failed to stat '%s': %s\n", cachefile,
-                   strerror(errno));
-               exit(1);
-       }
-
-       if ((buf = malloc(statbuf.st_size)) == NULL) {
-               (void) fprintf(stderr, "failed to allocate %llu bytes\n",
-                   (u_longlong_t)statbuf.st_size);
-               exit(1);
-       }
-
-       if (read(fd, buf, statbuf.st_size) != statbuf.st_size) {
-               (void) fprintf(stderr, "failed to read %llu bytes\n",
-                   (u_longlong_t)statbuf.st_size);
-               exit(1);
-       }
-
-       (void) close(fd);
-
-       if (nvlist_unpack(buf, statbuf.st_size, &config, 0) != 0) {
-               (void) fprintf(stderr, "failed to unpack nvlist\n");
-               exit(1);
-       }
-
-       free(buf);
-
-       dump_nvlist(config, 0);
-
-       nvlist_free(config);
-}
-
-#define        ZDB_MAX_UB_HEADER_SIZE 32
-
-static void
-dump_label_uberblocks(vdev_label_t *lbl, uint64_t ashift)
-{
-       vdev_t vd;
-       vdev_t *vdp = &vd;
-       char header[ZDB_MAX_UB_HEADER_SIZE];
-       int i;
-
-       vd.vdev_ashift = ashift;
-       vdp->vdev_top = vdp;
-
-       for (i = 0; i < VDEV_UBERBLOCK_COUNT(vdp); i++) {
-               uint64_t uoff = VDEV_UBERBLOCK_OFFSET(vdp, i);
-               uberblock_t *ub = (void *)((char *)lbl + uoff);
-
-               if (uberblock_verify(ub))
-                       continue;
-               (void) snprintf(header, ZDB_MAX_UB_HEADER_SIZE,
-                   "Uberblock[%d]\n", i);
-               dump_uberblock(ub, header, "");
-       }
-}
-
-static void
-dump_label(const char *dev)
-{
-       int fd;
-       vdev_label_t label;
-       char *path, *buf = label.vl_vdev_phys.vp_nvlist;
-       size_t buflen = sizeof (label.vl_vdev_phys.vp_nvlist);
-       struct stat64 statbuf;
-       uint64_t psize, ashift;
-       int len = strlen(dev) + 1;
-       int l;
-
-       if (strncmp(dev, "/dev/dsk/", 9) == 0) {
-               len++;
-               path = malloc(len);
-               (void) snprintf(path, len, "%s%s", "/dev/rdsk/", dev + 9);
-       } else {
-               path = strdup(dev);
-       }
-
-       if ((fd = open64(path, O_RDONLY)) < 0) {
-               (void) printf("cannot open '%s': %s\n", path, strerror(errno));
-               free(path);
-               exit(1);
-       }
-
-       if (fstat64_blk(fd, &statbuf) != 0) {
-               (void) printf("failed to stat '%s': %s\n", path,
-                   strerror(errno));
-               free(path);
-               (void) close(fd);
-               exit(1);
-       }
-
-       psize = statbuf.st_size;
-       psize = P2ALIGN(psize, (uint64_t)sizeof (vdev_label_t));
-
-       for (l = 0; l < VDEV_LABELS; l++) {
-               nvlist_t *config = NULL;
-
-               (void) printf("--------------------------------------------\n");
-               (void) printf("LABEL %d\n", l);
-               (void) printf("--------------------------------------------\n");
-
-               if (pread64(fd, &label, sizeof (label),
-                   vdev_label_offset(psize, l, 0)) != sizeof (label)) {
-                       (void) printf("failed to read label %d\n", l);
-                       continue;
-               }
-
-               if (nvlist_unpack(buf, buflen, &config, 0) != 0) {
-                       (void) printf("failed to unpack label %d\n", l);
-                       ashift = SPA_MINBLOCKSHIFT;
-               } else {
-                       nvlist_t *vdev_tree = NULL;
-
-                       dump_nvlist(config, 4);
-                       if ((nvlist_lookup_nvlist(config,
-                           ZPOOL_CONFIG_VDEV_TREE, &vdev_tree) != 0) ||
-                           (nvlist_lookup_uint64(vdev_tree,
-                           ZPOOL_CONFIG_ASHIFT, &ashift) != 0))
-                               ashift = SPA_MINBLOCKSHIFT;
-                       nvlist_free(config);
-               }
-               if (dump_opt['u'])
-                       dump_label_uberblocks(&label, ashift);
-       }
-
-       free(path);
-       (void) close(fd);
-}
-
-static uint64_t num_large_blocks;
-
-/*ARGSUSED*/
-static int
-dump_one_dir(const char *dsname, void *arg)
-{
-       int error;
-       objset_t *os;
-
-       error = dmu_objset_own(dsname, DMU_OST_ANY, B_TRUE, FTAG, &os);
-       if (error) {
-               (void) printf("Could not open %s, error %d\n", dsname, error);
-               return (0);
-       }
-       if (dmu_objset_ds(os)->ds_large_blocks)
-               num_large_blocks++;
-       dump_dir(os);
-       dmu_objset_disown(os, FTAG);
-       fuid_table_destroy();
-       sa_loaded = B_FALSE;
-       return (0);
-}
-
-/*
- * Block statistics.
- */
-#define        PSIZE_HISTO_SIZE (SPA_OLD_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 2)
-typedef struct zdb_blkstats {
-       uint64_t zb_asize;
-       uint64_t zb_lsize;
-       uint64_t zb_psize;
-       uint64_t zb_count;
-       uint64_t zb_gangs;
-       uint64_t zb_ditto_samevdev;
-       uint64_t zb_psize_histogram[PSIZE_HISTO_SIZE];
-} zdb_blkstats_t;
-
-/*
- * Extended object types to report deferred frees and dedup auto-ditto blocks.
- */
-#define        ZDB_OT_DEFERRED (DMU_OT_NUMTYPES + 0)
-#define        ZDB_OT_DITTO    (DMU_OT_NUMTYPES + 1)
-#define        ZDB_OT_OTHER    (DMU_OT_NUMTYPES + 2)
-#define        ZDB_OT_TOTAL    (DMU_OT_NUMTYPES + 3)
-
-static char *zdb_ot_extname[] = {
-       "deferred free",
-       "dedup ditto",
-       "other",
-       "Total",
-};
-
-#define        ZB_TOTAL        DN_MAX_LEVELS
-
-typedef struct zdb_cb {
-       zdb_blkstats_t  zcb_type[ZB_TOTAL + 1][ZDB_OT_TOTAL + 1];
-       uint64_t        zcb_dedup_asize;
-       uint64_t        zcb_dedup_blocks;
-       uint64_t        zcb_embedded_blocks[NUM_BP_EMBEDDED_TYPES];
-       uint64_t        zcb_embedded_histogram[NUM_BP_EMBEDDED_TYPES]
-           [BPE_PAYLOAD_SIZE];
-       uint64_t        zcb_start;
-       uint64_t        zcb_lastprint;
-       uint64_t        zcb_totalasize;
-       uint64_t        zcb_errors[256];
-       int             zcb_readfails;
-       int             zcb_haderrors;
-       spa_t           *zcb_spa;
-} zdb_cb_t;
-
-static void
-zdb_count_block(zdb_cb_t *zcb, zilog_t *zilog, const blkptr_t *bp,
-    dmu_object_type_t type)
-{
-       uint64_t refcnt = 0;
-       int i;
-
-       ASSERT(type < ZDB_OT_TOTAL);
-
-       if (zilog && zil_bp_tree_add(zilog, bp) != 0)
-               return;
-
-       for (i = 0; i < 4; i++) {
-               int l = (i < 2) ? BP_GET_LEVEL(bp) : ZB_TOTAL;
-               int t = (i & 1) ? type : ZDB_OT_TOTAL;
-               int equal;
-               zdb_blkstats_t *zb = &zcb->zcb_type[l][t];
-
-               zb->zb_asize += BP_GET_ASIZE(bp);
-               zb->zb_lsize += BP_GET_LSIZE(bp);
-               zb->zb_psize += BP_GET_PSIZE(bp);
-               zb->zb_count++;
-
-               /*
-                * The histogram is only big enough to record blocks up to
-                * SPA_OLD_MAXBLOCKSIZE; larger blocks go into the last,
-                * "other", bucket.
-                */
-               int idx = BP_GET_PSIZE(bp) >> SPA_MINBLOCKSHIFT;
-               idx = MIN(idx, SPA_OLD_MAXBLOCKSIZE / SPA_MINBLOCKSIZE + 1);
-               zb->zb_psize_histogram[idx]++;
-
-               zb->zb_gangs += BP_COUNT_GANG(bp);
-
-               switch (BP_GET_NDVAS(bp)) {
-               case 2:
-                       if (DVA_GET_VDEV(&bp->blk_dva[0]) ==
-                           DVA_GET_VDEV(&bp->blk_dva[1]))
-                               zb->zb_ditto_samevdev++;
-                       break;
-               case 3:
-                       equal = (DVA_GET_VDEV(&bp->blk_dva[0]) ==
-                           DVA_GET_VDEV(&bp->blk_dva[1])) +
-                           (DVA_GET_VDEV(&bp->blk_dva[0]) ==
-                           DVA_GET_VDEV(&bp->blk_dva[2])) +
-                           (DVA_GET_VDEV(&bp->blk_dva[1]) ==
-                           DVA_GET_VDEV(&bp->blk_dva[2]));
-                       if (equal != 0)
-                               zb->zb_ditto_samevdev++;
-                       break;
-               }
-
-       }
-
-       if (BP_IS_EMBEDDED(bp)) {
-               zcb->zcb_embedded_blocks[BPE_GET_ETYPE(bp)]++;
-               zcb->zcb_embedded_histogram[BPE_GET_ETYPE(bp)]
-                   [BPE_GET_PSIZE(bp)]++;
-               return;
-       }
-
-       if (dump_opt['L'])
-               return;
-
-       if (BP_GET_DEDUP(bp)) {
-               ddt_t *ddt;
-               ddt_entry_t *dde;
-
-               ddt = ddt_select(zcb->zcb_spa, bp);
-               ddt_enter(ddt);
-               dde = ddt_lookup(ddt, bp, B_FALSE);
-
-               if (dde == NULL) {
-                       refcnt = 0;
-               } else {
-                       ddt_phys_t *ddp = ddt_phys_select(dde, bp);
-                       ddt_phys_decref(ddp);
-                       refcnt = ddp->ddp_refcnt;
-                       if (ddt_phys_total_refcnt(dde) == 0)
-                               ddt_remove(ddt, dde);
-               }
-               ddt_exit(ddt);
-       }
-
-       VERIFY3U(zio_wait(zio_claim(NULL, zcb->zcb_spa,
-           refcnt ? 0 : spa_first_txg(zcb->zcb_spa),
-           bp, NULL, NULL, ZIO_FLAG_CANFAIL)), ==, 0);
-}
-
-static void
-zdb_blkptr_done(zio_t *zio)
-{
-       spa_t *spa = zio->io_spa;
-       blkptr_t *bp = zio->io_bp;
-       int ioerr = zio->io_error;
-       zdb_cb_t *zcb = zio->io_private;
-       zbookmark_phys_t *zb = &zio->io_bookmark;
-
-       zio_data_buf_free(zio->io_data, zio->io_size);
-
-       mutex_enter(&spa->spa_scrub_lock);
-       spa->spa_scrub_inflight--;
-       cv_broadcast(&spa->spa_scrub_io_cv);
-
-       if (ioerr && !(zio->io_flags & ZIO_FLAG_SPECULATIVE)) {
-               char blkbuf[BP_SPRINTF_LEN];
-
-               zcb->zcb_haderrors = 1;
-               zcb->zcb_errors[ioerr]++;
-
-               if (dump_opt['b'] >= 2)
-                       snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
-               else
-                       blkbuf[0] = '\0';
-
-               (void) printf("zdb_blkptr_cb: "
-                   "Got error %d reading "
-                   "<%llu, %llu, %lld, %llx> %s -- skipping\n",
-                   ioerr,
-                   (u_longlong_t)zb->zb_objset,
-                   (u_longlong_t)zb->zb_object,
-                   (u_longlong_t)zb->zb_level,
-                   (u_longlong_t)zb->zb_blkid,
-                   blkbuf);
-       }
-       mutex_exit(&spa->spa_scrub_lock);
-}
-
-static int
-zdb_blkptr_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
-{
-       zdb_cb_t *zcb = arg;
-       dmu_object_type_t type;
-       boolean_t is_metadata;
-
-       if (dump_opt['b'] >= 5 && bp->blk_birth > 0) {
-               char blkbuf[BP_SPRINTF_LEN];
-               snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
-               (void) printf("objset %llu object %llu "
-                   "level %lld offset 0x%llx %s\n",
-                   (u_longlong_t)zb->zb_objset,
-                   (u_longlong_t)zb->zb_object,
-                   (longlong_t)zb->zb_level,
-                   (u_longlong_t)blkid2offset(dnp, bp, zb),
-                   blkbuf);
-       }
-
-       if (BP_IS_HOLE(bp))
-               return (0);
-
-       type = BP_GET_TYPE(bp);
-
-       zdb_count_block(zcb, zilog, bp,
-           (type & DMU_OT_NEWTYPE) ? ZDB_OT_OTHER : type);
-
-       is_metadata = (BP_GET_LEVEL(bp) != 0 || DMU_OT_IS_METADATA(type));
-
-       if (!BP_IS_EMBEDDED(bp) &&
-           (dump_opt['c'] > 1 || (dump_opt['c'] && is_metadata))) {
-               size_t size = BP_GET_PSIZE(bp);
-               void *data = zio_data_buf_alloc(size);
-               int flags = ZIO_FLAG_CANFAIL | ZIO_FLAG_SCRUB | ZIO_FLAG_RAW;
-
-               /* If it's an intent log block, failure is expected. */
-               if (zb->zb_level == ZB_ZIL_LEVEL)
-                       flags |= ZIO_FLAG_SPECULATIVE;
-
-               mutex_enter(&spa->spa_scrub_lock);
-               while (spa->spa_scrub_inflight > max_inflight)
-                       cv_wait(&spa->spa_scrub_io_cv, &spa->spa_scrub_lock);
-               spa->spa_scrub_inflight++;
-               mutex_exit(&spa->spa_scrub_lock);
-
-               zio_nowait(zio_read(NULL, spa, bp, data, size,
-                   zdb_blkptr_done, zcb, ZIO_PRIORITY_ASYNC_READ, flags, zb));
-       }
-
-       zcb->zcb_readfails = 0;
-
-       /* only call gethrtime() every 100 blocks */
-       static int iters;
-       if (++iters > 100)
-               iters = 0;
-       else
-               return (0);
-
-       if (dump_opt['b'] < 5 && gethrtime() > zcb->zcb_lastprint + NANOSEC) {
-               uint64_t now = gethrtime();
-               char buf[10];
-               uint64_t bytes = zcb->zcb_type[ZB_TOTAL][ZDB_OT_TOTAL].zb_asize;
-               int kb_per_sec =
-                   1 + bytes / (1 + ((now - zcb->zcb_start) / 1000 / 1000));
-               int sec_remaining =
-                   (zcb->zcb_totalasize - bytes) / 1024 / kb_per_sec;
-
-               zfs_nicenum(bytes, buf, sizeof (buf));
-               (void) fprintf(stderr,
-                   "\r%5s completed (%4dMB/s) "
-                   "estimated time remaining: %uhr %02umin %02usec        ",
-                   buf, kb_per_sec / 1024,
-                   sec_remaining / 60 / 60,
-                   sec_remaining / 60 % 60,
-                   sec_remaining % 60);
-
-               zcb->zcb_lastprint = now;
-       }
-
-       return (0);
-}
-
-static void
-zdb_leak(void *arg, uint64_t start, uint64_t size)
-{
-       vdev_t *vd = arg;
-
-       (void) printf("leaked space: vdev %llu, offset 0x%llx, size %llu\n",
-           (u_longlong_t)vd->vdev_id, (u_longlong_t)start, (u_longlong_t)size);
-}
-
-static metaslab_ops_t zdb_metaslab_ops = {
-       NULL    /* alloc */
-};
-
-static void
-zdb_ddt_leak_init(spa_t *spa, zdb_cb_t *zcb)
-{
-       ddt_bookmark_t ddb = { 0 };
-       ddt_entry_t dde;
-       int error;
-       int p;
-
-       while ((error = ddt_walk(spa, &ddb, &dde)) == 0) {
-               blkptr_t blk;
-               ddt_phys_t *ddp = dde.dde_phys;
-
-               if (ddb.ddb_class == DDT_CLASS_UNIQUE)
-                       return;
-
-               ASSERT(ddt_phys_total_refcnt(&dde) > 1);
-
-               for (p = 0; p < DDT_PHYS_TYPES; p++, ddp++) {
-                       if (ddp->ddp_phys_birth == 0)
-                               continue;
-                       ddt_bp_create(ddb.ddb_checksum,
-                           &dde.dde_key, ddp, &blk);
-                       if (p == DDT_PHYS_DITTO) {
-                               zdb_count_block(zcb, NULL, &blk, ZDB_OT_DITTO);
-                       } else {
-                               zcb->zcb_dedup_asize +=
-                                   BP_GET_ASIZE(&blk) * (ddp->ddp_refcnt - 1);
-                               zcb->zcb_dedup_blocks++;
-                       }
-               }
-               if (!dump_opt['L']) {
-                       ddt_t *ddt = spa->spa_ddt[ddb.ddb_checksum];
-                       ddt_enter(ddt);
-                       VERIFY(ddt_lookup(ddt, &blk, B_TRUE) != NULL);
-                       ddt_exit(ddt);
-               }
-       }
-
-       ASSERT(error == ENOENT);
-}
-
-static void
-zdb_leak_init(spa_t *spa, zdb_cb_t *zcb)
-{
-       zcb->zcb_spa = spa;
-       uint64_t c, m;
-
-       if (!dump_opt['L']) {
-               vdev_t *rvd = spa->spa_root_vdev;
-               for (c = 0; c < rvd->vdev_children; c++) {
-                       vdev_t *vd = rvd->vdev_child[c];
-                       for (m = 0; m < vd->vdev_ms_count; m++) {
-                               metaslab_t *msp = vd->vdev_ms[m];
-                               mutex_enter(&msp->ms_lock);
-                               metaslab_unload(msp);
-
-                               /*
-                                * For leak detection, we overload the metaslab
-                                * ms_tree to contain allocated segments
-                                * instead of free segments. As a result,
-                                * we can't use the normal metaslab_load/unload
-                                * interfaces.
-                                */
-                               if (msp->ms_sm != NULL) {
-                                       (void) fprintf(stderr,
-                                           "\rloading space map for "
-                                           "vdev %llu of %llu, "
-                                           "metaslab %llu of %llu ...",
-                                           (longlong_t)c,
-                                           (longlong_t)rvd->vdev_children,
-                                           (longlong_t)m,
-                                           (longlong_t)vd->vdev_ms_count);
-
-                                       msp->ms_ops = &zdb_metaslab_ops;
-
-                                       /*
-                                        * We don't want to spend the CPU
-                                        * manipulating the size-ordered
-                                        * tree, so clear the range_tree
-                                        * ops.
-                                        */
-                                       msp->ms_tree->rt_ops = NULL;
-                                       VERIFY0(space_map_load(msp->ms_sm,
-                                           msp->ms_tree, SM_ALLOC));
-                                       msp->ms_loaded = B_TRUE;
-                               }
-                               mutex_exit(&msp->ms_lock);
-                       }
-               }
-               (void) fprintf(stderr, "\n");
-       }
-
-       spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
-
-       zdb_ddt_leak_init(spa, zcb);
-
-       spa_config_exit(spa, SCL_CONFIG, FTAG);
-}
-
-static void
-zdb_leak_fini(spa_t *spa)
-{
-       int c, m;
-
-       if (!dump_opt['L']) {
-               vdev_t *rvd = spa->spa_root_vdev;
-               for (c = 0; c < rvd->vdev_children; c++) {
-                       vdev_t *vd = rvd->vdev_child[c];
-                       for (m = 0; m < vd->vdev_ms_count; m++) {
-                               metaslab_t *msp = vd->vdev_ms[m];
-                               mutex_enter(&msp->ms_lock);
-
-                               /*
-                                * The ms_tree has been overloaded to
-                                * contain allocated segments. Now that we
-                                * finished traversing all blocks, any
-                                * block that remains in the ms_tree
-                                * represents an allocated block that we
-                                * did not claim during the traversal.
-                                * Claimed blocks would have been removed
-                                * from the ms_tree.
-                                */
-                               range_tree_vacate(msp->ms_tree, zdb_leak, vd);
-                               msp->ms_loaded = B_FALSE;
-
-                               mutex_exit(&msp->ms_lock);
-                       }
-               }
-       }
-}
-
-/* ARGSUSED */
-static int
-count_block_cb(void *arg, const blkptr_t *bp, dmu_tx_t *tx)
-{
-       zdb_cb_t *zcb = arg;
-
-       if (dump_opt['b'] >= 5) {
-               char blkbuf[BP_SPRINTF_LEN];
-               snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
-               (void) printf("[%s] %s\n",
-                   "deferred free", blkbuf);
-       }
-       zdb_count_block(zcb, NULL, bp, ZDB_OT_DEFERRED);
-       return (0);
-}
-
-static int
-dump_block_stats(spa_t *spa)
-{
-       zdb_cb_t zcb;
-       zdb_blkstats_t *zb, *tzb;
-       uint64_t norm_alloc, norm_space, total_alloc, total_found;
-       int flags = TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA | TRAVERSE_HARD;
-       boolean_t leaks = B_FALSE;
-       int e, c;
-       bp_embedded_type_t i;
-
-       (void) printf("\nTraversing all blocks %s%s%s%s%s...\n\n",
-           (dump_opt['c'] || !dump_opt['L']) ? "to verify " : "",
-           (dump_opt['c'] == 1) ? "metadata " : "",
-           dump_opt['c'] ? "checksums " : "",
-           (dump_opt['c'] && !dump_opt['L']) ? "and verify " : "",
-           !dump_opt['L'] ? "nothing leaked " : "");
-
-       /*
-        * Load all space maps as SM_ALLOC maps, then traverse the pool
-        * claiming each block we discover.  If the pool is perfectly
-        * consistent, the space maps will be empty when we're done.
-        * Anything left over is a leak; any block we can't claim (because
-        * it's not part of any space map) is a double allocation,
-        * reference to a freed block, or an unclaimed log block.
-        */
-       bzero(&zcb, sizeof (zdb_cb_t));
-       zdb_leak_init(spa, &zcb);
-
-       /*
-        * If there's a deferred-free bplist, process that first.
-        */
-       (void) bpobj_iterate_nofree(&spa->spa_deferred_bpobj,
-           count_block_cb, &zcb, NULL);
-       if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
-               (void) bpobj_iterate_nofree(&spa->spa_dsl_pool->dp_free_bpobj,
-                   count_block_cb, &zcb, NULL);
-       }
-       if (spa_feature_is_active(spa, SPA_FEATURE_ASYNC_DESTROY)) {
-               VERIFY3U(0, ==, bptree_iterate(spa->spa_meta_objset,
-                   spa->spa_dsl_pool->dp_bptree_obj, B_FALSE, count_block_cb,
-                   &zcb, NULL));
-       }
-
-       if (dump_opt['c'] > 1)
-               flags |= TRAVERSE_PREFETCH_DATA;
-
-       zcb.zcb_totalasize = metaslab_class_get_alloc(spa_normal_class(spa));
-       zcb.zcb_start = zcb.zcb_lastprint = gethrtime();
-       zcb.zcb_haderrors |= traverse_pool(spa, 0, flags, zdb_blkptr_cb, &zcb);
-
-       /*
-        * If we've traversed the data blocks then we need to wait for those
-        * I/Os to complete. We leverage "The Godfather" zio to wait on
-        * all async I/Os to complete.
-        */
-       if (dump_opt['c']) {
-               for (c = 0; c < max_ncpus; c++) {
-                       (void) zio_wait(spa->spa_async_zio_root[c]);
-                       spa->spa_async_zio_root[c] = zio_root(spa, NULL, NULL,
-                           ZIO_FLAG_CANFAIL | ZIO_FLAG_SPECULATIVE |
-                           ZIO_FLAG_GODFATHER);
-               }
-       }
-
-       if (zcb.zcb_haderrors) {
-               (void) printf("\nError counts:\n\n");
-               (void) printf("\t%5s  %s\n", "errno", "count");
-               for (e = 0; e < 256; e++) {
-                       if (zcb.zcb_errors[e] != 0) {
-                               (void) printf("\t%5d  %llu\n",
-                                   e, (u_longlong_t)zcb.zcb_errors[e]);
-                       }
-               }
-       }
-
-       /*
-        * Report any leaked segments.
-        */
-       zdb_leak_fini(spa);
-
-       tzb = &zcb.zcb_type[ZB_TOTAL][ZDB_OT_TOTAL];
-
-       norm_alloc = metaslab_class_get_alloc(spa_normal_class(spa));
-       norm_space = metaslab_class_get_space(spa_normal_class(spa));
-
-       total_alloc = norm_alloc + metaslab_class_get_alloc(spa_log_class(spa));
-       total_found = tzb->zb_asize - zcb.zcb_dedup_asize;
-
-       if (total_found == total_alloc) {
-               if (!dump_opt['L'])
-                       (void) printf("\n\tNo leaks (block sum matches space"
-                           " maps exactly)\n");
-       } else {
-               (void) printf("block traversal size %llu != alloc %llu "
-                   "(%s %lld)\n",
-                   (u_longlong_t)total_found,
-                   (u_longlong_t)total_alloc,
-                   (dump_opt['L']) ? "unreachable" : "leaked",
-                   (longlong_t)(total_alloc - total_found));
-               leaks = B_TRUE;
-       }
-
-       if (tzb->zb_count == 0)
-               return (2);
-
-       (void) printf("\n");
-       (void) printf("\tbp count:      %10llu\n",
-           (u_longlong_t)tzb->zb_count);
-       (void) printf("\tganged count:  %10llu\n",
-           (longlong_t)tzb->zb_gangs);
-       (void) printf("\tbp logical:    %10llu      avg: %6llu\n",
-           (u_longlong_t)tzb->zb_lsize,
-           (u_longlong_t)(tzb->zb_lsize / tzb->zb_count));
-       (void) printf("\tbp physical:   %10llu      avg:"
-           " %6llu     compression: %6.2f\n",
-           (u_longlong_t)tzb->zb_psize,
-           (u_longlong_t)(tzb->zb_psize / tzb->zb_count),
-           (double)tzb->zb_lsize / tzb->zb_psize);
-       (void) printf("\tbp allocated:  %10llu      avg:"
-           " %6llu     compression: %6.2f\n",
-           (u_longlong_t)tzb->zb_asize,
-           (u_longlong_t)(tzb->zb_asize / tzb->zb_count),
-           (double)tzb->zb_lsize / tzb->zb_asize);
-       (void) printf("\tbp deduped:    %10llu    ref>1:"
-           " %6llu   deduplication: %6.2f\n",
-           (u_longlong_t)zcb.zcb_dedup_asize,
-           (u_longlong_t)zcb.zcb_dedup_blocks,
-           (double)zcb.zcb_dedup_asize / tzb->zb_asize + 1.0);
-       (void) printf("\tSPA allocated: %10llu     used: %5.2f%%\n",
-           (u_longlong_t)norm_alloc, 100.0 * norm_alloc / norm_space);
-
-       for (i = 0; i < NUM_BP_EMBEDDED_TYPES; i++) {
-               if (zcb.zcb_embedded_blocks[i] == 0)
-                       continue;
-               (void) printf("\n");
-               (void) printf("\tadditional, non-pointer bps of type %u: "
-                   "%10llu\n",
-                   i, (u_longlong_t)zcb.zcb_embedded_blocks[i]);
-
-               if (dump_opt['b'] >= 3) {
-                       (void) printf("\t number of (compressed) bytes:  "
-                           "number of bps\n");
-                       dump_histogram(zcb.zcb_embedded_histogram[i],
-                           sizeof (zcb.zcb_embedded_histogram[i]) /
-                           sizeof (zcb.zcb_embedded_histogram[i][0]), 0);
-               }
-       }
-
-       if (tzb->zb_ditto_samevdev != 0) {
-               (void) printf("\tDittoed blocks on same vdev: %llu\n",
-                   (longlong_t)tzb->zb_ditto_samevdev);
-       }
-
-       if (dump_opt['b'] >= 2) {
-               int l, t, level;
-               (void) printf("\nBlocks\tLSIZE\tPSIZE\tASIZE"
-                   "\t  avg\t comp\t%%Total\tType\n");
-
-               for (t = 0; t <= ZDB_OT_TOTAL; t++) {
-                       char csize[32], lsize[32], psize[32], asize[32];
-                       char avg[32], gang[32];
-                       char *typename;
-
-                       if (t < DMU_OT_NUMTYPES)
-                               typename = dmu_ot[t].ot_name;
-                       else
-                               typename = zdb_ot_extname[t - DMU_OT_NUMTYPES];
-
-                       if (zcb.zcb_type[ZB_TOTAL][t].zb_asize == 0) {
-                               (void) printf("%6s\t%5s\t%5s\t%5s"
-                                   "\t%5s\t%5s\t%6s\t%s\n",
-                                   "-",
-                                   "-",
-                                   "-",
-                                   "-",
-                                   "-",
-                                   "-",
-                                   "-",
-                                   typename);
-                               continue;
-                       }
-
-                       for (l = ZB_TOTAL - 1; l >= -1; l--) {
-                               level = (l == -1 ? ZB_TOTAL : l);
-                               zb = &zcb.zcb_type[level][t];
-
-                               if (zb->zb_asize == 0)
-                                       continue;
-
-                               if (dump_opt['b'] < 3 && level != ZB_TOTAL)
-                                       continue;
-
-                               if (level == 0 && zb->zb_asize ==
-                                   zcb.zcb_type[ZB_TOTAL][t].zb_asize)
-                                       continue;
-
-                               zdb_nicenum(zb->zb_count, csize);
-                               zdb_nicenum(zb->zb_lsize, lsize);
-                               zdb_nicenum(zb->zb_psize, psize);
-                               zdb_nicenum(zb->zb_asize, asize);
-                               zdb_nicenum(zb->zb_asize / zb->zb_count, avg);
-                               zdb_nicenum(zb->zb_gangs, gang);
-
-                               (void) printf("%6s\t%5s\t%5s\t%5s\t%5s"
-                                   "\t%5.2f\t%6.2f\t",
-                                   csize, lsize, psize, asize, avg,
-                                   (double)zb->zb_lsize / zb->zb_psize,
-                                   100.0 * zb->zb_asize / tzb->zb_asize);
-
-                               if (level == ZB_TOTAL)
-                                       (void) printf("%s\n", typename);
-                               else
-                                       (void) printf("    L%d %s\n",
-                                           level, typename);
-
-                               if (dump_opt['b'] >= 3 && zb->zb_gangs > 0) {
-                                       (void) printf("\t number of ganged "
-                                           "blocks: %s\n", gang);
-                               }
-
-                               if (dump_opt['b'] >= 4) {
-                                       (void) printf("psize "
-                                           "(in 512-byte sectors): "
-                                           "number of blocks\n");
-                                       dump_histogram(zb->zb_psize_histogram,
-                                           PSIZE_HISTO_SIZE, 0);
-                               }
-                       }
-               }
-       }
-
-       (void) printf("\n");
-
-       if (leaks)
-               return (2);
-
-       if (zcb.zcb_haderrors)
-               return (3);
-
-       return (0);
-}
-
-typedef struct zdb_ddt_entry {
-       ddt_key_t       zdde_key;
-       uint64_t        zdde_ref_blocks;
-       uint64_t        zdde_ref_lsize;
-       uint64_t        zdde_ref_psize;
-       uint64_t        zdde_ref_dsize;
-       avl_node_t      zdde_node;
-} zdb_ddt_entry_t;
-
-/* ARGSUSED */
-static int
-zdb_ddt_add_cb(spa_t *spa, zilog_t *zilog, const blkptr_t *bp,
-    const zbookmark_phys_t *zb, const dnode_phys_t *dnp, void *arg)
-{
-       avl_tree_t *t = arg;
-       avl_index_t where;
-       zdb_ddt_entry_t *zdde, zdde_search;
-
-       if (BP_IS_HOLE(bp) || BP_IS_EMBEDDED(bp))
-               return (0);
-
-       if (dump_opt['S'] > 1 && zb->zb_level == ZB_ROOT_LEVEL) {
-               (void) printf("traversing objset %llu, %llu objects, "
-                   "%lu blocks so far\n",
-                   (u_longlong_t)zb->zb_objset,
-                   (u_longlong_t)BP_GET_FILL(bp),
-                   avl_numnodes(t));
-       }
-
-       if (BP_IS_HOLE(bp) || BP_GET_CHECKSUM(bp) == ZIO_CHECKSUM_OFF ||
-           BP_GET_LEVEL(bp) > 0 || DMU_OT_IS_METADATA(BP_GET_TYPE(bp)))
-               return (0);
-
-       ddt_key_fill(&zdde_search.zdde_key, bp);
-
-       zdde = avl_find(t, &zdde_search, &where);
-
-       if (zdde == NULL) {
-               zdde = umem_zalloc(sizeof (*zdde), UMEM_NOFAIL);
-               zdde->zdde_key = zdde_search.zdde_key;
-               avl_insert(t, zdde, where);
-       }
-
-       zdde->zdde_ref_blocks += 1;
-       zdde->zdde_ref_lsize += BP_GET_LSIZE(bp);
-       zdde->zdde_ref_psize += BP_GET_PSIZE(bp);
-       zdde->zdde_ref_dsize += bp_get_dsize_sync(spa, bp);
-
-       return (0);
-}
-
-static void
-dump_simulated_ddt(spa_t *spa)
-{
-       avl_tree_t t;
-       void *cookie = NULL;
-       zdb_ddt_entry_t *zdde;
-       ddt_histogram_t ddh_total;
-       ddt_stat_t dds_total;
-
-       bzero(&ddh_total, sizeof (ddt_histogram_t));
-       bzero(&dds_total, sizeof (ddt_stat_t));
-
-       avl_create(&t, ddt_entry_compare,
-           sizeof (zdb_ddt_entry_t), offsetof(zdb_ddt_entry_t, zdde_node));
-
-       spa_config_enter(spa, SCL_CONFIG, FTAG, RW_READER);
-
-       (void) traverse_pool(spa, 0, TRAVERSE_PRE | TRAVERSE_PREFETCH_METADATA,
-           zdb_ddt_add_cb, &t);
-
-       spa_config_exit(spa, SCL_CONFIG, FTAG);
-
-       while ((zdde = avl_destroy_nodes(&t, &cookie)) != NULL) {
-               ddt_stat_t dds;
-               uint64_t refcnt = zdde->zdde_ref_blocks;
-               ASSERT(refcnt != 0);
-
-               dds.dds_blocks = zdde->zdde_ref_blocks / refcnt;
-               dds.dds_lsize = zdde->zdde_ref_lsize / refcnt;
-               dds.dds_psize = zdde->zdde_ref_psize / refcnt;
-               dds.dds_dsize = zdde->zdde_ref_dsize / refcnt;
-
-               dds.dds_ref_blocks = zdde->zdde_ref_blocks;
-               dds.dds_ref_lsize = zdde->zdde_ref_lsize;
-               dds.dds_ref_psize = zdde->zdde_ref_psize;
-               dds.dds_ref_dsize = zdde->zdde_ref_dsize;
-
-               ddt_stat_add(&ddh_total.ddh_stat[highbit64(refcnt) - 1],
-                   &dds, 0);
-
-               umem_free(zdde, sizeof (*zdde));
-       }
-
-       avl_destroy(&t);
-
-       ddt_histogram_stat(&dds_total, &ddh_total);
-
-       (void) printf("Simulated DDT histogram:\n");
-
-       zpool_dump_ddt(&dds_total, &ddh_total);
-
-       dump_dedup_ratio(&dds_total);
-}
-
-static void
-dump_zpool(spa_t *spa)
-{
-       dsl_pool_t *dp = spa_get_dsl(spa);
-       int rc = 0;
-
-       if (dump_opt['S']) {
-               dump_simulated_ddt(spa);
-               return;
-       }
-
-       if (!dump_opt['e'] && dump_opt['C'] > 1) {
-               (void) printf("\nCached configuration:\n");
-               dump_nvlist(spa->spa_config, 8);
-       }
-
-       if (dump_opt['C'])
-               dump_config(spa);
-
-       if (dump_opt['u'])
-               dump_uberblock(&spa->spa_uberblock, "\nUberblock:\n", "\n");
-
-       if (dump_opt['D'])
-               dump_all_ddts(spa);
-
-       if (dump_opt['d'] > 2 || dump_opt['m'])
-               dump_metaslabs(spa);
-       if (dump_opt['M'])
-               dump_metaslab_groups(spa);
-
-       if (dump_opt['d'] || dump_opt['i']) {
-               uint64_t refcount;
-
-               dump_dir(dp->dp_meta_objset);
-               if (dump_opt['d'] >= 3) {
-                       dump_full_bpobj(&spa->spa_deferred_bpobj,
-                           "Deferred frees", 0);
-                       if (spa_version(spa) >= SPA_VERSION_DEADLISTS) {
-                               dump_full_bpobj(
-                                   &spa->spa_dsl_pool->dp_free_bpobj,
-                                   "Pool snapshot frees", 0);
-                       }
-
-                       if (spa_feature_is_active(spa,
-                           SPA_FEATURE_ASYNC_DESTROY)) {
-                               dump_bptree(spa->spa_meta_objset,
-                                   spa->spa_dsl_pool->dp_bptree_obj,
-                                   "Pool dataset frees");
-                       }
-                       dump_dtl(spa->spa_root_vdev, 0);
-               }
-               (void) dmu_objset_find(spa_name(spa), dump_one_dir,
-                   NULL, DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN);
-
-               if (feature_get_refcount(spa,
-                   &spa_feature_table[SPA_FEATURE_LARGE_BLOCKS],
-                   &refcount) != ENOTSUP) {
-                       if (num_large_blocks != refcount) {
-                               (void) printf("large_blocks feature refcount "
-                                   "mismatch: expected %lld != actual %lld\n",
-                                   (longlong_t)num_large_blocks,
-                                   (longlong_t)refcount);
-                               rc = 2;
-                       } else {
-                               (void) printf("Verified large_blocks feature "
-                                   "refcount is correct (%llu)\n",
-                                   (longlong_t)refcount);
-                       }
-               }
-       }
-       if (rc == 0 && (dump_opt['b'] || dump_opt['c']))
-               rc = dump_block_stats(spa);
-
-       if (rc == 0)
-               rc = verify_spacemap_refcounts(spa);
-
-       if (dump_opt['s'])
-               show_pool_stats(spa);
-
-       if (dump_opt['h'])
-               dump_history(spa);
-
-       if (rc != 0)
-               exit(rc);
-}
-
-#define        ZDB_FLAG_CHECKSUM       0x0001
-#define        ZDB_FLAG_DECOMPRESS     0x0002
-#define        ZDB_FLAG_BSWAP          0x0004
-#define        ZDB_FLAG_GBH            0x0008
-#define        ZDB_FLAG_INDIRECT       0x0010
-#define        ZDB_FLAG_PHYS           0x0020
-#define        ZDB_FLAG_RAW            0x0040
-#define        ZDB_FLAG_PRINT_BLKPTR   0x0080
-
-int flagbits[256];
-
-static void
-zdb_print_blkptr(blkptr_t *bp, int flags)
-{
-       char blkbuf[BP_SPRINTF_LEN];
-
-       if (flags & ZDB_FLAG_BSWAP)
-               byteswap_uint64_array((void *)bp, sizeof (blkptr_t));
-
-       snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
-       (void) printf("%s\n", blkbuf);
-}
-
-static void
-zdb_dump_indirect(blkptr_t *bp, int nbps, int flags)
-{
-       int i;
-
-       for (i = 0; i < nbps; i++)
-               zdb_print_blkptr(&bp[i], flags);
-}
-
-static void
-zdb_dump_gbh(void *buf, int flags)
-{
-       zdb_dump_indirect((blkptr_t *)buf, SPA_GBH_NBLKPTRS, flags);
-}
-
-static void
-zdb_dump_block_raw(void *buf, uint64_t size, int flags)
-{
-       if (flags & ZDB_FLAG_BSWAP)
-               byteswap_uint64_array(buf, size);
-       VERIFY(write(fileno(stdout), buf, size) == size);
-}
-
-static void
-zdb_dump_block(char *label, void *buf, uint64_t size, int flags)
-{
-       uint64_t *d = (uint64_t *)buf;
-       int nwords = size / sizeof (uint64_t);
-       int do_bswap = !!(flags & ZDB_FLAG_BSWAP);
-       int i, j;
-       char *hdr, *c;
-
-
-       if (do_bswap)
-               hdr = " 7 6 5 4 3 2 1 0   f e d c b a 9 8";
-       else
-               hdr = " 0 1 2 3 4 5 6 7   8 9 a b c d e f";
-
-       (void) printf("\n%s\n%6s   %s  0123456789abcdef\n", label, "", hdr);
-
-       for (i = 0; i < nwords; i += 2) {
-               (void) printf("%06llx:  %016llx  %016llx  ",
-                   (u_longlong_t)(i * sizeof (uint64_t)),
-                   (u_longlong_t)(do_bswap ? BSWAP_64(d[i]) : d[i]),
-                   (u_longlong_t)(do_bswap ? BSWAP_64(d[i + 1]) : d[i + 1]));
-
-               c = (char *)&d[i];
-               for (j = 0; j < 2 * sizeof (uint64_t); j++)
-                       (void) printf("%c", isprint(c[j]) ? c[j] : '.');
-               (void) printf("\n");
-       }
-}
-
-/*
- * There are two acceptable formats:
- *     leaf_name         - For example: c1t0d0 or /tmp/ztest.0a
- *     child[.child]*    - For example: 0.1.1
- *
- * The second form can be used to specify arbitrary vdevs anywhere
- * in the heirarchy.  For example, in a pool with a mirror of
- * RAID-Zs, you can specify either RAID-Z vdev with 0.0 or 0.1 .
- */
-static vdev_t *
-zdb_vdev_lookup(vdev_t *vdev, char *path)
-{
-       char *s, *p, *q;
-       int i;
-
-       if (vdev == NULL)
-               return (NULL);
-
-       /* First, assume the x.x.x.x format */
-       i = (int)strtoul(path, &s, 10);
-       if (s == path || (s && *s != '.' && *s != '\0'))
-               goto name;
-       if (i < 0 || i >= vdev->vdev_children)
-               return (NULL);
-
-       vdev = vdev->vdev_child[i];
-       if (*s == '\0')
-               return (vdev);
-       return (zdb_vdev_lookup(vdev, s+1));
-
-name:
-       for (i = 0; i < vdev->vdev_children; i++) {
-               vdev_t *vc = vdev->vdev_child[i];
-
-               if (vc->vdev_path == NULL) {
-                       vc = zdb_vdev_lookup(vc, path);
-                       if (vc == NULL)
-                               continue;
-                       else
-                               return (vc);
-               }
-
-               p = strrchr(vc->vdev_path, '/');
-               p = p ? p + 1 : vc->vdev_path;
-               q = &vc->vdev_path[strlen(vc->vdev_path) - 2];
-
-               if (strcmp(vc->vdev_path, path) == 0)
-                       return (vc);
-               if (strcmp(p, path) == 0)
-                       return (vc);
-               if (strcmp(q, "s0") == 0 && strncmp(p, path, q - p) == 0)
-                       return (vc);
-       }
-
-       return (NULL);
-}
-
-/*
- * Read a block from a pool and print it out.  The syntax of the
- * block descriptor is:
- *
- *     pool:vdev_specifier:offset:size[:flags]
- *
- *     pool           - The name of the pool you wish to read from
- *     vdev_specifier - Which vdev (see comment for zdb_vdev_lookup)
- *     offset         - offset, in hex, in bytes
- *     size           - Amount of data to read, in hex, in bytes
- *     flags          - A string of characters specifying options
- *              b: Decode a blkptr at given offset within block
- *             *c: Calculate and display checksums
- *              d: Decompress data before dumping
- *              e: Byteswap data before dumping
- *              g: Display data as a gang block header
- *              i: Display as an indirect block
- *              p: Do I/O to physical offset
- *              r: Dump raw data to stdout
- *
- *              * = not yet implemented
- */
-static void
-zdb_read_block(char *thing, spa_t *spa)
-{
-       blkptr_t blk, *bp = &blk;
-       dva_t *dva = bp->blk_dva;
-       int flags = 0;
-       uint64_t offset = 0, size = 0, psize = 0, lsize = 0, blkptr_offset = 0;
-       zio_t *zio;
-       vdev_t *vd;
-       void *pbuf, *lbuf, *buf;
-       char *s, *p, *dup, *vdev, *flagstr;
-       int i, error;
-
-       dup = strdup(thing);
-       s = strtok(dup, ":");
-       vdev = s ? s : "";
-       s = strtok(NULL, ":");
-       offset = strtoull(s ? s : "", NULL, 16);
-       s = strtok(NULL, ":");
-       size = strtoull(s ? s : "", NULL, 16);
-       s = strtok(NULL, ":");
-       flagstr = s ? s : "";
-
-       s = NULL;
-       if (size == 0)
-               s = "size must not be zero";
-       if (!IS_P2ALIGNED(size, DEV_BSIZE))
-               s = "size must be a multiple of sector size";
-       if (!IS_P2ALIGNED(offset, DEV_BSIZE))
-               s = "offset must be a multiple of sector size";
-       if (s) {
-               (void) printf("Invalid block specifier: %s  - %s\n", thing, s);
-               free(dup);
-               return;
-       }
-
-       for (s = strtok(flagstr, ":"); s; s = strtok(NULL, ":")) {
-               for (i = 0; flagstr[i]; i++) {
-                       int bit = flagbits[(uchar_t)flagstr[i]];
-
-                       if (bit == 0) {
-                               (void) printf("***Invalid flag: %c\n",
-                                   flagstr[i]);
-                               continue;
-                       }
-                       flags |= bit;
-
-                       /* If it's not something with an argument, keep going */
-                       if ((bit & (ZDB_FLAG_CHECKSUM |
-                           ZDB_FLAG_PRINT_BLKPTR)) == 0)
-                               continue;
-
-                       p = &flagstr[i + 1];
-                       if (bit == ZDB_FLAG_PRINT_BLKPTR)
-                               blkptr_offset = strtoull(p, &p, 16);
-                       if (*p != ':' && *p != '\0') {
-                               (void) printf("***Invalid flag arg: '%s'\n", s);
-                               free(dup);
-                               return;
-                       }
-               }
-       }
-
-       vd = zdb_vdev_lookup(spa->spa_root_vdev, vdev);
-       if (vd == NULL) {
-               (void) printf("***Invalid vdev: %s\n", vdev);
-               free(dup);
-               return;
-       } else {
-               if (vd->vdev_path)
-                       (void) fprintf(stderr, "Found vdev: %s\n",
-                           vd->vdev_path);
-               else
-                       (void) fprintf(stderr, "Found vdev type: %s\n",
-                           vd->vdev_ops->vdev_op_type);
-       }
-
-       psize = size;
-       lsize = size;
-
-       pbuf = umem_alloc_aligned(SPA_MAXBLOCKSIZE, 512, UMEM_NOFAIL);
-       lbuf = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
-
-       BP_ZERO(bp);
-
-       DVA_SET_VDEV(&dva[0], vd->vdev_id);
-       DVA_SET_OFFSET(&dva[0], offset);
-       DVA_SET_GANG(&dva[0], !!(flags & ZDB_FLAG_GBH));
-       DVA_SET_ASIZE(&dva[0], vdev_psize_to_asize(vd, psize));
-
-       BP_SET_BIRTH(bp, TXG_INITIAL, TXG_INITIAL);
-
-       BP_SET_LSIZE(bp, lsize);
-       BP_SET_PSIZE(bp, psize);
-       BP_SET_COMPRESS(bp, ZIO_COMPRESS_OFF);
-       BP_SET_CHECKSUM(bp, ZIO_CHECKSUM_OFF);
-       BP_SET_TYPE(bp, DMU_OT_NONE);
-       BP_SET_LEVEL(bp, 0);
-       BP_SET_DEDUP(bp, 0);
-       BP_SET_BYTEORDER(bp, ZFS_HOST_BYTEORDER);
-
-       spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
-       zio = zio_root(spa, NULL, NULL, 0);
-
-       if (vd == vd->vdev_top) {
-               /*
-                * Treat this as a normal block read.
-                */
-               zio_nowait(zio_read(zio, spa, bp, pbuf, psize, NULL, NULL,
-                   ZIO_PRIORITY_SYNC_READ,
-                   ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW, NULL));
-       } else {
-               /*
-                * Treat this as a vdev child I/O.
-                */
-               zio_nowait(zio_vdev_child_io(zio, bp, vd, offset, pbuf, psize,
-                   ZIO_TYPE_READ, ZIO_PRIORITY_SYNC_READ,
-                   ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE |
-                   ZIO_FLAG_DONT_PROPAGATE | ZIO_FLAG_DONT_RETRY |
-                   ZIO_FLAG_CANFAIL | ZIO_FLAG_RAW, NULL, NULL));
-       }
-
-       error = zio_wait(zio);
-       spa_config_exit(spa, SCL_STATE, FTAG);
-
-       if (error) {
-               (void) printf("Read of %s failed, error: %d\n", thing, error);
-               goto out;
-       }
-
-       if (flags & ZDB_FLAG_DECOMPRESS) {
-               /*
-                * We don't know how the data was compressed, so just try
-                * every decompress function at every inflated blocksize.
-                */
-               enum zio_compress c;
-               void *pbuf2 = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
-               void *lbuf2 = umem_alloc(SPA_MAXBLOCKSIZE, UMEM_NOFAIL);
-
-               bcopy(pbuf, pbuf2, psize);
-
-               VERIFY(random_get_pseudo_bytes((uint8_t *)pbuf + psize,
-                   SPA_MAXBLOCKSIZE - psize) == 0);
-
-               VERIFY(random_get_pseudo_bytes((uint8_t *)pbuf2 + psize,
-                   SPA_MAXBLOCKSIZE - psize) == 0);
-
-               for (lsize = SPA_MAXBLOCKSIZE; lsize > psize;
-                   lsize -= SPA_MINBLOCKSIZE) {
-                       for (c = 0; c < ZIO_COMPRESS_FUNCTIONS; c++) {
-                               if (zio_decompress_data(c, pbuf, lbuf,
-                                   psize, lsize) == 0 &&
-                                   zio_decompress_data(c, pbuf2, lbuf2,
-                                   psize, lsize) == 0 &&
-                                   bcmp(lbuf, lbuf2, lsize) == 0)
-                                       break;
-                       }
-                       if (c != ZIO_COMPRESS_FUNCTIONS)
-                               break;
-                       lsize -= SPA_MINBLOCKSIZE;
-               }
-
-               umem_free(pbuf2, SPA_MAXBLOCKSIZE);
-               umem_free(lbuf2, SPA_MAXBLOCKSIZE);
-
-               if (lsize <= psize) {
-                       (void) printf("Decompress of %s failed\n", thing);
-                       goto out;
-               }
-               buf = lbuf;
-               size = lsize;
-       } else {
-               buf = pbuf;
-               size = psize;
-       }
-
-       if (flags & ZDB_FLAG_PRINT_BLKPTR)
-               zdb_print_blkptr((blkptr_t *)(void *)
-                   ((uintptr_t)buf + (uintptr_t)blkptr_offset), flags);
-       else if (flags & ZDB_FLAG_RAW)
-               zdb_dump_block_raw(buf, size, flags);
-       else if (flags & ZDB_FLAG_INDIRECT)
-               zdb_dump_indirect((blkptr_t *)buf, size / sizeof (blkptr_t),
-                   flags);
-       else if (flags & ZDB_FLAG_GBH)
-               zdb_dump_gbh(buf, flags);
-       else
-               zdb_dump_block(thing, buf, size, flags);
-
-out:
-       umem_free(pbuf, SPA_MAXBLOCKSIZE);
-       umem_free(lbuf, SPA_MAXBLOCKSIZE);
-       free(dup);
-}
-
-static boolean_t
-pool_match(nvlist_t *cfg, char *tgt)
-{
-       uint64_t v, guid = strtoull(tgt, NULL, 0);
-       char *s;
-
-       if (guid != 0) {
-               if (nvlist_lookup_uint64(cfg, ZPOOL_CONFIG_POOL_GUID, &v) == 0)
-                       return (v == guid);
-       } else {
-               if (nvlist_lookup_string(cfg, ZPOOL_CONFIG_POOL_NAME, &s) == 0)
-                       return (strcmp(s, tgt) == 0);
-       }
-       return (B_FALSE);
-}
-
-static char *
-find_zpool(char **target, nvlist_t **configp, int dirc, char **dirv)
-{
-       nvlist_t *pools;
-       nvlist_t *match = NULL;
-       char *name = NULL;
-       char *sepp = NULL;
-       char sep = 0;
-       int count = 0;
-       importargs_t args = { 0 };
-
-       args.paths = dirc;
-       args.path = dirv;
-       args.can_be_active = B_TRUE;
-
-       if ((sepp = strpbrk(*target, "/@")) != NULL) {
-               sep = *sepp;
-               *sepp = '\0';
-       }
-
-       pools = zpool_search_import(g_zfs, &args);
-
-       if (pools != NULL) {
-               nvpair_t *elem = NULL;
-               while ((elem = nvlist_next_nvpair(pools, elem)) != NULL) {
-                       verify(nvpair_value_nvlist(elem, configp) == 0);
-                       if (pool_match(*configp, *target)) {
-                               count++;
-                               if (match != NULL) {
-                                       /* print previously found config */
-                                       if (name != NULL) {
-                                               (void) printf("%s\n", name);
-                                               dump_nvlist(match, 8);
-                                               name = NULL;
-                                       }
-                                       (void) printf("%s\n",
-                                           nvpair_name(elem));
-                                       dump_nvlist(*configp, 8);
-                               } else {
-                                       match = *configp;
-                                       name = nvpair_name(elem);
-                               }
-                       }
-               }
-       }
-       if (count > 1)
-               (void) fatal("\tMatched %d pools - use pool GUID "
-                   "instead of pool name or \n"
-                   "\tpool name part of a dataset name to select pool", count);
-
-       if (sepp)
-               *sepp = sep;
-       /*
-        * If pool GUID was specified for pool id, replace it with pool name
-        */
-       if (name && (strstr(*target, name) != *target)) {
-               int sz = 1 + strlen(name) + ((sepp) ? strlen(sepp) : 0);
-
-               *target = umem_alloc(sz, UMEM_NOFAIL);
-               (void) snprintf(*target, sz, "%s%s", name, sepp ? sepp : "");
-       }
-
-       *configp = name ? match : NULL;
-
-       return (name);
-}
-
-int
-main(int argc, char **argv)
-{
-       int i, c;
-       struct rlimit rl = { 1024, 1024 };
-       spa_t *spa = NULL;
-       objset_t *os = NULL;
-       int dump_all = 1;
-       int verbose = 0;
-       int error = 0;
-       char **searchdirs = NULL;
-       int nsearch = 0;
-       char *target;
-       nvlist_t *policy = NULL;
-       uint64_t max_txg = UINT64_MAX;
-       int flags = ZFS_IMPORT_MISSING_LOG;
-       int rewind = ZPOOL_NEVER_REWIND;
-       char *spa_config_path_env;
-       const char *opts = "bcdhilmMI:suCDRSAFLXevp:t:U:P";
-       boolean_t target_is_spa = B_TRUE;
-
-       (void) setrlimit(RLIMIT_NOFILE, &rl);
-       (void) enable_extended_FILE_stdio(-1, -1);
-
-       dprintf_setup(&argc, argv);
-
-       /*
-        * If there is an environment variable SPA_CONFIG_PATH it overrides
-        * default spa_config_path setting. If -U flag is specified it will
-        * override this environment variable settings once again.
-        */
-       spa_config_path_env = getenv("SPA_CONFIG_PATH");
-       if (spa_config_path_env != NULL)
-               spa_config_path = spa_config_path_env;
-
-       while ((c = getopt(argc, argv, opts)) != -1) {
-               switch (c) {
-               case 'b':
-               case 'c':
-               case 'd':
-               case 'h':
-               case 'i':
-               case 'l':
-               case 'm':
-               case 's':
-               case 'u':
-               case 'C':
-               case 'D':
-               case 'M':
-               case 'R':
-               case 'S':
-                       dump_opt[c]++;
-                       dump_all = 0;
-                       break;
-               case 'A':
-               case 'F':
-               case 'L':
-               case 'X':
-               case 'e':
-               case 'P':
-                       dump_opt[c]++;
-                       break;
-               case 'V':
-                       flags = ZFS_IMPORT_VERBATIM;
-                       break;
-               case 'I':
-                       max_inflight = strtoull(optarg, NULL, 0);
-                       if (max_inflight == 0) {
-                               (void) fprintf(stderr, "maximum number "
-                                   "of inflight I/Os must be greater "
-                                   "than 0\n");
-                               usage();
-                       }
-                       break;
-               case 'p':
-                       if (searchdirs == NULL) {
-                               searchdirs = umem_alloc(sizeof (char *),
-                                   UMEM_NOFAIL);
-                       } else {
-                               char **tmp = umem_alloc((nsearch + 1) *
-                                   sizeof (char *), UMEM_NOFAIL);
-                               bcopy(searchdirs, tmp, nsearch *
-                                   sizeof (char *));
-                               umem_free(searchdirs,
-                                   nsearch * sizeof (char *));
-                               searchdirs = tmp;
-                       }
-                       searchdirs[nsearch++] = optarg;
-                       break;
-               case 't':
-                       max_txg = strtoull(optarg, NULL, 0);
-                       if (max_txg < TXG_INITIAL) {
-                               (void) fprintf(stderr, "incorrect txg "
-                                   "specified: %s\n", optarg);
-                               usage();
-                       }
-                       break;
-               case 'U':
-                       spa_config_path = optarg;
-                       break;
-               case 'v':
-                       verbose++;
-                       break;
-               default:
-                       usage();
-                       break;
-               }
-       }
-
-       if (!dump_opt['e'] && searchdirs != NULL) {
-               (void) fprintf(stderr, "-p option requires use of -e\n");
-               usage();
-       }
-
-#if defined(_LP64)
-       /*
-        * ZDB does not typically re-read blocks; therefore limit the ARC
-        * to 256 MB, which can be used entirely for metadata.
-        */
-       zfs_arc_max = zfs_arc_meta_limit = 256 * 1024 * 1024;
-#endif
-
-       /*
-        * "zdb -c" uses checksum-verifying scrub i/os which are async reads.
-        * "zdb -b" uses traversal prefetch which uses async reads.
-        * For good performance, let several of them be active at once.
-        */
-       zfs_vdev_async_read_max_active = 10;
-
-       kernel_init(FREAD);
-       if ((g_zfs = libzfs_init()) == NULL) {
-               (void) fprintf(stderr, "%s", libzfs_error_init(errno));
-               return (1);
-       }
-
-       if (dump_all)
-               verbose = MAX(verbose, 1);
-
-       for (c = 0; c < 256; c++) {
-               if (dump_all && !strchr("elAFLRSXP", c))
-                       dump_opt[c] = 1;
-               if (dump_opt[c])
-                       dump_opt[c] += verbose;
-       }
-
-       aok = (dump_opt['A'] == 1) || (dump_opt['A'] > 2);
-       zfs_recover = (dump_opt['A'] > 1);
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 2 && dump_opt['R'])
-               usage();
-       if (argc < 1) {
-               if (!dump_opt['e'] && dump_opt['C']) {
-                       dump_cachefile(spa_config_path);
-                       return (0);
-               }
-               usage();
-       }
-
-       if (dump_opt['l']) {
-               dump_label(argv[0]);
-               return (0);
-       }
-
-       if (dump_opt['X'] || dump_opt['F'])
-               rewind = ZPOOL_DO_REWIND |
-                   (dump_opt['X'] ? ZPOOL_EXTREME_REWIND : 0);
-
-       if (nvlist_alloc(&policy, NV_UNIQUE_NAME_TYPE, 0) != 0 ||
-           nvlist_add_uint64(policy, ZPOOL_REWIND_REQUEST_TXG, max_txg) != 0 ||
-           nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind) != 0)
-               fatal("internal error: %s", strerror(ENOMEM));
-
-       error = 0;
-       target = argv[0];
-
-       if (dump_opt['e']) {
-               nvlist_t *cfg = NULL;
-               char *name = find_zpool(&target, &cfg, nsearch, searchdirs);
-
-               error = ENOENT;
-               if (name) {
-                       if (dump_opt['C'] > 1) {
-                               (void) printf("\nConfiguration for import:\n");
-                               dump_nvlist(cfg, 8);
-                       }
-                       if (nvlist_add_nvlist(cfg,
-                           ZPOOL_REWIND_POLICY, policy) != 0) {
-                               fatal("can't open '%s': %s",
-                                   target, strerror(ENOMEM));
-                       }
-                       error = spa_import(name, cfg, NULL, flags);
-               }
-       }
-
-       if (strpbrk(target, "/@") != NULL) {
-               size_t targetlen;
-
-               target_is_spa = B_FALSE;
-               targetlen = strlen(target);
-               if (targetlen && target[targetlen - 1] == '/')
-                       target[targetlen - 1] = '\0';
-       }
-
-       if (error == 0) {
-               if (target_is_spa || dump_opt['R']) {
-                       error = spa_open_rewind(target, &spa, FTAG, policy,
-                           NULL);
-                       if (error) {
-                               /*
-                                * If we're missing the log device then
-                                * try opening the pool after clearing the
-                                * log state.
-                                */
-                               mutex_enter(&spa_namespace_lock);
-                               if ((spa = spa_lookup(target)) != NULL &&
-                                   spa->spa_log_state == SPA_LOG_MISSING) {
-                                       spa->spa_log_state = SPA_LOG_CLEAR;
-                                       error = 0;
-                               }
-                               mutex_exit(&spa_namespace_lock);
-
-                               if (!error) {
-                                       error = spa_open_rewind(target, &spa,
-                                           FTAG, policy, NULL);
-                               }
-                       }
-               } else {
-                       error = dmu_objset_own(target, DMU_OST_ANY,
-                           B_TRUE, FTAG, &os);
-               }
-       }
-       nvlist_free(policy);
-
-       if (error)
-               fatal("can't open '%s': %s", target, strerror(error));
-
-       argv++;
-       argc--;
-       if (!dump_opt['R']) {
-               if (argc > 0) {
-                       zopt_objects = argc;
-                       zopt_object = calloc(zopt_objects, sizeof (uint64_t));
-                       for (i = 0; i < zopt_objects; i++) {
-                               errno = 0;
-                               zopt_object[i] = strtoull(argv[i], NULL, 0);
-                               if (zopt_object[i] == 0 && errno != 0)
-                                       fatal("bad number %s: %s",
-                                           argv[i], strerror(errno));
-                       }
-               }
-               if (os != NULL) {
-                       dump_dir(os);
-               } else if (zopt_objects > 0 && !dump_opt['m']) {
-                       dump_dir(spa->spa_meta_objset);
-               } else {
-                       dump_zpool(spa);
-               }
-       } else {
-               flagbits['b'] = ZDB_FLAG_PRINT_BLKPTR;
-               flagbits['c'] = ZDB_FLAG_CHECKSUM;
-               flagbits['d'] = ZDB_FLAG_DECOMPRESS;
-               flagbits['e'] = ZDB_FLAG_BSWAP;
-               flagbits['g'] = ZDB_FLAG_GBH;
-               flagbits['i'] = ZDB_FLAG_INDIRECT;
-               flagbits['p'] = ZDB_FLAG_PHYS;
-               flagbits['r'] = ZDB_FLAG_RAW;
-
-               for (i = 0; i < argc; i++)
-                       zdb_read_block(argv[i], spa);
-       }
-
-       (os != NULL) ? dmu_objset_disown(os, FTAG) : spa_close(spa, FTAG);
-
-       fuid_table_destroy();
-       sa_loaded = B_FALSE;
-
-       libzfs_fini(g_zfs);
-       kernel_fini();
-
-       return (0);
-}
diff --git a/zfs/cmd/zdb/zdb_il.c b/zfs/cmd/zdb/zdb_il.c
deleted file mode 100644 (file)
index 93b9057..0000000
+++ /dev/null
@@ -1,394 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Copyright (c) 2012 Cyril Plisko. All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Copyright (c) 2013, 2014 by Delphix. All rights reserved.
- */
-
-/*
- * Print intent log header and statistics.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/zfs_context.h>
-#include <sys/spa.h>
-#include <sys/dmu.h>
-#include <sys/stat.h>
-#include <sys/resource.h>
-#include <sys/zil.h>
-#include <sys/zil_impl.h>
-
-extern uint8_t dump_opt[256];
-
-static char prefix[4] = "\t\t\t";
-
-static void
-print_log_bp(const blkptr_t *bp, const char *prefix)
-{
-       char blkbuf[BP_SPRINTF_LEN];
-
-       snprintf_blkptr(blkbuf, sizeof (blkbuf), bp);
-       (void) printf("%s%s\n", prefix, blkbuf);
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_create(zilog_t *zilog, int txtype, lr_create_t *lr)
-{
-       time_t crtime = lr->lr_crtime[0];
-       char *name, *link;
-       lr_attr_t *lrattr;
-
-       name = (char *)(lr + 1);
-
-       if (lr->lr_common.lrc_txtype == TX_CREATE_ATTR ||
-           lr->lr_common.lrc_txtype == TX_MKDIR_ATTR) {
-               lrattr = (lr_attr_t *)(lr + 1);
-               name += ZIL_XVAT_SIZE(lrattr->lr_attr_masksize);
-       }
-
-       if (txtype == TX_SYMLINK) {
-               link = name + strlen(name) + 1;
-               (void) printf("%s%s -> %s\n", prefix, name, link);
-       } else if (txtype != TX_MKXATTR) {
-               (void) printf("%s%s\n", prefix, name);
-       }
-
-       (void) printf("%s%s", prefix, ctime(&crtime));
-       (void) printf("%sdoid %llu, foid %llu, mode %llo\n", prefix,
-           (u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_foid,
-           (longlong_t)lr->lr_mode);
-       (void) printf("%suid %llu, gid %llu, gen %llu, rdev 0x%llx\n", prefix,
-           (u_longlong_t)lr->lr_uid, (u_longlong_t)lr->lr_gid,
-           (u_longlong_t)lr->lr_gen, (u_longlong_t)lr->lr_rdev);
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_remove(zilog_t *zilog, int txtype, lr_remove_t *lr)
-{
-       (void) printf("%sdoid %llu, name %s\n", prefix,
-           (u_longlong_t)lr->lr_doid, (char *)(lr + 1));
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_link(zilog_t *zilog, int txtype, lr_link_t *lr)
-{
-       (void) printf("%sdoid %llu, link_obj %llu, name %s\n", prefix,
-           (u_longlong_t)lr->lr_doid, (u_longlong_t)lr->lr_link_obj,
-           (char *)(lr + 1));
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_rename(zilog_t *zilog, int txtype, lr_rename_t *lr)
-{
-       char *snm = (char *)(lr + 1);
-       char *tnm = snm + strlen(snm) + 1;
-
-       (void) printf("%ssdoid %llu, tdoid %llu\n", prefix,
-           (u_longlong_t)lr->lr_sdoid, (u_longlong_t)lr->lr_tdoid);
-       (void) printf("%ssrc %s tgt %s\n", prefix, snm, tnm);
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_write(zilog_t *zilog, int txtype, lr_write_t *lr)
-{
-       char *data, *dlimit;
-       blkptr_t *bp = &lr->lr_blkptr;
-       zbookmark_phys_t zb;
-       char *buf;
-       int verbose = MAX(dump_opt['d'], dump_opt['i']);
-       int error;
-
-       (void) printf("%sfoid %llu, offset %llx, length %llx\n", prefix,
-           (u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_offset,
-           (u_longlong_t)lr->lr_length);
-
-       if (txtype == TX_WRITE2 || verbose < 5)
-               return;
-
-       if ((buf = malloc(SPA_MAXBLOCKSIZE)) == NULL)
-               return;
-
-       if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
-               (void) printf("%shas blkptr, %s\n", prefix,
-                   !BP_IS_HOLE(bp) &&
-                   bp->blk_birth >= spa_first_txg(zilog->zl_spa) ?
-                   "will claim" : "won't claim");
-               print_log_bp(bp, prefix);
-
-               if (BP_IS_HOLE(bp)) {
-                       (void) printf("\t\t\tLSIZE 0x%llx\n",
-                           (u_longlong_t)BP_GET_LSIZE(bp));
-                       bzero(buf, SPA_MAXBLOCKSIZE);
-                       (void) printf("%s<hole>\n", prefix);
-                       goto exit;
-               }
-               if (bp->blk_birth < zilog->zl_header->zh_claim_txg) {
-                       (void) printf("%s<block already committed>\n", prefix);
-                       goto exit;
-               }
-
-               SET_BOOKMARK(&zb, dmu_objset_id(zilog->zl_os),
-                   lr->lr_foid, ZB_ZIL_LEVEL,
-                   lr->lr_offset / BP_GET_LSIZE(bp));
-
-               error = zio_wait(zio_read(NULL, zilog->zl_spa,
-                   bp, buf, BP_GET_LSIZE(bp), NULL, NULL,
-                   ZIO_PRIORITY_SYNC_READ, ZIO_FLAG_CANFAIL, &zb));
-               if (error)
-                       goto exit;
-               data = buf;
-       } else {
-               data = (char *)(lr + 1);
-       }
-
-       dlimit = data + MIN(lr->lr_length,
-           (verbose < 6 ? 20 : SPA_MAXBLOCKSIZE));
-
-       (void) printf("%s", prefix);
-       while (data < dlimit) {
-               if (isprint(*data))
-                       (void) printf("%c ", *data);
-               else
-                       (void) printf("%2hhX", *data);
-               data++;
-       }
-       (void) printf("\n");
-exit:
-       free(buf);
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_truncate(zilog_t *zilog, int txtype, lr_truncate_t *lr)
-{
-       (void) printf("%sfoid %llu, offset 0x%llx, length 0x%llx\n", prefix,
-           (u_longlong_t)lr->lr_foid, (longlong_t)lr->lr_offset,
-           (u_longlong_t)lr->lr_length);
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_setattr(zilog_t *zilog, int txtype, lr_setattr_t *lr)
-{
-       time_t atime = (time_t)lr->lr_atime[0];
-       time_t mtime = (time_t)lr->lr_mtime[0];
-
-       (void) printf("%sfoid %llu, mask 0x%llx\n", prefix,
-           (u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_mask);
-
-       if (lr->lr_mask & AT_MODE) {
-               (void) printf("%sAT_MODE  %llo\n", prefix,
-                   (longlong_t)lr->lr_mode);
-       }
-
-       if (lr->lr_mask & AT_UID) {
-               (void) printf("%sAT_UID   %llu\n", prefix,
-                   (u_longlong_t)lr->lr_uid);
-       }
-
-       if (lr->lr_mask & AT_GID) {
-               (void) printf("%sAT_GID   %llu\n", prefix,
-                   (u_longlong_t)lr->lr_gid);
-       }
-
-       if (lr->lr_mask & AT_SIZE) {
-               (void) printf("%sAT_SIZE  %llu\n", prefix,
-                   (u_longlong_t)lr->lr_size);
-       }
-
-       if (lr->lr_mask & AT_ATIME) {
-               (void) printf("%sAT_ATIME %llu.%09llu %s", prefix,
-                   (u_longlong_t)lr->lr_atime[0],
-                   (u_longlong_t)lr->lr_atime[1],
-                   ctime(&atime));
-       }
-
-       if (lr->lr_mask & AT_MTIME) {
-               (void) printf("%sAT_MTIME %llu.%09llu %s", prefix,
-                   (u_longlong_t)lr->lr_mtime[0],
-                   (u_longlong_t)lr->lr_mtime[1],
-                   ctime(&mtime));
-       }
-}
-
-/* ARGSUSED */
-static void
-zil_prt_rec_acl(zilog_t *zilog, int txtype, lr_acl_t *lr)
-{
-       (void) printf("%sfoid %llu, aclcnt %llu\n", prefix,
-           (u_longlong_t)lr->lr_foid, (u_longlong_t)lr->lr_aclcnt);
-}
-
-typedef void (*zil_prt_rec_func_t)(zilog_t *, int, void *);
-typedef struct zil_rec_info {
-       zil_prt_rec_func_t      zri_print;
-       char                    *zri_name;
-       uint64_t                zri_count;
-} zil_rec_info_t;
-
-static zil_rec_info_t zil_rec_info[TX_MAX_TYPE] = {
-       { NULL,                 "Total              " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_CREATE          " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_MKDIR           " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_MKXATTR         " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_SYMLINK         " },
-       { (zil_prt_rec_func_t)zil_prt_rec_remove,       "TX_REMOVE          " },
-       { (zil_prt_rec_func_t)zil_prt_rec_remove,       "TX_RMDIR           " },
-       { (zil_prt_rec_func_t)zil_prt_rec_link,         "TX_LINK            " },
-       { (zil_prt_rec_func_t)zil_prt_rec_rename,       "TX_RENAME          " },
-       { (zil_prt_rec_func_t)zil_prt_rec_write,        "TX_WRITE           " },
-       { (zil_prt_rec_func_t)zil_prt_rec_truncate,     "TX_TRUNCATE        " },
-       { (zil_prt_rec_func_t)zil_prt_rec_setattr,      "TX_SETATTR         " },
-       { (zil_prt_rec_func_t)zil_prt_rec_acl,          "TX_ACL_V0          " },
-       { (zil_prt_rec_func_t)zil_prt_rec_acl,          "TX_ACL_ACL         " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_CREATE_ACL      " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_CREATE_ATTR     " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_CREATE_ACL_ATTR " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_MKDIR_ACL       " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_MKDIR_ATTR      " },
-       { (zil_prt_rec_func_t)zil_prt_rec_create,       "TX_MKDIR_ACL_ATTR  " },
-       { (zil_prt_rec_func_t)zil_prt_rec_write,        "TX_WRITE2          " },
-};
-
-/* ARGSUSED */
-static int
-print_log_record(zilog_t *zilog, lr_t *lr, void *arg, uint64_t claim_txg)
-{
-       int txtype;
-       int verbose = MAX(dump_opt['d'], dump_opt['i']);
-
-       /* reduce size of txtype to strip off TX_CI bit */
-       txtype = lr->lrc_txtype;
-
-       ASSERT(txtype != 0 && (uint_t)txtype < TX_MAX_TYPE);
-       ASSERT(lr->lrc_txg);
-
-       (void) printf("\t\t%s%s len %6llu, txg %llu, seq %llu\n",
-           (lr->lrc_txtype & TX_CI) ? "CI-" : "",
-           zil_rec_info[txtype].zri_name,
-           (u_longlong_t)lr->lrc_reclen,
-           (u_longlong_t)lr->lrc_txg,
-           (u_longlong_t)lr->lrc_seq);
-
-       if (txtype && verbose >= 3)
-               zil_rec_info[txtype].zri_print(zilog, txtype, lr);
-
-       zil_rec_info[txtype].zri_count++;
-       zil_rec_info[0].zri_count++;
-
-       return (0);
-}
-
-/* ARGSUSED */
-static int
-print_log_block(zilog_t *zilog, blkptr_t *bp, void *arg, uint64_t claim_txg)
-{
-       char blkbuf[BP_SPRINTF_LEN + 10];
-       int verbose = MAX(dump_opt['d'], dump_opt['i']);
-       char *claim;
-
-       if (verbose <= 3)
-               return (0);
-
-       if (verbose >= 5) {
-               (void) strcpy(blkbuf, ", ");
-               snprintf_blkptr(blkbuf + strlen(blkbuf),
-                   sizeof (blkbuf) - strlen(blkbuf), bp);
-       } else {
-               blkbuf[0] = '\0';
-       }
-
-       if (claim_txg != 0)
-               claim = "already claimed";
-       else if (bp->blk_birth >= spa_first_txg(zilog->zl_spa))
-               claim = "will claim";
-       else
-               claim = "won't claim";
-
-       (void) printf("\tBlock seqno %llu, %s%s\n",
-           (u_longlong_t)bp->blk_cksum.zc_word[ZIL_ZC_SEQ], claim, blkbuf);
-
-       return (0);
-}
-
-static void
-print_log_stats(int verbose)
-{
-       int i, w, p10;
-
-       if (verbose > 3)
-               (void) printf("\n");
-
-       if (zil_rec_info[0].zri_count == 0)
-               return;
-
-       for (w = 1, p10 = 10; zil_rec_info[0].zri_count >= p10; p10 *= 10)
-               w++;
-
-       for (i = 0; i < TX_MAX_TYPE; i++)
-               if (zil_rec_info[i].zri_count || verbose >= 3)
-                       (void) printf("\t\t%s %*llu\n",
-                           zil_rec_info[i].zri_name, w,
-                           (u_longlong_t)zil_rec_info[i].zri_count);
-       (void) printf("\n");
-}
-
-/* ARGSUSED */
-void
-dump_intent_log(zilog_t *zilog)
-{
-       const zil_header_t *zh = zilog->zl_header;
-       int verbose = MAX(dump_opt['d'], dump_opt['i']);
-       int i;
-
-       if (BP_IS_HOLE(&zh->zh_log) || verbose < 1)
-               return;
-
-       (void) printf("\n    ZIL header: claim_txg %llu, "
-           "claim_blk_seq %llu, claim_lr_seq %llu",
-           (u_longlong_t)zh->zh_claim_txg,
-           (u_longlong_t)zh->zh_claim_blk_seq,
-           (u_longlong_t)zh->zh_claim_lr_seq);
-       (void) printf(" replay_seq %llu, flags 0x%llx\n",
-           (u_longlong_t)zh->zh_replay_seq, (u_longlong_t)zh->zh_flags);
-
-       for (i = 0; i < TX_MAX_TYPE; i++)
-               zil_rec_info[i].zri_count = 0;
-
-       if (verbose >= 2) {
-               (void) printf("\n");
-               (void) zil_parse(zilog, print_log_block, print_log_record, NULL,
-                   zh->zh_claim_txg);
-               print_log_stats(verbose);
-       }
-}
diff --git a/zfs/cmd/zed/.gitignore b/zfs/cmd/zed/.gitignore
deleted file mode 100644 (file)
index 76557bb..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zed
diff --git a/zfs/cmd/zed/Makefile.am b/zfs/cmd/zed/Makefile.am
deleted file mode 100644 (file)
index 70e4f7f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-EXTRA_DIST = zed.d/README
-
-sbin_PROGRAMS = zed
-
-zed_SOURCES = \
-       zed.c \
-       zed.h \
-       zed_conf.c \
-       zed_conf.h \
-       zed_event.c \
-       zed_event.h \
-       zed_exec.c \
-       zed_exec.h \
-       zed_file.c \
-       zed_file.h \
-       zed_log.c \
-       zed_log.h \
-       zed_strings.c \
-       zed_strings.h
-
-zed_LDADD = \
-       $(top_builddir)/lib/libavl/libavl.la \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libspl/libspl.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
-
-zedconfdir = $(sysconfdir)/zfs/zed.d
-
-dist_zedconf_DATA = \
-       zed.d/zed-functions.sh \
-       zed.d/zed.rc
-
-zedexecdir = $(libexecdir)/zfs/zed.d
-
-dist_zedexec_SCRIPTS = \
-       zed.d/all-debug.sh \
-       zed.d/all-syslog.sh \
-       zed.d/checksum-notify.sh \
-       zed.d/checksum-spare.sh \
-       zed.d/data-notify.sh \
-       zed.d/generic-notify.sh \
-       zed.d/io-notify.sh \
-       zed.d/io-spare.sh \
-       zed.d/resilver.finish-notify.sh \
-       zed.d/scrub.finish-notify.sh
-
-zedconfdefaults = \
-       all-syslog.sh \
-       checksum-notify.sh \
-       checksum-spare.sh \
-       data-notify.sh \
-       io-notify.sh \
-       io-spare.sh \
-       resilver.finish-notify.sh \
-       scrub.finish-notify.sh
-
-install-data-hook:
-       $(MKDIR_P) "$(DESTDIR)$(zedconfdir)"
-       for f in $(zedconfdefaults); do \
-         test -f "$(DESTDIR)$(zedconfdir)/$${f}" -o \
-              -L "$(DESTDIR)$(zedconfdir)/$${f}" || \
-           ln -s "$(zedexecdir)/$${f}" "$(DESTDIR)$(zedconfdir)"; \
-       done
-       chmod 0600 "$(DESTDIR)$(zedconfdir)/zed.rc"
diff --git a/zfs/cmd/zed/Makefile.in b/zfs/cmd/zed/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zed/zed.c b/zfs/cmd/zed/zed.c
deleted file mode 100644 (file)
index f85668f..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <signal.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/mman.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include "zed.h"
-#include "zed_conf.h"
-#include "zed_event.h"
-#include "zed_file.h"
-#include "zed_log.h"
-
-static volatile sig_atomic_t _got_exit = 0;
-static volatile sig_atomic_t _got_hup = 0;
-
-/*
- * Signal handler for SIGINT & SIGTERM.
- */
-static void
-_exit_handler(int signum)
-{
-       _got_exit = 1;
-}
-
-/*
- * Signal handler for SIGHUP.
- */
-static void
-_hup_handler(int signum)
-{
-       _got_hup = 1;
-}
-
-/*
- * Register signal handlers.
- */
-static void
-_setup_sig_handlers(void)
-{
-       struct sigaction sa;
-
-       if (sigemptyset(&sa.sa_mask) < 0)
-               zed_log_die("Failed to initialize sigset");
-
-       sa.sa_flags = SA_RESTART;
-       sa.sa_handler = SIG_IGN;
-
-       if (sigaction(SIGPIPE, &sa, NULL) < 0)
-               zed_log_die("Failed to ignore SIGPIPE");
-
-       sa.sa_handler = _exit_handler;
-       if (sigaction(SIGINT, &sa, NULL) < 0)
-               zed_log_die("Failed to register SIGINT handler");
-
-       if (sigaction(SIGTERM, &sa, NULL) < 0)
-               zed_log_die("Failed to register SIGTERM handler");
-
-       sa.sa_handler = _hup_handler;
-       if (sigaction(SIGHUP, &sa, NULL) < 0)
-               zed_log_die("Failed to register SIGHUP handler");
-}
-
-/*
- * Lock all current and future pages in the virtual memory address space.
- * Access to locked pages will never be delayed by a page fault.
- *
- * EAGAIN is tested up to max_tries in case this is a transient error.
- *
- * Note that memory locks are not inherited by a child created via fork()
- * and are automatically removed during an execve().  As such, this must
- * be called after the daemon fork()s (when running in the background).
- */
-static void
-_lock_memory(void)
-{
-#if HAVE_MLOCKALL
-       int i = 0;
-       const int max_tries = 10;
-
-       for (i = 0; i < max_tries; i++) {
-               if (mlockall(MCL_CURRENT | MCL_FUTURE) == 0) {
-                       zed_log_msg(LOG_INFO, "Locked all pages in memory");
-                       return;
-               }
-               if (errno != EAGAIN)
-                       break;
-       }
-       zed_log_die("Failed to lock memory pages: %s", strerror(errno));
-
-#else /* HAVE_MLOCKALL */
-       zed_log_die("Failed to lock memory pages: mlockall() not supported");
-#endif /* HAVE_MLOCKALL */
-}
-
-/*
- * Start daemonization of the process including the double fork().
- *
- * The parent process will block here until _finish_daemonize() is called
- * (in the grandchild process), at which point the parent process will exit.
- * This prevents the parent process from exiting until initialization is
- * complete.
- */
-static void
-_start_daemonize(void)
-{
-       pid_t pid;
-       struct sigaction sa;
-
-       /* Create pipe for communicating with child during daemonization. */
-       zed_log_pipe_open();
-
-       /* Background process and ensure child is not process group leader. */
-       pid = fork();
-       if (pid < 0) {
-               zed_log_die("Failed to create child process: %s",
-                   strerror(errno));
-       } else if (pid > 0) {
-
-               /* Close writes since parent will only read from pipe. */
-               zed_log_pipe_close_writes();
-
-               /* Wait for notification that daemonization is complete. */
-               zed_log_pipe_wait();
-
-               zed_log_pipe_close_reads();
-               _exit(EXIT_SUCCESS);
-       }
-
-       /* Close reads since child will only write to pipe. */
-       zed_log_pipe_close_reads();
-
-       /* Create independent session and detach from terminal. */
-       if (setsid() < 0)
-               zed_log_die("Failed to create new session: %s",
-                   strerror(errno));
-
-       /* Prevent child from terminating on HUP when session leader exits. */
-       if (sigemptyset(&sa.sa_mask) < 0)
-               zed_log_die("Failed to initialize sigset");
-
-       sa.sa_flags = 0;
-       sa.sa_handler = SIG_IGN;
-
-       if (sigaction(SIGHUP, &sa, NULL) < 0)
-               zed_log_die("Failed to ignore SIGHUP");
-
-       /* Ensure process cannot re-acquire terminal. */
-       pid = fork();
-       if (pid < 0) {
-               zed_log_die("Failed to create grandchild process: %s",
-                   strerror(errno));
-       } else if (pid > 0) {
-               _exit(EXIT_SUCCESS);
-       }
-}
-
-/*
- * Finish daemonization of the process by closing stdin/stdout/stderr.
- *
- * This must be called at the end of initialization after all external
- * communication channels are established and accessible.
- */
-static void
-_finish_daemonize(void)
-{
-       int devnull;
-
-       /* Preserve fd 0/1/2, but discard data to/from stdin/stdout/stderr. */
-       devnull = open("/dev/null", O_RDWR);
-       if (devnull < 0)
-               zed_log_die("Failed to open /dev/null: %s", strerror(errno));
-
-       if (dup2(devnull, STDIN_FILENO) < 0)
-               zed_log_die("Failed to dup /dev/null onto stdin: %s",
-                   strerror(errno));
-
-       if (dup2(devnull, STDOUT_FILENO) < 0)
-               zed_log_die("Failed to dup /dev/null onto stdout: %s",
-                   strerror(errno));
-
-       if (dup2(devnull, STDERR_FILENO) < 0)
-               zed_log_die("Failed to dup /dev/null onto stderr: %s",
-                   strerror(errno));
-
-       if (close(devnull) < 0)
-               zed_log_die("Failed to close /dev/null: %s", strerror(errno));
-
-       /* Notify parent that daemonization is complete. */
-       zed_log_pipe_close_writes();
-}
-
-/*
- * ZFS Event Daemon (ZED).
- */
-int
-main(int argc, char *argv[])
-{
-       struct zed_conf *zcp;
-       uint64_t saved_eid;
-       int64_t saved_etime[2];
-
-       zed_log_init(argv[0]);
-       zed_log_stderr_open(LOG_NOTICE);
-       zcp = zed_conf_create();
-       zed_conf_parse_opts(zcp, argc, argv);
-       if (zcp->do_verbose)
-               zed_log_stderr_open(LOG_INFO);
-
-       if (geteuid() != 0)
-               zed_log_die("Must be run as root");
-
-       zed_conf_parse_file(zcp);
-
-       zed_file_close_from(STDERR_FILENO + 1);
-
-       (void) umask(0);
-
-       if (chdir("/") < 0)
-               zed_log_die("Failed to change to root directory");
-
-       if (zed_conf_scan_dir(zcp) < 0)
-               exit(EXIT_FAILURE);
-
-       if (!zcp->do_foreground) {
-               _start_daemonize();
-               zed_log_syslog_open(LOG_DAEMON);
-       }
-       _setup_sig_handlers();
-
-       if (zcp->do_memlock)
-               _lock_memory();
-
-       if ((zed_conf_write_pid(zcp) < 0) && (!zcp->do_force))
-               exit(EXIT_FAILURE);
-
-       if (!zcp->do_foreground)
-               _finish_daemonize();
-
-       zed_log_msg(LOG_NOTICE,
-           "ZFS Event Daemon %s-%s (PID %d)",
-           ZFS_META_VERSION, ZFS_META_RELEASE, (int) getpid());
-
-       if (zed_conf_open_state(zcp) < 0)
-               exit(EXIT_FAILURE);
-
-       if (zed_conf_read_state(zcp, &saved_eid, saved_etime) < 0)
-               exit(EXIT_FAILURE);
-
-       zed_event_init(zcp);
-       zed_event_seek(zcp, saved_eid, saved_etime);
-
-       while (!_got_exit) {
-               if (_got_hup) {
-                       _got_hup = 0;
-                       (void) zed_conf_scan_dir(zcp);
-               }
-               zed_event_service(zcp);
-       }
-       zed_log_msg(LOG_NOTICE, "Exiting");
-       zed_event_fini(zcp);
-       zed_conf_destroy(zcp);
-       zed_log_fini();
-       exit(EXIT_SUCCESS);
-}
diff --git a/zfs/cmd/zed/zed.d/README b/zfs/cmd/zed/zed.d/README
deleted file mode 100644 (file)
index b4cb115..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-Shell scripts are the recommended choice for ZEDLETs that mostly call
-other utilities and do relatively little data manipulation.
-
-Shell scripts MUST work on both bash and dash.
-
-Shell scripts MUST run cleanly through ShellCheck:
-  http://www.shellcheck.net/
-
-General functions reside in "zed-functions.sh".  Use them where applicable.
-
-Additional references that may be of use:
-
-  Google Shell Style Guide
-  https://google-styleguide.googlecode.com/svn/trunk/shell.xml
-
-  Dash as /bin/sh
-  https://wiki.ubuntu.com/DashAsBinSh
-
-  Common shell script mistakes
-  http://www.pixelbeat.org/programming/shell_script_mistakes.html
-
-  Filenames and Pathnames in Shell: How to do it Correctly
-  http://www.dwheeler.com/essays/filenames-in-shell.html
-
-  Autoconf: Portable Shell Programming
-  https://www.gnu.org/software/autoconf/manual/autoconf.html#Portable-Shell
-
-Please BE CONSISTENT with the existing style, check for errors,
-minimize dependencies where possible, try to be portable,
-and comment anything non-obvious.  Festina lente.
diff --git a/zfs/cmd/zed/zed.d/all-debug.sh b/zfs/cmd/zed/zed.d/all-debug.sh
deleted file mode 100755 (executable)
index 057e39b..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/sh
-#
-# Log all environment variables to ZED_DEBUG_LOG.
-#
-# This can be a useful aid when developing/debugging ZEDLETs since it shows the
-# environment variables defined for each zevent.
-
-[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
-. "${ZED_ZEDLET_DIR}/zed-functions.sh"
-
-: "${ZED_DEBUG_LOG:="${TMPDIR:="/tmp"}/zed.debug.log"}"
-
-lockfile="$(basename -- "${ZED_DEBUG_LOG}").lock"
-
-umask 077
-zed_lock "${lockfile}"
-exec >> "${ZED_DEBUG_LOG}"
-
-printenv | sort
-echo
-
-exec >&-
-zed_unlock "${lockfile}"
-exit 0
diff --git a/zfs/cmd/zed/zed.d/all-syslog.sh b/zfs/cmd/zed/zed.d/all-syslog.sh
deleted file mode 100755 (executable)
index b34d17c..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-#!/bin/sh
-#
-# Log the zevent via syslog.
-
-[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
-. "${ZED_ZEDLET_DIR}/zed-functions.sh"
-
-zed_log_msg "eid=${ZEVENT_EID}" "class=${ZEVENT_SUBCLASS}" \
-    "${ZEVENT_POOL:+"pool=${ZEVENT_POOL}"}"
-exit 0
diff --git a/zfs/cmd/zed/zed.d/checksum-notify.sh b/zfs/cmd/zed/zed.d/checksum-notify.sh
deleted file mode 120000 (symlink)
index 9008738..0000000
+++ /dev/null
@@ -1 +0,0 @@
-io-notify.sh
\ No newline at end of file
diff --git a/zfs/cmd/zed/zed.d/checksum-spare.sh b/zfs/cmd/zed/zed.d/checksum-spare.sh
deleted file mode 120000 (symlink)
index f564f93..0000000
+++ /dev/null
@@ -1 +0,0 @@
-io-spare.sh
\ No newline at end of file
diff --git a/zfs/cmd/zed/zed.d/data-notify.sh b/zfs/cmd/zed/zed.d/data-notify.sh
deleted file mode 120000 (symlink)
index 9008738..0000000
+++ /dev/null
@@ -1 +0,0 @@
-io-notify.sh
\ No newline at end of file
diff --git a/zfs/cmd/zed/zed.d/generic-notify.sh b/zfs/cmd/zed/zed.d/generic-notify.sh
deleted file mode 100755 (executable)
index e438031..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-#!/bin/sh
-#
-# Send notification in response to a given zevent.
-#
-# This is a generic script than can be symlinked to a file in the
-# enabled-zedlets directory to have a notification sent when a particular
-# class of zevents occurs.  The symlink filename must begin with the zevent
-# (sub)class string (e.g., "probe_failure-notify.sh" for the "probe_failure"
-# subclass).  Refer to the zed(8) manpage for details.
-#
-# Only one notification per ZED_NOTIFY_INTERVAL_SECS will be sent for a given
-# class/pool combination.  This protects against spamming the recipient
-# should multiple events occur together in time for the same pool.
-#
-# Exit codes:
-#   0: notification sent
-#   1: notification failed
-#   2: notification not configured
-#   3: notification suppressed
-
-[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
-. "${ZED_ZEDLET_DIR}/zed-functions.sh"
-
-# Rate-limit the notification based in part on the filename.
-#
-rate_limit_tag="${ZEVENT_POOL};${ZEVENT_SUBCLASS};$(basename -- "$0")"
-rate_limit_interval="${ZED_NOTIFY_INTERVAL_SECS}"
-zed_rate_limit "${rate_limit_tag}" "${rate_limit_interval}" || exit 3
-
-umask 077
-pool_str="${ZEVENT_POOL:+" for ${ZEVENT_POOL}"}"
-host_str=" on $(hostname)"
-note_subject="ZFS ${ZEVENT_SUBCLASS} event${pool_str}${host_str}"
-note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
-{
-    echo "ZFS has posted the following event:"
-    echo
-    echo "   eid: ${ZEVENT_EID}"
-    echo " class: ${ZEVENT_SUBCLASS}"
-    echo "  host: $(hostname)"
-    echo "  time: ${ZEVENT_TIME_STRING}"
-
-    [ -n "${ZEVENT_VDEV_TYPE}" ] && echo " vtype: ${ZEVENT_VDEV_TYPE}"
-    [ -n "${ZEVENT_VDEV_PATH}" ] && echo " vpath: ${ZEVENT_VDEV_PATH}"
-    [ -n "${ZEVENT_VDEV_GUID}" ] && echo " vguid: ${ZEVENT_VDEV_GUID}"
-
-    [ -n "${ZEVENT_POOL}" ] && [ -x "${ZPOOL}" ] \
-        && "${ZPOOL}" status "${ZEVENT_POOL}"
-
-} > "${note_pathname}"
-
-zed_notify "${note_subject}" "${note_pathname}"; rv=$?
-rm -f "${note_pathname}"
-exit "${rv}"
diff --git a/zfs/cmd/zed/zed.d/io-notify.sh b/zfs/cmd/zed/zed.d/io-notify.sh
deleted file mode 100755 (executable)
index 3ce918a..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/bin/sh
-#
-# Send notification in response to a CHECKSUM, DATA, or IO error.
-#
-# Only one notification per ZED_NOTIFY_INTERVAL_SECS will be sent for a given
-# class/pool/[vdev] combination.  This protects against spamming the recipient
-# should multiple events occur together in time for the same pool/[vdev].
-#
-# Exit codes:
-#   0: notification sent
-#   1: notification failed
-#   2: notification not configured
-#   3: notification suppressed
-#   9: internal error
-
-[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
-. "${ZED_ZEDLET_DIR}/zed-functions.sh"
-
-[ -n "${ZEVENT_POOL}" ] || exit 9
-[ -n "${ZEVENT_SUBCLASS}" ] || exit 9
-
-if [ "${ZEVENT_SUBCLASS}" != "checksum" ] \
-        && [ "${ZEVENT_SUBCLASS}" != "data" ] \
-        && [ "${ZEVENT_SUBCLASS}" != "io" ]; then
-    zed_log_err "unsupported event class \"${ZEVENT_SUBCLASS}\""
-    exit 9
-fi
-
-rate_limit_tag="${ZEVENT_POOL};${ZEVENT_VDEV_GUID:-0};${ZEVENT_SUBCLASS};notify"
-zed_rate_limit "${rate_limit_tag}" || exit 3
-
-umask 077
-note_subject="ZFS ${ZEVENT_SUBCLASS} error for ${ZEVENT_POOL} on $(hostname)"
-note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
-{
-    [ "${ZEVENT_SUBCLASS}" = "io" ] && article="an" || article="a"
-
-    echo "ZFS has detected ${article} ${ZEVENT_SUBCLASS} error:"
-    echo
-    echo "   eid: ${ZEVENT_EID}"
-    echo " class: ${ZEVENT_SUBCLASS}"
-    echo "  host: $(hostname)"
-    echo "  time: ${ZEVENT_TIME_STRING}"
-
-    [ -n "${ZEVENT_VDEV_TYPE}" ] && echo " vtype: ${ZEVENT_VDEV_TYPE}"
-    [ -n "${ZEVENT_VDEV_PATH}" ] && echo " vpath: ${ZEVENT_VDEV_PATH}"
-    [ -n "${ZEVENT_VDEV_GUID}" ] && echo " vguid: ${ZEVENT_VDEV_GUID}"
-
-    [ -n "${ZEVENT_VDEV_CKSUM_ERRORS}" ] \
-        && echo " cksum: ${ZEVENT_VDEV_CKSUM_ERRORS}"
-
-    [ -n "${ZEVENT_VDEV_READ_ERRORS}" ] \
-        && echo "  read: ${ZEVENT_VDEV_READ_ERRORS}"
-
-    [ -n "${ZEVENT_VDEV_WRITE_ERRORS}" ] \
-        && echo " write: ${ZEVENT_VDEV_WRITE_ERRORS}"
-
-    echo "  pool: ${ZEVENT_POOL}"
-
-} > "${note_pathname}"
-
-zed_notify "${note_subject}" "${note_pathname}"; rv=$?
-rm -f "${note_pathname}"
-exit "${rv}"
diff --git a/zfs/cmd/zed/zed.d/io-spare.sh b/zfs/cmd/zed/zed.d/io-spare.sh
deleted file mode 100755 (executable)
index 1835cb4..0000000
+++ /dev/null
@@ -1,239 +0,0 @@
-#!/bin/sh
-#
-# Replace a device with a hot spare in response to IO or CHECKSUM errors.
-# The following actions will be performed automatically when the number
-# of errors exceed the limit set by ZED_SPARE_ON_IO_ERRORS or
-# ZED_SPARE_ON_CHECKSUM_ERRORS.
-#
-# 1) FAULT the device on IO errors, no futher IO will be attempted.
-#    DEGRADE the device on checksum errors, the device is still
-#    functional and can be used to service IO requests.
-# 2) Set the SES fault beacon for the device.
-# 3) Replace the device with a hot spare if any are available.
-#
-# Once the hot sparing operation is complete either the failed device or
-# the hot spare must be manually retired using the 'zpool detach' command.
-# The 'autoreplace' functionality which would normally take care of this
-# under Illumos has not yet been implemented.
-#
-# Full support for autoreplace is planned, but it requires that the full
-# ZFS Diagnosis Engine be ported.  In the meanwhile this script provides
-# the majority of the expected hot spare functionality.
-#
-# Exit codes:
-#   0: hot spare replacement successful
-#   1: hot spare device not available
-#   2: hot sparing disabled or threshold not reached
-#   3: device already faulted or degraded
-#   9: internal error
-
-[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
-. "${ZED_ZEDLET_DIR}/zed-functions.sh"
-
-# Disabled by default.  Enable in the zed.rc file.
-: "${ZED_SPARE_ON_CHECKSUM_ERRORS:=0}"
-: "${ZED_SPARE_ON_IO_ERRORS:=0}"
-
-
-# query_vdev_status (pool, vdev)
-#
-# Given a [pool] and [vdev], return the matching vdev path & status on stdout.
-#
-# Warning: This function does not handle the case of [pool] or [vdev]
-# containing whitespace.  Beware of ShellCheck SC2046.  Caveat emptor.
-#
-# Arguments
-#   pool: pool name
-#   vdev: virtual device name
-#
-# StdOut
-#   arg1: vdev pathname
-#   arg2: vdev status
-#
-query_vdev_status()
-{
-    local pool="$1"
-    local vdev="$2"
-    local t
-
-    vdev="$(basename -- "${vdev}")"
-    ([ -n "${pool}" ] && [ -n "${vdev}" ]) || return
-    t="$(printf '\t')"
-
-    "${ZPOOL}" status "${pool}" 2>/dev/null | sed -n -e \
-        "s,^[ $t]*\(.*${vdev}\(-part[0-9]\+\)\?\)[ $t]*\([A-Z]\+\).*,\1 \3,p" \
-        | tail -1
-}
-
-
-# notify (old_vdev, new_vdev, num_errors)
-#
-# Send a notification regarding the hot spare replacement.
-#
-# Arguments
-#   old_vdev: path of old vdev that has failed
-#   new_vdev: path of new vdev used as the hot spare replacement
-#   num_errors: number of errors that triggered this replacement
-#
-notify()
-{
-    local old_vdev="$1"
-    local new_vdev="$2"
-    local num_errors="$3"
-    local note_subject
-    local note_pathname
-    local s
-    local rv
-
-    umask 077
-    note_subject="ZFS hot spare replacement for ${ZEVENT_POOL} on $(hostname)"
-    note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
-    {
-        [ "${num_errors}" -ne 1 ] 2>/dev/null && s="s"
-
-        echo "ZFS has replaced a failing device with a hot spare after" \
-            "${num_errors} ${ZEVENT_SUBCLASS} error${s}:"
-        echo
-        echo "   eid: ${ZEVENT_EID}"
-        echo " class: ${ZEVENT_SUBCLASS}"
-        echo "  host: $(hostname)"
-        echo "  time: ${ZEVENT_TIME_STRING}"
-        echo "   old: ${old_vdev}"
-        echo "   new: ${new_vdev}"
-
-        "${ZPOOL}" status "${ZEVENT_POOL}"
-
-    } > "${note_pathname}"
-
-    zed_notify "${note_subject}" "${note_pathname}"; rv=$?
-    rm -f "${note_pathname}"
-    return "${rv}"
-}
-
-
-# main
-#
-# Arguments
-#   none
-#
-# Return
-#   see above
-#
-main()
-{
-    local num_errors
-    local action
-    local lockfile
-    local vdev_path
-    local vdev_status
-    local spare
-    local spare_path
-    local spare_status
-    local zpool_err
-    local zpool_rv
-    local rv
-
-    # Avoid hot-sparing a hot-spare.
-    #
-    # Note: ZEVENT_VDEV_PATH is not defined for ZEVENT_VDEV_TYPE=spare.
-    #
-    [ "${ZEVENT_VDEV_TYPE}" = "spare" ] && exit 2
-
-    [ -n "${ZEVENT_POOL}" ] || exit 9
-    [ -n "${ZEVENT_VDEV_GUID}" ] || exit 9
-    [ -n "${ZEVENT_VDEV_PATH}" ] || exit 9
-
-    zed_check_cmd "${ZPOOL}" "${ZINJECT}" || exit 9
-
-    # Fault the device after a given number of I/O errors.
-    #
-    if [ "${ZEVENT_SUBCLASS}" = "io" ]; then
-        if [ "${ZED_SPARE_ON_IO_ERRORS}" -gt 0 ]; then
-            num_errors=$((ZEVENT_VDEV_READ_ERRORS + ZEVENT_VDEV_WRITE_ERRORS))
-            [ "${num_errors}" -ge "${ZED_SPARE_ON_IO_ERRORS}" ] \
-                && action="fault"
-        fi 2>/dev/null
-
-    # Degrade the device after a given number of checksum errors.
-    #
-    elif [ "${ZEVENT_SUBCLASS}" = "checksum" ]; then
-        if [ "${ZED_SPARE_ON_CHECKSUM_ERRORS}" -gt 0 ]; then
-            num_errors="${ZEVENT_VDEV_CKSUM_ERRORS}"
-            [ "${num_errors}" -ge "${ZED_SPARE_ON_CHECKSUM_ERRORS}" ] \
-                && action="degrade"
-        fi 2>/dev/null
-
-    else
-        zed_log_err "unsupported event class \"${ZEVENT_SUBCLASS}\""
-        exit 9
-    fi
-
-    # Error threshold not reached.
-    #
-    if [ -z "${action}" ]; then
-        exit 2
-    fi
-
-    lockfile="zed.spare.lock"
-    zed_lock "${lockfile}"
-
-    # shellcheck disable=SC2046
-    set -- $(query_vdev_status "${ZEVENT_POOL}" "${ZEVENT_VDEV_PATH}")
-    vdev_path="$1"
-    vdev_status="$2"
-
-    # Device is already FAULTED or DEGRADED.
-    #
-    if [ "${vdev_status}" = "FAULTED" ] \
-            || [ "${vdev_status}" = "DEGRADED" ]; then
-        rv=3
-
-    else
-        rv=1
-
-        # 1) FAULT or DEGRADE the device.
-        #
-        "${ZINJECT}" -d "${ZEVENT_VDEV_GUID}" -A "${action}" "${ZEVENT_POOL}"
-
-        # 2) Set the SES fault beacon.
-        #
-        # TODO: Set the 'fault' or 'ident' beacon for the device.  This can
-        # be done through the sg_ses utility.  The only hard part is to map
-        # the sd device to its corresponding enclosure and slot.  We may
-        # be able to leverage the existing vdev_id scripts for this.
-        #
-        # $ sg_ses --dev-slot-num=0 --set=ident /dev/sg3
-        # $ sg_ses --dev-slot-num=0 --clear=ident /dev/sg3
-
-        # 3) Replace the device with a hot spare.
-        #
-        # Round-robin through the spares trying those that are available.
-        #
-        for spare in ${ZEVENT_VDEV_SPARE_PATHS}; do
-
-            # shellcheck disable=SC2046
-            set -- $(query_vdev_status "${ZEVENT_POOL}" "${spare}")
-            spare_path="$1"
-            spare_status="$2"
-
-            [ "${spare_status}" = "AVAIL" ] || continue
-
-            zpool_err="$("${ZPOOL}" replace "${ZEVENT_POOL}" \
-                "${ZEVENT_VDEV_GUID}" "${spare_path}" 2>&1)"; zpool_rv=$?
-
-            if [ "${zpool_rv}" -ne 0 ]; then
-                [ -n "${zpool_err}" ] && zed_log_err "zpool ${zpool_err}"
-            else
-                notify "${vdev_path}" "${spare_path}" "${num_errors}"
-                rv=0
-                break
-            fi
-        done
-    fi
-
-    zed_unlock "${lockfile}"
-    exit "${rv}"
-}
-
-
-main "$@"
diff --git a/zfs/cmd/zed/zed.d/resilver.finish-notify.sh b/zfs/cmd/zed/zed.d/resilver.finish-notify.sh
deleted file mode 120000 (symlink)
index 2635dcc..0000000
+++ /dev/null
@@ -1 +0,0 @@
-scrub.finish-notify.sh
\ No newline at end of file
diff --git a/zfs/cmd/zed/zed.d/scrub.finish-notify.sh b/zfs/cmd/zed/zed.d/scrub.finish-notify.sh
deleted file mode 100755 (executable)
index b4dd1dd..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-#!/bin/sh
-#
-# Send notification in response to a RESILVER.FINISH or SCRUB.FINISH.
-#
-# By default, "zpool status" output will only be included for a scrub.finish
-# zevent if the pool is not healthy; to always include its output, set
-# ZED_NOTIFY_VERBOSE=1.
-#
-# Exit codes:
-#   0: notification sent
-#   1: notification failed
-#   2: notification not configured
-#   3: notification suppressed
-#   9: internal error
-
-[ -f "${ZED_ZEDLET_DIR}/zed.rc" ] && . "${ZED_ZEDLET_DIR}/zed.rc"
-. "${ZED_ZEDLET_DIR}/zed-functions.sh"
-
-[ -n "${ZEVENT_POOL}" ] || exit 9
-[ -n "${ZEVENT_SUBCLASS}" ] || exit 9
-
-if   [ "${ZEVENT_SUBCLASS}" = "resilver.finish" ]; then
-    action="resilver"
-elif [ "${ZEVENT_SUBCLASS}" = "scrub.finish" ]; then
-    action="scrub"
-else
-    zed_log_err "unsupported event class \"${ZEVENT_SUBCLASS}\""
-    exit 9
-fi
-
-zed_check_cmd "${ZPOOL}" || exit 9
-
-# For scrub, suppress notification if the pool is healthy
-# and verbosity is not enabled.
-#
-if [ "${ZEVENT_SUBCLASS}" = "scrub.finish" ]; then
-    healthy="$("${ZPOOL}" status -x "${ZEVENT_POOL}" \
-        | grep "'${ZEVENT_POOL}' is healthy")"
-    [ -n "${healthy}" ] && [ "${ZED_NOTIFY_VERBOSE}" -eq 0 ] && exit 3
-fi
-
-umask 077
-note_subject="ZFS ${ZEVENT_SUBCLASS} event for ${ZEVENT_POOL} on $(hostname)"
-note_pathname="${TMPDIR:="/tmp"}/$(basename -- "$0").${ZEVENT_EID}.$$"
-{
-    echo "ZFS has finished a ${action}:"
-    echo
-    echo "   eid: ${ZEVENT_EID}"
-    echo " class: ${ZEVENT_SUBCLASS}"
-    echo "  host: $(hostname)"
-    echo "  time: ${ZEVENT_TIME_STRING}"
-
-    "${ZPOOL}" status "${ZEVENT_POOL}"
-
-} > "${note_pathname}"
-
-zed_notify "${note_subject}" "${note_pathname}"; rv=$?
-rm -f "${note_pathname}"
-exit "${rv}"
diff --git a/zfs/cmd/zed/zed.d/zed-functions.sh b/zfs/cmd/zed/zed.d/zed-functions.sh
deleted file mode 100644 (file)
index 1ddafa9..0000000
+++ /dev/null
@@ -1,415 +0,0 @@
-# zed-functions.sh
-#
-# ZED helper functions for use in ZEDLETs
-
-
-# Variable Defaults
-#
-: "${ZED_LOCKDIR:="/var/lock"}"
-: "${ZED_NOTIFY_INTERVAL_SECS:=3600}"
-: "${ZED_NOTIFY_VERBOSE:=0}"
-: "${ZED_RUNDIR:="/var/run"}"
-: "${ZED_SYSLOG_PRIORITY:="daemon.notice"}"
-: "${ZED_SYSLOG_TAG:="zed"}"
-
-ZED_FLOCK_FD=8
-
-
-# zed_check_cmd (cmd, ...)
-#
-# For each argument given, search PATH for the executable command [cmd].
-# Log a message if [cmd] is not found.
-#
-# Arguments
-#   cmd: name of executable command for which to search
-#
-# Return
-#   0 if all commands are found in PATH and are executable
-#   n for a count of the command executables that are not found
-#
-zed_check_cmd()
-{
-    local cmd
-    local rv=0
-
-    for cmd; do
-        if ! command -v "${cmd}" >/dev/null 2>&1; then
-            zed_log_err "\"${cmd}\" not installed"
-            rv=$((rv + 1))
-        fi
-    done
-    return "${rv}"
-}
-
-
-# zed_log_msg (msg, ...)
-#
-# Write all argument strings to the system log.
-#
-# Globals
-#   ZED_SYSLOG_PRIORITY
-#   ZED_SYSLOG_TAG
-#
-# Return
-#   nothing
-#
-zed_log_msg()
-{
-    logger -p "${ZED_SYSLOG_PRIORITY}" -t "${ZED_SYSLOG_TAG}" -- "$@"
-}
-
-
-# zed_log_err (msg, ...)
-#
-# Write an error message to the system log.  This message will contain the
-# script name, EID, and all argument strings.
-#
-# Globals
-#   ZED_SYSLOG_PRIORITY
-#   ZED_SYSLOG_TAG
-#   ZEVENT_EID
-#
-# Return
-#   nothing
-#
-zed_log_err()
-{
-    logger -p "${ZED_SYSLOG_PRIORITY}" -t "${ZED_SYSLOG_TAG}" -- "error:" \
-        "$(basename -- "$0"):""${ZEVENT_EID:+" eid=${ZEVENT_EID}:"}" "$@"
-}
-
-
-# zed_lock (lockfile, [fd])
-#
-# Obtain an exclusive (write) lock on [lockfile].  If the lock cannot be
-# immediately acquired, wait until it becomes available.
-#
-# Every zed_lock() must be paired with a corresponding zed_unlock().
-#
-# By default, flock-style locks associate the lockfile with file descriptor 8.
-# The bash manpage warns that file descriptors >9 should be used with care as
-# they may conflict with file descriptors used internally by the shell.  File
-# descriptor 9 is reserved for zed_rate_limit().  If concurrent locks are held
-# within the same process, they must use different file descriptors (preferably
-# decrementing from 8); otherwise, obtaining a new lock with a given file
-# descriptor will release the previous lock associated with that descriptor.
-#
-# Arguments
-#   lockfile: pathname of the lock file; the lock will be stored in
-#     ZED_LOCKDIR unless the pathname contains a "/".
-#   fd: integer for the file descriptor used by flock (OPTIONAL unless holding
-#     concurrent locks)
-#
-# Globals
-#   ZED_FLOCK_FD
-#   ZED_LOCKDIR
-#
-# Return
-#   nothing
-#
-zed_lock()
-{
-    local lockfile="$1"
-    local fd="${2:-${ZED_FLOCK_FD}}"
-    local umask_bak
-    local err
-
-    [ -n "${lockfile}" ] || return
-    if ! expr "${lockfile}" : '.*/' >/dev/null 2>&1; then
-        lockfile="${ZED_LOCKDIR}/${lockfile}"
-    fi
-
-    umask_bak="$(umask)"
-    umask 077
-
-    # Obtain a lock on the file bound to the given file descriptor.
-    #
-    eval "exec ${fd}> '${lockfile}'"
-    err="$(flock --exclusive "${fd}" 2>&1)"
-    if [ $? -ne 0 ]; then
-        zed_log_err "failed to lock \"${lockfile}\": ${err}"
-    fi
-
-    umask "${umask_bak}"
-}
-
-
-# zed_unlock (lockfile, [fd])
-#
-# Release the lock on [lockfile].
-#
-# Arguments
-#   lockfile: pathname of the lock file
-#   fd: integer for the file descriptor used by flock (must match the file
-#     descriptor passed to the zed_lock function call)
-#
-# Globals
-#   ZED_FLOCK_FD
-#   ZED_LOCKDIR
-#
-# Return
-#   nothing
-#
-zed_unlock()
-{
-    local lockfile="$1"
-    local fd="${2:-${ZED_FLOCK_FD}}"
-    local err
-
-    [ -n "${lockfile}" ] || return
-    if ! expr "${lockfile}" : '.*/' >/dev/null 2>&1; then
-        lockfile="${ZED_LOCKDIR}/${lockfile}"
-    fi
-
-    # Release the lock and close the file descriptor.
-    #
-    err="$(flock --unlock "${fd}" 2>&1)"
-    if [ $? -ne 0 ]; then
-        zed_log_err "failed to unlock \"${lockfile}\": ${err}"
-    fi
-    eval "exec ${fd}>&-"
-}
-
-
-# zed_notify (subject, pathname)
-#
-# Send a notification via all available methods.
-#
-# Arguments
-#   subject: notification subject
-#   pathname: pathname containing the notification message (OPTIONAL)
-#
-# Return
-#   0: notification succeeded via at least one method
-#   1: notification failed
-#   2: no notification methods configured
-#
-zed_notify()
-{
-    local subject="$1"
-    local pathname="$2"
-    local num_success=0
-    local num_failure=0
-
-    zed_notify_email "${subject}" "${pathname}"; rv=$?
-    [ "${rv}" -eq 0 ] && num_success=$((num_success + 1))
-    [ "${rv}" -eq 1 ] && num_failure=$((num_failure + 1))
-
-    zed_notify_pushbullet "${subject}" "${pathname}"; rv=$?
-    [ "${rv}" -eq 0 ] && num_success=$((num_success + 1))
-    [ "${rv}" -eq 1 ] && num_failure=$((num_failure + 1))
-
-    [ "${num_success}" -gt 0 ] && return 0
-    [ "${num_failure}" -gt 0 ] && return 1
-    return 2
-}
-
-
-# zed_notify_email (subject, pathname)
-#
-# Send a notification via email to the address specified by ZED_EMAIL_ADDR.
-#
-# Requires the mail executable to be installed in the standard PATH, or
-# ZED_EMAIL_PROG to be defined with the pathname of an executable capable of
-# reading a message body from stdin.
-#
-# Command-line options to the mail executable can be specified in
-# ZED_EMAIL_OPTS.  This undergoes the following keyword substitutions:
-# - @ADDRESS@ is replaced with the space-delimited recipient email address(es)
-# - @SUBJECT@ is replaced with the notification subject
-#
-# Arguments
-#   subject: notification subject
-#   pathname: pathname containing the notification message (OPTIONAL)
-#
-# Globals
-#   ZED_EMAIL_PROG
-#   ZED_EMAIL_OPTS
-#   ZED_EMAIL_ADDR
-#
-# Return
-#   0: notification sent
-#   1: notification failed
-#   2: not configured
-#
-zed_notify_email()
-{
-    local subject="$1"
-    local pathname="${2:-"/dev/null"}"
-
-    : "${ZED_EMAIL_PROG:="mail"}"
-    : "${ZED_EMAIL_OPTS:="-s '@SUBJECT@' @ADDRESS@"}"
-
-    # For backward compatibility with ZED_EMAIL.
-    if [ -n "${ZED_EMAIL}" ] && [ -z "${ZED_EMAIL_ADDR}" ]; then
-        ZED_EMAIL_ADDR="${ZED_EMAIL}"
-    fi
-    [ -n "${ZED_EMAIL_ADDR}" ] || return 2
-
-    zed_check_cmd "${ZED_EMAIL_PROG}" || return 1
-
-    [ -n "${subject}" ] || return 1
-    if [ ! -r "${pathname}" ]; then
-        zed_log_err \
-                "$(basename "${ZED_EMAIL_PROG}") cannot read \"${pathname}\""
-        return 1
-    fi
-
-    ZED_EMAIL_OPTS="$(echo "${ZED_EMAIL_OPTS}" \
-        | sed   -e "s/@ADDRESS@/${ZED_EMAIL_ADDR}/g" \
-                -e "s/@SUBJECT@/${subject}/g")"
-
-    # shellcheck disable=SC2086
-    eval "${ZED_EMAIL_PROG}" ${ZED_EMAIL_OPTS} < "${pathname}" >/dev/null 2>&1
-    rv=$?
-    if [ "${rv}" -ne 0 ]; then
-        zed_log_err "$(basename "${ZED_EMAIL_PROG}") exit=${rv}"
-        return 1
-    fi
-    return 0
-}
-
-
-# zed_notify_pushbullet (subject, pathname)
-#
-# Send a notification via Pushbullet <https://www.pushbullet.com/>.
-# The access token (ZED_PUSHBULLET_ACCESS_TOKEN) identifies this client to the
-# Pushbullet server.  The optional channel tag (ZED_PUSHBULLET_CHANNEL_TAG) is
-# for pushing to notification feeds that can be subscribed to; if a channel is
-# not defined, push notifications will instead be sent to all devices
-# associated with the account specified by the access token.
-#
-# Requires awk, curl, and sed executables to be installed in the standard PATH.
-#
-# References
-#   https://docs.pushbullet.com/
-#   https://www.pushbullet.com/security
-#
-# Arguments
-#   subject: notification subject
-#   pathname: pathname containing the notification message (OPTIONAL)
-#
-# Globals
-#   ZED_PUSHBULLET_ACCESS_TOKEN
-#   ZED_PUSHBULLET_CHANNEL_TAG
-#
-# Return
-#   0: notification sent
-#   1: notification failed
-#   2: not configured
-#
-zed_notify_pushbullet()
-{
-    local subject="$1"
-    local pathname="${2:-"/dev/null"}"
-    local msg_body
-    local msg_tag
-    local msg_json
-    local msg_out
-    local msg_err
-    local url="https://api.pushbullet.com/v2/pushes"
-
-    [ -n "${ZED_PUSHBULLET_ACCESS_TOKEN}" ] || return 2
-
-    [ -n "${subject}" ] || return 1
-    if [ ! -r "${pathname}" ]; then
-        zed_log_err "pushbullet cannot read \"${pathname}\""
-        return 1
-    fi
-
-    zed_check_cmd "awk" "curl" "sed" || return 1
-
-    # Escape the following characters in the message body for JSON:
-    # newline, backslash, double quote, horizontal tab, vertical tab,
-    # and carriage return.
-    #
-    msg_body="$(awk '{ ORS="\\n" } { gsub(/\\/, "\\\\"); gsub(/"/, "\\\"");
-        gsub(/\t/, "\\t"); gsub(/\f/, "\\f"); gsub(/\r/, "\\r"); print }' \
-        "${pathname}")"
-
-    # Push to a channel if one is configured.
-    #
-    [ -n "${ZED_PUSHBULLET_CHANNEL_TAG}" ] && msg_tag="$(printf \
-        '"channel_tag": "%s", ' "${ZED_PUSHBULLET_CHANNEL_TAG}")"
-
-    # Construct the JSON message for pushing a note.
-    #
-    msg_json="$(printf '{%s"type": "note", "title": "%s", "body": "%s"}' \
-        "${msg_tag}" "${subject}" "${msg_body}")"
-
-    # Send the POST request and check for errors.
-    #
-    msg_out="$(curl -u "${ZED_PUSHBULLET_ACCESS_TOKEN}:" -X POST "${url}" \
-        --header "Content-Type: application/json" --data-binary "${msg_json}" \
-        2>/dev/null)"; rv=$?
-    if [ "${rv}" -ne 0 ]; then
-        zed_log_err "curl exit=${rv}"
-        return 1
-    fi
-    msg_err="$(echo "${msg_out}" \
-        | sed -n -e 's/.*"error" *:.*"message" *: *"\([^"]*\)".*/\1/p')"
-    if [ -n "${msg_err}" ]; then
-        zed_log_err "pushbullet \"${msg_err}"\"
-        return 1
-    fi
-    return 0
-}
-
-
-# zed_rate_limit (tag, [interval])
-#
-# Check whether an event of a given type [tag] has already occurred within the
-# last [interval] seconds.
-#
-# This function obtains a lock on the statefile using file descriptor 9.
-#
-# Arguments
-#   tag: arbitrary string for grouping related events to rate-limit
-#   interval: time interval in seconds (OPTIONAL)
-#
-# Globals
-#   ZED_NOTIFY_INTERVAL_SECS
-#   ZED_RUNDIR
-#
-# Return
-#   0 if the event should be processed
-#   1 if the event should be dropped
-#
-# State File Format
-#   time;tag
-#
-zed_rate_limit()
-{
-    local tag="$1"
-    local interval="${2:-${ZED_NOTIFY_INTERVAL_SECS}}"
-    local lockfile="zed.zedlet.state.lock"
-    local lockfile_fd=9
-    local statefile="${ZED_RUNDIR}/zed.zedlet.state"
-    local time_now
-    local time_prev
-    local umask_bak
-    local rv=0
-
-    [ -n "${tag}" ] || return 0
-
-    zed_lock "${lockfile}" "${lockfile_fd}"
-    time_now="$(date +%s)"
-    time_prev="$(egrep "^[0-9]+;${tag}\$" "${statefile}" 2>/dev/null \
-        | tail -1 | cut -d\; -f1)"
-
-    if [ -n "${time_prev}" ] \
-            && [ "$((time_now - time_prev))" -lt "${interval}" ]; then
-        rv=1
-    else
-        umask_bak="$(umask)"
-        umask 077
-        egrep -v "^[0-9]+;${tag}\$" "${statefile}" 2>/dev/null \
-            > "${statefile}.$$"
-        echo "${time_now};${tag}" >> "${statefile}.$$"
-        mv -f "${statefile}.$$" "${statefile}"
-        umask "${umask_bak}"
-    fi
-
-    zed_unlock "${lockfile}" "${lockfile_fd}"
-    return "${rv}"
-}
diff --git a/zfs/cmd/zed/zed.d/zed.rc b/zfs/cmd/zed/zed.d/zed.rc
deleted file mode 100644 (file)
index f80fa33..0000000
+++ /dev/null
@@ -1,97 +0,0 @@
-##
-# zed.rc
-#
-# This file should be owned by root and permissioned 0600.
-##
-
-##
-# Absolute path to the debug output file.
-#
-#ZED_DEBUG_LOG="/tmp/zed.debug.log"
-
-##
-# Email address of the zpool administrator for receipt of notifications;
-#   multiple addresses can be specified if they are delimited by whitespace.
-# Email will only be sent if ZED_EMAIL_ADDR is defined.
-# Disabled by default; uncomment to enable.
-#
-#ZED_EMAIL_ADDR="root"
-
-##
-# Name or path of executable responsible for sending notifications via email;
-#   the mail program must be capable of reading a message body from stdin.
-# Email will only be sent if ZED_EMAIL_ADDR is defined.
-#
-#ZED_EMAIL_PROG="mail"
-
-##
-# Command-line options for ZED_EMAIL_PROG.
-# The string @ADDRESS@ will be replaced with the recipient email address(es).
-# The string @SUBJECT@ will be replaced with the notification subject;
-#   this should be protected with quotes to prevent word-splitting.
-# Email will only be sent if ZED_EMAIL_ADDR is defined.
-#
-#ZED_EMAIL_OPTS="-s '@SUBJECT@' @ADDRESS@"
-
-##
-# Default directory for zed lock files.
-#
-#ZED_LOCKDIR="/var/lock"
-
-##
-# Minimum number of seconds between notifications for a similar event.
-#
-#ZED_NOTIFY_INTERVAL_SECS=3600
-
-##
-# Notification verbosity.
-#   If set to 0, suppress notification if the pool is healthy.
-#   If set to 1, send notification regardless of pool health.
-#
-#ZED_NOTIFY_VERBOSE=0
-
-##
-# Pushbullet access token.
-# This grants full access to your account -- protect it accordingly!
-#   <https://www.pushbullet.com/get-started>
-#   <https://www.pushbullet.com/account>
-# Disabled by default; uncomment to enable.
-#
-#ZED_PUSHBULLET_ACCESS_TOKEN=""
-
-##
-# Pushbullet channel tag for push notification feeds that can be subscribed to.
-#   <https://www.pushbullet.com/my-channel>
-# If not defined, push notifications will instead be sent to all devices
-#   associated with the account specified by the access token.
-# Disabled by default; uncomment to enable.
-#
-#ZED_PUSHBULLET_CHANNEL_TAG=""
-
-##
-# Default directory for zed state files.
-#
-#ZED_RUNDIR="/var/run"
-
-##
-# Replace a device with a hot spare after N checksum errors are detected.
-# Disabled by default; uncomment to enable.
-#
-#ZED_SPARE_ON_CHECKSUM_ERRORS=10
-
-##
-# Replace a device with a hot spare after N I/O errors are detected.
-# Disabled by default; uncomment to enable.
-#
-#ZED_SPARE_ON_IO_ERRORS=1
-
-##
-# The syslog priority (e.g., specified as a "facility.level" pair).
-#
-#ZED_SYSLOG_PRIORITY="daemon.notice"
-
-##
-# The syslog tag for marking zed events.
-#
-#ZED_SYSLOG_TAG="zed"
-
diff --git a/zfs/cmd/zed/zed.h b/zfs/cmd/zed/zed.h
deleted file mode 100644 (file)
index 3ac0e63..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#ifndef        ZED_H
-#define        ZED_H
-
-/*
- * Absolute path for the default zed configuration file.
- */
-#define        ZED_CONF_FILE           SYSCONFDIR "/zfs/zed.conf"
-
-/*
- * Absolute path for the default zed pid file.
- */
-#define        ZED_PID_FILE            RUNSTATEDIR "/zed.pid"
-
-/*
- * Absolute path for the default zed state file.
- */
-#define        ZED_STATE_FILE          RUNSTATEDIR "/zed.state"
-
-/*
- * Absolute path for the default zed zedlet directory.
- */
-#define        ZED_ZEDLET_DIR          SYSCONFDIR "/zfs/zed.d"
-
-/*
- * Reserved for future use.
- */
-#define        ZED_MAX_EVENTS          0
-
-/*
- * Reserved for future use.
- */
-#define        ZED_MIN_EVENTS          0
-
-/*
- * String prefix for ZED variables passed via environment variables.
- */
-#define        ZED_VAR_PREFIX          "ZED_"
-
-/*
- * String prefix for ZFS event names passed via environment variables.
- */
-#define        ZEVENT_VAR_PREFIX       "ZEVENT_"
-
-#endif /* !ZED_H */
diff --git a/zfs/cmd/zed/zed_conf.c b/zfs/cmd/zed/zed_conf.c
deleted file mode 100644 (file)
index 6dfd14e..0000000
+++ /dev/null
@@ -1,725 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <libgen.h>
-#include <limits.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/uio.h>
-#include <unistd.h>
-#include "zed.h"
-#include "zed_conf.h"
-#include "zed_file.h"
-#include "zed_log.h"
-#include "zed_strings.h"
-
-/*
- * Return a new configuration with default values.
- */
-struct zed_conf *
-zed_conf_create(void)
-{
-       struct zed_conf *zcp;
-
-       zcp = calloc(1, sizeof (*zcp));
-       if (!zcp)
-               goto nomem;
-
-       zcp->syslog_facility = LOG_DAEMON;
-       zcp->min_events = ZED_MIN_EVENTS;
-       zcp->max_events = ZED_MAX_EVENTS;
-       zcp->pid_fd = -1;
-       zcp->zedlets = NULL;            /* created via zed_conf_scan_dir() */
-       zcp->state_fd = -1;             /* opened via zed_conf_open_state() */
-       zcp->zfs_hdl = NULL;            /* opened via zed_event_init() */
-       zcp->zevent_fd = -1;            /* opened via zed_event_init() */
-
-       if (!(zcp->conf_file = strdup(ZED_CONF_FILE)))
-               goto nomem;
-
-       if (!(zcp->pid_file = strdup(ZED_PID_FILE)))
-               goto nomem;
-
-       if (!(zcp->zedlet_dir = strdup(ZED_ZEDLET_DIR)))
-               goto nomem;
-
-       if (!(zcp->state_file = strdup(ZED_STATE_FILE)))
-               goto nomem;
-
-       return (zcp);
-
-nomem:
-       zed_log_die("Failed to create conf: %s", strerror(errno));
-       return (NULL);
-}
-
-/*
- * Destroy the configuration [zcp].
- *
- * Note: zfs_hdl & zevent_fd are destroyed via zed_event_fini().
- */
-void
-zed_conf_destroy(struct zed_conf *zcp)
-{
-       if (!zcp)
-               return;
-
-       if (zcp->state_fd >= 0) {
-               if (close(zcp->state_fd) < 0)
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to close state file \"%s\": %s",
-                           zcp->state_file, strerror(errno));
-               zcp->state_fd = -1;
-       }
-       if (zcp->pid_file) {
-               if ((unlink(zcp->pid_file) < 0) && (errno != ENOENT))
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to remove PID file \"%s\": %s",
-                           zcp->pid_file, strerror(errno));
-       }
-       if (zcp->pid_fd >= 0) {
-               if (close(zcp->pid_fd) < 0)
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to close PID file \"%s\": %s",
-                           zcp->pid_file, strerror(errno));
-               zcp->pid_fd = -1;
-       }
-       if (zcp->conf_file) {
-               free(zcp->conf_file);
-               zcp->conf_file = NULL;
-       }
-       if (zcp->pid_file) {
-               free(zcp->pid_file);
-               zcp->pid_file = NULL;
-       }
-       if (zcp->zedlet_dir) {
-               free(zcp->zedlet_dir);
-               zcp->zedlet_dir = NULL;
-       }
-       if (zcp->state_file) {
-               free(zcp->state_file);
-               zcp->state_file = NULL;
-       }
-       if (zcp->zedlets) {
-               zed_strings_destroy(zcp->zedlets);
-               zcp->zedlets = NULL;
-       }
-       free(zcp);
-}
-
-/*
- * Display command-line help and exit.
- *
- * If [got_err] is 0, output to stdout and exit normally;
- * otherwise, output to stderr and exit with a failure status.
- */
-static void
-_zed_conf_display_help(const char *prog, int got_err)
-{
-       FILE *fp = got_err ? stderr : stdout;
-       int w1 = 4;                     /* width of leading whitespace */
-       int w2 = 8;                     /* width of L-justified option field */
-
-       fprintf(fp, "Usage: %s [OPTION]...\n", (prog ? prog : "zed"));
-       fprintf(fp, "\n");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-h",
-           "Display help.");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-L",
-           "Display license information.");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-V",
-           "Display version information.");
-       fprintf(fp, "\n");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-v",
-           "Be verbose.");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-f",
-           "Force daemon to run.");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-F",
-           "Run daemon in the foreground.");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-M",
-           "Lock all pages in memory.");
-       fprintf(fp, "%*c%*s %s\n", w1, 0x20, -w2, "-Z",
-           "Zero state file.");
-       fprintf(fp, "\n");
-#if 0
-       fprintf(fp, "%*c%*s %s [%s]\n", w1, 0x20, -w2, "-c FILE",
-           "Read configuration from FILE.", ZED_CONF_FILE);
-#endif
-       fprintf(fp, "%*c%*s %s [%s]\n", w1, 0x20, -w2, "-d DIR",
-           "Read enabled ZEDLETs from DIR.", ZED_ZEDLET_DIR);
-       fprintf(fp, "%*c%*s %s [%s]\n", w1, 0x20, -w2, "-p FILE",
-           "Write daemon's PID to FILE.", ZED_PID_FILE);
-       fprintf(fp, "%*c%*s %s [%s]\n", w1, 0x20, -w2, "-s FILE",
-           "Write daemon's state to FILE.", ZED_STATE_FILE);
-       fprintf(fp, "\n");
-
-       exit(got_err ? EXIT_FAILURE : EXIT_SUCCESS);
-}
-
-/*
- * Display license information to stdout and exit.
- */
-static void
-_zed_conf_display_license(void)
-{
-       const char **pp;
-       const char *text[] = {
-           "The ZFS Event Daemon (ZED) is distributed under the terms of the",
-           "  Common Development and Distribution License (CDDL-1.0)",
-           "  <http://opensource.org/licenses/CDDL-1.0>.",
-           "",
-           "Developed at Lawrence Livermore National Laboratory"
-           " (LLNL-CODE-403049).",
-           "",
-           NULL
-       };
-
-       for (pp = text; *pp; pp++)
-               printf("%s\n", *pp);
-
-       exit(EXIT_SUCCESS);
-}
-
-/*
- * Display version information to stdout and exit.
- */
-static void
-_zed_conf_display_version(void)
-{
-       printf("%s-%s-%s\n",
-           ZFS_META_NAME, ZFS_META_VERSION, ZFS_META_RELEASE);
-
-       exit(EXIT_SUCCESS);
-}
-
-/*
- * Copy the [path] string to the [resultp] ptr.
- * If [path] is not an absolute path, prefix it with the current working dir.
- * If [resultp] is non-null, free its existing string before assignment.
- */
-static void
-_zed_conf_parse_path(char **resultp, const char *path)
-{
-       char buf[PATH_MAX];
-
-       assert(resultp != NULL);
-       assert(path != NULL);
-
-       if (*resultp)
-               free(*resultp);
-
-       if (path[0] == '/') {
-               *resultp = strdup(path);
-       } else if (!getcwd(buf, sizeof (buf))) {
-               zed_log_die("Failed to get current working dir: %s",
-                   strerror(errno));
-       } else if (strlcat(buf, "/", sizeof (buf)) >= sizeof (buf)) {
-               zed_log_die("Failed to copy path: %s", strerror(ENAMETOOLONG));
-       } else if (strlcat(buf, path, sizeof (buf)) >= sizeof (buf)) {
-               zed_log_die("Failed to copy path: %s", strerror(ENAMETOOLONG));
-       } else {
-               *resultp = strdup(buf);
-       }
-       if (!*resultp)
-               zed_log_die("Failed to copy path: %s", strerror(ENOMEM));
-}
-
-/*
- * Parse the command-line options into the configuration [zcp].
- */
-void
-zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv)
-{
-       const char * const opts = ":hLVc:d:p:s:vfFMZ";
-       int opt;
-
-       if (!zcp || !argv || !argv[0])
-               zed_log_die("Failed to parse options: Internal error");
-
-       opterr = 0;                     /* suppress default getopt err msgs */
-
-       while ((opt = getopt(argc, argv, opts)) != -1) {
-               switch (opt) {
-               case 'h':
-                       _zed_conf_display_help(argv[0], EXIT_SUCCESS);
-                       break;
-               case 'L':
-                       _zed_conf_display_license();
-                       break;
-               case 'V':
-                       _zed_conf_display_version();
-                       break;
-               case 'c':
-                       _zed_conf_parse_path(&zcp->conf_file, optarg);
-                       break;
-               case 'd':
-                       _zed_conf_parse_path(&zcp->zedlet_dir, optarg);
-                       break;
-               case 'p':
-                       _zed_conf_parse_path(&zcp->pid_file, optarg);
-                       break;
-               case 's':
-                       _zed_conf_parse_path(&zcp->state_file, optarg);
-                       break;
-               case 'v':
-                       zcp->do_verbose = 1;
-                       break;
-               case 'f':
-                       zcp->do_force = 1;
-                       break;
-               case 'F':
-                       zcp->do_foreground = 1;
-                       break;
-               case 'M':
-                       zcp->do_memlock = 1;
-                       break;
-               case 'Z':
-                       zcp->do_zero = 1;
-                       break;
-               case '?':
-               default:
-                       if (optopt == '?')
-                               _zed_conf_display_help(argv[0], EXIT_SUCCESS);
-
-                       fprintf(stderr, "%s: %s '-%c'\n\n", argv[0],
-                           "Invalid option", optopt);
-                       _zed_conf_display_help(argv[0], EXIT_FAILURE);
-                       break;
-               }
-       }
-}
-
-/*
- * Parse the configuration file into the configuration [zcp].
- *
- * FIXME: Not yet implemented.
- */
-void
-zed_conf_parse_file(struct zed_conf *zcp)
-{
-       if (!zcp)
-               zed_log_die("Failed to parse config: %s", strerror(EINVAL));
-}
-
-/*
- * Scan the [zcp] zedlet_dir for files to exec based on the event class.
- * Files must be executable by user, but not writable by group or other.
- * Dotfiles are ignored.
- *
- * Return 0 on success with an updated set of zedlets,
- * or -1 on error with errno set.
- *
- * FIXME: Check if zedlet_dir and all parent dirs are secure.
- */
-int
-zed_conf_scan_dir(struct zed_conf *zcp)
-{
-       zed_strings_t *zedlets;
-       DIR *dirp;
-       struct dirent *direntp;
-       char pathname[PATH_MAX];
-       struct stat st;
-       int n;
-
-       if (!zcp) {
-               errno = EINVAL;
-               zed_log_msg(LOG_ERR, "Failed to scan zedlet dir: %s",
-                   strerror(errno));
-               return (-1);
-       }
-       zedlets = zed_strings_create();
-       if (!zedlets) {
-               errno = ENOMEM;
-               zed_log_msg(LOG_WARNING, "Failed to scan dir \"%s\": %s",
-                   zcp->zedlet_dir, strerror(errno));
-               return (-1);
-       }
-       dirp = opendir(zcp->zedlet_dir);
-       if (!dirp) {
-               int errno_bak = errno;
-               zed_log_msg(LOG_WARNING, "Failed to open dir \"%s\": %s",
-                   zcp->zedlet_dir, strerror(errno));
-               zed_strings_destroy(zedlets);
-               errno = errno_bak;
-               return (-1);
-       }
-       while ((direntp = readdir(dirp))) {
-               if (direntp->d_name[0] == '.')
-                       continue;
-
-               n = snprintf(pathname, sizeof (pathname),
-                   "%s/%s", zcp->zedlet_dir, direntp->d_name);
-               if ((n < 0) || (n >= sizeof (pathname))) {
-                       zed_log_msg(LOG_WARNING, "Failed to stat \"%s\": %s",
-                           direntp->d_name, strerror(ENAMETOOLONG));
-                       continue;
-               }
-               if (stat(pathname, &st) < 0) {
-                       zed_log_msg(LOG_WARNING, "Failed to stat \"%s\": %s",
-                           pathname, strerror(errno));
-                       continue;
-               }
-               if (!S_ISREG(st.st_mode)) {
-                       zed_log_msg(LOG_INFO,
-                           "Ignoring \"%s\": not a regular file",
-                           direntp->d_name);
-                       continue;
-               }
-               if ((st.st_uid != 0) && !zcp->do_force) {
-                       zed_log_msg(LOG_NOTICE,
-                           "Ignoring \"%s\": not owned by root",
-                           direntp->d_name);
-                       continue;
-               }
-               if (!(st.st_mode & S_IXUSR)) {
-                       zed_log_msg(LOG_INFO,
-                           "Ignoring \"%s\": not executable by user",
-                           direntp->d_name);
-                       continue;
-               }
-               if ((st.st_mode & S_IWGRP) & !zcp->do_force) {
-                       zed_log_msg(LOG_NOTICE,
-                           "Ignoring \"%s\": writable by group",
-                           direntp->d_name);
-                       continue;
-               }
-               if ((st.st_mode & S_IWOTH) & !zcp->do_force) {
-                       zed_log_msg(LOG_NOTICE,
-                           "Ignoring \"%s\": writable by other",
-                           direntp->d_name);
-                       continue;
-               }
-               if (zed_strings_add(zedlets, NULL, direntp->d_name) < 0) {
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to register \"%s\": %s",
-                           direntp->d_name, strerror(errno));
-                       continue;
-               }
-               if (zcp->do_verbose)
-                       zed_log_msg(LOG_INFO,
-                           "Registered zedlet \"%s\"", direntp->d_name);
-       }
-       if (closedir(dirp) < 0) {
-               int errno_bak = errno;
-               zed_log_msg(LOG_WARNING, "Failed to close dir \"%s\": %s",
-                   zcp->zedlet_dir, strerror(errno));
-               zed_strings_destroy(zedlets);
-               errno = errno_bak;
-               return (-1);
-       }
-       if (zcp->zedlets)
-               zed_strings_destroy(zcp->zedlets);
-
-       zcp->zedlets = zedlets;
-       return (0);
-}
-
-/*
- * Write the PID file specified in [zcp].
- * Return 0 on success, -1 on error.
- *
- * This must be called after fork()ing to become a daemon (so the correct PID
- * is recorded), but before daemonization is complete and the parent process
- * exits (for synchronization with systemd).
- */
-int
-zed_conf_write_pid(struct zed_conf *zcp)
-{
-       const mode_t dirmode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
-       const mode_t filemode = S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH;
-       char buf[PATH_MAX];
-       int n;
-       char *p;
-       mode_t mask;
-       int rv;
-
-       if (!zcp || !zcp->pid_file) {
-               errno = EINVAL;
-               zed_log_msg(LOG_ERR, "Failed to create PID file: %s",
-                   strerror(errno));
-               return (-1);
-       }
-       assert(zcp->pid_fd == -1);
-       /*
-        * Create PID file directory if needed.
-        */
-       n = strlcpy(buf, zcp->pid_file, sizeof (buf));
-       if (n >= sizeof (buf)) {
-               errno = ENAMETOOLONG;
-               zed_log_msg(LOG_ERR, "Failed to create PID file: %s",
-                   strerror(errno));
-               goto err;
-       }
-       p = strrchr(buf, '/');
-       if (p)
-               *p = '\0';
-
-       if ((mkdirp(buf, dirmode) < 0) && (errno != EEXIST)) {
-               zed_log_msg(LOG_ERR, "Failed to create directory \"%s\": %s",
-                   buf, strerror(errno));
-               goto err;
-       }
-       /*
-        * Obtain PID file lock.
-        */
-       mask = umask(0);
-       umask(mask | 022);
-       zcp->pid_fd = open(zcp->pid_file, (O_RDWR | O_CREAT), filemode);
-       umask(mask);
-       if (zcp->pid_fd < 0) {
-               zed_log_msg(LOG_ERR, "Failed to open PID file \"%s\": %s",
-                   zcp->pid_file, strerror(errno));
-               goto err;
-       }
-       rv = zed_file_lock(zcp->pid_fd);
-       if (rv < 0) {
-               zed_log_msg(LOG_ERR, "Failed to lock PID file \"%s\": %s",
-                   zcp->pid_file, strerror(errno));
-               goto err;
-       } else if (rv > 0) {
-               pid_t pid = zed_file_is_locked(zcp->pid_fd);
-               if (pid < 0) {
-                       zed_log_msg(LOG_ERR,
-                           "Failed to test lock on PID file \"%s\"",
-                           zcp->pid_file);
-               } else if (pid > 0) {
-                       zed_log_msg(LOG_ERR,
-                           "Found PID %d bound to PID file \"%s\"",
-                           pid, zcp->pid_file);
-               } else {
-                       zed_log_msg(LOG_ERR,
-                           "Inconsistent lock state on PID file \"%s\"",
-                           zcp->pid_file);
-               }
-               goto err;
-       }
-       /*
-        * Write PID file.
-        */
-       n = snprintf(buf, sizeof (buf), "%d\n", (int) getpid());
-       if ((n < 0) || (n >= sizeof (buf))) {
-               errno = ERANGE;
-               zed_log_msg(LOG_ERR, "Failed to write PID file \"%s\": %s",
-                   zcp->pid_file, strerror(errno));
-       } else if (zed_file_write_n(zcp->pid_fd, buf, n) != n) {
-               zed_log_msg(LOG_ERR, "Failed to write PID file \"%s\": %s",
-                   zcp->pid_file, strerror(errno));
-       } else if (fdatasync(zcp->pid_fd) < 0) {
-               zed_log_msg(LOG_ERR, "Failed to sync PID file \"%s\": %s",
-                   zcp->pid_file, strerror(errno));
-       } else {
-               return (0);
-       }
-
-err:
-       if (zcp->pid_fd >= 0) {
-               (void) close(zcp->pid_fd);
-               zcp->pid_fd = -1;
-       }
-       return (-1);
-}
-
-/*
- * Open and lock the [zcp] state_file.
- * Return 0 on success, -1 on error.
- *
- * FIXME: Move state information into kernel.
- */
-int
-zed_conf_open_state(struct zed_conf *zcp)
-{
-       char dirbuf[PATH_MAX];
-       mode_t dirmode = S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH;
-       int n;
-       char *p;
-       int rv;
-
-       if (!zcp || !zcp->state_file) {
-               errno = EINVAL;
-               zed_log_msg(LOG_ERR, "Failed to open state file: %s",
-                   strerror(errno));
-               return (-1);
-       }
-       n = strlcpy(dirbuf, zcp->state_file, sizeof (dirbuf));
-       if (n >= sizeof (dirbuf)) {
-               errno = ENAMETOOLONG;
-               zed_log_msg(LOG_WARNING, "Failed to open state file: %s",
-                   strerror(errno));
-               return (-1);
-       }
-       p = strrchr(dirbuf, '/');
-       if (p)
-               *p = '\0';
-
-       if ((mkdirp(dirbuf, dirmode) < 0) && (errno != EEXIST)) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to create directory \"%s\": %s",
-                   dirbuf, strerror(errno));
-               return (-1);
-       }
-       if (zcp->state_fd >= 0) {
-               if (close(zcp->state_fd) < 0) {
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to close state file \"%s\": %s",
-                           zcp->state_file, strerror(errno));
-                       return (-1);
-               }
-       }
-       if (zcp->do_zero)
-               (void) unlink(zcp->state_file);
-
-       zcp->state_fd = open(zcp->state_file,
-           (O_RDWR | O_CREAT), (S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH));
-       if (zcp->state_fd < 0) {
-               zed_log_msg(LOG_WARNING, "Failed to open state file \"%s\": %s",
-                   zcp->state_file, strerror(errno));
-               return (-1);
-       }
-       rv = zed_file_lock(zcp->state_fd);
-       if (rv < 0) {
-               zed_log_msg(LOG_WARNING, "Failed to lock state file \"%s\": %s",
-                   zcp->state_file, strerror(errno));
-               return (-1);
-       }
-       if (rv > 0) {
-               pid_t pid = zed_file_is_locked(zcp->state_fd);
-               if (pid < 0) {
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to test lock on state file \"%s\"",
-                           zcp->state_file);
-               } else if (pid > 0) {
-                       zed_log_msg(LOG_WARNING,
-                           "Found PID %d bound to state file \"%s\"",
-                           pid, zcp->state_file);
-               } else {
-                       zed_log_msg(LOG_WARNING,
-                           "Inconsistent lock state on state file \"%s\"",
-                           zcp->state_file);
-               }
-               return (-1);
-       }
-       return (0);
-}
-
-/*
- * Read the opened [zcp] state_file to obtain the eid & etime of the last event
- * processed.  Write the state from the last event to the [eidp] & [etime] args
- * passed by reference.  Note that etime[] is an array of size 2.
- * Return 0 on success, -1 on error.
- */
-int
-zed_conf_read_state(struct zed_conf *zcp, uint64_t *eidp, int64_t etime[])
-{
-       ssize_t len;
-       struct iovec iov[3];
-       ssize_t n;
-
-       if (!zcp || !eidp || !etime) {
-               errno = EINVAL;
-               zed_log_msg(LOG_ERR,
-                   "Failed to read state file: %s", strerror(errno));
-               return (-1);
-       }
-       if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t) -1) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to reposition state file offset: %s",
-                   strerror(errno));
-               return (-1);
-       }
-       len = 0;
-       iov[0].iov_base = eidp;
-       len += iov[0].iov_len = sizeof (*eidp);
-       iov[1].iov_base = &etime[0];
-       len += iov[1].iov_len = sizeof (etime[0]);
-       iov[2].iov_base = &etime[1];
-       len += iov[2].iov_len = sizeof (etime[1]);
-
-       n = readv(zcp->state_fd, iov, 3);
-       if (n == 0) {
-               *eidp = 0;
-       } else if (n < 0) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to read state file \"%s\": %s",
-                   zcp->state_file, strerror(errno));
-               return (-1);
-       } else if (n != len) {
-               errno = EIO;
-               zed_log_msg(LOG_WARNING,
-                   "Failed to read state file \"%s\": Read %d of %d bytes",
-                   zcp->state_file, n, len);
-               return (-1);
-       }
-       return (0);
-}
-
-/*
- * Write the [eid] & [etime] of the last processed event to the opened
- * [zcp] state_file.  Note that etime[] is an array of size 2.
- * Return 0 on success, -1 on error.
- */
-int
-zed_conf_write_state(struct zed_conf *zcp, uint64_t eid, int64_t etime[])
-{
-       ssize_t len;
-       struct iovec iov[3];
-       ssize_t n;
-
-       if (!zcp) {
-               errno = EINVAL;
-               zed_log_msg(LOG_ERR,
-                   "Failed to write state file: %s", strerror(errno));
-               return (-1);
-       }
-       if (lseek(zcp->state_fd, 0, SEEK_SET) == (off_t) -1) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to reposition state file offset: %s",
-                   strerror(errno));
-               return (-1);
-       }
-       len = 0;
-       iov[0].iov_base = &eid;
-       len += iov[0].iov_len = sizeof (eid);
-       iov[1].iov_base = &etime[0];
-       len += iov[1].iov_len = sizeof (etime[0]);
-       iov[2].iov_base = &etime[1];
-       len += iov[2].iov_len = sizeof (etime[1]);
-
-       n = writev(zcp->state_fd, iov, 3);
-       if (n < 0) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to write state file \"%s\": %s",
-                   zcp->state_file, strerror(errno));
-               return (-1);
-       }
-       if (n != len) {
-               errno = EIO;
-               zed_log_msg(LOG_WARNING,
-                   "Failed to write state file \"%s\": Wrote %d of %d bytes",
-                   zcp->state_file, n, len);
-               return (-1);
-       }
-       if (fdatasync(zcp->state_fd) < 0) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to sync state file \"%s\": %s",
-                   zcp->state_file, strerror(errno));
-               return (-1);
-       }
-       return (0);
-}
diff --git a/zfs/cmd/zed/zed_conf.h b/zfs/cmd/zed/zed_conf.h
deleted file mode 100644 (file)
index 2bc6341..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#ifndef        ZED_CONF_H
-#define        ZED_CONF_H
-
-#include <libzfs.h>
-#include <stdint.h>
-#include "zed_strings.h"
-
-struct zed_conf {
-       unsigned        do_force:1;             /* true if force enabled */
-       unsigned        do_foreground:1;        /* true if run in foreground */
-       unsigned        do_memlock:1;           /* true if locking memory */
-       unsigned        do_verbose:1;           /* true if verbosity enabled */
-       unsigned        do_zero:1;              /* true if zeroing state */
-       int             syslog_facility;        /* syslog facility value */
-       int             min_events;             /* RESERVED FOR FUTURE USE */
-       int             max_events;             /* RESERVED FOR FUTURE USE */
-       char            *conf_file;             /* abs path to config file */
-       char            *pid_file;              /* abs path to pid file */
-       int             pid_fd;                 /* fd to pid file for lock */
-       char            *zedlet_dir;            /* abs path to zedlet dir */
-       zed_strings_t   *zedlets;               /* names of enabled zedlets */
-       char            *state_file;            /* abs path to state file */
-       int             state_fd;               /* fd to state file */
-       libzfs_handle_t *zfs_hdl;               /* handle to libzfs */
-       int             zevent_fd;              /* fd for access to zevents */
-};
-
-struct zed_conf *zed_conf_create(void);
-
-void zed_conf_destroy(struct zed_conf *zcp);
-
-void zed_conf_parse_opts(struct zed_conf *zcp, int argc, char **argv);
-
-void zed_conf_parse_file(struct zed_conf *zcp);
-
-int zed_conf_scan_dir(struct zed_conf *zcp);
-
-int zed_conf_write_pid(struct zed_conf *zcp);
-
-int zed_conf_open_state(struct zed_conf *zcp);
-
-int zed_conf_read_state(struct zed_conf *zcp, uint64_t *eidp, int64_t etime[]);
-
-int zed_conf_write_state(struct zed_conf *zcp, uint64_t eid, int64_t etime[]);
-
-#endif /* !ZED_CONF_H */
diff --git a/zfs/cmd/zed/zed_event.c b/zfs/cmd/zed/zed_event.c
deleted file mode 100644 (file)
index bd298dc..0000000
+++ /dev/null
@@ -1,883 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <libzfs.h>                    /* FIXME: Replace with libzfs_core. */
-#include <paths.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/zfs_ioctl.h>
-#include <time.h>
-#include <unistd.h>
-#include "zed.h"
-#include "zed_conf.h"
-#include "zed_exec.h"
-#include "zed_file.h"
-#include "zed_log.h"
-#include "zed_strings.h"
-
-#define        MAXBUF  4096
-
-/*
- * Open the libzfs interface.
- */
-void
-zed_event_init(struct zed_conf *zcp)
-{
-       if (!zcp)
-               zed_log_die("Failed zed_event_init: %s", strerror(EINVAL));
-
-       zcp->zfs_hdl = libzfs_init();
-       if (!zcp->zfs_hdl)
-               zed_log_die("Failed to initialize libzfs");
-
-       zcp->zevent_fd = open(ZFS_DEV, O_RDWR);
-       if (zcp->zevent_fd < 0)
-               zed_log_die("Failed to open \"%s\": %s",
-                   ZFS_DEV, strerror(errno));
-}
-
-/*
- * Close the libzfs interface.
- */
-void
-zed_event_fini(struct zed_conf *zcp)
-{
-       if (!zcp)
-               zed_log_die("Failed zed_event_fini: %s", strerror(EINVAL));
-
-       if (zcp->zevent_fd >= 0) {
-               if (close(zcp->zevent_fd) < 0)
-                       zed_log_msg(LOG_WARNING, "Failed to close \"%s\": %s",
-                           ZFS_DEV, strerror(errno));
-
-               zcp->zevent_fd = -1;
-       }
-       if (zcp->zfs_hdl) {
-               libzfs_fini(zcp->zfs_hdl);
-               zcp->zfs_hdl = NULL;
-       }
-}
-
-/*
- * Seek to the event specified by [saved_eid] and [saved_etime].
- * This protects against processing a given event more than once.
- * Return 0 upon a successful seek to the specified event, or -1 otherwise.
- *
- * A zevent is considered to be uniquely specified by its (eid,time) tuple.
- * The unsigned 64b eid is set to 1 when the kernel module is loaded, and
- * incremented by 1 for each new event.  Since the state file can persist
- * across a kernel module reload, the time must be checked to ensure a match.
- */
-int
-zed_event_seek(struct zed_conf *zcp, uint64_t saved_eid, int64_t saved_etime[])
-{
-       uint64_t eid;
-       int found;
-       nvlist_t *nvl;
-       int n_dropped;
-       int64_t *etime;
-       uint_t nelem;
-       int rv;
-
-       if (!zcp) {
-               errno = EINVAL;
-               zed_log_msg(LOG_ERR, "Failed to seek zevent: %s",
-                   strerror(errno));
-               return (-1);
-       }
-       eid = 0;
-       found = 0;
-       while ((eid < saved_eid) && !found) {
-               rv = zpool_events_next(zcp->zfs_hdl, &nvl, &n_dropped,
-                   ZEVENT_NONBLOCK, zcp->zevent_fd);
-
-               if ((rv != 0) || !nvl)
-                       break;
-
-               if (n_dropped > 0) {
-                       zed_log_msg(LOG_WARNING, "Missed %d events", n_dropped);
-                       /*
-                        * FIXME: Increase max size of event nvlist in
-                        *   /sys/module/zfs/parameters/zfs_zevent_len_max ?
-                        */
-               }
-               if (nvlist_lookup_uint64(nvl, "eid", &eid) != 0) {
-                       zed_log_msg(LOG_WARNING, "Failed to lookup zevent eid");
-               } else if (nvlist_lookup_int64_array(nvl, "time",
-                   &etime, &nelem) != 0) {
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to lookup zevent time (eid=%llu)", eid);
-               } else if (nelem != 2) {
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to lookup zevent time (eid=%llu, nelem=%u)",
-                           eid, nelem);
-               } else if ((eid != saved_eid) ||
-                   (etime[0] != saved_etime[0]) ||
-                   (etime[1] != saved_etime[1])) {
-                       /* no-op */
-               } else {
-                       found = 1;
-               }
-               free(nvl);
-       }
-       if (!found && (saved_eid > 0)) {
-               if (zpool_events_seek(zcp->zfs_hdl, ZEVENT_SEEK_START,
-                   zcp->zevent_fd) < 0)
-                       zed_log_msg(LOG_WARNING, "Failed to seek to eid=0");
-               else
-                       eid = 0;
-       }
-       zed_log_msg(LOG_NOTICE, "Processing events since eid=%llu", eid);
-       return (found ? 0 : -1);
-}
-
-/*
- * Return non-zero if nvpair [name] should be formatted in hex; o/w, return 0.
- */
-static int
-_zed_event_value_is_hex(const char *name)
-{
-       const char *hex_suffix[] = {
-               "_guid",
-               "_guids",
-               NULL
-       };
-       const char **pp;
-       char *p;
-
-       if (!name)
-               return (0);
-
-       for (pp = hex_suffix; *pp; pp++) {
-               p = strstr(name, *pp);
-               if (p && strlen(p) == strlen(*pp))
-                       return (1);
-       }
-       return (0);
-}
-
-/*
- * Add an environment variable for [eid] to the container [zsp].
- *
- * The variable name is the concatenation of [prefix] and [name] converted to
- * uppercase with non-alphanumeric characters converted to underscores;
- * [prefix] is optional, and [name] must begin with an alphabetic character.
- * If the converted variable name already exists within the container [zsp],
- * its existing value will be replaced with the new value.
- *
- * The variable value is specified by the format string [fmt].
- *
- * Returns 0 on success, and -1 on error (with errno set).
- *
- * All environment variables in [zsp] should be added through this function.
- */
-static int
-_zed_event_add_var(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, const char *name, const char *fmt, ...)
-{
-       char keybuf[MAXBUF];
-       char valbuf[MAXBUF];
-       char *dstp;
-       const char *srcp;
-       const char *lastp;
-       int n;
-       int buflen;
-       va_list vargs;
-
-       assert(zsp != NULL);
-       assert(fmt != NULL);
-
-       if (!name) {
-               errno = EINVAL;
-               zed_log_msg(LOG_WARNING,
-                   "Failed to add variable for eid=%llu: Name is empty", eid);
-               return (-1);
-       } else if (!isalpha(name[0])) {
-               errno = EINVAL;
-               zed_log_msg(LOG_WARNING,
-                   "Failed to add variable for eid=%llu: "
-                   "Name \"%s\" is invalid", eid, name);
-               return (-1);
-       }
-       /*
-        * Construct the string key by converting PREFIX (if present) and NAME.
-        */
-       dstp = keybuf;
-       lastp = keybuf + sizeof (keybuf);
-       if (prefix) {
-               for (srcp = prefix; *srcp && (dstp < lastp); srcp++)
-                       *dstp++ = isalnum(*srcp) ? toupper(*srcp) : '_';
-       }
-       for (srcp = name; *srcp && (dstp < lastp); srcp++)
-               *dstp++ = isalnum(*srcp) ? toupper(*srcp) : '_';
-
-       if (dstp == lastp) {
-               errno = ENAMETOOLONG;
-               zed_log_msg(LOG_WARNING,
-                   "Failed to add variable for eid=%llu: Name too long", eid);
-               return (-1);
-       }
-       *dstp = '\0';
-       /*
-        * Construct the string specified by "[PREFIX][NAME]=[FMT]".
-        */
-       dstp = valbuf;
-       buflen = sizeof (valbuf);
-       n = strlcpy(dstp, keybuf, buflen);
-       if (n >= sizeof (valbuf)) {
-               errno = EMSGSIZE;
-               zed_log_msg(LOG_WARNING, "Failed to add %s for eid=%llu: %s",
-                   keybuf, eid, "Exceeded buffer size");
-               return (-1);
-       }
-       dstp += n;
-       buflen -= n;
-
-       *dstp++ = '=';
-       buflen--;
-
-       va_start(vargs, fmt);
-       n = vsnprintf(dstp, buflen, fmt, vargs);
-       va_end(vargs);
-
-       if ((n < 0) || (n >= buflen)) {
-               errno = EMSGSIZE;
-               zed_log_msg(LOG_WARNING, "Failed to add %s for eid=%llu: %s",
-                   keybuf, eid, "Exceeded buffer size");
-               return (-1);
-       } else if (zed_strings_add(zsp, keybuf, valbuf) < 0) {
-               zed_log_msg(LOG_WARNING, "Failed to add %s for eid=%llu: %s",
-                   keybuf, eid, strerror(errno));
-               return (-1);
-       }
-       return (0);
-}
-
-static int
-_zed_event_add_array_err(uint64_t eid, const char *name)
-{
-       errno = EMSGSIZE;
-       zed_log_msg(LOG_WARNING,
-           "Failed to convert nvpair \"%s\" for eid=%llu: "
-           "Exceeded buffer size", name, eid);
-       return (-1);
-}
-
-static int
-_zed_event_add_int8_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       int8_t *i8p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_INT8_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_int8_array(nvp, &i8p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%d ", i8p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_uint8_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       uint8_t *u8p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_UINT8_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_uint8_array(nvp, &u8p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%u ", u8p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_int16_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       int16_t *i16p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_INT16_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_int16_array(nvp, &i16p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%d ", i16p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_uint16_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       uint16_t *u16p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_UINT16_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_uint16_array(nvp, &u16p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%u ", u16p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_int32_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       int32_t *i32p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_INT32_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_int32_array(nvp, &i32p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%d ", i32p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_uint32_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       uint32_t *u32p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_UINT32_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_uint32_array(nvp, &u32p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%u ", u32p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_int64_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       int64_t *i64p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_INT64_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_int64_array(nvp, &i64p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%lld ", (u_longlong_t) i64p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_uint64_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       const char *fmt;
-       uint64_t *u64p;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_UINT64_ARRAY));
-
-       name = nvpair_name(nvp);
-       fmt = _zed_event_value_is_hex(name) ? "0x%.16llX " : "%llu ";
-       (void) nvpair_value_uint64_array(nvp, &u64p, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, fmt, (u_longlong_t) u64p[i]);
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-static int
-_zed_event_add_string_array(uint64_t eid, zed_strings_t *zsp,
-    const char *prefix, nvpair_t *nvp)
-{
-       char buf[MAXBUF];
-       int buflen = sizeof (buf);
-       const char *name;
-       char **strp;
-       uint_t nelem;
-       uint_t i;
-       char *p;
-       int n;
-
-       assert((nvp != NULL) && (nvpair_type(nvp) == DATA_TYPE_STRING_ARRAY));
-
-       name = nvpair_name(nvp);
-       (void) nvpair_value_string_array(nvp, &strp, &nelem);
-       for (i = 0, p = buf; (i < nelem) && (buflen > 0); i++) {
-               n = snprintf(p, buflen, "%s ", strp[i] ? strp[i] : "<NULL>");
-               if ((n < 0) || (n >= buflen))
-                       return (_zed_event_add_array_err(eid, name));
-               p += n;
-               buflen -= n;
-       }
-       if (nelem > 0)
-               *--p = '\0';
-
-       return (_zed_event_add_var(eid, zsp, prefix, name, "%s", buf));
-}
-
-/*
- * Convert the nvpair [nvp] to a string which is added to the environment
- * of the child process.
- * Return 0 on success, -1 on error.
- *
- * FIXME: Refactor with cmd/zpool/zpool_main.c:zpool_do_events_nvprint()?
- */
-static void
-_zed_event_add_nvpair(uint64_t eid, zed_strings_t *zsp, nvpair_t *nvp)
-{
-       const char *name;
-       data_type_t type;
-       const char *prefix = ZEVENT_VAR_PREFIX;
-       boolean_t b;
-       double d;
-       uint8_t i8;
-       uint16_t i16;
-       uint32_t i32;
-       uint64_t i64;
-       char *str;
-
-       assert(zsp != NULL);
-       assert(nvp != NULL);
-
-       name = nvpair_name(nvp);
-       type = nvpair_type(nvp);
-
-       switch (type) {
-       case DATA_TYPE_BOOLEAN:
-               _zed_event_add_var(eid, zsp, prefix, name, "%s", "1");
-               break;
-       case DATA_TYPE_BOOLEAN_VALUE:
-               (void) nvpair_value_boolean_value(nvp, &b);
-               _zed_event_add_var(eid, zsp, prefix, name, "%s", b ? "1" : "0");
-               break;
-       case DATA_TYPE_BYTE:
-               (void) nvpair_value_byte(nvp, &i8);
-               _zed_event_add_var(eid, zsp, prefix, name, "%d", i8);
-               break;
-       case DATA_TYPE_INT8:
-               (void) nvpair_value_int8(nvp, (int8_t *) &i8);
-               _zed_event_add_var(eid, zsp, prefix, name, "%d", i8);
-               break;
-       case DATA_TYPE_UINT8:
-               (void) nvpair_value_uint8(nvp, &i8);
-               _zed_event_add_var(eid, zsp, prefix, name, "%u", i8);
-               break;
-       case DATA_TYPE_INT16:
-               (void) nvpair_value_int16(nvp, (int16_t *) &i16);
-               _zed_event_add_var(eid, zsp, prefix, name, "%d", i16);
-               break;
-       case DATA_TYPE_UINT16:
-               (void) nvpair_value_uint16(nvp, &i16);
-               _zed_event_add_var(eid, zsp, prefix, name, "%u", i16);
-               break;
-       case DATA_TYPE_INT32:
-               (void) nvpair_value_int32(nvp, (int32_t *) &i32);
-               _zed_event_add_var(eid, zsp, prefix, name, "%d", i32);
-               break;
-       case DATA_TYPE_UINT32:
-               (void) nvpair_value_uint32(nvp, &i32);
-               _zed_event_add_var(eid, zsp, prefix, name, "%u", i32);
-               break;
-       case DATA_TYPE_INT64:
-               (void) nvpair_value_int64(nvp, (int64_t *) &i64);
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   "%lld", (longlong_t) i64);
-               break;
-       case DATA_TYPE_UINT64:
-               (void) nvpair_value_uint64(nvp, &i64);
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   (_zed_event_value_is_hex(name) ? "0x%.16llX" : "%llu"),
-                   (u_longlong_t) i64);
-               break;
-       case DATA_TYPE_DOUBLE:
-               (void) nvpair_value_double(nvp, &d);
-               _zed_event_add_var(eid, zsp, prefix, name, "%g", d);
-               break;
-       case DATA_TYPE_HRTIME:
-               (void) nvpair_value_hrtime(nvp, (hrtime_t *) &i64);
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   "%llu", (u_longlong_t) i64);
-               break;
-       case DATA_TYPE_NVLIST:
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   "%s", "_NOT_IMPLEMENTED_");                 /* FIXME */
-               break;
-       case DATA_TYPE_STRING:
-               (void) nvpair_value_string(nvp, &str);
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   "%s", (str ? str : "<NULL>"));
-               break;
-       case DATA_TYPE_BOOLEAN_ARRAY:
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   "%s", "_NOT_IMPLEMENTED_");                 /* FIXME */
-               break;
-       case DATA_TYPE_BYTE_ARRAY:
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   "%s", "_NOT_IMPLEMENTED_");                 /* FIXME */
-               break;
-       case DATA_TYPE_INT8_ARRAY:
-               _zed_event_add_int8_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_UINT8_ARRAY:
-               _zed_event_add_uint8_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_INT16_ARRAY:
-               _zed_event_add_int16_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_UINT16_ARRAY:
-               _zed_event_add_uint16_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_INT32_ARRAY:
-               _zed_event_add_int32_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_UINT32_ARRAY:
-               _zed_event_add_uint32_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_INT64_ARRAY:
-               _zed_event_add_int64_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_UINT64_ARRAY:
-               _zed_event_add_uint64_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_STRING_ARRAY:
-               _zed_event_add_string_array(eid, zsp, prefix, nvp);
-               break;
-       case DATA_TYPE_NVLIST_ARRAY:
-               _zed_event_add_var(eid, zsp, prefix, name,
-                   "%s", "_NOT_IMPLEMENTED_");                 /* FIXME */
-               break;
-       default:
-               errno = EINVAL;
-               zed_log_msg(LOG_WARNING,
-                   "Failed to convert nvpair \"%s\" for eid=%llu: "
-                   "Unrecognized type=%u", name, eid, (unsigned int) type);
-               break;
-       }
-}
-
-/*
- * Restrict various environment variables to safe and sane values
- * when constructing the environment for the child process.
- *
- * Reference: Secure Programming Cookbook by Viega & Messier, Section 1.1.
- */
-static void
-_zed_event_add_env_restrict(uint64_t eid, zed_strings_t *zsp)
-{
-       const char *env_restrict[][2] = {
-               { "IFS",                " \t\n" },
-               { "PATH",               _PATH_STDPATH },
-               { "ZDB",                SBINDIR "/zdb" },
-               { "ZED",                SBINDIR "/zed" },
-               { "ZFS",                SBINDIR "/zfs" },
-               { "ZINJECT",            SBINDIR "/zinject" },
-               { "ZPOOL",              SBINDIR "/zpool" },
-               { "ZFS_ALIAS",          ZFS_META_ALIAS },
-               { "ZFS_VERSION",        ZFS_META_VERSION },
-               { "ZFS_RELEASE",        ZFS_META_RELEASE },
-               { NULL,                 NULL }
-       };
-       const char *(*pa)[2];
-
-       assert(zsp != NULL);
-
-       for (pa = env_restrict; *(*pa); pa++) {
-               _zed_event_add_var(eid, zsp, NULL, (*pa)[0], "%s", (*pa)[1]);
-       }
-}
-
-/*
- * Preserve specified variables from the parent environment
- * when constructing the environment for the child process.
- *
- * Reference: Secure Programming Cookbook by Viega & Messier, Section 1.1.
- */
-static void
-_zed_event_add_env_preserve(uint64_t eid, zed_strings_t *zsp)
-{
-       const char *env_preserve[] = {
-               "TZ",
-               NULL
-       };
-       const char **keyp;
-       const char *val;
-
-       assert(zsp != NULL);
-
-       for (keyp = env_preserve; *keyp; keyp++) {
-               if ((val = getenv(*keyp)))
-                       _zed_event_add_var(eid, zsp, NULL, *keyp, "%s", val);
-       }
-}
-
-/*
- * Compute the "subclass" by removing the first 3 components of [class]
- * (which seem to always be either "ereport.fs.zfs" or "resource.fs.zfs").
- * Return a pointer inside the string [class], or NULL if insufficient
- * components exist.
- */
-static const char *
-_zed_event_get_subclass(const char *class)
-{
-       const char *p;
-       int i;
-
-       if (!class)
-               return (NULL);
-
-       p = class;
-       for (i = 0; i < 3; i++) {
-               p = strchr(p, '.');
-               if (!p)
-                       break;
-               p++;
-       }
-       return (p);
-}
-
-/*
- * Convert the zevent time from a 2-element array of 64b integers
- * into a more convenient form:
- * - TIME_SECS is the second component of the time.
- * - TIME_NSECS is the nanosecond component of the time.
- * - TIME_STRING is an almost-RFC3339-compliant string representation.
- */
-static void
-_zed_event_add_time_strings(uint64_t eid, zed_strings_t *zsp, int64_t etime[])
-{
-       struct tm *stp;
-       char buf[32];
-
-       assert(zsp != NULL);
-       assert(etime != NULL);
-
-       _zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "TIME_SECS",
-           "%lld", (long long int) etime[0]);
-       _zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "TIME_NSECS",
-           "%lld", (long long int) etime[1]);
-
-       if (!(stp = localtime((const time_t *) &etime[0]))) {
-               zed_log_msg(LOG_WARNING, "Failed to add %s%s for eid=%llu: %s",
-                   ZEVENT_VAR_PREFIX, "TIME_STRING", eid, "localtime error");
-       } else if (!strftime(buf, sizeof (buf), "%Y-%m-%d %H:%M:%S%z", stp)) {
-               zed_log_msg(LOG_WARNING, "Failed to add %s%s for eid=%llu: %s",
-                   ZEVENT_VAR_PREFIX, "TIME_STRING", eid, "strftime error");
-       } else {
-               _zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "TIME_STRING",
-                   "%s", buf);
-       }
-}
-
-/*
- * Service the next zevent, blocking until one is available.
- */
-void
-zed_event_service(struct zed_conf *zcp)
-{
-       nvlist_t *nvl;
-       nvpair_t *nvp;
-       int n_dropped;
-       zed_strings_t *zsp;
-       uint64_t eid;
-       int64_t *etime;
-       uint_t nelem;
-       char *class;
-       const char *subclass;
-       int rv;
-
-       if (!zcp) {
-               errno = EINVAL;
-               zed_log_msg(LOG_ERR, "Failed to service zevent: %s",
-                   strerror(errno));
-               return;
-       }
-       rv = zpool_events_next(zcp->zfs_hdl, &nvl, &n_dropped, ZEVENT_NONE,
-           zcp->zevent_fd);
-
-       if ((rv != 0) || !nvl)
-               return;
-
-       if (n_dropped > 0) {
-               zed_log_msg(LOG_WARNING, "Missed %d events", n_dropped);
-               /*
-                * FIXME: Increase max size of event nvlist in
-                * /sys/module/zfs/parameters/zfs_zevent_len_max ?
-                */
-       }
-       if (nvlist_lookup_uint64(nvl, "eid", &eid) != 0) {
-               zed_log_msg(LOG_WARNING, "Failed to lookup zevent eid");
-       } else if (nvlist_lookup_int64_array(
-           nvl, "time", &etime, &nelem) != 0) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to lookup zevent time (eid=%llu)", eid);
-       } else if (nelem != 2) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to lookup zevent time (eid=%llu, nelem=%u)",
-                   eid, nelem);
-       } else if (nvlist_lookup_string(nvl, "class", &class) != 0) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to lookup zevent class (eid=%llu)", eid);
-       } else {
-               zsp = zed_strings_create();
-
-               nvp = NULL;
-               while ((nvp = nvlist_next_nvpair(nvl, nvp)))
-                       _zed_event_add_nvpair(eid, zsp, nvp);
-
-               _zed_event_add_env_restrict(eid, zsp);
-               _zed_event_add_env_preserve(eid, zsp);
-
-               _zed_event_add_var(eid, zsp, ZED_VAR_PREFIX, "PID",
-                   "%d", (int) getpid());
-               _zed_event_add_var(eid, zsp, ZED_VAR_PREFIX, "ZEDLET_DIR",
-                   "%s", zcp->zedlet_dir);
-               subclass = _zed_event_get_subclass(class);
-               _zed_event_add_var(eid, zsp, ZEVENT_VAR_PREFIX, "SUBCLASS",
-                   "%s", (subclass ? subclass : class));
-               _zed_event_add_time_strings(eid, zsp, etime);
-
-               zed_exec_process(eid, class, subclass,
-                   zcp->zedlet_dir, zcp->zedlets, zsp, zcp->zevent_fd);
-
-               zed_conf_write_state(zcp, eid, etime);
-
-               zed_strings_destroy(zsp);
-       }
-       nvlist_free(nvl);
-}
diff --git a/zfs/cmd/zed/zed_event.h b/zfs/cmd/zed/zed_event.h
deleted file mode 100644 (file)
index 9f37b80..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#ifndef        ZED_EVENT_H
-#define        ZED_EVENT_H
-
-#include <stdint.h>
-
-void zed_event_init(struct zed_conf *zcp);
-
-void zed_event_fini(struct zed_conf *zcp);
-
-int zed_event_seek(struct zed_conf *zcp, uint64_t saved_eid,
-    int64_t saved_etime[]);
-
-void zed_event_service(struct zed_conf *zcp);
-
-#endif /* !ZED_EVENT_H */
diff --git a/zfs/cmd/zed/zed_exec.c b/zfs/cmd/zed/zed_exec.c
deleted file mode 100644 (file)
index 1d040cc..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include "zed_file.h"
-#include "zed_log.h"
-#include "zed_strings.h"
-
-#define        ZEVENT_FILENO   3
-
-/*
- * Create an environment string array for passing to execve() using the
- * NAME=VALUE strings in container [zsp].
- * Return a newly-allocated environment, or NULL on error.
- */
-static char **
-_zed_exec_create_env(zed_strings_t *zsp)
-{
-       int num_ptrs;
-       int buflen;
-       char *buf;
-       char **pp;
-       char *p;
-       const char *q;
-       int i;
-       int len;
-
-       num_ptrs = zed_strings_count(zsp) + 1;
-       buflen = num_ptrs * sizeof (char *);
-       for (q = zed_strings_first(zsp); q; q = zed_strings_next(zsp))
-               buflen += strlen(q) + 1;
-
-       buf = calloc(1, buflen);
-       if (!buf)
-               return (NULL);
-
-       pp = (char **) buf;
-       p = buf + (num_ptrs * sizeof (char *));
-       i = 0;
-       for (q = zed_strings_first(zsp); q; q = zed_strings_next(zsp)) {
-               pp[i] = p;
-               len = strlen(q) + 1;
-               memcpy(p, q, len);
-               p += len;
-               i++;
-       }
-       pp[i] = NULL;
-       assert(buf + buflen == p);
-       return ((char **) buf);
-}
-
-/*
- * Fork a child process to handle event [eid].  The program [prog]
- * in directory [dir] is executed with the envionment [env].
- *
- * The file descriptor [zfd] is the zevent_fd used to track the
- * current cursor location within the zevent nvlist.
- */
-static void
-_zed_exec_fork_child(uint64_t eid, const char *dir, const char *prog,
-    char *env[], int zfd)
-{
-       char path[PATH_MAX];
-       int n;
-       pid_t pid;
-       int fd;
-       pid_t wpid;
-       int status;
-
-       assert(dir != NULL);
-       assert(prog != NULL);
-       assert(env != NULL);
-       assert(zfd >= 0);
-
-       n = snprintf(path, sizeof (path), "%s/%s", dir, prog);
-       if ((n < 0) || (n >= sizeof (path))) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to fork \"%s\" for eid=%llu: %s",
-                   prog, eid, strerror(ENAMETOOLONG));
-               return;
-       }
-       pid = fork();
-       if (pid < 0) {
-               zed_log_msg(LOG_WARNING,
-                   "Failed to fork \"%s\" for eid=%llu: %s",
-                   prog, eid, strerror(errno));
-               return;
-       } else if (pid == 0) {
-               (void) umask(022);
-               fd = open("/dev/null", O_RDWR);
-               (void) dup2(fd, STDIN_FILENO);
-               (void) dup2(fd, STDOUT_FILENO);
-               (void) dup2(fd, STDERR_FILENO);
-               (void) dup2(zfd, ZEVENT_FILENO);
-               zed_file_close_from(ZEVENT_FILENO + 1);
-               execle(path, prog, NULL, env);
-               _exit(127);
-       } else {
-               zed_log_msg(LOG_INFO, "Invoking \"%s\" eid=%llu pid=%d",
-                   prog, eid, pid);
-               /* FIXME: Timeout rogue child processes with sigalarm? */
-restart:
-               wpid = waitpid(pid, &status, 0);
-               if (wpid == (pid_t) -1) {
-                       if (errno == EINTR)
-                               goto restart;
-                       zed_log_msg(LOG_WARNING,
-                           "Failed to wait for \"%s\" eid=%llu pid=%d",
-                           prog, eid, pid);
-               } else if (WIFEXITED(status)) {
-                       zed_log_msg(LOG_INFO,
-                           "Finished \"%s\" eid=%llu pid=%d exit=%d",
-                           prog, eid, pid, WEXITSTATUS(status));
-               } else if (WIFSIGNALED(status)) {
-                       zed_log_msg(LOG_INFO,
-                           "Finished \"%s\" eid=%llu pid=%d sig=%d/%s",
-                           prog, eid, pid, WTERMSIG(status),
-                           strsignal(WTERMSIG(status)));
-               } else {
-                       zed_log_msg(LOG_INFO,
-                           "Finished \"%s\" eid=%llu pid=%d status=0x%X",
-                           prog, eid, (unsigned int) status);
-               }
-       }
-}
-
-/*
- * Process the event [eid] by synchronously invoking all zedlets with a
- * matching class prefix.
- *
- * Each executable in [zedlets] from the directory [dir] is matched against
- * the event's [class], [subclass], and the "all" class (which matches
- * all events).  Every zedlet with a matching class prefix is invoked.
- * The NAME=VALUE strings in [envs] will be passed to the zedlet as
- * environment variables.
- *
- * The file descriptor [zfd] is the zevent_fd used to track the
- * current cursor location within the zevent nvlist.
- *
- * Return 0 on success, -1 on error.
- */
-int
-zed_exec_process(uint64_t eid, const char *class, const char *subclass,
-    const char *dir, zed_strings_t *zedlets, zed_strings_t *envs, int zfd)
-{
-       const char *class_strings[4];
-       const char *allclass = "all";
-       const char **csp;
-       const char *z;
-       char **e;
-       int n;
-
-       if (!dir || !zedlets || !envs || zfd < 0)
-               return (-1);
-
-       csp = class_strings;
-
-       if (class)
-               *csp++ = class;
-
-       if (subclass)
-               *csp++ = subclass;
-
-       if (allclass)
-               *csp++ = allclass;
-
-       *csp = NULL;
-
-       e = _zed_exec_create_env(envs);
-
-       for (z = zed_strings_first(zedlets); z; z = zed_strings_next(zedlets)) {
-               for (csp = class_strings; *csp; csp++) {
-                       n = strlen(*csp);
-                       if ((strncmp(z, *csp, n) == 0) && !isalpha(z[n]))
-                               _zed_exec_fork_child(eid, dir, z, e, zfd);
-               }
-       }
-       free(e);
-       return (0);
-}
diff --git a/zfs/cmd/zed/zed_exec.h b/zfs/cmd/zed/zed_exec.h
deleted file mode 100644 (file)
index 69179c9..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#ifndef        ZED_EXEC_H
-#define        ZED_EXEC_H
-
-#include <stdint.h>
-
-int zed_exec_process(uint64_t eid, const char *class, const char *subclass,
-    const char *dir, zed_strings_t *zedlets, zed_strings_t *envs,
-    int zevent_fd);
-
-#endif /* !ZED_EXEC_H */
diff --git a/zfs/cmd/zed/zed_file.c b/zfs/cmd/zed/zed_file.c
deleted file mode 100644 (file)
index 3a1a661..0000000
+++ /dev/null
@@ -1,216 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <string.h>
-#include <sys/resource.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-#include "zed_log.h"
-
-/*
- * Read up to [n] bytes from [fd] into [buf].
- * Return the number of bytes read, 0 on EOF, or -1 on error.
- */
-ssize_t
-zed_file_read_n(int fd, void *buf, size_t n)
-{
-       unsigned char *p;
-       size_t n_left;
-       ssize_t n_read;
-
-       p = buf;
-       n_left = n;
-       while (n_left > 0) {
-               if ((n_read = read(fd, p, n_left)) < 0) {
-                       if (errno == EINTR)
-                               continue;
-                       else
-                               return (-1);
-
-               } else if (n_read == 0) {
-                       break;
-               }
-               n_left -= n_read;
-               p += n_read;
-       }
-       return (n - n_left);
-}
-
-/*
- * Write [n] bytes from [buf] out to [fd].
- * Return the number of bytes written, or -1 on error.
- */
-ssize_t
-zed_file_write_n(int fd, void *buf, size_t n)
-{
-       const unsigned char *p;
-       size_t n_left;
-       ssize_t n_written;
-
-       p = buf;
-       n_left = n;
-       while (n_left > 0) {
-               if ((n_written = write(fd, p, n_left)) < 0) {
-                       if (errno == EINTR)
-                               continue;
-                       else
-                               return (-1);
-
-               }
-               n_left -= n_written;
-               p += n_written;
-       }
-       return (n);
-}
-
-/*
- * Set an exclusive advisory lock on the open file descriptor [fd].
- * Return 0 on success, 1 if a conflicting lock is held by another process,
- * or -1 on error (with errno set).
- */
-int
-zed_file_lock(int fd)
-{
-       struct flock lock;
-
-       if (fd < 0) {
-               errno = EBADF;
-               return (-1);
-       }
-       lock.l_type = F_WRLCK;
-       lock.l_whence = SEEK_SET;
-       lock.l_start = 0;
-       lock.l_len = 0;
-
-       if (fcntl(fd, F_SETLK, &lock) < 0) {
-               if ((errno == EACCES) || (errno == EAGAIN))
-                       return (1);
-
-               return (-1);
-       }
-       return (0);
-}
-
-/*
- * Release an advisory lock held on the open file descriptor [fd].
- * Return 0 on success, or -1 on error (with errno set).
- */
-int
-zed_file_unlock(int fd)
-{
-       struct flock lock;
-
-       if (fd < 0) {
-               errno = EBADF;
-               return (-1);
-       }
-       lock.l_type = F_UNLCK;
-       lock.l_whence = SEEK_SET;
-       lock.l_start = 0;
-       lock.l_len = 0;
-
-       if (fcntl(fd, F_SETLK, &lock) < 0)
-               return (-1);
-
-       return (0);
-}
-
-/*
- * Test whether an exclusive advisory lock could be obtained for the open
- * file descriptor [fd].
- * Return 0 if the file is not locked, >0 for the PID of another process
- * holding a conflicting lock, or -1 on error (with errno set).
- */
-pid_t
-zed_file_is_locked(int fd)
-{
-       struct flock lock;
-
-       if (fd < 0) {
-               errno = EBADF;
-               return (-1);
-       }
-       lock.l_type = F_WRLCK;
-       lock.l_whence = SEEK_SET;
-       lock.l_start = 0;
-       lock.l_len = 0;
-
-       if (fcntl(fd, F_GETLK, &lock) < 0)
-               return (-1);
-
-       if (lock.l_type == F_UNLCK)
-               return (0);
-
-       return (lock.l_pid);
-}
-
-/*
- * Close all open file descriptors greater than or equal to [lowfd].
- * Any errors encountered while closing file descriptors are ignored.
- */
-void
-zed_file_close_from(int lowfd)
-{
-       const int maxfd_def = 256;
-       int errno_bak;
-       struct rlimit rl;
-       int maxfd;
-       int fd;
-
-       errno_bak = errno;
-
-       if (getrlimit(RLIMIT_NOFILE, &rl) < 0) {
-               maxfd = maxfd_def;
-       } else if (rl.rlim_max == RLIM_INFINITY) {
-               maxfd = maxfd_def;
-       } else {
-               maxfd = rl.rlim_max;
-       }
-       for (fd = lowfd; fd < maxfd; fd++)
-               (void) close(fd);
-
-       errno = errno_bak;
-}
-
-/*
- * Set the CLOEXEC flag on file descriptor [fd] so it will be automatically
- * closed upon successful execution of one of the exec functions.
- * Return 0 on success, or -1 on error.
- *
- * FIXME: No longer needed?
- */
-int
-zed_file_close_on_exec(int fd)
-{
-       int flags;
-
-       if (fd < 0) {
-               errno = EBADF;
-               return (-1);
-       }
-       flags = fcntl(fd, F_GETFD);
-       if (flags == -1)
-               return (-1);
-
-       flags |= FD_CLOEXEC;
-
-       if (fcntl(fd, F_SETFD, flags) == -1)
-               return (-1);
-
-       return (0);
-}
diff --git a/zfs/cmd/zed/zed_file.h b/zfs/cmd/zed/zed_file.h
deleted file mode 100644 (file)
index 05f360d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#ifndef        ZED_FILE_H
-#define        ZED_FILE_H
-
-#include <sys/types.h>
-#include <unistd.h>
-
-ssize_t zed_file_read_n(int fd, void *buf, size_t n);
-
-ssize_t zed_file_write_n(int fd, void *buf, size_t n);
-
-int zed_file_lock(int fd);
-
-int zed_file_unlock(int fd);
-
-pid_t zed_file_is_locked(int fd);
-
-void zed_file_close_from(int fd);
-
-int zed_file_close_on_exec(int fd);
-
-#endif /* !ZED_FILE_H */
diff --git a/zfs/cmd/zed/zed_log.c b/zfs/cmd/zed/zed_log.c
deleted file mode 100644 (file)
index ae1e2cd..0000000
+++ /dev/null
@@ -1,254 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <syslog.h>
-#include "zed_log.h"
-
-#define        ZED_LOG_MAX_LOG_LEN     1024
-
-static struct {
-       unsigned do_stderr:1;
-       unsigned do_syslog:1;
-       const char *identity;
-       int priority;
-       int pipe_fd[2];
-} _ctx;
-
-/*
- * Initialize the logging subsystem.
- */
-void
-zed_log_init(const char *identity)
-{
-       if (identity) {
-               const char *p = strrchr(identity, '/');
-               _ctx.identity = (p != NULL) ? p + 1 : identity;
-       } else {
-               _ctx.identity = NULL;
-       }
-       _ctx.pipe_fd[0] = -1;
-       _ctx.pipe_fd[1] = -1;
-}
-
-/*
- * Shutdown the logging subsystem.
- */
-void
-zed_log_fini(void)
-{
-       zed_log_stderr_close();
-       zed_log_syslog_close();
-}
-
-/*
- * Create pipe for communicating daemonization status between the parent and
- * child processes across the double-fork().
- */
-void
-zed_log_pipe_open(void)
-{
-       if ((_ctx.pipe_fd[0] != -1) || (_ctx.pipe_fd[1] != -1))
-               zed_log_die("Invalid use of zed_log_pipe_open in PID %d",
-                   (int) getpid());
-
-       if (pipe(_ctx.pipe_fd) < 0)
-               zed_log_die("Failed to create daemonize pipe in PID %d: %s",
-                   (int) getpid(), strerror(errno));
-}
-
-/*
- * Close the read-half of the daemonize pipe.
- *
- * This should be called by the child after fork()ing from the parent since
- * the child will never read from this pipe.
- */
-void
-zed_log_pipe_close_reads(void)
-{
-       if (_ctx.pipe_fd[0] < 0)
-               zed_log_die(
-                   "Invalid use of zed_log_pipe_close_reads in PID %d",
-                   (int) getpid());
-
-       if (close(_ctx.pipe_fd[0]) < 0)
-               zed_log_die(
-                   "Failed to close reads on daemonize pipe in PID %d: %s",
-                   (int) getpid(), strerror(errno));
-
-       _ctx.pipe_fd[0] = -1;
-}
-
-/*
- * Close the write-half of the daemonize pipe.
- *
- * This should be called by the parent after fork()ing its child since the
- * parent will never write to this pipe.
- *
- * This should also be called by the child once initialization is complete
- * in order to signal the parent that it can safely exit.
- */
-void
-zed_log_pipe_close_writes(void)
-{
-       if (_ctx.pipe_fd[1] < 0)
-               zed_log_die(
-                   "Invalid use of zed_log_pipe_close_writes in PID %d",
-                   (int) getpid());
-
-       if (close(_ctx.pipe_fd[1]) < 0)
-               zed_log_die(
-                   "Failed to close writes on daemonize pipe in PID %d: %s",
-                   (int) getpid(), strerror(errno));
-
-       _ctx.pipe_fd[1] = -1;
-}
-
-/*
- * Block on reading from the daemonize pipe until signaled by the child
- * (via zed_log_pipe_close_writes()) that initialization is complete.
- *
- * This should only be called by the parent while waiting to exit after
- * fork()ing the child.
- */
-void
-zed_log_pipe_wait(void)
-{
-       ssize_t n;
-       char c;
-
-       if (_ctx.pipe_fd[0] < 0)
-               zed_log_die("Invalid use of zed_log_pipe_wait in PID %d",
-                   (int) getpid());
-
-       for (;;) {
-               n = read(_ctx.pipe_fd[0], &c, sizeof (c));
-               if (n < 0) {
-                       if (errno == EINTR)
-                               continue;
-                       zed_log_die(
-                           "Failed to read from daemonize pipe in PID %d: %s",
-                           (int) getpid(), strerror(errno));
-               }
-               if (n == 0) {
-                       break;
-               }
-       }
-}
-
-/*
- * Start logging messages at the syslog [priority] level or higher to stderr.
- * Refer to syslog(3) for valid priority values.
- */
-void
-zed_log_stderr_open(int priority)
-{
-       _ctx.do_stderr = 1;
-       _ctx.priority = priority;
-}
-
-/*
- * Stop logging messages to stderr.
- */
-void
-zed_log_stderr_close(void)
-{
-       if (_ctx.do_stderr)
-               _ctx.do_stderr = 0;
-}
-
-/*
- * Start logging messages to syslog.
- * Refer to syslog(3) for valid option/facility values.
- */
-void
-zed_log_syslog_open(int facility)
-{
-       _ctx.do_syslog = 1;
-       openlog(_ctx.identity, LOG_NDELAY | LOG_PID, facility);
-}
-
-/*
- * Stop logging messages to syslog.
- */
-void
-zed_log_syslog_close(void)
-{
-       if (_ctx.do_syslog) {
-               _ctx.do_syslog = 0;
-               closelog();
-       }
-}
-
-/*
- * Auxiliary function to log a message to syslog and/or stderr.
- */
-static void
-_zed_log_aux(int priority, const char *fmt, va_list vargs)
-{
-       char buf[ZED_LOG_MAX_LOG_LEN];
-       int n;
-
-       if (!fmt)
-               return;
-
-       n = vsnprintf(buf, sizeof (buf), fmt, vargs);
-       if ((n < 0) || (n >= sizeof (buf))) {
-               buf[sizeof (buf) - 2] = '+';
-               buf[sizeof (buf) - 1] = '\0';
-       }
-
-       if (_ctx.do_syslog)
-               syslog(priority, "%s", buf);
-
-       if (_ctx.do_stderr && (priority <= _ctx.priority))
-               fprintf(stderr, "%s\n", buf);
-}
-
-/*
- * Log a message at the given [priority] level specified by the printf-style
- * format string [fmt].
- */
-void
-zed_log_msg(int priority, const char *fmt, ...)
-{
-       va_list vargs;
-
-       if (fmt) {
-               va_start(vargs, fmt);
-               _zed_log_aux(priority, fmt, vargs);
-               va_end(vargs);
-       }
-}
-
-/*
- * Log a fatal error message specified by the printf-style format string [fmt].
- */
-void
-zed_log_die(const char *fmt, ...)
-{
-       va_list vargs;
-
-       if (fmt) {
-               va_start(vargs, fmt);
-               _zed_log_aux(LOG_ERR, fmt, vargs);
-               va_end(vargs);
-       }
-       exit(EXIT_FAILURE);
-}
diff --git a/zfs/cmd/zed/zed_log.h b/zfs/cmd/zed/zed_log.h
deleted file mode 100644 (file)
index a03a4f5..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#ifndef        ZED_LOG_H
-#define        ZED_LOG_H
-
-#include <syslog.h>
-
-void zed_log_init(const char *identity);
-
-void zed_log_fini(void);
-
-void zed_log_pipe_open(void);
-
-void zed_log_pipe_close_reads(void);
-
-void zed_log_pipe_close_writes(void);
-
-void zed_log_pipe_wait(void);
-
-void zed_log_stderr_open(int priority);
-
-void zed_log_stderr_close(void);
-
-void zed_log_syslog_open(int facility);
-
-void zed_log_syslog_close(void);
-
-void zed_log_msg(int priority, const char *fmt, ...);
-
-void zed_log_die(const char *fmt, ...);
-
-#endif /* !ZED_LOG_H */
diff --git a/zfs/cmd/zed/zed_strings.c b/zfs/cmd/zed/zed_strings.c
deleted file mode 100644 (file)
index 6942e9f..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#include <assert.h>
-#include <errno.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/avl.h>
-#include <sys/sysmacros.h>
-#include "zed_strings.h"
-
-struct zed_strings {
-       avl_tree_t tree;
-       avl_node_t *iteratorp;
-};
-
-struct zed_strings_node {
-       avl_node_t node;
-       char *key;
-       char *val;
-};
-
-typedef struct zed_strings_node zed_strings_node_t;
-
-/*
- * Compare zed_strings_node_t nodes [x1] and [x2].
- * As required for the AVL tree, return -1 for <, 0 for ==, and +1 for >.
- */
-static int
-_zed_strings_node_compare(const void *x1, const void *x2)
-{
-       const char *s1;
-       const char *s2;
-       int rv;
-
-       assert(x1 != NULL);
-       assert(x2 != NULL);
-
-       s1 = ((const zed_strings_node_t *) x1)->key;
-       assert(s1 != NULL);
-       s2 = ((const zed_strings_node_t *) x2)->key;
-       assert(s2 != NULL);
-       rv = strcmp(s1, s2);
-
-       if (rv < 0)
-               return (-1);
-
-       if (rv > 0)
-               return (1);
-
-       return (0);
-}
-
-/*
- * Return a new string container, or NULL on error.
- */
-zed_strings_t *
-zed_strings_create(void)
-{
-       zed_strings_t *zsp;
-
-       zsp = calloc(1, sizeof (*zsp));
-       if (!zsp)
-               return (NULL);
-
-       avl_create(&zsp->tree, _zed_strings_node_compare,
-           sizeof (zed_strings_node_t), offsetof(zed_strings_node_t, node));
-
-       zsp->iteratorp = NULL;
-       return (zsp);
-}
-
-/*
- * Destroy the string node [np].
- */
-static void
-_zed_strings_node_destroy(zed_strings_node_t *np)
-{
-       if (!np)
-               return;
-
-       if (np->key) {
-               if (np->key != np->val)
-                       free(np->key);
-               np->key = NULL;
-       }
-       if (np->val) {
-               free(np->val);
-               np->val = NULL;
-       }
-       free(np);
-}
-
-/*
- * Return a new string node for storing the string [val], or NULL on error.
- * If [key] is specified, it will be used to index the node; otherwise,
- * the string [val] will be used.
- */
-zed_strings_node_t *
-_zed_strings_node_create(const char *key, const char *val)
-{
-       zed_strings_node_t *np;
-
-       assert(val != NULL);
-
-       np = calloc(1, sizeof (*np));
-       if (!np)
-               return (NULL);
-
-       np->val = strdup(val);
-       if (!np->val)
-               goto nomem;
-
-       if (key) {
-               np->key = strdup(key);
-               if (!np->key)
-                       goto nomem;
-       } else {
-               np->key = np->val;
-       }
-       return (np);
-
-nomem:
-       _zed_strings_node_destroy(np);
-       return (NULL);
-}
-
-/*
- * Destroy the string container [zsp] and all nodes within.
- */
-void
-zed_strings_destroy(zed_strings_t *zsp)
-{
-       void *cookie;
-       zed_strings_node_t *np;
-
-       if (!zsp)
-               return;
-
-       cookie = NULL;
-       while ((np = avl_destroy_nodes(&zsp->tree, &cookie)))
-               _zed_strings_node_destroy(np);
-
-       avl_destroy(&zsp->tree);
-       free(zsp);
-}
-
-/*
- * Add a copy of the string [s] indexed by [key] to the container [zsp].
- * If [key] already exists within the container [zsp], it will be replaced
- * with the new string [s].
- * If [key] is NULL, the string [s] will be used as the key.
- * Return 0 on success, or -1 on error.
- */
-int
-zed_strings_add(zed_strings_t *zsp, const char *key, const char *s)
-{
-       zed_strings_node_t *newp, *oldp;
-
-       if (!zsp || !s) {
-               errno = EINVAL;
-               return (-1);
-       }
-       if (key == s)
-               key = NULL;
-
-       newp = _zed_strings_node_create(key, s);
-       if (!newp)
-               return (-1);
-
-       oldp = avl_find(&zsp->tree, newp, NULL);
-       if (oldp) {
-               avl_remove(&zsp->tree, oldp);
-               _zed_strings_node_destroy(oldp);
-       }
-       avl_add(&zsp->tree, newp);
-       return (0);
-}
-
-/*
- * Return the first string in container [zsp].
- * Return NULL if there are no strings, or on error.
- * This can be called multiple times to re-traverse [zsp].
- * XXX: Not thread-safe.
- */
-const char *
-zed_strings_first(zed_strings_t *zsp)
-{
-       if (!zsp) {
-               errno = EINVAL;
-               return (NULL);
-       }
-       zsp->iteratorp = avl_first(&zsp->tree);
-       if (!zsp->iteratorp)
-               return (NULL);
-
-       return (((zed_strings_node_t *) zsp->iteratorp)->val);
-
-}
-
-/*
- * Return the next string in container [zsp].
- * Return NULL after the last string, or on error.
- * This must be called after zed_strings_first().
- * XXX: Not thread-safe.
- */
-const char *
-zed_strings_next(zed_strings_t *zsp)
-{
-       if (!zsp) {
-               errno = EINVAL;
-               return (NULL);
-       }
-       if (!zsp->iteratorp)
-               return (NULL);
-
-       zsp->iteratorp = AVL_NEXT(&zsp->tree, zsp->iteratorp);
-       if (!zsp->iteratorp)
-               return (NULL);
-
-       return (((zed_strings_node_t *)zsp->iteratorp)->val);
-}
-
-/*
- * Return the number of strings in container [zsp], or -1 on error.
- */
-int
-zed_strings_count(zed_strings_t *zsp)
-{
-       if (!zsp) {
-               errno = EINVAL;
-               return (-1);
-       }
-       return (avl_numnodes(&zsp->tree));
-}
diff --git a/zfs/cmd/zed/zed_strings.h b/zfs/cmd/zed/zed_strings.h
deleted file mode 100644 (file)
index 6177c76..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * This file is part of the ZFS Event Daemon (ZED)
- * for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
- * Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
- * Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
- * Refer to the ZoL git commit log for authoritative copyright attribution.
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License Version 1.0 (CDDL-1.0).
- * You can obtain a copy of the license from the top-level file
- * "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
- * You may not use this file except in compliance with the license.
- */
-
-#ifndef        ZED_STRINGS_H
-#define        ZED_STRINGS_H
-
-typedef struct zed_strings zed_strings_t;
-
-zed_strings_t * zed_strings_create(void);
-
-void zed_strings_destroy(zed_strings_t *zsp);
-
-int zed_strings_add(zed_strings_t *zsp, const char *key, const char *s);
-
-const char * zed_strings_first(zed_strings_t *zsp);
-
-const char * zed_strings_next(zed_strings_t *zsp);
-
-int zed_strings_count(zed_strings_t *zsp);
-
-#endif /* !ZED_STRINGS_H */
diff --git a/zfs/cmd/zfs/.gitignore b/zfs/cmd/zfs/.gitignore
deleted file mode 100644 (file)
index 0fd9cc6..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zfs
diff --git a/zfs/cmd/zfs/Makefile.am b/zfs/cmd/zfs/Makefile.am
deleted file mode 100644 (file)
index 3cac73d..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-sbin_PROGRAMS = zfs
-
-zfs_SOURCES = \
-       zfs_iter.c \
-       zfs_iter.h \
-       zfs_main.c \
-       zfs_util.h
-
-zfs_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
-
-zfs_LDADD += $(ZLIB)
-zfs_LDFLAGS = -pthread
diff --git a/zfs/cmd/zfs/Makefile.in b/zfs/cmd/zfs/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zfs/zfs_iter.c b/zfs/cmd/zfs/zfs_iter.c
deleted file mode 100644 (file)
index 2c16f69..0000000
+++ /dev/null
@@ -1,496 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
- */
-
-#include <libintl.h>
-#include <libuutil.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-
-#include <libzfs.h>
-
-#include "zfs_util.h"
-#include "zfs_iter.h"
-
-/*
- * This is a private interface used to gather up all the datasets specified on
- * the command line so that we can iterate over them in order.
- *
- * First, we iterate over all filesystems, gathering them together into an
- * AVL tree.  We report errors for any explicitly specified datasets
- * that we couldn't open.
- *
- * When finished, we have an AVL tree of ZFS handles.  We go through and execute
- * the provided callback for each one, passing whatever data the user supplied.
- */
-
-typedef struct zfs_node {
-       zfs_handle_t    *zn_handle;
-       uu_avl_node_t   zn_avlnode;
-} zfs_node_t;
-
-typedef struct callback_data {
-       uu_avl_t                *cb_avl;
-       int                     cb_flags;
-       zfs_type_t              cb_types;
-       zfs_sort_column_t       *cb_sortcol;
-       zprop_list_t            **cb_proplist;
-       int                     cb_depth_limit;
-       int                     cb_depth;
-       uint8_t                 cb_props_table[ZFS_NUM_PROPS];
-} callback_data_t;
-
-uu_avl_pool_t *avl_pool;
-
-/*
- * Include snaps if they were requested or if this a zfs list where types
- * were not specified and the "listsnapshots" property is set on this pool.
- */
-static boolean_t
-zfs_include_snapshots(zfs_handle_t *zhp, callback_data_t *cb)
-{
-       zpool_handle_t *zph;
-
-       if ((cb->cb_flags & ZFS_ITER_PROP_LISTSNAPS) == 0)
-               return (cb->cb_types & ZFS_TYPE_SNAPSHOT);
-
-       zph = zfs_get_pool_handle(zhp);
-       return (zpool_get_prop_int(zph, ZPOOL_PROP_LISTSNAPS, NULL));
-}
-
-/*
- * Called for each dataset.  If the object is of an appropriate type,
- * add it to the avl tree and recurse over any children as necessary.
- */
-static int
-zfs_callback(zfs_handle_t *zhp, void *data)
-{
-       callback_data_t *cb = data;
-       boolean_t dontclose = B_FALSE;
-       boolean_t include_snaps = zfs_include_snapshots(zhp, cb);
-       boolean_t include_bmarks = (cb->cb_types & ZFS_TYPE_BOOKMARK);
-
-       if ((zfs_get_type(zhp) & cb->cb_types) ||
-           ((zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) && include_snaps)) {
-               uu_avl_index_t idx;
-               zfs_node_t *node = safe_malloc(sizeof (zfs_node_t));
-
-               node->zn_handle = zhp;
-               uu_avl_node_init(node, &node->zn_avlnode, avl_pool);
-               if (uu_avl_find(cb->cb_avl, node, cb->cb_sortcol,
-                   &idx) == NULL) {
-                       if (cb->cb_proplist) {
-                               if ((*cb->cb_proplist) &&
-                                   !(*cb->cb_proplist)->pl_all)
-                                       zfs_prune_proplist(zhp,
-                                           cb->cb_props_table);
-
-                               if (zfs_expand_proplist(zhp, cb->cb_proplist,
-                                   (cb->cb_flags & ZFS_ITER_RECVD_PROPS),
-                                   (cb->cb_flags & ZFS_ITER_LITERAL_PROPS))
-                                   != 0) {
-                                       free(node);
-                                       return (-1);
-                               }
-                       }
-                       uu_avl_insert(cb->cb_avl, node, idx);
-                       dontclose = B_TRUE;
-               } else {
-                       free(node);
-               }
-       }
-
-       /*
-        * Recurse if necessary.
-        */
-       if (cb->cb_flags & ZFS_ITER_RECURSE &&
-           ((cb->cb_flags & ZFS_ITER_DEPTH_LIMIT) == 0 ||
-           cb->cb_depth < cb->cb_depth_limit)) {
-               cb->cb_depth++;
-               if (zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM)
-                       (void) zfs_iter_filesystems(zhp, zfs_callback, data);
-               if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
-                   ZFS_TYPE_BOOKMARK)) == 0) && include_snaps)
-                       (void) zfs_iter_snapshots(zhp,
-                           (cb->cb_flags & ZFS_ITER_SIMPLE) != 0, zfs_callback,
-                           data);
-               if (((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT |
-                   ZFS_TYPE_BOOKMARK)) == 0) && include_bmarks)
-                       (void) zfs_iter_bookmarks(zhp, zfs_callback, data);
-               cb->cb_depth--;
-       }
-
-       if (!dontclose)
-               zfs_close(zhp);
-
-       return (0);
-}
-
-int
-zfs_add_sort_column(zfs_sort_column_t **sc, const char *name,
-    boolean_t reverse)
-{
-       zfs_sort_column_t *col;
-       zfs_prop_t prop;
-
-       if ((prop = zfs_name_to_prop(name)) == ZPROP_INVAL &&
-           !zfs_prop_user(name))
-               return (-1);
-
-       col = safe_malloc(sizeof (zfs_sort_column_t));
-
-       col->sc_prop = prop;
-       col->sc_reverse = reverse;
-       if (prop == ZPROP_INVAL) {
-               col->sc_user_prop = safe_malloc(strlen(name) + 1);
-               (void) strcpy(col->sc_user_prop, name);
-       }
-
-       if (*sc == NULL) {
-               col->sc_last = col;
-               *sc = col;
-       } else {
-               (*sc)->sc_last->sc_next = col;
-               (*sc)->sc_last = col;
-       }
-
-       return (0);
-}
-
-void
-zfs_free_sort_columns(zfs_sort_column_t *sc)
-{
-       zfs_sort_column_t *col;
-
-       while (sc != NULL) {
-               col = sc->sc_next;
-               free(sc->sc_user_prop);
-               free(sc);
-               sc = col;
-       }
-}
-
-int
-zfs_sort_only_by_name(const zfs_sort_column_t *sc)
-{
-       return (sc != NULL && sc->sc_next == NULL &&
-           sc->sc_prop == ZFS_PROP_NAME);
-}
-
-/* ARGSUSED */
-static int
-zfs_compare(const void *larg, const void *rarg, void *unused)
-{
-       zfs_handle_t *l = ((zfs_node_t *)larg)->zn_handle;
-       zfs_handle_t *r = ((zfs_node_t *)rarg)->zn_handle;
-       const char *lname = zfs_get_name(l);
-       const char *rname = zfs_get_name(r);
-       char *lat, *rat;
-       uint64_t lcreate, rcreate;
-       int ret;
-
-       lat = (char *)strchr(lname, '@');
-       rat = (char *)strchr(rname, '@');
-
-       if (lat != NULL)
-               *lat = '\0';
-       if (rat != NULL)
-               *rat = '\0';
-
-       ret = strcmp(lname, rname);
-       if (ret == 0) {
-               /*
-                * If we're comparing a dataset to one of its snapshots, we
-                * always make the full dataset first.
-                */
-               if (lat == NULL) {
-                       ret = -1;
-               } else if (rat == NULL) {
-                       ret = 1;
-               } else {
-                       /*
-                        * If we have two snapshots from the same dataset, then
-                        * we want to sort them according to creation time.  We
-                        * use the hidden CREATETXG property to get an absolute
-                        * ordering of snapshots.
-                        */
-                       lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG);
-                       rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG);
-
-                       /*
-                        * Both lcreate and rcreate being 0 means we don't have
-                        * properties and we should compare full name.
-                        */
-                       if (lcreate == 0 && rcreate == 0)
-                               ret = strcmp(lat + 1, rat + 1);
-                       else if (lcreate < rcreate)
-                               ret = -1;
-                       else if (lcreate > rcreate)
-                               ret = 1;
-               }
-       }
-
-       if (lat != NULL)
-               *lat = '@';
-       if (rat != NULL)
-               *rat = '@';
-
-       return (ret);
-}
-
-/*
- * Sort datasets by specified columns.
- *
- * o  Numeric types sort in ascending order.
- * o  String types sort in alphabetical order.
- * o  Types inappropriate for a row sort that row to the literal
- *    bottom, regardless of the specified ordering.
- *
- * If no sort columns are specified, or two datasets compare equally
- * across all specified columns, they are sorted alphabetically by name
- * with snapshots grouped under their parents.
- */
-static int
-zfs_sort(const void *larg, const void *rarg, void *data)
-{
-       zfs_handle_t *l = ((zfs_node_t *)larg)->zn_handle;
-       zfs_handle_t *r = ((zfs_node_t *)rarg)->zn_handle;
-       zfs_sort_column_t *sc = (zfs_sort_column_t *)data;
-       zfs_sort_column_t *psc;
-
-       for (psc = sc; psc != NULL; psc = psc->sc_next) {
-               char lbuf[ZFS_MAXPROPLEN], rbuf[ZFS_MAXPROPLEN];
-               char *lstr, *rstr;
-               uint64_t lnum, rnum;
-               boolean_t lvalid, rvalid;
-               int ret = 0;
-
-               /*
-                * We group the checks below the generic code.  If 'lstr' and
-                * 'rstr' are non-NULL, then we do a string based comparison.
-                * Otherwise, we compare 'lnum' and 'rnum'.
-                */
-               lstr = rstr = NULL;
-               if (psc->sc_prop == ZPROP_INVAL) {
-                       nvlist_t *luser, *ruser;
-                       nvlist_t *lval, *rval;
-
-                       luser = zfs_get_user_props(l);
-                       ruser = zfs_get_user_props(r);
-
-                       lvalid = (nvlist_lookup_nvlist(luser,
-                           psc->sc_user_prop, &lval) == 0);
-                       rvalid = (nvlist_lookup_nvlist(ruser,
-                           psc->sc_user_prop, &rval) == 0);
-
-                       if (lvalid)
-                               verify(nvlist_lookup_string(lval,
-                                   ZPROP_VALUE, &lstr) == 0);
-                       if (rvalid)
-                               verify(nvlist_lookup_string(rval,
-                                   ZPROP_VALUE, &rstr) == 0);
-               } else if (psc->sc_prop == ZFS_PROP_NAME) {
-                       lvalid = rvalid = B_TRUE;
-
-                       (void) strlcpy(lbuf, zfs_get_name(l), sizeof (lbuf));
-                       (void) strlcpy(rbuf, zfs_get_name(r), sizeof (rbuf));
-
-                       lstr = lbuf;
-                       rstr = rbuf;
-               } else if (zfs_prop_is_string(psc->sc_prop)) {
-                       lvalid = (zfs_prop_get(l, psc->sc_prop, lbuf,
-                           sizeof (lbuf), NULL, NULL, 0, B_TRUE) == 0);
-                       rvalid = (zfs_prop_get(r, psc->sc_prop, rbuf,
-                           sizeof (rbuf), NULL, NULL, 0, B_TRUE) == 0);
-
-                       lstr = lbuf;
-                       rstr = rbuf;
-               } else {
-                       lvalid = zfs_prop_valid_for_type(psc->sc_prop,
-                           zfs_get_type(l), B_FALSE);
-                       rvalid = zfs_prop_valid_for_type(psc->sc_prop,
-                           zfs_get_type(r), B_FALSE);
-
-                       if (lvalid)
-                               (void) zfs_prop_get_numeric(l, psc->sc_prop,
-                                   &lnum, NULL, NULL, 0);
-                       if (rvalid)
-                               (void) zfs_prop_get_numeric(r, psc->sc_prop,
-                                   &rnum, NULL, NULL, 0);
-               }
-
-               if (!lvalid && !rvalid)
-                       continue;
-               else if (!lvalid)
-                       return (1);
-               else if (!rvalid)
-                       return (-1);
-
-               if (lstr)
-                       ret = strcmp(lstr, rstr);
-               else if (lnum < rnum)
-                       ret = -1;
-               else if (lnum > rnum)
-                       ret = 1;
-
-               if (ret != 0) {
-                       if (psc->sc_reverse == B_TRUE)
-                               ret = (ret < 0) ? 1 : -1;
-                       return (ret);
-               }
-       }
-
-       return (zfs_compare(larg, rarg, NULL));
-}
-
-int
-zfs_for_each(int argc, char **argv, int flags, zfs_type_t types,
-    zfs_sort_column_t *sortcol, zprop_list_t **proplist, int limit,
-    zfs_iter_f callback, void *data)
-{
-       callback_data_t cb = {0};
-       int ret = 0;
-       zfs_node_t *node;
-       uu_avl_walk_t *walk;
-
-       avl_pool = uu_avl_pool_create("zfs_pool", sizeof (zfs_node_t),
-           offsetof(zfs_node_t, zn_avlnode), zfs_sort, UU_DEFAULT);
-
-       if (avl_pool == NULL)
-               nomem();
-
-       cb.cb_sortcol = sortcol;
-       cb.cb_flags = flags;
-       cb.cb_proplist = proplist;
-       cb.cb_types = types;
-       cb.cb_depth_limit = limit;
-       /*
-        * If cb_proplist is provided then in the zfs_handles created we
-        * retain only those properties listed in cb_proplist and sortcol.
-        * The rest are pruned. So, the caller should make sure that no other
-        * properties other than those listed in cb_proplist/sortcol are
-        * accessed.
-        *
-        * If cb_proplist is NULL then we retain all the properties.  We
-        * always retain the zoned property, which some other properties
-        * need (userquota & friends), and the createtxg property, which
-        * we need to sort snapshots.
-        */
-       if (cb.cb_proplist && *cb.cb_proplist) {
-               zprop_list_t *p = *cb.cb_proplist;
-
-               while (p) {
-                       if (p->pl_prop >= ZFS_PROP_TYPE &&
-                           p->pl_prop < ZFS_NUM_PROPS) {
-                               cb.cb_props_table[p->pl_prop] = B_TRUE;
-                       }
-                       p = p->pl_next;
-               }
-
-               while (sortcol) {
-                       if (sortcol->sc_prop >= ZFS_PROP_TYPE &&
-                           sortcol->sc_prop < ZFS_NUM_PROPS) {
-                               cb.cb_props_table[sortcol->sc_prop] = B_TRUE;
-                       }
-                       sortcol = sortcol->sc_next;
-               }
-
-               cb.cb_props_table[ZFS_PROP_ZONED] = B_TRUE;
-               cb.cb_props_table[ZFS_PROP_CREATETXG] = B_TRUE;
-       } else {
-               (void) memset(cb.cb_props_table, B_TRUE,
-                   sizeof (cb.cb_props_table));
-       }
-
-       if ((cb.cb_avl = uu_avl_create(avl_pool, NULL, UU_DEFAULT)) == NULL)
-               nomem();
-
-       if (argc == 0) {
-               /*
-                * If given no arguments, iterate over all datasets.
-                */
-               cb.cb_flags |= ZFS_ITER_RECURSE;
-               ret = zfs_iter_root(g_zfs, zfs_callback, &cb);
-       } else {
-               int i;
-               zfs_handle_t *zhp;
-               zfs_type_t argtype;
-
-               /*
-                * If we're recursive, then we always allow filesystems as
-                * arguments.  If we also are interested in snapshots, then we
-                * can take volumes as well.
-                */
-               argtype = types;
-               if (flags & ZFS_ITER_RECURSE) {
-                       argtype |= ZFS_TYPE_FILESYSTEM;
-                       if (types & ZFS_TYPE_SNAPSHOT)
-                               argtype |= ZFS_TYPE_VOLUME;
-               }
-
-               for (i = 0; i < argc; i++) {
-                       if (flags & ZFS_ITER_ARGS_CAN_BE_PATHS) {
-                               zhp = zfs_path_to_zhandle(g_zfs, argv[i],
-                                   argtype);
-                       } else {
-                               zhp = zfs_open(g_zfs, argv[i], argtype);
-                       }
-                       if (zhp != NULL)
-                               ret |= zfs_callback(zhp, &cb);
-                       else
-                               ret = 1;
-               }
-       }
-
-       /*
-        * At this point we've got our AVL tree full of zfs handles, so iterate
-        * over each one and execute the real user callback.
-        */
-       for (node = uu_avl_first(cb.cb_avl); node != NULL;
-           node = uu_avl_next(cb.cb_avl, node))
-               ret |= callback(node->zn_handle, data);
-
-       /*
-        * Finally, clean up the AVL tree.
-        */
-       if ((walk = uu_avl_walk_start(cb.cb_avl, UU_WALK_ROBUST)) == NULL)
-               nomem();
-
-       while ((node = uu_avl_walk_next(walk)) != NULL) {
-               uu_avl_remove(cb.cb_avl, node);
-               zfs_close(node->zn_handle);
-               free(node);
-       }
-
-       uu_avl_walk_end(walk);
-       uu_avl_destroy(cb.cb_avl);
-       uu_avl_pool_destroy(avl_pool);
-
-       return (ret);
-}
diff --git a/zfs/cmd/zfs/zfs_iter.h b/zfs/cmd/zfs/zfs_iter.h
deleted file mode 100644 (file)
index 2697fbd..0000000
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
- */
-
-#ifndef        ZFS_ITER_H
-#define        ZFS_ITER_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct zfs_sort_column {
-       struct zfs_sort_column  *sc_next;
-       struct zfs_sort_column  *sc_last;
-       zfs_prop_t              sc_prop;
-       char                    *sc_user_prop;
-       boolean_t               sc_reverse;
-} zfs_sort_column_t;
-
-#define        ZFS_ITER_RECURSE           (1 << 0)
-#define        ZFS_ITER_ARGS_CAN_BE_PATHS (1 << 1)
-#define        ZFS_ITER_PROP_LISTSNAPS    (1 << 2)
-#define        ZFS_ITER_DEPTH_LIMIT       (1 << 3)
-#define        ZFS_ITER_RECVD_PROPS       (1 << 4)
-#define        ZFS_ITER_LITERAL_PROPS     (1 << 5)
-#define        ZFS_ITER_SIMPLE            (1 << 6)
-
-int zfs_for_each(int, char **, int options, zfs_type_t,
-    zfs_sort_column_t *, zprop_list_t **, int, zfs_iter_f, void *);
-int zfs_add_sort_column(zfs_sort_column_t **, const char *, boolean_t);
-void zfs_free_sort_columns(zfs_sort_column_t *);
-int zfs_sort_only_by_name(const zfs_sort_column_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZFS_ITER_H */
diff --git a/zfs/cmd/zfs/zfs_main.c b/zfs/cmd/zfs/zfs_main.c
deleted file mode 100644 (file)
index 6fb3559..0000000
+++ /dev/null
@@ -1,6750 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
- * Copyright (c) 2013 Steven Hartland.  All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <libgen.h>
-#include <libintl.h>
-#include <libuutil.h>
-#include <libnvpair.h>
-#include <locale.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <zone.h>
-#include <grp.h>
-#include <pwd.h>
-#include <signal.h>
-#include <sys/list.h>
-#include <sys/mkdev.h>
-#include <sys/mntent.h>
-#include <sys/mnttab.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-#include <sys/fs/zfs.h>
-#include <sys/types.h>
-#include <time.h>
-
-#include <libzfs.h>
-#include <libzfs_core.h>
-#include <zfs_prop.h>
-#include <zfs_deleg.h>
-#include <libuutil.h>
-#ifdef HAVE_IDMAP
-#include <aclutils.h>
-#include <directory.h>
-#endif /* HAVE_IDMAP */
-
-#include "zfs_iter.h"
-#include "zfs_util.h"
-#include "zfs_comutil.h"
-#include "libzfs_impl.h"
-
-libzfs_handle_t *g_zfs;
-
-static FILE *mnttab_file;
-static char history_str[HIS_MAX_RECORD_LEN];
-static boolean_t log_history = B_TRUE;
-
-static int zfs_do_clone(int argc, char **argv);
-static int zfs_do_create(int argc, char **argv);
-static int zfs_do_destroy(int argc, char **argv);
-static int zfs_do_get(int argc, char **argv);
-static int zfs_do_inherit(int argc, char **argv);
-static int zfs_do_list(int argc, char **argv);
-static int zfs_do_mount(int argc, char **argv);
-static int zfs_do_rename(int argc, char **argv);
-static int zfs_do_rollback(int argc, char **argv);
-static int zfs_do_set(int argc, char **argv);
-static int zfs_do_upgrade(int argc, char **argv);
-static int zfs_do_snapshot(int argc, char **argv);
-static int zfs_do_unmount(int argc, char **argv);
-static int zfs_do_share(int argc, char **argv);
-static int zfs_do_unshare(int argc, char **argv);
-static int zfs_do_send(int argc, char **argv);
-static int zfs_do_receive(int argc, char **argv);
-static int zfs_do_promote(int argc, char **argv);
-static int zfs_do_userspace(int argc, char **argv);
-static int zfs_do_allow(int argc, char **argv);
-static int zfs_do_unallow(int argc, char **argv);
-static int zfs_do_hold(int argc, char **argv);
-static int zfs_do_holds(int argc, char **argv);
-static int zfs_do_release(int argc, char **argv);
-static int zfs_do_diff(int argc, char **argv);
-static int zfs_do_bookmark(int argc, char **argv);
-
-/*
- * Enable a reasonable set of defaults for libumem debugging on DEBUG builds.
- */
-
-#ifdef DEBUG
-const char *
-_umem_debug_init(void)
-{
-       return ("default,verbose"); /* $UMEM_DEBUG setting */
-}
-
-const char *
-_umem_logging_init(void)
-{
-       return ("fail,contents"); /* $UMEM_LOGGING setting */
-}
-#endif
-
-typedef enum {
-       HELP_CLONE,
-       HELP_CREATE,
-       HELP_DESTROY,
-       HELP_GET,
-       HELP_INHERIT,
-       HELP_UPGRADE,
-       HELP_LIST,
-       HELP_MOUNT,
-       HELP_PROMOTE,
-       HELP_RECEIVE,
-       HELP_RENAME,
-       HELP_ROLLBACK,
-       HELP_SEND,
-       HELP_SET,
-       HELP_SHARE,
-       HELP_SNAPSHOT,
-       HELP_UNMOUNT,
-       HELP_UNSHARE,
-       HELP_ALLOW,
-       HELP_UNALLOW,
-       HELP_USERSPACE,
-       HELP_GROUPSPACE,
-       HELP_HOLD,
-       HELP_HOLDS,
-       HELP_RELEASE,
-       HELP_DIFF,
-       HELP_BOOKMARK,
-} zfs_help_t;
-
-typedef struct zfs_command {
-       const char      *name;
-       int             (*func)(int argc, char **argv);
-       zfs_help_t      usage;
-} zfs_command_t;
-
-/*
- * Master command table.  Each ZFS command has a name, associated function, and
- * usage message.  The usage messages need to be internationalized, so we have
- * to have a function to return the usage message based on a command index.
- *
- * These commands are organized according to how they are displayed in the usage
- * message.  An empty command (one with a NULL name) indicates an empty line in
- * the generic usage message.
- */
-static zfs_command_t command_table[] = {
-       { "create",     zfs_do_create,          HELP_CREATE             },
-       { "destroy",    zfs_do_destroy,         HELP_DESTROY            },
-       { NULL },
-       { "snapshot",   zfs_do_snapshot,        HELP_SNAPSHOT           },
-       { "rollback",   zfs_do_rollback,        HELP_ROLLBACK           },
-       { "clone",      zfs_do_clone,           HELP_CLONE              },
-       { "promote",    zfs_do_promote,         HELP_PROMOTE            },
-       { "rename",     zfs_do_rename,          HELP_RENAME             },
-       { "bookmark",   zfs_do_bookmark,        HELP_BOOKMARK           },
-       { NULL },
-       { "list",       zfs_do_list,            HELP_LIST               },
-       { NULL },
-       { "set",        zfs_do_set,             HELP_SET                },
-       { "get",        zfs_do_get,             HELP_GET                },
-       { "inherit",    zfs_do_inherit,         HELP_INHERIT            },
-       { "upgrade",    zfs_do_upgrade,         HELP_UPGRADE            },
-       { "userspace",  zfs_do_userspace,       HELP_USERSPACE          },
-       { "groupspace", zfs_do_userspace,       HELP_GROUPSPACE         },
-       { NULL },
-       { "mount",      zfs_do_mount,           HELP_MOUNT              },
-       { "unmount",    zfs_do_unmount,         HELP_UNMOUNT            },
-       { "share",      zfs_do_share,           HELP_SHARE              },
-       { "unshare",    zfs_do_unshare,         HELP_UNSHARE            },
-       { NULL },
-       { "send",       zfs_do_send,            HELP_SEND               },
-       { "receive",    zfs_do_receive,         HELP_RECEIVE            },
-       { NULL },
-       { "allow",      zfs_do_allow,           HELP_ALLOW              },
-       { NULL },
-       { "unallow",    zfs_do_unallow,         HELP_UNALLOW            },
-       { NULL },
-       { "hold",       zfs_do_hold,            HELP_HOLD               },
-       { "holds",      zfs_do_holds,           HELP_HOLDS              },
-       { "release",    zfs_do_release,         HELP_RELEASE            },
-       { "diff",       zfs_do_diff,            HELP_DIFF               },
-};
-
-#define        NCOMMAND        (sizeof (command_table) / sizeof (command_table[0]))
-
-zfs_command_t *current_command;
-
-static const char *
-get_usage(zfs_help_t idx)
-{
-       switch (idx) {
-       case HELP_CLONE:
-               return (gettext("\tclone [-p] [-o property=value] ... "
-                   "<snapshot> <filesystem|volume>\n"));
-       case HELP_CREATE:
-               return (gettext("\tcreate [-p] [-o property=value] ... "
-                   "<filesystem>\n"
-                   "\tcreate [-ps] [-b blocksize] [-o property=value] ... "
-                   "-V <size> <volume>\n"));
-       case HELP_DESTROY:
-               return (gettext("\tdestroy [-fnpRrv] <filesystem|volume>\n"
-                   "\tdestroy [-dnpRrv] "
-                   "<filesystem|volume>@<snap>[%<snap>][,...]\n"
-                   "\tdestroy <filesystem|volume>#<bookmark>\n"));
-       case HELP_GET:
-               return (gettext("\tget [-rHp] [-d max] "
-                   "[-o \"all\" | field[,...]]\n"
-                   "\t    [-t type[,...]] [-s source[,...]]\n"
-                   "\t    <\"all\" | property[,...]> "
-                   "[filesystem|volume|snapshot] ...\n"));
-       case HELP_INHERIT:
-               return (gettext("\tinherit [-rS] <property> "
-                   "<filesystem|volume|snapshot> ...\n"));
-       case HELP_UPGRADE:
-               return (gettext("\tupgrade [-v]\n"
-                   "\tupgrade [-r] [-V version] <-a | filesystem ...>\n"));
-       case HELP_LIST:
-               return (gettext("\tlist [-Hp] [-r|-d max] [-o property[,...]] "
-                   "[-s property]...\n\t    [-S property]... [-t type[,...]] "
-                   "[filesystem|volume|snapshot] ...\n"));
-       case HELP_MOUNT:
-               return (gettext("\tmount\n"
-                   "\tmount [-vO] [-o opts] <-a | filesystem>\n"));
-       case HELP_PROMOTE:
-               return (gettext("\tpromote <clone-filesystem>\n"));
-       case HELP_RECEIVE:
-               return (gettext("\treceive [-vnFu] <filesystem|volume|"
-               "snapshot>\n"
-               "\treceive [-vnFu] [-d | -e] <filesystem>\n"));
-       case HELP_RENAME:
-               return (gettext("\trename [-f] <filesystem|volume|snapshot> "
-                   "<filesystem|volume|snapshot>\n"
-                   "\trename [-f] -p <filesystem|volume> <filesystem|volume>\n"
-                   "\trename -r <snapshot> <snapshot>\n"));
-       case HELP_ROLLBACK:
-               return (gettext("\trollback [-rRf] <snapshot>\n"));
-       case HELP_SEND:
-               return (gettext("\tsend [-DnPpRvLe] [-[iI] snapshot] "
-                   "<snapshot>\n"
-                   "\tsend [-Le] [-i snapshot|bookmark] "
-                   "<filesystem|volume|snapshot>\n"));
-       case HELP_SET:
-               return (gettext("\tset <property=value> "
-                   "<filesystem|volume|snapshot> ...\n"));
-       case HELP_SHARE:
-               return (gettext("\tshare <-a | filesystem>\n"));
-       case HELP_SNAPSHOT:
-               return (gettext("\tsnapshot|snap [-r] [-o property=value] ... "
-                   "<filesystem|volume>@<snap> ...\n"));
-       case HELP_UNMOUNT:
-               return (gettext("\tunmount [-f] "
-                   "<-a | filesystem|mountpoint>\n"));
-       case HELP_UNSHARE:
-               return (gettext("\tunshare "
-                   "<-a | filesystem|mountpoint>\n"));
-       case HELP_ALLOW:
-               return (gettext("\tallow <filesystem|volume>\n"
-                   "\tallow [-ldug] "
-                   "<\"everyone\"|user|group>[,...] <perm|@setname>[,...]\n"
-                   "\t    <filesystem|volume>\n"
-                   "\tallow [-ld] -e <perm|@setname>[,...] "
-                   "<filesystem|volume>\n"
-                   "\tallow -c <perm|@setname>[,...] <filesystem|volume>\n"
-                   "\tallow -s @setname <perm|@setname>[,...] "
-                   "<filesystem|volume>\n"));
-       case HELP_UNALLOW:
-               return (gettext("\tunallow [-rldug] "
-                   "<\"everyone\"|user|group>[,...]\n"
-                   "\t    [<perm|@setname>[,...]] <filesystem|volume>\n"
-                   "\tunallow [-rld] -e [<perm|@setname>[,...]] "
-                   "<filesystem|volume>\n"
-                   "\tunallow [-r] -c [<perm|@setname>[,...]] "
-                   "<filesystem|volume>\n"
-                   "\tunallow [-r] -s @setname [<perm|@setname>[,...]] "
-                   "<filesystem|volume>\n"));
-       case HELP_USERSPACE:
-               return (gettext("\tuserspace [-Hinp] [-o field[,...]] "
-                   "[-s field] ...\n"
-                   "\t    [-S field] ... [-t type[,...]] "
-                   "<filesystem|snapshot>\n"));
-       case HELP_GROUPSPACE:
-               return (gettext("\tgroupspace [-Hinp] [-o field[,...]] "
-                   "[-s field] ...\n"
-                   "\t    [-S field] ... [-t type[,...]] "
-                   "<filesystem|snapshot>\n"));
-       case HELP_HOLD:
-               return (gettext("\thold [-r] <tag> <snapshot> ...\n"));
-       case HELP_HOLDS:
-               return (gettext("\tholds [-r] <snapshot> ...\n"));
-       case HELP_RELEASE:
-               return (gettext("\trelease [-r] <tag> <snapshot> ...\n"));
-       case HELP_DIFF:
-               return (gettext("\tdiff [-FHt] <snapshot> "
-                   "[snapshot|filesystem]\n"));
-       case HELP_BOOKMARK:
-               return (gettext("\tbookmark <snapshot> <bookmark>\n"));
-       }
-
-       abort();
-       /* NOTREACHED */
-}
-
-void
-nomem(void)
-{
-       (void) fprintf(stderr, gettext("internal error: out of memory\n"));
-       exit(1);
-}
-
-/*
- * Utility function to guarantee malloc() success.
- */
-
-void *
-safe_malloc(size_t size)
-{
-       void *data;
-
-       if ((data = calloc(1, size)) == NULL)
-               nomem();
-
-       return (data);
-}
-
-static char *
-safe_strdup(char *str)
-{
-       char *dupstr = strdup(str);
-
-       if (dupstr == NULL)
-               nomem();
-
-       return (dupstr);
-}
-
-/*
- * Callback routine that will print out information for each of
- * the properties.
- */
-static int
-usage_prop_cb(int prop, void *cb)
-{
-       FILE *fp = cb;
-
-       (void) fprintf(fp, "\t%-15s ", zfs_prop_to_name(prop));
-
-       if (zfs_prop_readonly(prop))
-               (void) fprintf(fp, " NO    ");
-       else
-               (void) fprintf(fp, "YES    ");
-
-       if (zfs_prop_inheritable(prop))
-               (void) fprintf(fp, "  YES   ");
-       else
-               (void) fprintf(fp, "   NO   ");
-
-       if (zfs_prop_values(prop) == NULL)
-               (void) fprintf(fp, "-\n");
-       else
-               (void) fprintf(fp, "%s\n", zfs_prop_values(prop));
-
-       return (ZPROP_CONT);
-}
-
-/*
- * Display usage message.  If we're inside a command, display only the usage for
- * that command.  Otherwise, iterate over the entire command table and display
- * a complete usage message.
- */
-static void
-usage(boolean_t requested)
-{
-       int i;
-       boolean_t show_properties = B_FALSE;
-       FILE *fp = requested ? stdout : stderr;
-
-       if (current_command == NULL) {
-
-               (void) fprintf(fp, gettext("usage: zfs command args ...\n"));
-               (void) fprintf(fp,
-                   gettext("where 'command' is one of the following:\n\n"));
-
-               for (i = 0; i < NCOMMAND; i++) {
-                       if (command_table[i].name == NULL)
-                               (void) fprintf(fp, "\n");
-                       else
-                               (void) fprintf(fp, "%s",
-                                   get_usage(command_table[i].usage));
-               }
-
-               (void) fprintf(fp, gettext("\nEach dataset is of the form: "
-                   "pool/[dataset/]*dataset[@name]\n"));
-       } else {
-               (void) fprintf(fp, gettext("usage:\n"));
-               (void) fprintf(fp, "%s", get_usage(current_command->usage));
-       }
-
-       if (current_command != NULL &&
-           (strcmp(current_command->name, "set") == 0 ||
-           strcmp(current_command->name, "get") == 0 ||
-           strcmp(current_command->name, "inherit") == 0 ||
-           strcmp(current_command->name, "list") == 0))
-               show_properties = B_TRUE;
-
-       if (show_properties) {
-               (void) fprintf(fp,
-                   gettext("\nThe following properties are supported:\n"));
-
-               (void) fprintf(fp, "\n\t%-14s %s  %s   %s\n\n",
-                   "PROPERTY", "EDIT", "INHERIT", "VALUES");
-
-               /* Iterate over all properties */
-               (void) zprop_iter(usage_prop_cb, fp, B_FALSE, B_TRUE,
-                   ZFS_TYPE_DATASET);
-
-               (void) fprintf(fp, "\t%-15s ", "userused@...");
-               (void) fprintf(fp, " NO       NO   <size>\n");
-               (void) fprintf(fp, "\t%-15s ", "groupused@...");
-               (void) fprintf(fp, " NO       NO   <size>\n");
-               (void) fprintf(fp, "\t%-15s ", "userquota@...");
-               (void) fprintf(fp, "YES       NO   <size> | none\n");
-               (void) fprintf(fp, "\t%-15s ", "groupquota@...");
-               (void) fprintf(fp, "YES       NO   <size> | none\n");
-               (void) fprintf(fp, "\t%-15s ", "written@<snap>");
-               (void) fprintf(fp, " NO       NO   <size>\n");
-
-               (void) fprintf(fp, gettext("\nSizes are specified in bytes "
-                   "with standard units such as K, M, G, etc.\n"));
-               (void) fprintf(fp, gettext("\nUser-defined properties can "
-                   "be specified by using a name containing a colon (:).\n"));
-               (void) fprintf(fp, gettext("\nThe {user|group}{used|quota}@ "
-                   "properties must be appended with\n"
-                   "a user or group specifier of one of these forms:\n"
-                   "    POSIX name      (eg: \"matt\")\n"
-                   "    POSIX id        (eg: \"126829\")\n"
-                   "    SMB name@domain (eg: \"matt@sun\")\n"
-                   "    SMB SID         (eg: \"S-1-234-567-89\")\n"));
-       } else {
-               (void) fprintf(fp,
-                   gettext("\nFor the property list, run: %s\n"),
-                   "zfs set|get");
-               (void) fprintf(fp,
-                   gettext("\nFor the delegated permission list, run: %s\n"),
-                   "zfs allow|unallow");
-       }
-
-       /*
-        * See comments at end of main().
-        */
-       if (getenv("ZFS_ABORT") != NULL) {
-               (void) printf("dumping core by request\n");
-               abort();
-       }
-
-       exit(requested ? 0 : 2);
-}
-
-static int
-parseprop(nvlist_t *props)
-{
-       char *propname = optarg;
-       char *propval, *strval;
-
-       if ((propval = strchr(propname, '=')) == NULL) {
-               (void) fprintf(stderr, gettext("missing "
-                   "'=' for -o option\n"));
-               return (-1);
-       }
-       *propval = '\0';
-       propval++;
-       if (nvlist_lookup_string(props, propname, &strval) == 0) {
-               (void) fprintf(stderr, gettext("property '%s' "
-                   "specified multiple times\n"), propname);
-               return (-1);
-       }
-       if (nvlist_add_string(props, propname, propval) != 0)
-               nomem();
-       return (0);
-}
-
-static int
-parse_depth(char *opt, int *flags)
-{
-       char *tmp;
-       int depth;
-
-       depth = (int)strtol(opt, &tmp, 0);
-       if (*tmp) {
-               (void) fprintf(stderr,
-                   gettext("%s is not an integer\n"), optarg);
-               usage(B_FALSE);
-       }
-       if (depth < 0) {
-               (void) fprintf(stderr,
-                   gettext("Depth can not be negative.\n"));
-               usage(B_FALSE);
-       }
-       *flags |= (ZFS_ITER_DEPTH_LIMIT|ZFS_ITER_RECURSE);
-       return (depth);
-}
-
-#define        PROGRESS_DELAY 2                /* seconds */
-
-static char *pt_reverse = "\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b";
-static time_t pt_begin;
-static char *pt_header = NULL;
-static boolean_t pt_shown;
-
-static void
-start_progress_timer(void)
-{
-       pt_begin = time(NULL) + PROGRESS_DELAY;
-       pt_shown = B_FALSE;
-}
-
-static void
-set_progress_header(char *header)
-{
-       assert(pt_header == NULL);
-       pt_header = safe_strdup(header);
-       if (pt_shown) {
-               (void) printf("%s: ", header);
-               (void) fflush(stdout);
-       }
-}
-
-static void
-update_progress(char *update)
-{
-       if (!pt_shown && time(NULL) > pt_begin) {
-               int len = strlen(update);
-
-               (void) printf("%s: %s%*.*s", pt_header, update, len, len,
-                   pt_reverse);
-               (void) fflush(stdout);
-               pt_shown = B_TRUE;
-       } else if (pt_shown) {
-               int len = strlen(update);
-
-               (void) printf("%s%*.*s", update, len, len, pt_reverse);
-               (void) fflush(stdout);
-       }
-}
-
-static void
-finish_progress(char *done)
-{
-       if (pt_shown) {
-               (void) printf("%s\n", done);
-               (void) fflush(stdout);
-       }
-       free(pt_header);
-       pt_header = NULL;
-}
-
-static int
-zfs_mount_and_share(libzfs_handle_t *hdl, const char *dataset, zfs_type_t type)
-{
-       zfs_handle_t *zhp = NULL;
-       int ret = 0;
-
-       zhp = zfs_open(hdl, dataset, type);
-       if (zhp == NULL)
-               return (1);
-
-       /*
-        * Volumes may neither be mounted or shared.  Potentially in the
-        * future filesystems detected on these volumes could be mounted.
-        */
-       if (zfs_get_type(zhp) == ZFS_TYPE_VOLUME) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       /*
-        * Mount and/or share the new filesystem as appropriate.  We provide a
-        * verbose error message to let the user know that their filesystem was
-        * in fact created, even if we failed to mount or share it.
-        *
-        * If the user doesn't want the dataset automatically mounted, then
-        * skip the mount/share step
-        */
-       if (zfs_prop_valid_for_type(ZFS_PROP_CANMOUNT, type, B_FALSE) &&
-           zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_ON) {
-               if (zfs_mount(zhp, NULL, 0) != 0) {
-                       (void) fprintf(stderr, gettext("filesystem "
-                           "successfully created, but not mounted\n"));
-                       ret = 1;
-               } else if (zfs_share(zhp) != 0) {
-                       (void) fprintf(stderr, gettext("filesystem "
-                           "successfully created, but not shared\n"));
-                       ret = 1;
-               }
-       }
-
-       zfs_close(zhp);
-
-       return (ret);
-}
-
-/*
- * zfs clone [-p] [-o prop=value] ... <snap> <fs | vol>
- *
- * Given an existing dataset, create a writable copy whose initial contents
- * are the same as the source.  The newly created dataset maintains a
- * dependency on the original; the original cannot be destroyed so long as
- * the clone exists.
- *
- * The '-p' flag creates all the non-existing ancestors of the target first.
- */
-static int
-zfs_do_clone(int argc, char **argv)
-{
-       zfs_handle_t *zhp = NULL;
-       boolean_t parents = B_FALSE;
-       nvlist_t *props;
-       int ret = 0;
-       int c;
-
-       if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-
-       /* check options */
-       while ((c = getopt(argc, argv, "o:p")) != -1) {
-               switch (c) {
-               case 'o':
-                       if (parseprop(props))
-                               return (1);
-                       break;
-               case 'p':
-                       parents = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       goto usage;
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing source dataset "
-                   "argument\n"));
-               goto usage;
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing target dataset "
-                   "argument\n"));
-               goto usage;
-       }
-       if (argc > 2) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               goto usage;
-       }
-
-       /* open the source dataset */
-       if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_SNAPSHOT)) == NULL)
-               return (1);
-
-       if (parents && zfs_name_valid(argv[1], ZFS_TYPE_FILESYSTEM |
-           ZFS_TYPE_VOLUME)) {
-               /*
-                * Now create the ancestors of the target dataset.  If the
-                * target already exists and '-p' option was used we should not
-                * complain.
-                */
-               if (zfs_dataset_exists(g_zfs, argv[1], ZFS_TYPE_FILESYSTEM |
-                   ZFS_TYPE_VOLUME))
-                       return (0);
-               if (zfs_create_ancestors(g_zfs, argv[1]) != 0)
-                       return (1);
-       }
-
-       /* pass to libzfs */
-       ret = zfs_clone(zhp, argv[1], props);
-
-       /* create the mountpoint if necessary */
-       if (ret == 0) {
-               if (log_history) {
-                       (void) zpool_log_history(g_zfs, history_str);
-                       log_history = B_FALSE;
-               }
-
-               ret = zfs_mount_and_share(g_zfs, argv[1], ZFS_TYPE_DATASET);
-       }
-
-       zfs_close(zhp);
-       nvlist_free(props);
-
-       return (!!ret);
-
-usage:
-       if (zhp)
-               zfs_close(zhp);
-       nvlist_free(props);
-       usage(B_FALSE);
-       return (-1);
-}
-
-/*
- * zfs create [-p] [-o prop=value] ... fs
- * zfs create [-ps] [-b blocksize] [-o prop=value] ... -V vol size
- *
- * Create a new dataset.  This command can be used to create filesystems
- * and volumes.  Snapshot creation is handled by 'zfs snapshot'.
- * For volumes, the user must specify a size to be used.
- *
- * The '-s' flag applies only to volumes, and indicates that we should not try
- * to set the reservation for this volume.  By default we set a reservation
- * equal to the size for any volume.  For pools with SPA_VERSION >=
- * SPA_VERSION_REFRESERVATION, we set a refreservation instead.
- *
- * The '-p' flag creates all the non-existing ancestors of the target first.
- */
-static int
-zfs_do_create(int argc, char **argv)
-{
-       zfs_type_t type = ZFS_TYPE_FILESYSTEM;
-       uint64_t volsize = 0;
-       int c;
-       boolean_t noreserve = B_FALSE;
-       boolean_t bflag = B_FALSE;
-       boolean_t parents = B_FALSE;
-       int ret = 1;
-       nvlist_t *props;
-       uint64_t intval;
-
-       if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":V:b:so:p")) != -1) {
-               switch (c) {
-               case 'V':
-                       type = ZFS_TYPE_VOLUME;
-                       if (zfs_nicestrtonum(g_zfs, optarg, &intval) != 0) {
-                               (void) fprintf(stderr, gettext("bad volume "
-                                   "size '%s': %s\n"), optarg,
-                                   libzfs_error_description(g_zfs));
-                               goto error;
-                       }
-
-                       if (nvlist_add_uint64(props,
-                           zfs_prop_to_name(ZFS_PROP_VOLSIZE), intval) != 0)
-                               nomem();
-                       volsize = intval;
-                       break;
-               case 'p':
-                       parents = B_TRUE;
-                       break;
-               case 'b':
-                       bflag = B_TRUE;
-                       if (zfs_nicestrtonum(g_zfs, optarg, &intval) != 0) {
-                               (void) fprintf(stderr, gettext("bad volume "
-                                   "block size '%s': %s\n"), optarg,
-                                   libzfs_error_description(g_zfs));
-                               goto error;
-                       }
-
-                       if (nvlist_add_uint64(props,
-                           zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE),
-                           intval) != 0)
-                               nomem();
-                       break;
-               case 'o':
-                       if (parseprop(props))
-                               goto error;
-                       break;
-               case 's':
-                       noreserve = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing size "
-                           "argument\n"));
-                       goto badusage;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       goto badusage;
-               }
-       }
-
-       if ((bflag || noreserve) && type != ZFS_TYPE_VOLUME) {
-               (void) fprintf(stderr, gettext("'-s' and '-b' can only be "
-                   "used when creating a volume\n"));
-               goto badusage;
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc == 0) {
-               (void) fprintf(stderr, gettext("missing %s argument\n"),
-                   zfs_type_to_name(type));
-               goto badusage;
-       }
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               goto badusage;
-       }
-
-       if (type == ZFS_TYPE_VOLUME && !noreserve) {
-               zpool_handle_t *zpool_handle;
-               uint64_t spa_version;
-               char *p;
-               zfs_prop_t resv_prop;
-               char *strval;
-
-               if ((p = strchr(argv[0], '/')))
-                       *p = '\0';
-               zpool_handle = zpool_open(g_zfs, argv[0]);
-               if (p != NULL)
-                       *p = '/';
-               if (zpool_handle == NULL)
-                       goto error;
-               spa_version = zpool_get_prop_int(zpool_handle,
-                   ZPOOL_PROP_VERSION, NULL);
-               zpool_close(zpool_handle);
-               if (spa_version >= SPA_VERSION_REFRESERVATION)
-                       resv_prop = ZFS_PROP_REFRESERVATION;
-               else
-                       resv_prop = ZFS_PROP_RESERVATION;
-               volsize = zvol_volsize_to_reservation(volsize, props);
-
-               if (nvlist_lookup_string(props, zfs_prop_to_name(resv_prop),
-                   &strval) != 0) {
-                       if (nvlist_add_uint64(props,
-                           zfs_prop_to_name(resv_prop), volsize) != 0) {
-                               nvlist_free(props);
-                               nomem();
-                       }
-               }
-       }
-
-       if (parents && zfs_name_valid(argv[0], type)) {
-               /*
-                * Now create the ancestors of target dataset.  If the target
-                * already exists and '-p' option was used we should not
-                * complain.
-                */
-               if (zfs_dataset_exists(g_zfs, argv[0], type)) {
-                       ret = 0;
-                       goto error;
-               }
-               if (zfs_create_ancestors(g_zfs, argv[0]) != 0)
-                       goto error;
-       }
-
-       /* pass to libzfs */
-       if (zfs_create(g_zfs, argv[0], type, props) != 0)
-               goto error;
-
-       if (log_history) {
-               (void) zpool_log_history(g_zfs, history_str);
-               log_history = B_FALSE;
-       }
-
-       ret = zfs_mount_and_share(g_zfs, argv[0], ZFS_TYPE_DATASET);
-error:
-       nvlist_free(props);
-       return (ret);
-badusage:
-       nvlist_free(props);
-       usage(B_FALSE);
-       return (2);
-}
-
-/*
- * zfs destroy [-rRf] <fs, vol>
- * zfs destroy [-rRd] <snap>
- *
- *     -r      Recursively destroy all children
- *     -R      Recursively destroy all dependents, including clones
- *     -f      Force unmounting of any dependents
- *     -d      If we can't destroy now, mark for deferred destruction
- *
- * Destroys the given dataset.  By default, it will unmount any filesystems,
- * and refuse to destroy a dataset that has any dependents.  A dependent can
- * either be a child, or a clone of a child.
- */
-typedef struct destroy_cbdata {
-       boolean_t       cb_first;
-       boolean_t       cb_force;
-       boolean_t       cb_recurse;
-       boolean_t       cb_error;
-       boolean_t       cb_doclones;
-       zfs_handle_t    *cb_target;
-       boolean_t       cb_defer_destroy;
-       boolean_t       cb_verbose;
-       boolean_t       cb_parsable;
-       boolean_t       cb_dryrun;
-       nvlist_t        *cb_nvl;
-       nvlist_t        *cb_batchedsnaps;
-
-       /* first snap in contiguous run */
-       char            *cb_firstsnap;
-       /* previous snap in contiguous run */
-       char            *cb_prevsnap;
-       int64_t         cb_snapused;
-       char            *cb_snapspec;
-       char            *cb_bookmark;
-} destroy_cbdata_t;
-
-/*
- * Check for any dependents based on the '-r' or '-R' flags.
- */
-static int
-destroy_check_dependent(zfs_handle_t *zhp, void *data)
-{
-       destroy_cbdata_t *cbp = data;
-       const char *tname = zfs_get_name(cbp->cb_target);
-       const char *name = zfs_get_name(zhp);
-
-       if (strncmp(tname, name, strlen(tname)) == 0 &&
-           (name[strlen(tname)] == '/' || name[strlen(tname)] == '@')) {
-               /*
-                * This is a direct descendant, not a clone somewhere else in
-                * the hierarchy.
-                */
-               if (cbp->cb_recurse)
-                       goto out;
-
-               if (cbp->cb_first) {
-                       (void) fprintf(stderr, gettext("cannot destroy '%s': "
-                           "%s has children\n"),
-                           zfs_get_name(cbp->cb_target),
-                           zfs_type_to_name(zfs_get_type(cbp->cb_target)));
-                       (void) fprintf(stderr, gettext("use '-r' to destroy "
-                           "the following datasets:\n"));
-                       cbp->cb_first = B_FALSE;
-                       cbp->cb_error = B_TRUE;
-               }
-
-               (void) fprintf(stderr, "%s\n", zfs_get_name(zhp));
-       } else {
-               /*
-                * This is a clone.  We only want to report this if the '-r'
-                * wasn't specified, or the target is a snapshot.
-                */
-               if (!cbp->cb_recurse &&
-                   zfs_get_type(cbp->cb_target) != ZFS_TYPE_SNAPSHOT)
-                       goto out;
-
-               if (cbp->cb_first) {
-                       (void) fprintf(stderr, gettext("cannot destroy '%s': "
-                           "%s has dependent clones\n"),
-                           zfs_get_name(cbp->cb_target),
-                           zfs_type_to_name(zfs_get_type(cbp->cb_target)));
-                       (void) fprintf(stderr, gettext("use '-R' to destroy "
-                           "the following datasets:\n"));
-                       cbp->cb_first = B_FALSE;
-                       cbp->cb_error = B_TRUE;
-                       cbp->cb_dryrun = B_TRUE;
-               }
-
-               (void) fprintf(stderr, "%s\n", zfs_get_name(zhp));
-       }
-
-out:
-       zfs_close(zhp);
-       return (0);
-}
-
-static int
-destroy_callback(zfs_handle_t *zhp, void *data)
-{
-       destroy_cbdata_t *cb = data;
-       const char *name = zfs_get_name(zhp);
-
-       if (cb->cb_verbose) {
-               if (cb->cb_parsable) {
-                       (void) printf("destroy\t%s\n", name);
-               } else if (cb->cb_dryrun) {
-                       (void) printf(gettext("would destroy %s\n"),
-                           name);
-               } else {
-                       (void) printf(gettext("will destroy %s\n"),
-                           name);
-               }
-       }
-
-       /*
-        * Ignore pools (which we've already flagged as an error before getting
-        * here).
-        */
-       if (strchr(zfs_get_name(zhp), '/') == NULL &&
-           zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) {
-               zfs_close(zhp);
-               return (0);
-       }
-       if (cb->cb_dryrun) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       /*
-        * We batch up all contiguous snapshots (even of different
-        * filesystems) and destroy them with one ioctl.  We can't
-        * simply do all snap deletions and then all fs deletions,
-        * because we must delete a clone before its origin.
-        */
-       if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT) {
-               fnvlist_add_boolean(cb->cb_batchedsnaps, name);
-       } else {
-               int error = zfs_destroy_snaps_nvl(g_zfs,
-                   cb->cb_batchedsnaps, B_FALSE);
-               fnvlist_free(cb->cb_batchedsnaps);
-               cb->cb_batchedsnaps = fnvlist_alloc();
-
-               if (error != 0 ||
-                   zfs_unmount(zhp, NULL, cb->cb_force ? MS_FORCE : 0) != 0 ||
-                   zfs_destroy(zhp, cb->cb_defer_destroy) != 0) {
-                       zfs_close(zhp);
-                       return (-1);
-               }
-       }
-
-       zfs_close(zhp);
-       return (0);
-}
-
-static int
-destroy_print_cb(zfs_handle_t *zhp, void *arg)
-{
-       destroy_cbdata_t *cb = arg;
-       const char *name = zfs_get_name(zhp);
-       int err = 0;
-
-       if (nvlist_exists(cb->cb_nvl, name)) {
-               if (cb->cb_firstsnap == NULL)
-                       cb->cb_firstsnap = strdup(name);
-               if (cb->cb_prevsnap != NULL)
-                       free(cb->cb_prevsnap);
-               /* this snap continues the current range */
-               cb->cb_prevsnap = strdup(name);
-               if (cb->cb_firstsnap == NULL || cb->cb_prevsnap == NULL)
-                       nomem();
-               if (cb->cb_verbose) {
-                       if (cb->cb_parsable) {
-                               (void) printf("destroy\t%s\n", name);
-                       } else if (cb->cb_dryrun) {
-                               (void) printf(gettext("would destroy %s\n"),
-                                   name);
-                       } else {
-                               (void) printf(gettext("will destroy %s\n"),
-                                   name);
-                       }
-               }
-       } else if (cb->cb_firstsnap != NULL) {
-               /* end of this range */
-               uint64_t used = 0;
-               err = lzc_snaprange_space(cb->cb_firstsnap,
-                   cb->cb_prevsnap, &used);
-               cb->cb_snapused += used;
-               free(cb->cb_firstsnap);
-               cb->cb_firstsnap = NULL;
-               free(cb->cb_prevsnap);
-               cb->cb_prevsnap = NULL;
-       }
-       zfs_close(zhp);
-       return (err);
-}
-
-static int
-destroy_print_snapshots(zfs_handle_t *fs_zhp, destroy_cbdata_t *cb)
-{
-       int err;
-       assert(cb->cb_firstsnap == NULL);
-       assert(cb->cb_prevsnap == NULL);
-       err = zfs_iter_snapshots_sorted(fs_zhp, destroy_print_cb, cb);
-       if (cb->cb_firstsnap != NULL) {
-               uint64_t used = 0;
-               if (err == 0) {
-                       err = lzc_snaprange_space(cb->cb_firstsnap,
-                           cb->cb_prevsnap, &used);
-               }
-               cb->cb_snapused += used;
-               free(cb->cb_firstsnap);
-               cb->cb_firstsnap = NULL;
-               free(cb->cb_prevsnap);
-               cb->cb_prevsnap = NULL;
-       }
-       return (err);
-}
-
-static int
-snapshot_to_nvl_cb(zfs_handle_t *zhp, void *arg)
-{
-       destroy_cbdata_t *cb = arg;
-       int err = 0;
-
-       /* Check for clones. */
-       if (!cb->cb_doclones && !cb->cb_defer_destroy) {
-               cb->cb_target = zhp;
-               cb->cb_first = B_TRUE;
-               err = zfs_iter_dependents(zhp, B_TRUE,
-                   destroy_check_dependent, cb);
-       }
-
-       if (err == 0) {
-               if (nvlist_add_boolean(cb->cb_nvl, zfs_get_name(zhp)))
-                       nomem();
-       }
-       zfs_close(zhp);
-       return (err);
-}
-
-static int
-gather_snapshots(zfs_handle_t *zhp, void *arg)
-{
-       destroy_cbdata_t *cb = arg;
-       int err = 0;
-
-       err = zfs_iter_snapspec(zhp, cb->cb_snapspec, snapshot_to_nvl_cb, cb);
-       if (err == ENOENT)
-               err = 0;
-       if (err != 0)
-               goto out;
-
-       if (cb->cb_verbose) {
-               err = destroy_print_snapshots(zhp, cb);
-               if (err != 0)
-                       goto out;
-       }
-
-       if (cb->cb_recurse)
-               err = zfs_iter_filesystems(zhp, gather_snapshots, cb);
-
-out:
-       zfs_close(zhp);
-       return (err);
-}
-
-static int
-destroy_clones(destroy_cbdata_t *cb)
-{
-       nvpair_t *pair;
-       for (pair = nvlist_next_nvpair(cb->cb_nvl, NULL);
-           pair != NULL;
-           pair = nvlist_next_nvpair(cb->cb_nvl, pair)) {
-               zfs_handle_t *zhp = zfs_open(g_zfs, nvpair_name(pair),
-                   ZFS_TYPE_SNAPSHOT);
-               if (zhp != NULL) {
-                       boolean_t defer = cb->cb_defer_destroy;
-                       int err;
-
-                       /*
-                        * We can't defer destroy non-snapshots, so set it to
-                        * false while destroying the clones.
-                        */
-                       cb->cb_defer_destroy = B_FALSE;
-                       err = zfs_iter_dependents(zhp, B_FALSE,
-                           destroy_callback, cb);
-                       cb->cb_defer_destroy = defer;
-                       zfs_close(zhp);
-                       if (err != 0)
-                               return (err);
-               }
-       }
-       return (0);
-}
-
-static int
-zfs_do_destroy(int argc, char **argv)
-{
-       destroy_cbdata_t cb = { 0 };
-       int rv = 0;
-       int err = 0;
-       int c;
-       zfs_handle_t *zhp = NULL;
-       char *at, *pound;
-       zfs_type_t type = ZFS_TYPE_DATASET;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "vpndfrR")) != -1) {
-               switch (c) {
-               case 'v':
-                       cb.cb_verbose = B_TRUE;
-                       break;
-               case 'p':
-                       cb.cb_verbose = B_TRUE;
-                       cb.cb_parsable = B_TRUE;
-                       break;
-               case 'n':
-                       cb.cb_dryrun = B_TRUE;
-                       break;
-               case 'd':
-                       cb.cb_defer_destroy = B_TRUE;
-                       type = ZFS_TYPE_SNAPSHOT;
-                       break;
-               case 'f':
-                       cb.cb_force = B_TRUE;
-                       break;
-               case 'r':
-                       cb.cb_recurse = B_TRUE;
-                       break;
-               case 'R':
-                       cb.cb_recurse = B_TRUE;
-                       cb.cb_doclones = B_TRUE;
-                       break;
-               case '?':
-               default:
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc == 0) {
-               (void) fprintf(stderr, gettext("missing dataset argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       at = strchr(argv[0], '@');
-       pound = strchr(argv[0], '#');
-       if (at != NULL) {
-
-               /* Build the list of snaps to destroy in cb_nvl. */
-               cb.cb_nvl = fnvlist_alloc();
-
-               *at = '\0';
-               zhp = zfs_open(g_zfs, argv[0],
-                   ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-               if (zhp == NULL)
-                       return (1);
-
-               cb.cb_snapspec = at + 1;
-               if (gather_snapshots(zfs_handle_dup(zhp), &cb) != 0 ||
-                   cb.cb_error) {
-                       rv = 1;
-                       goto out;
-               }
-
-               if (nvlist_empty(cb.cb_nvl)) {
-                       (void) fprintf(stderr, gettext("could not find any "
-                           "snapshots to destroy; check snapshot names.\n"));
-                       rv = 1;
-                       goto out;
-               }
-
-               if (cb.cb_verbose) {
-                       char buf[16];
-                       zfs_nicenum(cb.cb_snapused, buf, sizeof (buf));
-                       if (cb.cb_parsable) {
-                               (void) printf("reclaim\t%llu\n",
-                                   (u_longlong_t)cb.cb_snapused);
-                       } else if (cb.cb_dryrun) {
-                               (void) printf(gettext("would reclaim %s\n"),
-                                   buf);
-                       } else {
-                               (void) printf(gettext("will reclaim %s\n"),
-                                   buf);
-                       }
-               }
-
-               if (!cb.cb_dryrun) {
-                       if (cb.cb_doclones) {
-                               cb.cb_batchedsnaps = fnvlist_alloc();
-                               err = destroy_clones(&cb);
-                               if (err == 0) {
-                                       err = zfs_destroy_snaps_nvl(g_zfs,
-                                           cb.cb_batchedsnaps, B_FALSE);
-                               }
-                               if (err != 0) {
-                                       rv = 1;
-                                       goto out;
-                               }
-                       }
-                       if (err == 0) {
-                               err = zfs_destroy_snaps_nvl(g_zfs, cb.cb_nvl,
-                                   cb.cb_defer_destroy);
-                       }
-               }
-
-               if (err != 0)
-                       rv = 1;
-       } else if (pound != NULL) {
-               int err;
-               nvlist_t *nvl;
-
-               if (cb.cb_dryrun) {
-                       (void) fprintf(stderr,
-                           "dryrun is not supported with bookmark\n");
-                       return (-1);
-               }
-
-               if (cb.cb_defer_destroy) {
-                       (void) fprintf(stderr,
-                           "defer destroy is not supported with bookmark\n");
-                       return (-1);
-               }
-
-               if (cb.cb_recurse) {
-                       (void) fprintf(stderr,
-                           "recursive is not supported with bookmark\n");
-                       return (-1);
-               }
-
-               if (!zfs_bookmark_exists(argv[0])) {
-                       (void) fprintf(stderr, gettext("bookmark '%s' "
-                           "does not exist.\n"), argv[0]);
-                       return (1);
-               }
-
-               nvl = fnvlist_alloc();
-               fnvlist_add_boolean(nvl, argv[0]);
-
-               err = lzc_destroy_bookmarks(nvl, NULL);
-               if (err != 0) {
-                       (void) zfs_standard_error(g_zfs, err,
-                           "cannot destroy bookmark");
-               }
-
-               nvlist_free(cb.cb_nvl);
-
-               return (err);
-       } else {
-               /* Open the given dataset */
-               if ((zhp = zfs_open(g_zfs, argv[0], type)) == NULL)
-                       return (1);
-
-               cb.cb_target = zhp;
-
-               /*
-                * Perform an explicit check for pools before going any further.
-                */
-               if (!cb.cb_recurse && strchr(zfs_get_name(zhp), '/') == NULL &&
-                   zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) {
-                       (void) fprintf(stderr, gettext("cannot destroy '%s': "
-                           "operation does not apply to pools\n"),
-                           zfs_get_name(zhp));
-                       (void) fprintf(stderr, gettext("use 'zfs destroy -r "
-                           "%s' to destroy all datasets in the pool\n"),
-                           zfs_get_name(zhp));
-                       (void) fprintf(stderr, gettext("use 'zpool destroy %s' "
-                           "to destroy the pool itself\n"), zfs_get_name(zhp));
-                       rv = 1;
-                       goto out;
-               }
-
-               /*
-                * Check for any dependents and/or clones.
-                */
-               cb.cb_first = B_TRUE;
-               if (!cb.cb_doclones &&
-                   zfs_iter_dependents(zhp, B_TRUE, destroy_check_dependent,
-                   &cb) != 0) {
-                       rv = 1;
-                       goto out;
-               }
-
-               if (cb.cb_error) {
-                       rv = 1;
-                       goto out;
-               }
-
-               cb.cb_batchedsnaps = fnvlist_alloc();
-               if (zfs_iter_dependents(zhp, B_FALSE, destroy_callback,
-                   &cb) != 0) {
-                       rv = 1;
-                       goto out;
-               }
-
-               /*
-                * Do the real thing.  The callback will close the
-                * handle regardless of whether it succeeds or not.
-                */
-               err = destroy_callback(zhp, &cb);
-               zhp = NULL;
-               if (err == 0) {
-                       err = zfs_destroy_snaps_nvl(g_zfs,
-                           cb.cb_batchedsnaps, cb.cb_defer_destroy);
-               }
-               if (err != 0)
-                       rv = 1;
-       }
-
-out:
-       fnvlist_free(cb.cb_batchedsnaps);
-       fnvlist_free(cb.cb_nvl);
-       if (zhp != NULL)
-               zfs_close(zhp);
-       return (rv);
-}
-
-static boolean_t
-is_recvd_column(zprop_get_cbdata_t *cbp)
-{
-       int i;
-       zfs_get_column_t col;
-
-       for (i = 0; i < ZFS_GET_NCOLS &&
-           (col = cbp->cb_columns[i]) != GET_COL_NONE; i++)
-               if (col == GET_COL_RECVD)
-                       return (B_TRUE);
-       return (B_FALSE);
-}
-
-/*
- * zfs get [-rHp] [-o all | field[,field]...] [-s source[,source]...]
- *     < all | property[,property]... > < fs | snap | vol > ...
- *
- *     -r      recurse over any child datasets
- *     -H      scripted mode.  Headers are stripped, and fields are separated
- *             by tabs instead of spaces.
- *     -o      Set of fields to display.  One of "name,property,value,
- *             received,source". Default is "name,property,value,source".
- *             "all" is an alias for all five.
- *     -s      Set of sources to allow.  One of
- *             "local,default,inherited,received,temporary,none".  Default is
- *             all six.
- *     -p      Display values in parsable (literal) format.
- *
- *  Prints properties for the given datasets.  The user can control which
- *  columns to display as well as which property types to allow.
- */
-
-/*
- * Invoked to display the properties for a single dataset.
- */
-static int
-get_callback(zfs_handle_t *zhp, void *data)
-{
-       char buf[ZFS_MAXPROPLEN];
-       char rbuf[ZFS_MAXPROPLEN];
-       zprop_source_t sourcetype;
-       char source[ZFS_MAXNAMELEN];
-       zprop_get_cbdata_t *cbp = data;
-       nvlist_t *user_props = zfs_get_user_props(zhp);
-       zprop_list_t *pl = cbp->cb_proplist;
-       nvlist_t *propval;
-       char *strval;
-       char *sourceval;
-       boolean_t received = is_recvd_column(cbp);
-
-       for (; pl != NULL; pl = pl->pl_next) {
-               char *recvdval = NULL;
-               /*
-                * Skip the special fake placeholder.  This will also skip over
-                * the name property when 'all' is specified.
-                */
-               if (pl->pl_prop == ZFS_PROP_NAME &&
-                   pl == cbp->cb_proplist)
-                       continue;
-
-               if (pl->pl_prop != ZPROP_INVAL) {
-                       if (zfs_prop_get(zhp, pl->pl_prop, buf,
-                           sizeof (buf), &sourcetype, source,
-                           sizeof (source),
-                           cbp->cb_literal) != 0) {
-                               if (pl->pl_all)
-                                       continue;
-                               if (!zfs_prop_valid_for_type(pl->pl_prop,
-                                   ZFS_TYPE_DATASET, B_FALSE)) {
-                                       (void) fprintf(stderr,
-                                           gettext("No such property '%s'\n"),
-                                           zfs_prop_to_name(pl->pl_prop));
-                                       continue;
-                               }
-                               sourcetype = ZPROP_SRC_NONE;
-                               (void) strlcpy(buf, "-", sizeof (buf));
-                       }
-
-                       if (received && (zfs_prop_get_recvd(zhp,
-                           zfs_prop_to_name(pl->pl_prop), rbuf, sizeof (rbuf),
-                           cbp->cb_literal) == 0))
-                               recvdval = rbuf;
-
-                       zprop_print_one_property(zfs_get_name(zhp), cbp,
-                           zfs_prop_to_name(pl->pl_prop),
-                           buf, sourcetype, source, recvdval);
-               } else if (zfs_prop_userquota(pl->pl_user_prop)) {
-                       sourcetype = ZPROP_SRC_LOCAL;
-
-                       if (zfs_prop_get_userquota(zhp, pl->pl_user_prop,
-                           buf, sizeof (buf), cbp->cb_literal) != 0) {
-                               sourcetype = ZPROP_SRC_NONE;
-                               (void) strlcpy(buf, "-", sizeof (buf));
-                       }
-
-                       zprop_print_one_property(zfs_get_name(zhp), cbp,
-                           pl->pl_user_prop, buf, sourcetype, source, NULL);
-               } else if (zfs_prop_written(pl->pl_user_prop)) {
-                       sourcetype = ZPROP_SRC_LOCAL;
-
-                       if (zfs_prop_get_written(zhp, pl->pl_user_prop,
-                           buf, sizeof (buf), cbp->cb_literal) != 0) {
-                               sourcetype = ZPROP_SRC_NONE;
-                               (void) strlcpy(buf, "-", sizeof (buf));
-                       }
-
-                       zprop_print_one_property(zfs_get_name(zhp), cbp,
-                           pl->pl_user_prop, buf, sourcetype, source, NULL);
-               } else {
-                       if (nvlist_lookup_nvlist(user_props,
-                           pl->pl_user_prop, &propval) != 0) {
-                               if (pl->pl_all)
-                                       continue;
-                               sourcetype = ZPROP_SRC_NONE;
-                               strval = "-";
-                       } else {
-                               verify(nvlist_lookup_string(propval,
-                                   ZPROP_VALUE, &strval) == 0);
-                               verify(nvlist_lookup_string(propval,
-                                   ZPROP_SOURCE, &sourceval) == 0);
-
-                               if (strcmp(sourceval,
-                                   zfs_get_name(zhp)) == 0) {
-                                       sourcetype = ZPROP_SRC_LOCAL;
-                               } else if (strcmp(sourceval,
-                                   ZPROP_SOURCE_VAL_RECVD) == 0) {
-                                       sourcetype = ZPROP_SRC_RECEIVED;
-                               } else {
-                                       sourcetype = ZPROP_SRC_INHERITED;
-                                       (void) strlcpy(source,
-                                           sourceval, sizeof (source));
-                               }
-                       }
-
-                       if (received && (zfs_prop_get_recvd(zhp,
-                           pl->pl_user_prop, rbuf, sizeof (rbuf),
-                           cbp->cb_literal) == 0))
-                               recvdval = rbuf;
-
-                       zprop_print_one_property(zfs_get_name(zhp), cbp,
-                           pl->pl_user_prop, strval, sourcetype,
-                           source, recvdval);
-               }
-       }
-
-       return (0);
-}
-
-static int
-zfs_do_get(int argc, char **argv)
-{
-       zprop_get_cbdata_t cb = { 0 };
-       int i, c, flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
-       int types = ZFS_TYPE_DATASET;
-       char *value, *fields;
-       int ret = 0;
-       int limit = 0;
-       zprop_list_t fake_name = { 0 };
-
-       /*
-        * Set up default columns and sources.
-        */
-       cb.cb_sources = ZPROP_SRC_ALL;
-       cb.cb_columns[0] = GET_COL_NAME;
-       cb.cb_columns[1] = GET_COL_PROPERTY;
-       cb.cb_columns[2] = GET_COL_VALUE;
-       cb.cb_columns[3] = GET_COL_SOURCE;
-       cb.cb_type = ZFS_TYPE_DATASET;
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":d:o:s:rt:Hp")) != -1) {
-               switch (c) {
-               case 'p':
-                       cb.cb_literal = B_TRUE;
-                       break;
-               case 'd':
-                       limit = parse_depth(optarg, &flags);
-                       break;
-               case 'r':
-                       flags |= ZFS_ITER_RECURSE;
-                       break;
-               case 'H':
-                       cb.cb_scripted = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case 'o':
-                       /*
-                        * Process the set of columns to display.  We zero out
-                        * the structure to give us a blank slate.
-                        */
-                       bzero(&cb.cb_columns, sizeof (cb.cb_columns));
-                       i = 0;
-                       while (*optarg != '\0') {
-                               static char *col_subopts[] =
-                                   { "name", "property", "value", "received",
-                                   "source", "all", NULL };
-
-                               if (i == ZFS_GET_NCOLS) {
-                                       (void) fprintf(stderr, gettext("too "
-                                           "many fields given to -o "
-                                           "option\n"));
-                                       usage(B_FALSE);
-                               }
-
-                               switch (getsubopt(&optarg, col_subopts,
-                                   &value)) {
-                               case 0:
-                                       cb.cb_columns[i++] = GET_COL_NAME;
-                                       break;
-                               case 1:
-                                       cb.cb_columns[i++] = GET_COL_PROPERTY;
-                                       break;
-                               case 2:
-                                       cb.cb_columns[i++] = GET_COL_VALUE;
-                                       break;
-                               case 3:
-                                       cb.cb_columns[i++] = GET_COL_RECVD;
-                                       flags |= ZFS_ITER_RECVD_PROPS;
-                                       break;
-                               case 4:
-                                       cb.cb_columns[i++] = GET_COL_SOURCE;
-                                       break;
-                               case 5:
-                                       if (i > 0) {
-                                               (void) fprintf(stderr,
-                                                   gettext("\"all\" conflicts "
-                                                   "with specific fields "
-                                                   "given to -o option\n"));
-                                               usage(B_FALSE);
-                                       }
-                                       cb.cb_columns[0] = GET_COL_NAME;
-                                       cb.cb_columns[1] = GET_COL_PROPERTY;
-                                       cb.cb_columns[2] = GET_COL_VALUE;
-                                       cb.cb_columns[3] = GET_COL_RECVD;
-                                       cb.cb_columns[4] = GET_COL_SOURCE;
-                                       flags |= ZFS_ITER_RECVD_PROPS;
-                                       i = ZFS_GET_NCOLS;
-                                       break;
-                               default:
-                                       (void) fprintf(stderr,
-                                           gettext("invalid column name "
-                                           "'%s'\n"), value);
-                                       usage(B_FALSE);
-                               }
-                       }
-                       break;
-
-               case 's':
-                       cb.cb_sources = 0;
-                       while (*optarg != '\0') {
-                               static char *source_subopts[] = {
-                                       "local", "default", "inherited",
-                                       "received", "temporary", "none",
-                                       NULL };
-
-                               switch (getsubopt(&optarg, source_subopts,
-                                   &value)) {
-                               case 0:
-                                       cb.cb_sources |= ZPROP_SRC_LOCAL;
-                                       break;
-                               case 1:
-                                       cb.cb_sources |= ZPROP_SRC_DEFAULT;
-                                       break;
-                               case 2:
-                                       cb.cb_sources |= ZPROP_SRC_INHERITED;
-                                       break;
-                               case 3:
-                                       cb.cb_sources |= ZPROP_SRC_RECEIVED;
-                                       break;
-                               case 4:
-                                       cb.cb_sources |= ZPROP_SRC_TEMPORARY;
-                                       break;
-                               case 5:
-                                       cb.cb_sources |= ZPROP_SRC_NONE;
-                                       break;
-                               default:
-                                       (void) fprintf(stderr,
-                                           gettext("invalid source "
-                                           "'%s'\n"), value);
-                                       usage(B_FALSE);
-                               }
-                       }
-                       break;
-
-               case 't':
-                       types = 0;
-                       flags &= ~ZFS_ITER_PROP_LISTSNAPS;
-                       while (*optarg != '\0') {
-                               static char *type_subopts[] = { "filesystem",
-                                   "volume", "snapshot", "bookmark",
-                                   "all", NULL };
-
-                               switch (getsubopt(&optarg, type_subopts,
-                                   &value)) {
-                               case 0:
-                                       types |= ZFS_TYPE_FILESYSTEM;
-                                       break;
-                               case 1:
-                                       types |= ZFS_TYPE_VOLUME;
-                                       break;
-                               case 2:
-                                       types |= ZFS_TYPE_SNAPSHOT;
-                                       break;
-                               case 3:
-                                       types |= ZFS_TYPE_BOOKMARK;
-                                       break;
-                               case 4:
-                                       types = ZFS_TYPE_DATASET |
-                                           ZFS_TYPE_BOOKMARK;
-                                       break;
-
-                               default:
-                                       (void) fprintf(stderr,
-                                           gettext("invalid type '%s'\n"),
-                                           value);
-                                       usage(B_FALSE);
-                               }
-                       }
-                       break;
-
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing property "
-                   "argument\n"));
-               usage(B_FALSE);
-       }
-
-       fields = argv[0];
-
-       if (zprop_get_list(g_zfs, fields, &cb.cb_proplist, ZFS_TYPE_DATASET)
-           != 0)
-               usage(B_FALSE);
-
-       argc--;
-       argv++;
-
-       /*
-        * As part of zfs_expand_proplist(), we keep track of the maximum column
-        * width for each property.  For the 'NAME' (and 'SOURCE') columns, we
-        * need to know the maximum name length.  However, the user likely did
-        * not specify 'name' as one of the properties to fetch, so we need to
-        * make sure we always include at least this property for
-        * print_get_headers() to work properly.
-        */
-       if (cb.cb_proplist != NULL) {
-               fake_name.pl_prop = ZFS_PROP_NAME;
-               fake_name.pl_width = strlen(gettext("NAME"));
-               fake_name.pl_next = cb.cb_proplist;
-               cb.cb_proplist = &fake_name;
-       }
-
-       cb.cb_first = B_TRUE;
-
-       /* run for each object */
-       ret = zfs_for_each(argc, argv, flags, types, NULL,
-           &cb.cb_proplist, limit, get_callback, &cb);
-
-       if (cb.cb_proplist == &fake_name)
-               zprop_free_list(fake_name.pl_next);
-       else
-               zprop_free_list(cb.cb_proplist);
-
-       return (ret);
-}
-
-/*
- * inherit [-rS] <property> <fs|vol> ...
- *
- *     -r      Recurse over all children
- *     -S      Revert to received value, if any
- *
- * For each dataset specified on the command line, inherit the given property
- * from its parent.  Inheriting a property at the pool level will cause it to
- * use the default value.  The '-r' flag will recurse over all children, and is
- * useful for setting a property on a hierarchy-wide basis, regardless of any
- * local modifications for each dataset.
- */
-
-typedef struct inherit_cbdata {
-       const char *cb_propname;
-       boolean_t cb_received;
-} inherit_cbdata_t;
-
-static int
-inherit_recurse_cb(zfs_handle_t *zhp, void *data)
-{
-       inherit_cbdata_t *cb = data;
-       zfs_prop_t prop = zfs_name_to_prop(cb->cb_propname);
-
-       /*
-        * If we're doing it recursively, then ignore properties that
-        * are not valid for this type of dataset.
-        */
-       if (prop != ZPROP_INVAL &&
-           !zfs_prop_valid_for_type(prop, zfs_get_type(zhp), B_FALSE))
-               return (0);
-
-       return (zfs_prop_inherit(zhp, cb->cb_propname, cb->cb_received) != 0);
-}
-
-static int
-inherit_cb(zfs_handle_t *zhp, void *data)
-{
-       inherit_cbdata_t *cb = data;
-
-       return (zfs_prop_inherit(zhp, cb->cb_propname, cb->cb_received) != 0);
-}
-
-static int
-zfs_do_inherit(int argc, char **argv)
-{
-       int c;
-       zfs_prop_t prop;
-       inherit_cbdata_t cb = { 0 };
-       char *propname;
-       int ret = 0;
-       int flags = 0;
-       boolean_t received = B_FALSE;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "rS")) != -1) {
-               switch (c) {
-               case 'r':
-                       flags |= ZFS_ITER_RECURSE;
-                       break;
-               case 'S':
-                       received = B_TRUE;
-                       break;
-               case '?':
-               default:
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing property argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing dataset argument\n"));
-               usage(B_FALSE);
-       }
-
-       propname = argv[0];
-       argc--;
-       argv++;
-
-       if ((prop = zfs_name_to_prop(propname)) != ZPROP_INVAL) {
-               if (zfs_prop_readonly(prop)) {
-                       (void) fprintf(stderr, gettext(
-                           "%s property is read-only\n"),
-                           propname);
-                       return (1);
-               }
-               if (!zfs_prop_inheritable(prop) && !received) {
-                       (void) fprintf(stderr, gettext("'%s' property cannot "
-                           "be inherited\n"), propname);
-                       if (prop == ZFS_PROP_QUOTA ||
-                           prop == ZFS_PROP_RESERVATION ||
-                           prop == ZFS_PROP_REFQUOTA ||
-                           prop == ZFS_PROP_REFRESERVATION) {
-                               (void) fprintf(stderr, gettext("use 'zfs set "
-                                   "%s=none' to clear\n"), propname);
-                               (void) fprintf(stderr, gettext("use 'zfs "
-                                   "inherit -S %s' to revert to received "
-                                   "value\n"), propname);
-                       }
-                       return (1);
-               }
-               if (received && (prop == ZFS_PROP_VOLSIZE ||
-                   prop == ZFS_PROP_VERSION)) {
-                       (void) fprintf(stderr, gettext("'%s' property cannot "
-                           "be reverted to a received value\n"), propname);
-                       return (1);
-               }
-       } else if (!zfs_prop_user(propname)) {
-               (void) fprintf(stderr, gettext("invalid property '%s'\n"),
-                   propname);
-               usage(B_FALSE);
-       }
-
-       cb.cb_propname = propname;
-       cb.cb_received = received;
-
-       if (flags & ZFS_ITER_RECURSE) {
-               ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_DATASET,
-                   NULL, NULL, 0, inherit_recurse_cb, &cb);
-       } else {
-               ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_DATASET,
-                   NULL, NULL, 0, inherit_cb, &cb);
-       }
-
-       return (ret);
-}
-
-typedef struct upgrade_cbdata {
-       uint64_t cb_numupgraded;
-       uint64_t cb_numsamegraded;
-       uint64_t cb_numfailed;
-       uint64_t cb_version;
-       boolean_t cb_newer;
-       boolean_t cb_foundone;
-       char cb_lastfs[ZFS_MAXNAMELEN];
-} upgrade_cbdata_t;
-
-static int
-same_pool(zfs_handle_t *zhp, const char *name)
-{
-       int len1 = strcspn(name, "/@");
-       const char *zhname = zfs_get_name(zhp);
-       int len2 = strcspn(zhname, "/@");
-
-       if (len1 != len2)
-               return (B_FALSE);
-       return (strncmp(name, zhname, len1) == 0);
-}
-
-static int
-upgrade_list_callback(zfs_handle_t *zhp, void *data)
-{
-       upgrade_cbdata_t *cb = data;
-       int version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
-
-       /* list if it's old/new */
-       if ((!cb->cb_newer && version < ZPL_VERSION) ||
-           (cb->cb_newer && version > ZPL_VERSION)) {
-               char *str;
-               if (cb->cb_newer) {
-                       str = gettext("The following filesystems are "
-                           "formatted using a newer software version and\n"
-                           "cannot be accessed on the current system.\n\n");
-               } else {
-                       str = gettext("The following filesystems are "
-                           "out of date, and can be upgraded.  After being\n"
-                           "upgraded, these filesystems (and any 'zfs send' "
-                           "streams generated from\n"
-                           "subsequent snapshots) will no longer be "
-                           "accessible by older software versions.\n\n");
-               }
-
-               if (!cb->cb_foundone) {
-                       (void) puts(str);
-                       (void) printf(gettext("VER  FILESYSTEM\n"));
-                       (void) printf(gettext("---  ------------\n"));
-                       cb->cb_foundone = B_TRUE;
-               }
-
-               (void) printf("%2u   %s\n", version, zfs_get_name(zhp));
-       }
-
-       return (0);
-}
-
-static int
-upgrade_set_callback(zfs_handle_t *zhp, void *data)
-{
-       upgrade_cbdata_t *cb = data;
-       int version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
-       int needed_spa_version;
-       int spa_version;
-
-       if (zfs_spa_version(zhp, &spa_version) < 0)
-               return (-1);
-
-       needed_spa_version = zfs_spa_version_map(cb->cb_version);
-
-       if (needed_spa_version < 0)
-               return (-1);
-
-       if (spa_version < needed_spa_version) {
-               /* can't upgrade */
-               (void) printf(gettext("%s: can not be "
-                   "upgraded; the pool version needs to first "
-                   "be upgraded\nto version %d\n\n"),
-                   zfs_get_name(zhp), needed_spa_version);
-               cb->cb_numfailed++;
-               return (0);
-       }
-
-       /* upgrade */
-       if (version < cb->cb_version) {
-               char verstr[16];
-               (void) snprintf(verstr, sizeof (verstr),
-                   "%llu", (u_longlong_t)cb->cb_version);
-               if (cb->cb_lastfs[0] && !same_pool(zhp, cb->cb_lastfs)) {
-                       /*
-                        * If they did "zfs upgrade -a", then we could
-                        * be doing ioctls to different pools.  We need
-                        * to log this history once to each pool, and bypass
-                        * the normal history logging that happens in main().
-                        */
-                       (void) zpool_log_history(g_zfs, history_str);
-                       log_history = B_FALSE;
-               }
-               if (zfs_prop_set(zhp, "version", verstr) == 0)
-                       cb->cb_numupgraded++;
-               else
-                       cb->cb_numfailed++;
-               (void) strcpy(cb->cb_lastfs, zfs_get_name(zhp));
-       } else if (version > cb->cb_version) {
-               /* can't downgrade */
-               (void) printf(gettext("%s: can not be downgraded; "
-                   "it is already at version %u\n"),
-                   zfs_get_name(zhp), version);
-               cb->cb_numfailed++;
-       } else {
-               cb->cb_numsamegraded++;
-       }
-       return (0);
-}
-
-/*
- * zfs upgrade
- * zfs upgrade -v
- * zfs upgrade [-r] [-V <version>] <-a | filesystem>
- */
-static int
-zfs_do_upgrade(int argc, char **argv)
-{
-       boolean_t all = B_FALSE;
-       boolean_t showversions = B_FALSE;
-       int ret = 0;
-       upgrade_cbdata_t cb = { 0 };
-       signed char c;
-       int flags = ZFS_ITER_ARGS_CAN_BE_PATHS;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "rvV:a")) != -1) {
-               switch (c) {
-               case 'r':
-                       flags |= ZFS_ITER_RECURSE;
-                       break;
-               case 'v':
-                       showversions = B_TRUE;
-                       break;
-               case 'V':
-                       if (zfs_prop_string_to_index(ZFS_PROP_VERSION,
-                           optarg, &cb.cb_version) != 0) {
-                               (void) fprintf(stderr,
-                                   gettext("invalid version %s\n"), optarg);
-                               usage(B_FALSE);
-                       }
-                       break;
-               case 'a':
-                       all = B_TRUE;
-                       break;
-               case '?':
-               default:
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if ((!all && !argc) && ((flags & ZFS_ITER_RECURSE) | cb.cb_version))
-               usage(B_FALSE);
-       if (showversions && (flags & ZFS_ITER_RECURSE || all ||
-           cb.cb_version || argc))
-               usage(B_FALSE);
-       if ((all || argc) && (showversions))
-               usage(B_FALSE);
-       if (all && argc)
-               usage(B_FALSE);
-
-       if (showversions) {
-               /* Show info on available versions. */
-               (void) printf(gettext("The following filesystem versions are "
-                   "supported:\n\n"));
-               (void) printf(gettext("VER  DESCRIPTION\n"));
-               (void) printf("---  -----------------------------------------"
-                   "---------------\n");
-               (void) printf(gettext(" 1   Initial ZFS filesystem version\n"));
-               (void) printf(gettext(" 2   Enhanced directory entries\n"));
-               (void) printf(gettext(" 3   Case insensitive and filesystem "
-                   "user identifier (FUID)\n"));
-               (void) printf(gettext(" 4   userquota, groupquota "
-                   "properties\n"));
-               (void) printf(gettext(" 5   System attributes\n"));
-               (void) printf(gettext("\nFor more information on a particular "
-                   "version, including supported releases,\n"));
-               (void) printf("see the ZFS Administration Guide.\n\n");
-               ret = 0;
-       } else if (argc || all) {
-               /* Upgrade filesystems */
-               if (cb.cb_version == 0)
-                       cb.cb_version = ZPL_VERSION;
-               ret = zfs_for_each(argc, argv, flags, ZFS_TYPE_FILESYSTEM,
-                   NULL, NULL, 0, upgrade_set_callback, &cb);
-               (void) printf(gettext("%llu filesystems upgraded\n"),
-                   (u_longlong_t)cb.cb_numupgraded);
-               if (cb.cb_numsamegraded) {
-                       (void) printf(gettext("%llu filesystems already at "
-                           "this version\n"),
-                           (u_longlong_t)cb.cb_numsamegraded);
-               }
-               if (cb.cb_numfailed != 0)
-                       ret = 1;
-       } else {
-               /* List old-version filesytems */
-               boolean_t found;
-               (void) printf(gettext("This system is currently running "
-                   "ZFS filesystem version %llu.\n\n"), ZPL_VERSION);
-
-               flags |= ZFS_ITER_RECURSE;
-               ret = zfs_for_each(0, NULL, flags, ZFS_TYPE_FILESYSTEM,
-                   NULL, NULL, 0, upgrade_list_callback, &cb);
-
-               found = cb.cb_foundone;
-               cb.cb_foundone = B_FALSE;
-               cb.cb_newer = B_TRUE;
-
-               ret = zfs_for_each(0, NULL, flags, ZFS_TYPE_FILESYSTEM,
-                   NULL, NULL, 0, upgrade_list_callback, &cb);
-
-               if (!cb.cb_foundone && !found) {
-                       (void) printf(gettext("All filesystems are "
-                           "formatted with the current version.\n"));
-               }
-       }
-
-       return (ret);
-}
-
-/*
- * zfs userspace [-Hinp] [-o field[,...]] [-s field [-s field]...]
- *               [-S field [-S field]...] [-t type[,...]] filesystem | snapshot
- * zfs groupspace [-Hinp] [-o field[,...]] [-s field [-s field]...]
- *                [-S field [-S field]...] [-t type[,...]] filesystem | snapshot
- *
- *     -H      Scripted mode; elide headers and separate columns by tabs.
- *     -i      Translate SID to POSIX ID.
- *     -n      Print numeric ID instead of user/group name.
- *     -o      Control which fields to display.
- *     -p      Use exact (parsable) numeric output.
- *     -s      Specify sort columns, descending order.
- *     -S      Specify sort columns, ascending order.
- *     -t      Control which object types to display.
- *
- *     Displays space consumed by, and quotas on, each user in the specified
- *     filesystem or snapshot.
- */
-
-/* us_field_types, us_field_hdr and us_field_names should be kept in sync */
-enum us_field_types {
-       USFIELD_TYPE,
-       USFIELD_NAME,
-       USFIELD_USED,
-       USFIELD_QUOTA
-};
-static char *us_field_hdr[] = { "TYPE", "NAME", "USED", "QUOTA" };
-static char *us_field_names[] = { "type", "name", "used", "quota" };
-#define        USFIELD_LAST    (sizeof (us_field_names) / sizeof (char *))
-
-#define        USTYPE_PSX_GRP  (1 << 0)
-#define        USTYPE_PSX_USR  (1 << 1)
-#define        USTYPE_SMB_GRP  (1 << 2)
-#define        USTYPE_SMB_USR  (1 << 3)
-#define        USTYPE_ALL      \
-       (USTYPE_PSX_GRP | USTYPE_PSX_USR | USTYPE_SMB_GRP | USTYPE_SMB_USR)
-
-static int us_type_bits[] = {
-       USTYPE_PSX_GRP,
-       USTYPE_PSX_USR,
-       USTYPE_SMB_GRP,
-       USTYPE_SMB_USR,
-       USTYPE_ALL
-};
-static char *us_type_names[] = { "posixgroup", "posixuser", "smbgroup",
-       "smbuser", "all" };
-
-typedef struct us_node {
-       nvlist_t        *usn_nvl;
-       uu_avl_node_t   usn_avlnode;
-       uu_list_node_t  usn_listnode;
-} us_node_t;
-
-typedef struct us_cbdata {
-       nvlist_t        **cb_nvlp;
-       uu_avl_pool_t   *cb_avl_pool;
-       uu_avl_t        *cb_avl;
-       boolean_t       cb_numname;
-       boolean_t       cb_nicenum;
-       boolean_t       cb_sid2posix;
-       zfs_userquota_prop_t cb_prop;
-       zfs_sort_column_t *cb_sortcol;
-       size_t          cb_width[USFIELD_LAST];
-} us_cbdata_t;
-
-static boolean_t us_populated = B_FALSE;
-
-typedef struct {
-       zfs_sort_column_t *si_sortcol;
-       boolean_t       si_numname;
-} us_sort_info_t;
-
-static int
-us_field_index(char *field)
-{
-       int i;
-
-       for (i = 0; i < USFIELD_LAST; i++) {
-               if (strcmp(field, us_field_names[i]) == 0)
-                       return (i);
-       }
-
-       return (-1);
-}
-
-static int
-us_compare(const void *larg, const void *rarg, void *unused)
-{
-       const us_node_t *l = larg;
-       const us_node_t *r = rarg;
-       us_sort_info_t *si = (us_sort_info_t *)unused;
-       zfs_sort_column_t *sortcol = si->si_sortcol;
-       boolean_t numname = si->si_numname;
-       nvlist_t *lnvl = l->usn_nvl;
-       nvlist_t *rnvl = r->usn_nvl;
-       int rc = 0;
-       boolean_t lvb, rvb;
-
-       for (; sortcol != NULL; sortcol = sortcol->sc_next) {
-               char *lvstr = "";
-               char *rvstr = "";
-               uint32_t lv32 = 0;
-               uint32_t rv32 = 0;
-               uint64_t lv64 = 0;
-               uint64_t rv64 = 0;
-               zfs_prop_t prop = sortcol->sc_prop;
-               const char *propname = NULL;
-               boolean_t reverse = sortcol->sc_reverse;
-
-               switch (prop) {
-               case ZFS_PROP_TYPE:
-                       propname = "type";
-                       (void) nvlist_lookup_uint32(lnvl, propname, &lv32);
-                       (void) nvlist_lookup_uint32(rnvl, propname, &rv32);
-                       if (rv32 != lv32)
-                               rc = (rv32 < lv32) ? 1 : -1;
-                       break;
-               case ZFS_PROP_NAME:
-                       propname = "name";
-                       if (numname) {
-                               (void) nvlist_lookup_uint64(lnvl, propname,
-                                   &lv64);
-                               (void) nvlist_lookup_uint64(rnvl, propname,
-                                   &rv64);
-                               if (rv64 != lv64)
-                                       rc = (rv64 < lv64) ? 1 : -1;
-                       } else {
-                               (void) nvlist_lookup_string(lnvl, propname,
-                                   &lvstr);
-                               (void) nvlist_lookup_string(rnvl, propname,
-                                   &rvstr);
-                               rc = strcmp(lvstr, rvstr);
-                       }
-                       break;
-               case ZFS_PROP_USED:
-               case ZFS_PROP_QUOTA:
-                       if (!us_populated)
-                               break;
-                       if (prop == ZFS_PROP_USED)
-                               propname = "used";
-                       else
-                               propname = "quota";
-                       (void) nvlist_lookup_uint64(lnvl, propname, &lv64);
-                       (void) nvlist_lookup_uint64(rnvl, propname, &rv64);
-                       if (rv64 != lv64)
-                               rc = (rv64 < lv64) ? 1 : -1;
-                       break;
-               default:
-                       break;
-               }
-
-               if (rc != 0) {
-                       if (rc < 0)
-                               return (reverse ? 1 : -1);
-                       else
-                               return (reverse ? -1 : 1);
-               }
-       }
-
-       /*
-        * If entries still seem to be the same, check if they are of the same
-        * type (smbentity is added only if we are doing SID to POSIX ID
-        * translation where we can have duplicate type/name combinations).
-        */
-       if (nvlist_lookup_boolean_value(lnvl, "smbentity", &lvb) == 0 &&
-           nvlist_lookup_boolean_value(rnvl, "smbentity", &rvb) == 0 &&
-           lvb != rvb)
-               return (lvb < rvb ? -1 : 1);
-
-       return (0);
-}
-
-static inline const char *
-us_type2str(unsigned field_type)
-{
-       switch (field_type) {
-       case USTYPE_PSX_USR:
-               return ("POSIX User");
-       case USTYPE_PSX_GRP:
-               return ("POSIX Group");
-       case USTYPE_SMB_USR:
-               return ("SMB User");
-       case USTYPE_SMB_GRP:
-               return ("SMB Group");
-       default:
-               return ("Undefined");
-       }
-}
-
-static int
-userspace_cb(void *arg, const char *domain, uid_t rid, uint64_t space)
-{
-       us_cbdata_t *cb = (us_cbdata_t *)arg;
-       zfs_userquota_prop_t prop = cb->cb_prop;
-       char *name = NULL;
-       char *propname;
-       char sizebuf[32];
-       us_node_t *node;
-       uu_avl_pool_t *avl_pool = cb->cb_avl_pool;
-       uu_avl_t *avl = cb->cb_avl;
-       uu_avl_index_t idx;
-       nvlist_t *props;
-       us_node_t *n;
-       zfs_sort_column_t *sortcol = cb->cb_sortcol;
-       unsigned type = 0;
-       const char *typestr;
-       size_t namelen;
-       size_t typelen;
-       size_t sizelen;
-       int typeidx, nameidx, sizeidx;
-       us_sort_info_t sortinfo = { sortcol, cb->cb_numname };
-       boolean_t smbentity = B_FALSE;
-
-       if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-       node = safe_malloc(sizeof (us_node_t));
-       uu_avl_node_init(node, &node->usn_avlnode, avl_pool);
-       node->usn_nvl = props;
-
-       if (domain != NULL && domain[0] != '\0') {
-#ifdef HAVE_IDMAP
-               /* SMB */
-               char sid[ZFS_MAXNAMELEN + 32];
-               uid_t id;
-               uint64_t classes;
-               int err;
-               directory_error_t e;
-
-               smbentity = B_TRUE;
-
-               (void) snprintf(sid, sizeof (sid), "%s-%u", domain, rid);
-
-               if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) {
-                       type = USTYPE_SMB_GRP;
-                       err = sid_to_id(sid, B_FALSE, &id);
-               } else {
-                       type = USTYPE_SMB_USR;
-                       err = sid_to_id(sid, B_TRUE, &id);
-               }
-
-               if (err == 0) {
-                       rid = id;
-                       if (!cb->cb_sid2posix) {
-                               e = directory_name_from_sid(NULL, sid, &name,
-                                   &classes);
-                               if (e != NULL)
-                                       directory_error_free(e);
-                               if (name == NULL)
-                                       name = sid;
-                       }
-               }
-#else
-               nvlist_free(props);
-               free(node);
-
-               return (-1);
-#endif /* HAVE_IDMAP */
-       }
-
-       if (cb->cb_sid2posix || domain == NULL || domain[0] == '\0') {
-               /* POSIX or -i */
-               if (prop == ZFS_PROP_GROUPUSED || prop == ZFS_PROP_GROUPQUOTA) {
-                       type = USTYPE_PSX_GRP;
-                       if (!cb->cb_numname) {
-                               struct group *g;
-
-                               if ((g = getgrgid(rid)) != NULL)
-                                       name = g->gr_name;
-                       }
-               } else {
-                       type = USTYPE_PSX_USR;
-                       if (!cb->cb_numname) {
-                               struct passwd *p;
-
-                               if ((p = getpwuid(rid)) != NULL)
-                                       name = p->pw_name;
-                       }
-               }
-       }
-
-       /*
-        * Make sure that the type/name combination is unique when doing
-        * SID to POSIX ID translation (hence changing the type from SMB to
-        * POSIX).
-        */
-       if (cb->cb_sid2posix &&
-           nvlist_add_boolean_value(props, "smbentity", smbentity) != 0)
-               nomem();
-
-       /* Calculate/update width of TYPE field */
-       typestr = us_type2str(type);
-       typelen = strlen(gettext(typestr));
-       typeidx = us_field_index("type");
-       if (typelen > cb->cb_width[typeidx])
-               cb->cb_width[typeidx] = typelen;
-       if (nvlist_add_uint32(props, "type", type) != 0)
-               nomem();
-
-       /* Calculate/update width of NAME field */
-       if ((cb->cb_numname && cb->cb_sid2posix) || name == NULL) {
-               if (nvlist_add_uint64(props, "name", rid) != 0)
-                       nomem();
-               namelen = snprintf(NULL, 0, "%u", rid);
-       } else {
-               if (nvlist_add_string(props, "name", name) != 0)
-                       nomem();
-               namelen = strlen(name);
-       }
-       nameidx = us_field_index("name");
-       if (namelen > cb->cb_width[nameidx])
-               cb->cb_width[nameidx] = namelen;
-
-       /*
-        * Check if this type/name combination is in the list and update it;
-        * otherwise add new node to the list.
-        */
-       if ((n = uu_avl_find(avl, node, &sortinfo, &idx)) == NULL) {
-               uu_avl_insert(avl, node, idx);
-       } else {
-               nvlist_free(props);
-               free(node);
-               node = n;
-               props = node->usn_nvl;
-       }
-
-       /* Calculate/update width of USED/QUOTA fields */
-       if (cb->cb_nicenum)
-               zfs_nicenum(space, sizebuf, sizeof (sizebuf));
-       else
-               (void) snprintf(sizebuf, sizeof (sizebuf), "%llu",
-                   (u_longlong_t)space);
-       sizelen = strlen(sizebuf);
-       if (prop == ZFS_PROP_USERUSED || prop == ZFS_PROP_GROUPUSED) {
-               propname = "used";
-               if (!nvlist_exists(props, "quota"))
-                       (void) nvlist_add_uint64(props, "quota", 0);
-       } else {
-               propname = "quota";
-               if (!nvlist_exists(props, "used"))
-                       (void) nvlist_add_uint64(props, "used", 0);
-       }
-       sizeidx = us_field_index(propname);
-       if (sizelen > cb->cb_width[sizeidx])
-               cb->cb_width[sizeidx] = sizelen;
-
-       if (nvlist_add_uint64(props, propname, space) != 0)
-               nomem();
-
-       return (0);
-}
-
-static void
-print_us_node(boolean_t scripted, boolean_t parsable, int *fields, int types,
-    size_t *width, us_node_t *node)
-{
-       nvlist_t *nvl = node->usn_nvl;
-       char valstr[ZFS_MAXNAMELEN];
-       boolean_t first = B_TRUE;
-       int cfield = 0;
-       int field;
-       uint32_t ustype;
-
-       /* Check type */
-       (void) nvlist_lookup_uint32(nvl, "type", &ustype);
-       if (!(ustype & types))
-               return;
-
-       while ((field = fields[cfield]) != USFIELD_LAST) {
-               nvpair_t *nvp = NULL;
-               data_type_t type;
-               uint32_t val32;
-               uint64_t val64;
-               char *strval = NULL;
-
-               while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
-                       if (strcmp(nvpair_name(nvp),
-                           us_field_names[field]) == 0)
-                               break;
-               }
-
-               type = nvpair_type(nvp);
-               switch (type) {
-               case DATA_TYPE_UINT32:
-                       (void) nvpair_value_uint32(nvp, &val32);
-                       break;
-               case DATA_TYPE_UINT64:
-                       (void) nvpair_value_uint64(nvp, &val64);
-                       break;
-               case DATA_TYPE_STRING:
-                       (void) nvpair_value_string(nvp, &strval);
-                       break;
-               default:
-                       (void) fprintf(stderr, "invalid data type\n");
-               }
-
-               switch (field) {
-               case USFIELD_TYPE:
-                       strval = (char *)us_type2str(val32);
-                       break;
-               case USFIELD_NAME:
-                       if (type == DATA_TYPE_UINT64) {
-                               (void) sprintf(valstr, "%llu",
-                                   (u_longlong_t) val64);
-                               strval = valstr;
-                       }
-                       break;
-               case USFIELD_USED:
-               case USFIELD_QUOTA:
-                       if (type == DATA_TYPE_UINT64) {
-                               if (parsable) {
-                                       (void) sprintf(valstr, "%llu",
-                                           (u_longlong_t) val64);
-                               } else {
-                                       zfs_nicenum(val64, valstr,
-                                           sizeof (valstr));
-                               }
-                               if (field == USFIELD_QUOTA &&
-                                   strcmp(valstr, "0") == 0)
-                                       strval = "none";
-                               else
-                                       strval = valstr;
-                       }
-                       break;
-               }
-
-               if (!first) {
-                       if (scripted)
-                               (void) printf("\t");
-                       else
-                               (void) printf("  ");
-               }
-               if (scripted)
-                       (void) printf("%s", strval);
-               else if (field == USFIELD_TYPE || field == USFIELD_NAME)
-                       (void) printf("%-*s", (int) width[field], strval);
-               else
-                       (void) printf("%*s", (int) width[field], strval);
-
-               first = B_FALSE;
-               cfield++;
-       }
-
-       (void) printf("\n");
-}
-
-static void
-print_us(boolean_t scripted, boolean_t parsable, int *fields, int types,
-    size_t *width, boolean_t rmnode, uu_avl_t *avl)
-{
-       us_node_t *node;
-       const char *col;
-       int cfield = 0;
-       int field;
-
-       if (!scripted) {
-               boolean_t first = B_TRUE;
-
-               while ((field = fields[cfield]) != USFIELD_LAST) {
-                       col = gettext(us_field_hdr[field]);
-                       if (field == USFIELD_TYPE || field == USFIELD_NAME) {
-                               (void) printf(first ? "%-*s" : "  %-*s",
-                                   (int) width[field], col);
-                       } else {
-                               (void) printf(first ? "%*s" : "  %*s",
-                                   (int) width[field], col);
-                       }
-                       first = B_FALSE;
-                       cfield++;
-               }
-               (void) printf("\n");
-       }
-
-       for (node = uu_avl_first(avl); node; node = uu_avl_next(avl, node)) {
-               print_us_node(scripted, parsable, fields, types, width, node);
-               if (rmnode)
-                       nvlist_free(node->usn_nvl);
-       }
-}
-
-static int
-zfs_do_userspace(int argc, char **argv)
-{
-       zfs_handle_t *zhp;
-       zfs_userquota_prop_t p;
-       uu_avl_pool_t *avl_pool;
-       uu_avl_t *avl_tree;
-       uu_avl_walk_t *walk;
-       char *delim;
-       char deffields[] = "type,name,used,quota";
-       char *ofield = NULL;
-       char *tfield = NULL;
-       int cfield = 0;
-       int fields[256];
-       int i;
-       boolean_t scripted = B_FALSE;
-       boolean_t prtnum = B_FALSE;
-       boolean_t parsable = B_FALSE;
-       boolean_t sid2posix = B_FALSE;
-       int ret = 0;
-       int c;
-       zfs_sort_column_t *sortcol = NULL;
-       int types = USTYPE_PSX_USR | USTYPE_SMB_USR;
-       us_cbdata_t cb;
-       us_node_t *node;
-       us_node_t *rmnode;
-       uu_list_pool_t *listpool;
-       uu_list_t *list;
-       uu_avl_index_t idx = 0;
-       uu_list_index_t idx2 = 0;
-
-       if (argc < 2)
-               usage(B_FALSE);
-
-       if (strcmp(argv[0], "groupspace") == 0)
-               /* Toggle default group types */
-               types = USTYPE_PSX_GRP | USTYPE_SMB_GRP;
-
-       while ((c = getopt(argc, argv, "nHpo:s:S:t:i")) != -1) {
-               switch (c) {
-               case 'n':
-                       prtnum = B_TRUE;
-                       break;
-               case 'H':
-                       scripted = B_TRUE;
-                       break;
-               case 'p':
-                       parsable = B_TRUE;
-                       break;
-               case 'o':
-                       ofield = optarg;
-                       break;
-               case 's':
-               case 'S':
-                       if (zfs_add_sort_column(&sortcol, optarg,
-                           c == 's' ? B_FALSE : B_TRUE) != 0) {
-                               (void) fprintf(stderr,
-                                   gettext("invalid field '%s'\n"), optarg);
-                               usage(B_FALSE);
-                       }
-                       break;
-               case 't':
-                       tfield = optarg;
-                       break;
-               case 'i':
-                       sid2posix = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing dataset name\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       /* Use default output fields if not specified using -o */
-       if (ofield == NULL)
-               ofield = deffields;
-       do {
-               if ((delim = strchr(ofield, ',')) != NULL)
-                       *delim = '\0';
-               if ((fields[cfield++] = us_field_index(ofield)) == -1) {
-                       (void) fprintf(stderr, gettext("invalid type '%s' "
-                           "for -o option\n"), ofield);
-                       return (-1);
-               }
-               if (delim != NULL)
-                       ofield = delim + 1;
-       } while (delim != NULL);
-       fields[cfield] = USFIELD_LAST;
-
-       /* Override output types (-t option) */
-       if (tfield != NULL) {
-               types = 0;
-
-               do {
-                       boolean_t found = B_FALSE;
-
-                       if ((delim = strchr(tfield, ',')) != NULL)
-                               *delim = '\0';
-                       for (i = 0; i < sizeof (us_type_bits) / sizeof (int);
-                           i++) {
-                               if (strcmp(tfield, us_type_names[i]) == 0) {
-                                       found = B_TRUE;
-                                       types |= us_type_bits[i];
-                                       break;
-                               }
-                       }
-                       if (!found) {
-                               (void) fprintf(stderr, gettext("invalid type "
-                                   "'%s' for -t option\n"), tfield);
-                               return (-1);
-                       }
-                       if (delim != NULL)
-                               tfield = delim + 1;
-               } while (delim != NULL);
-       }
-
-       if ((zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_DATASET)) == NULL)
-               return (1);
-
-       if ((avl_pool = uu_avl_pool_create("us_avl_pool", sizeof (us_node_t),
-           offsetof(us_node_t, usn_avlnode), us_compare, UU_DEFAULT)) == NULL)
-               nomem();
-       if ((avl_tree = uu_avl_create(avl_pool, NULL, UU_DEFAULT)) == NULL)
-               nomem();
-
-       /* Always add default sorting columns */
-       (void) zfs_add_sort_column(&sortcol, "type", B_FALSE);
-       (void) zfs_add_sort_column(&sortcol, "name", B_FALSE);
-
-       cb.cb_sortcol = sortcol;
-       cb.cb_numname = prtnum;
-       cb.cb_nicenum = !parsable;
-       cb.cb_avl_pool = avl_pool;
-       cb.cb_avl = avl_tree;
-       cb.cb_sid2posix = sid2posix;
-
-       for (i = 0; i < USFIELD_LAST; i++)
-               cb.cb_width[i] = strlen(gettext(us_field_hdr[i]));
-
-       for (p = 0; p < ZFS_NUM_USERQUOTA_PROPS; p++) {
-               if (((p == ZFS_PROP_USERUSED || p == ZFS_PROP_USERQUOTA) &&
-                   !(types & (USTYPE_PSX_USR | USTYPE_SMB_USR))) ||
-                   ((p == ZFS_PROP_GROUPUSED || p == ZFS_PROP_GROUPQUOTA) &&
-                   !(types & (USTYPE_PSX_GRP | USTYPE_SMB_GRP))))
-                       continue;
-               cb.cb_prop = p;
-               if ((ret = zfs_userspace(zhp, p, userspace_cb, &cb)) != 0)
-                       return (ret);
-       }
-
-       /* Sort the list */
-       if ((node = uu_avl_first(avl_tree)) == NULL)
-               return (0);
-
-       us_populated = B_TRUE;
-
-       listpool = uu_list_pool_create("tmplist", sizeof (us_node_t),
-           offsetof(us_node_t, usn_listnode), NULL, UU_DEFAULT);
-       list = uu_list_create(listpool, NULL, UU_DEFAULT);
-       uu_list_node_init(node, &node->usn_listnode, listpool);
-
-       while (node != NULL) {
-               rmnode = node;
-               node = uu_avl_next(avl_tree, node);
-               uu_avl_remove(avl_tree, rmnode);
-               if (uu_list_find(list, rmnode, NULL, &idx2) == NULL)
-                       uu_list_insert(list, rmnode, idx2);
-       }
-
-       for (node = uu_list_first(list); node != NULL;
-           node = uu_list_next(list, node)) {
-               us_sort_info_t sortinfo = { sortcol, cb.cb_numname };
-
-               if (uu_avl_find(avl_tree, node, &sortinfo, &idx) == NULL)
-                       uu_avl_insert(avl_tree, node, idx);
-       }
-
-       uu_list_destroy(list);
-       uu_list_pool_destroy(listpool);
-
-       /* Print and free node nvlist memory */
-       print_us(scripted, parsable, fields, types, cb.cb_width, B_TRUE,
-           cb.cb_avl);
-
-       zfs_free_sort_columns(sortcol);
-
-       /* Clean up the AVL tree */
-       if ((walk = uu_avl_walk_start(cb.cb_avl, UU_WALK_ROBUST)) == NULL)
-               nomem();
-
-       while ((node = uu_avl_walk_next(walk)) != NULL) {
-               uu_avl_remove(cb.cb_avl, node);
-               free(node);
-       }
-
-       uu_avl_walk_end(walk);
-       uu_avl_destroy(avl_tree);
-       uu_avl_pool_destroy(avl_pool);
-
-       return (ret);
-}
-
-/*
- * list [-Hp][-r|-d max] [-o property[,...]] [-s property] ... [-S property]
- *      [-t type[,...]] [filesystem|volume|snapshot] ...
- *
- *     -H      Scripted mode; elide headers and separate columns by tabs
- *     -p      Display values in parsable (literal) format.
- *     -r      Recurse over all children
- *     -d      Limit recursion by depth.
- *     -o      Control which fields to display.
- *     -s      Specify sort columns, descending order.
- *     -S      Specify sort columns, ascending order.
- *     -t      Control which object types to display.
- *
- * When given no arguments, list all filesystems in the system.
- * Otherwise, list the specified datasets, optionally recursing down them if
- * '-r' is specified.
- */
-typedef struct list_cbdata {
-       boolean_t       cb_first;
-       boolean_t       cb_literal;
-       boolean_t       cb_scripted;
-       zprop_list_t    *cb_proplist;
-} list_cbdata_t;
-
-/*
- * Given a list of columns to display, output appropriate headers for each one.
- */
-static void
-print_header(list_cbdata_t *cb)
-{
-       zprop_list_t *pl = cb->cb_proplist;
-       char headerbuf[ZFS_MAXPROPLEN];
-       const char *header;
-       int i;
-       boolean_t first = B_TRUE;
-       boolean_t right_justify;
-
-       for (; pl != NULL; pl = pl->pl_next) {
-               if (!first) {
-                       (void) printf("  ");
-               } else {
-                       first = B_FALSE;
-               }
-
-               right_justify = B_FALSE;
-               if (pl->pl_prop != ZPROP_INVAL) {
-                       header = zfs_prop_column_name(pl->pl_prop);
-                       right_justify = zfs_prop_align_right(pl->pl_prop);
-               } else {
-                       for (i = 0; pl->pl_user_prop[i] != '\0'; i++)
-                               headerbuf[i] = toupper(pl->pl_user_prop[i]);
-                       headerbuf[i] = '\0';
-                       header = headerbuf;
-               }
-
-               if (pl->pl_next == NULL && !right_justify)
-                       (void) printf("%s", header);
-               else if (right_justify)
-                       (void) printf("%*s", (int)pl->pl_width, header);
-               else
-                       (void) printf("%-*s", (int)pl->pl_width, header);
-       }
-
-       (void) printf("\n");
-}
-
-/*
- * Given a dataset and a list of fields, print out all the properties according
- * to the described layout.
- */
-static void
-print_dataset(zfs_handle_t *zhp, list_cbdata_t *cb)
-{
-       zprop_list_t *pl = cb->cb_proplist;
-       boolean_t first = B_TRUE;
-       char property[ZFS_MAXPROPLEN];
-       nvlist_t *userprops = zfs_get_user_props(zhp);
-       nvlist_t *propval;
-       char *propstr;
-       boolean_t right_justify;
-
-       for (; pl != NULL; pl = pl->pl_next) {
-               if (!first) {
-                       if (cb->cb_scripted)
-                               (void) printf("\t");
-                       else
-                               (void) printf("  ");
-               } else {
-                       first = B_FALSE;
-               }
-
-               if (pl->pl_prop == ZFS_PROP_NAME) {
-                       (void) strlcpy(property, zfs_get_name(zhp),
-                           sizeof (property));
-                       propstr = property;
-                       right_justify = zfs_prop_align_right(pl->pl_prop);
-               } else if (pl->pl_prop != ZPROP_INVAL) {
-                       if (zfs_prop_get(zhp, pl->pl_prop, property,
-                           sizeof (property), NULL, NULL, 0,
-                           cb->cb_literal) != 0)
-                               propstr = "-";
-                       else
-                               propstr = property;
-                       right_justify = zfs_prop_align_right(pl->pl_prop);
-               } else if (zfs_prop_userquota(pl->pl_user_prop)) {
-                       if (zfs_prop_get_userquota(zhp, pl->pl_user_prop,
-                           property, sizeof (property), cb->cb_literal) != 0)
-                               propstr = "-";
-                       else
-                               propstr = property;
-                       right_justify = B_TRUE;
-               } else if (zfs_prop_written(pl->pl_user_prop)) {
-                       if (zfs_prop_get_written(zhp, pl->pl_user_prop,
-                           property, sizeof (property), cb->cb_literal) != 0)
-                               propstr = "-";
-                       else
-                               propstr = property;
-                       right_justify = B_TRUE;
-               } else {
-                       if (nvlist_lookup_nvlist(userprops,
-                           pl->pl_user_prop, &propval) != 0)
-                               propstr = "-";
-                       else
-                               verify(nvlist_lookup_string(propval,
-                                   ZPROP_VALUE, &propstr) == 0);
-                       right_justify = B_FALSE;
-               }
-
-               /*
-                * If this is being called in scripted mode, or if this is the
-                * last column and it is left-justified, don't include a width
-                * format specifier.
-                */
-               if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify))
-                       (void) printf("%s", propstr);
-               else if (right_justify)
-                       (void) printf("%*s", (int)pl->pl_width, propstr);
-               else
-                       (void) printf("%-*s", (int)pl->pl_width, propstr);
-       }
-
-       (void) printf("\n");
-}
-
-/*
- * Generic callback function to list a dataset or snapshot.
- */
-static int
-list_callback(zfs_handle_t *zhp, void *data)
-{
-       list_cbdata_t *cbp = data;
-
-       if (cbp->cb_first) {
-               if (!cbp->cb_scripted)
-                       print_header(cbp);
-               cbp->cb_first = B_FALSE;
-       }
-
-       print_dataset(zhp, cbp);
-
-       return (0);
-}
-
-static int
-zfs_do_list(int argc, char **argv)
-{
-       int c;
-       static char default_fields[] =
-           "name,used,available,referenced,mountpoint";
-       int types = ZFS_TYPE_DATASET;
-       boolean_t types_specified = B_FALSE;
-       char *fields = NULL;
-       list_cbdata_t cb = { 0 };
-       char *value;
-       int limit = 0;
-       int ret = 0;
-       zfs_sort_column_t *sortcol = NULL;
-       int flags = ZFS_ITER_PROP_LISTSNAPS | ZFS_ITER_ARGS_CAN_BE_PATHS;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "HS:d:o:prs:t:")) != -1) {
-               switch (c) {
-               case 'o':
-                       fields = optarg;
-                       break;
-               case 'p':
-                       cb.cb_literal = B_TRUE;
-                       flags |= ZFS_ITER_LITERAL_PROPS;
-                       break;
-               case 'd':
-                       limit = parse_depth(optarg, &flags);
-                       break;
-               case 'r':
-                       flags |= ZFS_ITER_RECURSE;
-                       break;
-               case 'H':
-                       cb.cb_scripted = B_TRUE;
-                       break;
-               case 's':
-                       if (zfs_add_sort_column(&sortcol, optarg,
-                           B_FALSE) != 0) {
-                               (void) fprintf(stderr,
-                                   gettext("invalid property '%s'\n"), optarg);
-                               usage(B_FALSE);
-                       }
-                       break;
-               case 'S':
-                       if (zfs_add_sort_column(&sortcol, optarg,
-                           B_TRUE) != 0) {
-                               (void) fprintf(stderr,
-                                   gettext("invalid property '%s'\n"), optarg);
-                               usage(B_FALSE);
-                       }
-                       break;
-               case 't':
-                       types = 0;
-                       types_specified = B_TRUE;
-                       flags &= ~ZFS_ITER_PROP_LISTSNAPS;
-                       while (*optarg != '\0') {
-                               static char *type_subopts[] = { "filesystem",
-                                   "volume", "snapshot", "snap", "bookmark",
-                                   "all", NULL };
-
-                               switch (getsubopt(&optarg, type_subopts,
-                                   &value)) {
-                               case 0:
-                                       types |= ZFS_TYPE_FILESYSTEM;
-                                       break;
-                               case 1:
-                                       types |= ZFS_TYPE_VOLUME;
-                                       break;
-                               case 2:
-                               case 3:
-                                       types |= ZFS_TYPE_SNAPSHOT;
-                                       break;
-                               case 4:
-                                       types |= ZFS_TYPE_BOOKMARK;
-                                       break;
-                               case 5:
-                                       types = ZFS_TYPE_DATASET |
-                                           ZFS_TYPE_BOOKMARK;
-                                       break;
-                               default:
-                                       (void) fprintf(stderr,
-                                           gettext("invalid type '%s'\n"),
-                                           value);
-                                       usage(B_FALSE);
-                               }
-                       }
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (fields == NULL)
-               fields = default_fields;
-
-       /*
-        * If we are only going to list snapshot names and sort by name,
-        * then we can use faster version.
-        */
-       if (strcmp(fields, "name") == 0 && zfs_sort_only_by_name(sortcol))
-               flags |= ZFS_ITER_SIMPLE;
-
-       /*
-        * If "-o space" and no types were specified, don't display snapshots.
-        */
-       if (strcmp(fields, "space") == 0 && types_specified == B_FALSE)
-               types &= ~ZFS_TYPE_SNAPSHOT;
-
-       /*
-        * If the user specifies '-o all', the zprop_get_list() doesn't
-        * normally include the name of the dataset.  For 'zfs list', we always
-        * want this property to be first.
-        */
-       if (zprop_get_list(g_zfs, fields, &cb.cb_proplist, ZFS_TYPE_DATASET)
-           != 0)
-               usage(B_FALSE);
-
-       cb.cb_first = B_TRUE;
-
-       ret = zfs_for_each(argc, argv, flags, types, sortcol, &cb.cb_proplist,
-           limit, list_callback, &cb);
-
-       zprop_free_list(cb.cb_proplist);
-       zfs_free_sort_columns(sortcol);
-
-       if (ret == 0 && cb.cb_first && !cb.cb_scripted)
-               (void) fprintf(stderr, gettext("no datasets available\n"));
-
-       return (ret);
-}
-
-/*
- * zfs rename [-f] <fs | snap | vol> <fs | snap | vol>
- * zfs rename [-f] -p <fs | vol> <fs | vol>
- * zfs rename -r <snap> <snap>
- *
- * Renames the given dataset to another of the same type.
- *
- * The '-p' flag creates all the non-existing ancestors of the target first.
- */
-/* ARGSUSED */
-static int
-zfs_do_rename(int argc, char **argv)
-{
-       zfs_handle_t *zhp;
-       int c;
-       int ret = 0;
-       boolean_t recurse = B_FALSE;
-       boolean_t parents = B_FALSE;
-       boolean_t force_unmount = B_FALSE;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "prf")) != -1) {
-               switch (c) {
-               case 'p':
-                       parents = B_TRUE;
-                       break;
-               case 'r':
-                       recurse = B_TRUE;
-                       break;
-               case 'f':
-                       force_unmount = B_TRUE;
-                       break;
-               case '?':
-               default:
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing source dataset "
-                   "argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing target dataset "
-                   "argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 2) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       if (recurse && parents) {
-               (void) fprintf(stderr, gettext("-p and -r options are mutually "
-                   "exclusive\n"));
-               usage(B_FALSE);
-       }
-
-       if (recurse && strchr(argv[0], '@') == 0) {
-               (void) fprintf(stderr, gettext("source dataset for recursive "
-                   "rename must be a snapshot\n"));
-               usage(B_FALSE);
-       }
-
-       if ((zhp = zfs_open(g_zfs, argv[0], parents ? ZFS_TYPE_FILESYSTEM |
-           ZFS_TYPE_VOLUME : ZFS_TYPE_DATASET)) == NULL)
-               return (1);
-
-       /* If we were asked and the name looks good, try to create ancestors. */
-       if (parents && zfs_name_valid(argv[1], zfs_get_type(zhp)) &&
-           zfs_create_ancestors(g_zfs, argv[1]) != 0) {
-               zfs_close(zhp);
-               return (1);
-       }
-
-       ret = (zfs_rename(zhp, argv[1], recurse, force_unmount) != 0);
-
-       zfs_close(zhp);
-       return (ret);
-}
-
-/*
- * zfs promote <fs>
- *
- * Promotes the given clone fs to be the parent
- */
-/* ARGSUSED */
-static int
-zfs_do_promote(int argc, char **argv)
-{
-       zfs_handle_t *zhp;
-       int ret = 0;
-
-       /* check options */
-       if (argc > 1 && argv[1][0] == '-') {
-               (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                   argv[1][1]);
-               usage(B_FALSE);
-       }
-
-       /* check number of arguments */
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing clone filesystem"
-                   " argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 2) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       zhp = zfs_open(g_zfs, argv[1], ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-       if (zhp == NULL)
-               return (1);
-
-       ret = (zfs_promote(zhp) != 0);
-
-
-       zfs_close(zhp);
-       return (ret);
-}
-
-/*
- * zfs rollback [-rRf] <snapshot>
- *
- *     -r      Delete any intervening snapshots before doing rollback
- *     -R      Delete any snapshots and their clones
- *     -f      ignored for backwards compatability
- *
- * Given a filesystem, rollback to a specific snapshot, discarding any changes
- * since then and making it the active dataset.  If more recent snapshots exist,
- * the command will complain unless the '-r' flag is given.
- */
-typedef struct rollback_cbdata {
-       uint64_t        cb_create;
-       boolean_t       cb_first;
-       int             cb_doclones;
-       char            *cb_target;
-       int             cb_error;
-       boolean_t       cb_recurse;
-} rollback_cbdata_t;
-
-static int
-rollback_check_dependent(zfs_handle_t *zhp, void *data)
-{
-       rollback_cbdata_t *cbp = data;
-
-       if (cbp->cb_first && cbp->cb_recurse) {
-               (void) fprintf(stderr, gettext("cannot rollback to "
-                   "'%s': clones of previous snapshots exist\n"),
-                   cbp->cb_target);
-               (void) fprintf(stderr, gettext("use '-R' to "
-                   "force deletion of the following clones and "
-                   "dependents:\n"));
-               cbp->cb_first = 0;
-               cbp->cb_error = 1;
-       }
-
-       (void) fprintf(stderr, "%s\n", zfs_get_name(zhp));
-
-       zfs_close(zhp);
-       return (0);
-}
-
-
-/*
- * Report any snapshots more recent than the one specified.  Used when '-r' is
- * not specified.  We reuse this same callback for the snapshot dependents - if
- * 'cb_dependent' is set, then this is a dependent and we should report it
- * without checking the transaction group.
- */
-static int
-rollback_check(zfs_handle_t *zhp, void *data)
-{
-       rollback_cbdata_t *cbp = data;
-
-       if (cbp->cb_doclones) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if (zfs_prop_get_int(zhp, ZFS_PROP_CREATETXG) > cbp->cb_create) {
-               if (cbp->cb_first && !cbp->cb_recurse) {
-                       (void) fprintf(stderr, gettext("cannot "
-                           "rollback to '%s': more recent snapshots "
-                           "or bookmarks exist\n"),
-                           cbp->cb_target);
-                       (void) fprintf(stderr, gettext("use '-r' to "
-                           "force deletion of the following "
-                           "snapshots and bookmarks:\n"));
-                       cbp->cb_first = 0;
-                       cbp->cb_error = 1;
-               }
-
-               if (cbp->cb_recurse) {
-                       if (zfs_iter_dependents(zhp, B_TRUE,
-                           rollback_check_dependent, cbp) != 0) {
-                               zfs_close(zhp);
-                               return (-1);
-                       }
-               } else {
-                       (void) fprintf(stderr, "%s\n",
-                           zfs_get_name(zhp));
-               }
-       }
-       zfs_close(zhp);
-       return (0);
-}
-
-static int
-zfs_do_rollback(int argc, char **argv)
-{
-       int ret = 0;
-       int c;
-       boolean_t force = B_FALSE;
-       rollback_cbdata_t cb = { 0 };
-       zfs_handle_t *zhp, *snap;
-       char parentname[ZFS_MAXNAMELEN];
-       char *delim;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "rRf")) != -1) {
-               switch (c) {
-               case 'r':
-                       cb.cb_recurse = 1;
-                       break;
-               case 'R':
-                       cb.cb_recurse = 1;
-                       cb.cb_doclones = 1;
-                       break;
-               case 'f':
-                       force = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing dataset argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       /* open the snapshot */
-       if ((snap = zfs_open(g_zfs, argv[0], ZFS_TYPE_SNAPSHOT)) == NULL)
-               return (1);
-
-       /* open the parent dataset */
-       (void) strlcpy(parentname, argv[0], sizeof (parentname));
-       verify((delim = strrchr(parentname, '@')) != NULL);
-       *delim = '\0';
-       if ((zhp = zfs_open(g_zfs, parentname, ZFS_TYPE_DATASET)) == NULL) {
-               zfs_close(snap);
-               return (1);
-       }
-
-       /*
-        * Check for more recent snapshots and/or clones based on the presence
-        * of '-r' and '-R'.
-        */
-       cb.cb_target = argv[0];
-       cb.cb_create = zfs_prop_get_int(snap, ZFS_PROP_CREATETXG);
-       cb.cb_first = B_TRUE;
-       cb.cb_error = 0;
-       if ((ret = zfs_iter_snapshots(zhp, B_FALSE, rollback_check, &cb)) != 0)
-               goto out;
-       if ((ret = zfs_iter_bookmarks(zhp, rollback_check, &cb)) != 0)
-               goto out;
-
-       if ((ret = cb.cb_error) != 0)
-               goto out;
-
-       /*
-        * Rollback parent to the given snapshot.
-        */
-       ret = zfs_rollback(zhp, snap, force);
-
-out:
-       zfs_close(snap);
-       zfs_close(zhp);
-
-       if (ret == 0)
-               return (0);
-       else
-               return (1);
-}
-
-/*
- * zfs set property=value { fs | snap | vol } ...
- *
- * Sets the given property for all datasets specified on the command line.
- */
-typedef struct set_cbdata {
-       char            *cb_propname;
-       char            *cb_value;
-} set_cbdata_t;
-
-static int
-set_callback(zfs_handle_t *zhp, void *data)
-{
-       set_cbdata_t *cbp = data;
-
-       if (zfs_prop_set(zhp, cbp->cb_propname, cbp->cb_value) != 0) {
-               switch (libzfs_errno(g_zfs)) {
-               case EZFS_MOUNTFAILED:
-                       (void) fprintf(stderr, gettext("property may be set "
-                           "but unable to remount filesystem\n"));
-                       break;
-               case EZFS_SHARENFSFAILED:
-                       (void) fprintf(stderr, gettext("property may be set "
-                           "but unable to reshare filesystem\n"));
-                       break;
-               }
-               return (1);
-       }
-       return (0);
-}
-
-static int
-zfs_do_set(int argc, char **argv)
-{
-       set_cbdata_t cb;
-       int ret = 0;
-
-       /* check for options */
-       if (argc > 1 && argv[1][0] == '-') {
-               (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                   argv[1][1]);
-               usage(B_FALSE);
-       }
-
-       /* check number of arguments */
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing property=value "
-                   "argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 3) {
-               (void) fprintf(stderr, gettext("missing dataset name\n"));
-               usage(B_FALSE);
-       }
-
-       /* validate property=value argument */
-       cb.cb_propname = argv[1];
-       if (((cb.cb_value = strchr(cb.cb_propname, '=')) == NULL) ||
-           (cb.cb_value[1] == '\0')) {
-               (void) fprintf(stderr, gettext("missing value in "
-                   "property=value argument\n"));
-               usage(B_FALSE);
-       }
-
-       *cb.cb_value = '\0';
-       cb.cb_value++;
-
-       if (*cb.cb_propname == '\0') {
-               (void) fprintf(stderr,
-                   gettext("missing property in property=value argument\n"));
-               usage(B_FALSE);
-       }
-
-       ret = zfs_for_each(argc - 2, argv + 2, 0,
-           ZFS_TYPE_DATASET, NULL, NULL, 0, set_callback, &cb);
-
-       return (ret);
-}
-
-typedef struct snap_cbdata {
-       nvlist_t *sd_nvl;
-       boolean_t sd_recursive;
-       const char *sd_snapname;
-} snap_cbdata_t;
-
-static int
-zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
-{
-       snap_cbdata_t *sd = arg;
-       char *name;
-       int rv = 0;
-       int error;
-
-       if (sd->sd_recursive &&
-           zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) != 0) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       error = asprintf(&name, "%s@%s", zfs_get_name(zhp), sd->sd_snapname);
-       if (error == -1)
-               nomem();
-       fnvlist_add_boolean(sd->sd_nvl, name);
-       free(name);
-
-       if (sd->sd_recursive)
-               rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd);
-       zfs_close(zhp);
-       return (rv);
-}
-
-/*
- * zfs snapshot [-r] [-o prop=value] ... <fs@snap>
- *
- * Creates a snapshot with the given name.  While functionally equivalent to
- * 'zfs create', it is a separate command to differentiate intent.
- */
-static int
-zfs_do_snapshot(int argc, char **argv)
-{
-       int ret = 0;
-       signed char c;
-       nvlist_t *props;
-       snap_cbdata_t sd = { 0 };
-       boolean_t multiple_snaps = B_FALSE;
-
-       if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-       if (nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-
-       /* check options */
-       while ((c = getopt(argc, argv, "ro:")) != -1) {
-               switch (c) {
-               case 'o':
-                       if (parseprop(props))
-                               return (1);
-                       break;
-               case 'r':
-                       sd.sd_recursive = B_TRUE;
-                       multiple_snaps = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       goto usage;
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing snapshot argument\n"));
-               goto usage;
-       }
-
-       if (argc > 1)
-               multiple_snaps = B_TRUE;
-       for (; argc > 0; argc--, argv++) {
-               char *atp;
-               zfs_handle_t *zhp;
-
-               atp = strchr(argv[0], '@');
-               if (atp == NULL)
-                       goto usage;
-               *atp = '\0';
-               sd.sd_snapname = atp + 1;
-               zhp = zfs_open(g_zfs, argv[0],
-                   ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-               if (zhp == NULL)
-                       goto usage;
-               if (zfs_snapshot_cb(zhp, &sd) != 0)
-                       goto usage;
-       }
-
-       ret = zfs_snapshot_nvl(g_zfs, sd.sd_nvl, props);
-       nvlist_free(sd.sd_nvl);
-       nvlist_free(props);
-       if (ret != 0 && multiple_snaps)
-               (void) fprintf(stderr, gettext("no snapshots were created\n"));
-       return (ret != 0);
-
-usage:
-       nvlist_free(sd.sd_nvl);
-       nvlist_free(props);
-       usage(B_FALSE);
-       return (-1);
-}
-
-/*
- * Send a backup stream to stdout.
- */
-static int
-zfs_do_send(int argc, char **argv)
-{
-       char *fromname = NULL;
-       char *toname = NULL;
-       char *cp;
-       zfs_handle_t *zhp;
-       sendflags_t flags = { 0 };
-       int c, err;
-       nvlist_t *dbgnv = NULL;
-       boolean_t extraverbose = B_FALSE;
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":i:I:RDpvnPLe")) != -1) {
-               switch (c) {
-               case 'i':
-                       if (fromname)
-                               usage(B_FALSE);
-                       fromname = optarg;
-                       break;
-               case 'I':
-                       if (fromname)
-                               usage(B_FALSE);
-                       fromname = optarg;
-                       flags.doall = B_TRUE;
-                       break;
-               case 'R':
-                       flags.replicate = B_TRUE;
-                       break;
-               case 'p':
-                       flags.props = B_TRUE;
-                       break;
-               case 'P':
-                       flags.parsable = B_TRUE;
-                       flags.verbose = B_TRUE;
-                       break;
-               case 'v':
-                       if (flags.verbose)
-                               extraverbose = B_TRUE;
-                       flags.verbose = B_TRUE;
-                       flags.progress = B_TRUE;
-                       break;
-               case 'D':
-                       flags.dedup = B_TRUE;
-                       break;
-               case 'n':
-                       flags.dryrun = B_TRUE;
-                       break;
-               case 'L':
-                       flags.largeblock = B_TRUE;
-                       break;
-               case 'e':
-                       flags.embed_data = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing snapshot argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       if (!flags.dryrun && isatty(STDOUT_FILENO)) {
-               (void) fprintf(stderr,
-                   gettext("Error: Stream can not be written to a terminal.\n"
-                   "You must redirect standard output.\n"));
-               return (1);
-       }
-
-       /*
-        * Special case sending a filesystem, or from a bookmark.
-        */
-       if (strchr(argv[0], '@') == NULL ||
-           (fromname && strchr(fromname, '#') != NULL)) {
-               char frombuf[ZFS_MAXNAMELEN];
-               enum lzc_send_flags lzc_flags = 0;
-
-               if (flags.replicate || flags.doall || flags.props ||
-                   flags.dedup || flags.dryrun || flags.verbose ||
-                   flags.progress) {
-                       (void) fprintf(stderr,
-                           gettext("Error: "
-                           "Unsupported flag with filesystem or bookmark.\n"));
-                       return (1);
-               }
-
-               zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_DATASET);
-               if (zhp == NULL)
-                       return (1);
-
-               if (flags.largeblock)
-                       lzc_flags |= LZC_SEND_FLAG_LARGE_BLOCK;
-               if (flags.embed_data)
-                       lzc_flags |= LZC_SEND_FLAG_EMBED_DATA;
-
-               if (fromname != NULL &&
-                   (fromname[0] == '#' || fromname[0] == '@')) {
-                       /*
-                        * Incremental source name begins with # or @.
-                        * Default to same fs as target.
-                        */
-                       (void) strncpy(frombuf, argv[0], sizeof (frombuf));
-                       cp = strchr(frombuf, '@');
-                       if (cp != NULL)
-                               *cp = '\0';
-                       (void) strlcat(frombuf, fromname, sizeof (frombuf));
-                       fromname = frombuf;
-               }
-               err = zfs_send_one(zhp, fromname, STDOUT_FILENO, lzc_flags);
-               zfs_close(zhp);
-               return (err != 0);
-       }
-
-       cp = strchr(argv[0], '@');
-       *cp = '\0';
-       toname = cp + 1;
-       zhp = zfs_open(g_zfs, argv[0], ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-       if (zhp == NULL)
-               return (1);
-
-       /*
-        * If they specified the full path to the snapshot, chop off
-        * everything except the short name of the snapshot, but special
-        * case if they specify the origin.
-        */
-       if (fromname && (cp = strchr(fromname, '@')) != NULL) {
-               char origin[ZFS_MAXNAMELEN];
-               zprop_source_t src;
-
-               (void) zfs_prop_get(zhp, ZFS_PROP_ORIGIN,
-                   origin, sizeof (origin), &src, NULL, 0, B_FALSE);
-
-               if (strcmp(origin, fromname) == 0) {
-                       fromname = NULL;
-                       flags.fromorigin = B_TRUE;
-               } else {
-                       *cp = '\0';
-                       if (cp != fromname && strcmp(argv[0], fromname)) {
-                               (void) fprintf(stderr,
-                                   gettext("incremental source must be "
-                                   "in same filesystem\n"));
-                               usage(B_FALSE);
-                       }
-                       fromname = cp + 1;
-                       if (strchr(fromname, '@') || strchr(fromname, '/')) {
-                               (void) fprintf(stderr,
-                                   gettext("invalid incremental source\n"));
-                               usage(B_FALSE);
-                       }
-               }
-       }
-
-       if (flags.replicate && fromname == NULL)
-               flags.doall = B_TRUE;
-
-       err = zfs_send(zhp, fromname, toname, &flags, STDOUT_FILENO, NULL, 0,
-           extraverbose ? &dbgnv : NULL);
-
-       if (extraverbose && dbgnv != NULL) {
-               /*
-                * dump_nvlist prints to stdout, but that's been
-                * redirected to a file.  Make it print to stderr
-                * instead.
-                */
-               (void) dup2(STDERR_FILENO, STDOUT_FILENO);
-               dump_nvlist(dbgnv, 0);
-               nvlist_free(dbgnv);
-       }
-       zfs_close(zhp);
-
-       return (err != 0);
-}
-
-/*
- * zfs receive [-vnFu] [-d | -e] <fs@snap>
- *
- * Restore a backup stream from stdin.
- */
-static int
-zfs_do_receive(int argc, char **argv)
-{
-       int c, err;
-       recvflags_t flags = { 0 };
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":denuvF")) != -1) {
-               switch (c) {
-               case 'd':
-                       flags.isprefix = B_TRUE;
-                       break;
-               case 'e':
-                       flags.isprefix = B_TRUE;
-                       flags.istail = B_TRUE;
-                       break;
-               case 'n':
-                       flags.dryrun = B_TRUE;
-                       break;
-               case 'u':
-                       flags.nomount = B_TRUE;
-                       break;
-               case 'v':
-                       flags.verbose = B_TRUE;
-                       break;
-               case 'F':
-                       flags.force = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing snapshot argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       if (isatty(STDIN_FILENO)) {
-               (void) fprintf(stderr,
-                   gettext("Error: Backup stream can not be read "
-                   "from a terminal.\n"
-                   "You must redirect standard input.\n"));
-               return (1);
-       }
-
-       err = zfs_receive(g_zfs, argv[0], &flags, STDIN_FILENO, NULL);
-
-       return (err != 0);
-}
-
-/*
- * allow/unallow stuff
- */
-/* copied from zfs/sys/dsl_deleg.h */
-#define        ZFS_DELEG_PERM_CREATE           "create"
-#define        ZFS_DELEG_PERM_DESTROY          "destroy"
-#define        ZFS_DELEG_PERM_SNAPSHOT         "snapshot"
-#define        ZFS_DELEG_PERM_ROLLBACK         "rollback"
-#define        ZFS_DELEG_PERM_CLONE            "clone"
-#define        ZFS_DELEG_PERM_PROMOTE          "promote"
-#define        ZFS_DELEG_PERM_RENAME           "rename"
-#define        ZFS_DELEG_PERM_MOUNT            "mount"
-#define        ZFS_DELEG_PERM_SHARE            "share"
-#define        ZFS_DELEG_PERM_SEND             "send"
-#define        ZFS_DELEG_PERM_RECEIVE          "receive"
-#define        ZFS_DELEG_PERM_ALLOW            "allow"
-#define        ZFS_DELEG_PERM_USERPROP         "userprop"
-#define        ZFS_DELEG_PERM_VSCAN            "vscan" /* ??? */
-#define        ZFS_DELEG_PERM_USERQUOTA        "userquota"
-#define        ZFS_DELEG_PERM_GROUPQUOTA       "groupquota"
-#define        ZFS_DELEG_PERM_USERUSED         "userused"
-#define        ZFS_DELEG_PERM_GROUPUSED        "groupused"
-#define        ZFS_DELEG_PERM_HOLD             "hold"
-#define        ZFS_DELEG_PERM_RELEASE          "release"
-#define        ZFS_DELEG_PERM_DIFF             "diff"
-#define        ZFS_DELEG_PERM_BOOKMARK         "bookmark"
-
-#define        ZFS_NUM_DELEG_NOTES ZFS_DELEG_NOTE_NONE
-
-static zfs_deleg_perm_tab_t zfs_deleg_perm_tbl[] = {
-       { ZFS_DELEG_PERM_ALLOW, ZFS_DELEG_NOTE_ALLOW },
-       { ZFS_DELEG_PERM_CLONE, ZFS_DELEG_NOTE_CLONE },
-       { ZFS_DELEG_PERM_CREATE, ZFS_DELEG_NOTE_CREATE },
-       { ZFS_DELEG_PERM_DESTROY, ZFS_DELEG_NOTE_DESTROY },
-       { ZFS_DELEG_PERM_DIFF, ZFS_DELEG_NOTE_DIFF},
-       { ZFS_DELEG_PERM_HOLD, ZFS_DELEG_NOTE_HOLD },
-       { ZFS_DELEG_PERM_MOUNT, ZFS_DELEG_NOTE_MOUNT },
-       { ZFS_DELEG_PERM_PROMOTE, ZFS_DELEG_NOTE_PROMOTE },
-       { ZFS_DELEG_PERM_RECEIVE, ZFS_DELEG_NOTE_RECEIVE },
-       { ZFS_DELEG_PERM_RELEASE, ZFS_DELEG_NOTE_RELEASE },
-       { ZFS_DELEG_PERM_RENAME, ZFS_DELEG_NOTE_RENAME },
-       { ZFS_DELEG_PERM_ROLLBACK, ZFS_DELEG_NOTE_ROLLBACK },
-       { ZFS_DELEG_PERM_SEND, ZFS_DELEG_NOTE_SEND },
-       { ZFS_DELEG_PERM_SHARE, ZFS_DELEG_NOTE_SHARE },
-       { ZFS_DELEG_PERM_SNAPSHOT, ZFS_DELEG_NOTE_SNAPSHOT },
-       { ZFS_DELEG_PERM_BOOKMARK, ZFS_DELEG_NOTE_BOOKMARK },
-
-       { ZFS_DELEG_PERM_GROUPQUOTA, ZFS_DELEG_NOTE_GROUPQUOTA },
-       { ZFS_DELEG_PERM_GROUPUSED, ZFS_DELEG_NOTE_GROUPUSED },
-       { ZFS_DELEG_PERM_USERPROP, ZFS_DELEG_NOTE_USERPROP },
-       { ZFS_DELEG_PERM_USERQUOTA, ZFS_DELEG_NOTE_USERQUOTA },
-       { ZFS_DELEG_PERM_USERUSED, ZFS_DELEG_NOTE_USERUSED },
-       { NULL, ZFS_DELEG_NOTE_NONE }
-};
-
-/* permission structure */
-typedef struct deleg_perm {
-       zfs_deleg_who_type_t    dp_who_type;
-       const char              *dp_name;
-       boolean_t               dp_local;
-       boolean_t               dp_descend;
-} deleg_perm_t;
-
-/* */
-typedef struct deleg_perm_node {
-       deleg_perm_t            dpn_perm;
-
-       uu_avl_node_t           dpn_avl_node;
-} deleg_perm_node_t;
-
-typedef struct fs_perm fs_perm_t;
-
-/* permissions set */
-typedef struct who_perm {
-       zfs_deleg_who_type_t    who_type;
-       const char              *who_name;              /* id */
-       char                    who_ug_name[256];       /* user/group name */
-       fs_perm_t               *who_fsperm;            /* uplink */
-
-       uu_avl_t                *who_deleg_perm_avl;    /* permissions */
-} who_perm_t;
-
-/* */
-typedef struct who_perm_node {
-       who_perm_t      who_perm;
-       uu_avl_node_t   who_avl_node;
-} who_perm_node_t;
-
-typedef struct fs_perm_set fs_perm_set_t;
-/* fs permissions */
-struct fs_perm {
-       const char              *fsp_name;
-
-       uu_avl_t                *fsp_sc_avl;    /* sets,create */
-       uu_avl_t                *fsp_uge_avl;   /* user,group,everyone */
-
-       fs_perm_set_t           *fsp_set;       /* uplink */
-};
-
-/* */
-typedef struct fs_perm_node {
-       fs_perm_t       fspn_fsperm;
-       uu_avl_t        *fspn_avl;
-
-       uu_list_node_t  fspn_list_node;
-} fs_perm_node_t;
-
-/* top level structure */
-struct fs_perm_set {
-       uu_list_pool_t  *fsps_list_pool;
-       uu_list_t       *fsps_list; /* list of fs_perms */
-
-       uu_avl_pool_t   *fsps_named_set_avl_pool;
-       uu_avl_pool_t   *fsps_who_perm_avl_pool;
-       uu_avl_pool_t   *fsps_deleg_perm_avl_pool;
-};
-
-static inline const char *
-deleg_perm_type(zfs_deleg_note_t note)
-{
-       /* subcommands */
-       switch (note) {
-               /* SUBCOMMANDS */
-               /* OTHER */
-       case ZFS_DELEG_NOTE_GROUPQUOTA:
-       case ZFS_DELEG_NOTE_GROUPUSED:
-       case ZFS_DELEG_NOTE_USERPROP:
-       case ZFS_DELEG_NOTE_USERQUOTA:
-       case ZFS_DELEG_NOTE_USERUSED:
-               /* other */
-               return (gettext("other"));
-       default:
-               return (gettext("subcommand"));
-       }
-}
-
-static int inline
-who_type2weight(zfs_deleg_who_type_t who_type)
-{
-       int res;
-       switch (who_type) {
-               case ZFS_DELEG_NAMED_SET_SETS:
-               case ZFS_DELEG_NAMED_SET:
-                       res = 0;
-                       break;
-               case ZFS_DELEG_CREATE_SETS:
-               case ZFS_DELEG_CREATE:
-                       res = 1;
-                       break;
-               case ZFS_DELEG_USER_SETS:
-               case ZFS_DELEG_USER:
-                       res = 2;
-                       break;
-               case ZFS_DELEG_GROUP_SETS:
-               case ZFS_DELEG_GROUP:
-                       res = 3;
-                       break;
-               case ZFS_DELEG_EVERYONE_SETS:
-               case ZFS_DELEG_EVERYONE:
-                       res = 4;
-                       break;
-               default:
-                       res = -1;
-       }
-
-       return (res);
-}
-
-/* ARGSUSED */
-static int
-who_perm_compare(const void *larg, const void *rarg, void *unused)
-{
-       const who_perm_node_t *l = larg;
-       const who_perm_node_t *r = rarg;
-       zfs_deleg_who_type_t ltype = l->who_perm.who_type;
-       zfs_deleg_who_type_t rtype = r->who_perm.who_type;
-       int lweight = who_type2weight(ltype);
-       int rweight = who_type2weight(rtype);
-       int res = lweight - rweight;
-       if (res == 0)
-               res = strncmp(l->who_perm.who_name, r->who_perm.who_name,
-                   ZFS_MAX_DELEG_NAME-1);
-
-       if (res == 0)
-               return (0);
-       if (res > 0)
-               return (1);
-       else
-               return (-1);
-}
-
-/* ARGSUSED */
-static int
-deleg_perm_compare(const void *larg, const void *rarg, void *unused)
-{
-       const deleg_perm_node_t *l = larg;
-       const deleg_perm_node_t *r = rarg;
-       int res =  strncmp(l->dpn_perm.dp_name, r->dpn_perm.dp_name,
-           ZFS_MAX_DELEG_NAME-1);
-
-       if (res == 0)
-               return (0);
-
-       if (res > 0)
-               return (1);
-       else
-               return (-1);
-}
-
-static inline void
-fs_perm_set_init(fs_perm_set_t *fspset)
-{
-       bzero(fspset, sizeof (fs_perm_set_t));
-
-       if ((fspset->fsps_list_pool = uu_list_pool_create("fsps_list_pool",
-           sizeof (fs_perm_node_t), offsetof(fs_perm_node_t, fspn_list_node),
-           NULL, UU_DEFAULT)) == NULL)
-               nomem();
-       if ((fspset->fsps_list = uu_list_create(fspset->fsps_list_pool, NULL,
-           UU_DEFAULT)) == NULL)
-               nomem();
-
-       if ((fspset->fsps_named_set_avl_pool = uu_avl_pool_create(
-           "named_set_avl_pool", sizeof (who_perm_node_t), offsetof(
-           who_perm_node_t, who_avl_node), who_perm_compare,
-           UU_DEFAULT)) == NULL)
-               nomem();
-
-       if ((fspset->fsps_who_perm_avl_pool = uu_avl_pool_create(
-           "who_perm_avl_pool", sizeof (who_perm_node_t), offsetof(
-           who_perm_node_t, who_avl_node), who_perm_compare,
-           UU_DEFAULT)) == NULL)
-               nomem();
-
-       if ((fspset->fsps_deleg_perm_avl_pool = uu_avl_pool_create(
-           "deleg_perm_avl_pool", sizeof (deleg_perm_node_t), offsetof(
-           deleg_perm_node_t, dpn_avl_node), deleg_perm_compare, UU_DEFAULT))
-           == NULL)
-               nomem();
-}
-
-static inline void fs_perm_fini(fs_perm_t *);
-static inline void who_perm_fini(who_perm_t *);
-
-static inline void
-fs_perm_set_fini(fs_perm_set_t *fspset)
-{
-       fs_perm_node_t *node = uu_list_first(fspset->fsps_list);
-
-       while (node != NULL) {
-               fs_perm_node_t *next_node =
-                   uu_list_next(fspset->fsps_list, node);
-               fs_perm_t *fsperm = &node->fspn_fsperm;
-               fs_perm_fini(fsperm);
-               uu_list_remove(fspset->fsps_list, node);
-               free(node);
-               node = next_node;
-       }
-
-       uu_avl_pool_destroy(fspset->fsps_named_set_avl_pool);
-       uu_avl_pool_destroy(fspset->fsps_who_perm_avl_pool);
-       uu_avl_pool_destroy(fspset->fsps_deleg_perm_avl_pool);
-}
-
-static inline void
-deleg_perm_init(deleg_perm_t *deleg_perm, zfs_deleg_who_type_t type,
-    const char *name)
-{
-       deleg_perm->dp_who_type = type;
-       deleg_perm->dp_name = name;
-}
-
-static inline void
-who_perm_init(who_perm_t *who_perm, fs_perm_t *fsperm,
-    zfs_deleg_who_type_t type, const char *name)
-{
-       uu_avl_pool_t   *pool;
-       pool = fsperm->fsp_set->fsps_deleg_perm_avl_pool;
-
-       bzero(who_perm, sizeof (who_perm_t));
-
-       if ((who_perm->who_deleg_perm_avl = uu_avl_create(pool, NULL,
-           UU_DEFAULT)) == NULL)
-               nomem();
-
-       who_perm->who_type = type;
-       who_perm->who_name = name;
-       who_perm->who_fsperm = fsperm;
-}
-
-static inline void
-who_perm_fini(who_perm_t *who_perm)
-{
-       deleg_perm_node_t *node = uu_avl_first(who_perm->who_deleg_perm_avl);
-
-       while (node != NULL) {
-               deleg_perm_node_t *next_node =
-                   uu_avl_next(who_perm->who_deleg_perm_avl, node);
-
-               uu_avl_remove(who_perm->who_deleg_perm_avl, node);
-               free(node);
-               node = next_node;
-       }
-
-       uu_avl_destroy(who_perm->who_deleg_perm_avl);
-}
-
-static inline void
-fs_perm_init(fs_perm_t *fsperm, fs_perm_set_t *fspset, const char *fsname)
-{
-       uu_avl_pool_t   *nset_pool = fspset->fsps_named_set_avl_pool;
-       uu_avl_pool_t   *who_pool = fspset->fsps_who_perm_avl_pool;
-
-       bzero(fsperm, sizeof (fs_perm_t));
-
-       if ((fsperm->fsp_sc_avl = uu_avl_create(nset_pool, NULL, UU_DEFAULT))
-           == NULL)
-               nomem();
-
-       if ((fsperm->fsp_uge_avl = uu_avl_create(who_pool, NULL, UU_DEFAULT))
-           == NULL)
-               nomem();
-
-       fsperm->fsp_set = fspset;
-       fsperm->fsp_name = fsname;
-}
-
-static inline void
-fs_perm_fini(fs_perm_t *fsperm)
-{
-       who_perm_node_t *node = uu_avl_first(fsperm->fsp_sc_avl);
-       while (node != NULL) {
-               who_perm_node_t *next_node = uu_avl_next(fsperm->fsp_sc_avl,
-                   node);
-               who_perm_t *who_perm = &node->who_perm;
-               who_perm_fini(who_perm);
-               uu_avl_remove(fsperm->fsp_sc_avl, node);
-               free(node);
-               node = next_node;
-       }
-
-       node = uu_avl_first(fsperm->fsp_uge_avl);
-       while (node != NULL) {
-               who_perm_node_t *next_node = uu_avl_next(fsperm->fsp_uge_avl,
-                   node);
-               who_perm_t *who_perm = &node->who_perm;
-               who_perm_fini(who_perm);
-               uu_avl_remove(fsperm->fsp_uge_avl, node);
-               free(node);
-               node = next_node;
-       }
-
-       uu_avl_destroy(fsperm->fsp_sc_avl);
-       uu_avl_destroy(fsperm->fsp_uge_avl);
-}
-
-static void inline
-set_deleg_perm_node(uu_avl_t *avl, deleg_perm_node_t *node,
-    zfs_deleg_who_type_t who_type, const char *name, char locality)
-{
-       uu_avl_index_t idx = 0;
-
-       deleg_perm_node_t *found_node = NULL;
-       deleg_perm_t    *deleg_perm = &node->dpn_perm;
-
-       deleg_perm_init(deleg_perm, who_type, name);
-
-       if ((found_node = uu_avl_find(avl, node, NULL, &idx))
-           == NULL)
-               uu_avl_insert(avl, node, idx);
-       else {
-               node = found_node;
-               deleg_perm = &node->dpn_perm;
-       }
-
-
-       switch (locality) {
-       case ZFS_DELEG_LOCAL:
-               deleg_perm->dp_local = B_TRUE;
-               break;
-       case ZFS_DELEG_DESCENDENT:
-               deleg_perm->dp_descend = B_TRUE;
-               break;
-       case ZFS_DELEG_NA:
-               break;
-       default:
-               assert(B_FALSE); /* invalid locality */
-       }
-}
-
-static inline int
-parse_who_perm(who_perm_t *who_perm, nvlist_t *nvl, char locality)
-{
-       nvpair_t *nvp = NULL;
-       fs_perm_set_t *fspset = who_perm->who_fsperm->fsp_set;
-       uu_avl_t *avl = who_perm->who_deleg_perm_avl;
-       zfs_deleg_who_type_t who_type = who_perm->who_type;
-
-       while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
-               const char *name = nvpair_name(nvp);
-               data_type_t type = nvpair_type(nvp);
-               uu_avl_pool_t *avl_pool = fspset->fsps_deleg_perm_avl_pool;
-               deleg_perm_node_t *node =
-                   safe_malloc(sizeof (deleg_perm_node_t));
-
-               VERIFY(type == DATA_TYPE_BOOLEAN);
-
-               uu_avl_node_init(node, &node->dpn_avl_node, avl_pool);
-               set_deleg_perm_node(avl, node, who_type, name, locality);
-       }
-
-       return (0);
-}
-
-static inline int
-parse_fs_perm(fs_perm_t *fsperm, nvlist_t *nvl)
-{
-       nvpair_t *nvp = NULL;
-       fs_perm_set_t *fspset = fsperm->fsp_set;
-
-       while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
-               nvlist_t *nvl2 = NULL;
-               const char *name = nvpair_name(nvp);
-               uu_avl_t *avl = NULL;
-               uu_avl_pool_t *avl_pool = NULL;
-               zfs_deleg_who_type_t perm_type = name[0];
-               char perm_locality = name[1];
-               const char *perm_name = name + 3;
-               boolean_t is_set = B_TRUE;
-               who_perm_t *who_perm = NULL;
-
-               assert('$' == name[2]);
-
-               if (nvpair_value_nvlist(nvp, &nvl2) != 0)
-                       return (-1);
-
-               switch (perm_type) {
-               case ZFS_DELEG_CREATE:
-               case ZFS_DELEG_CREATE_SETS:
-               case ZFS_DELEG_NAMED_SET:
-               case ZFS_DELEG_NAMED_SET_SETS:
-                       avl_pool = fspset->fsps_named_set_avl_pool;
-                       avl = fsperm->fsp_sc_avl;
-                       break;
-               case ZFS_DELEG_USER:
-               case ZFS_DELEG_USER_SETS:
-               case ZFS_DELEG_GROUP:
-               case ZFS_DELEG_GROUP_SETS:
-               case ZFS_DELEG_EVERYONE:
-               case ZFS_DELEG_EVERYONE_SETS:
-                       avl_pool = fspset->fsps_who_perm_avl_pool;
-                       avl = fsperm->fsp_uge_avl;
-                       break;
-               default:
-                       break;
-               }
-
-               if (is_set) {
-                       who_perm_node_t *found_node = NULL;
-                       who_perm_node_t *node = safe_malloc(
-                           sizeof (who_perm_node_t));
-                       who_perm = &node->who_perm;
-                       uu_avl_index_t idx = 0;
-
-                       uu_avl_node_init(node, &node->who_avl_node, avl_pool);
-                       who_perm_init(who_perm, fsperm, perm_type, perm_name);
-
-                       if ((found_node = uu_avl_find(avl, node, NULL, &idx))
-                           == NULL) {
-                               if (avl == fsperm->fsp_uge_avl) {
-                                       uid_t rid = 0;
-                                       struct passwd *p = NULL;
-                                       struct group *g = NULL;
-                                       const char *nice_name = NULL;
-
-                                       switch (perm_type) {
-                                       case ZFS_DELEG_USER_SETS:
-                                       case ZFS_DELEG_USER:
-                                               rid = atoi(perm_name);
-                                               p = getpwuid(rid);
-                                               if (p)
-                                                       nice_name = p->pw_name;
-                                               break;
-                                       case ZFS_DELEG_GROUP_SETS:
-                                       case ZFS_DELEG_GROUP:
-                                               rid = atoi(perm_name);
-                                               g = getgrgid(rid);
-                                               if (g)
-                                                       nice_name = g->gr_name;
-                                               break;
-                                       default:
-                                               break;
-                                       }
-
-                                       if (nice_name != NULL)
-                                               (void) strlcpy(
-                                                   node->who_perm.who_ug_name,
-                                                   nice_name, 256);
-                               }
-
-                               uu_avl_insert(avl, node, idx);
-                       } else {
-                               node = found_node;
-                               who_perm = &node->who_perm;
-                       }
-               }
-
-               (void) parse_who_perm(who_perm, nvl2, perm_locality);
-       }
-
-       return (0);
-}
-
-static inline int
-parse_fs_perm_set(fs_perm_set_t *fspset, nvlist_t *nvl)
-{
-       nvpair_t *nvp = NULL;
-       uu_avl_index_t idx = 0;
-
-       while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
-               nvlist_t *nvl2 = NULL;
-               const char *fsname = nvpair_name(nvp);
-               data_type_t type = nvpair_type(nvp);
-               fs_perm_t *fsperm = NULL;
-               fs_perm_node_t *node = safe_malloc(sizeof (fs_perm_node_t));
-               if (node == NULL)
-                       nomem();
-
-               fsperm = &node->fspn_fsperm;
-
-               VERIFY(DATA_TYPE_NVLIST == type);
-
-               uu_list_node_init(node, &node->fspn_list_node,
-                   fspset->fsps_list_pool);
-
-               idx = uu_list_numnodes(fspset->fsps_list);
-               fs_perm_init(fsperm, fspset, fsname);
-
-               if (nvpair_value_nvlist(nvp, &nvl2) != 0)
-                       return (-1);
-
-               (void) parse_fs_perm(fsperm, nvl2);
-
-               uu_list_insert(fspset->fsps_list, node, idx);
-       }
-
-       return (0);
-}
-
-static inline const char *
-deleg_perm_comment(zfs_deleg_note_t note)
-{
-       const char *str = "";
-
-       /* subcommands */
-       switch (note) {
-               /* SUBCOMMANDS */
-       case ZFS_DELEG_NOTE_ALLOW:
-               str = gettext("Must also have the permission that is being"
-                   "\n\t\t\t\tallowed");
-               break;
-       case ZFS_DELEG_NOTE_CLONE:
-               str = gettext("Must also have the 'create' ability and 'mount'"
-                   "\n\t\t\t\tability in the origin file system");
-               break;
-       case ZFS_DELEG_NOTE_CREATE:
-               str = gettext("Must also have the 'mount' ability");
-               break;
-       case ZFS_DELEG_NOTE_DESTROY:
-               str = gettext("Must also have the 'mount' ability");
-               break;
-       case ZFS_DELEG_NOTE_DIFF:
-               str = gettext("Allows lookup of paths within a dataset;"
-                   "\n\t\t\t\tgiven an object number. Ordinary users need this"
-                   "\n\t\t\t\tin order to use zfs diff");
-               break;
-       case ZFS_DELEG_NOTE_HOLD:
-               str = gettext("Allows adding a user hold to a snapshot");
-               break;
-       case ZFS_DELEG_NOTE_MOUNT:
-               str = gettext("Allows mount/umount of ZFS datasets");
-               break;
-       case ZFS_DELEG_NOTE_PROMOTE:
-               str = gettext("Must also have the 'mount'\n\t\t\t\tand"
-                   " 'promote' ability in the origin file system");
-               break;
-       case ZFS_DELEG_NOTE_RECEIVE:
-               str = gettext("Must also have the 'mount' and 'create'"
-                   " ability");
-               break;
-       case ZFS_DELEG_NOTE_RELEASE:
-               str = gettext("Allows releasing a user hold which\n\t\t\t\t"
-                   "might destroy the snapshot");
-               break;
-       case ZFS_DELEG_NOTE_RENAME:
-               str = gettext("Must also have the 'mount' and 'create'"
-                   "\n\t\t\t\tability in the new parent");
-               break;
-       case ZFS_DELEG_NOTE_ROLLBACK:
-               str = gettext("");
-               break;
-       case ZFS_DELEG_NOTE_SEND:
-               str = gettext("");
-               break;
-       case ZFS_DELEG_NOTE_SHARE:
-               str = gettext("Allows sharing file systems over NFS or SMB"
-                   "\n\t\t\t\tprotocols");
-               break;
-       case ZFS_DELEG_NOTE_SNAPSHOT:
-               str = gettext("");
-               break;
-/*
- *     case ZFS_DELEG_NOTE_VSCAN:
- *             str = gettext("");
- *             break;
- */
-               /* OTHER */
-       case ZFS_DELEG_NOTE_GROUPQUOTA:
-               str = gettext("Allows accessing any groupquota@... property");
-               break;
-       case ZFS_DELEG_NOTE_GROUPUSED:
-               str = gettext("Allows reading any groupused@... property");
-               break;
-       case ZFS_DELEG_NOTE_USERPROP:
-               str = gettext("Allows changing any user property");
-               break;
-       case ZFS_DELEG_NOTE_USERQUOTA:
-               str = gettext("Allows accessing any userquota@... property");
-               break;
-       case ZFS_DELEG_NOTE_USERUSED:
-               str = gettext("Allows reading any userused@... property");
-               break;
-               /* other */
-       default:
-               str = "";
-       }
-
-       return (str);
-}
-
-struct allow_opts {
-       boolean_t local;
-       boolean_t descend;
-       boolean_t user;
-       boolean_t group;
-       boolean_t everyone;
-       boolean_t create;
-       boolean_t set;
-       boolean_t recursive; /* unallow only */
-       boolean_t prt_usage;
-
-       boolean_t prt_perms;
-       char *who;
-       char *perms;
-       const char *dataset;
-};
-
-static inline int
-prop_cmp(const void *a, const void *b)
-{
-       const char *str1 = *(const char **)a;
-       const char *str2 = *(const char **)b;
-       return (strcmp(str1, str2));
-}
-
-static void
-allow_usage(boolean_t un, boolean_t requested, const char *msg)
-{
-       const char *opt_desc[] = {
-               "-h", gettext("show this help message and exit"),
-               "-l", gettext("set permission locally"),
-               "-d", gettext("set permission for descents"),
-               "-u", gettext("set permission for user"),
-               "-g", gettext("set permission for group"),
-               "-e", gettext("set permission for everyone"),
-               "-c", gettext("set create time permission"),
-               "-s", gettext("define permission set"),
-               /* unallow only */
-               "-r", gettext("remove permissions recursively"),
-       };
-       size_t unallow_size = sizeof (opt_desc) / sizeof (char *);
-       size_t allow_size = unallow_size - 2;
-       const char *props[ZFS_NUM_PROPS];
-       int i;
-       size_t count = 0;
-       FILE *fp = requested ? stdout : stderr;
-       zprop_desc_t *pdtbl = zfs_prop_get_table();
-       const char *fmt = gettext("%-16s %-14s\t%s\n");
-
-       (void) fprintf(fp, gettext("Usage: %s\n"), get_usage(un ? HELP_UNALLOW :
-           HELP_ALLOW));
-       (void) fprintf(fp, gettext("Options:\n"));
-       for (i = 0; i < (un ? unallow_size : allow_size); i++) {
-               const char *opt = opt_desc[i++];
-               const char *optdsc = opt_desc[i];
-               (void) fprintf(fp, gettext("  %-10s  %s\n"), opt, optdsc);
-       }
-
-       (void) fprintf(fp, gettext("\nThe following permissions are "
-           "supported:\n\n"));
-       (void) fprintf(fp, fmt, gettext("NAME"), gettext("TYPE"),
-           gettext("NOTES"));
-       for (i = 0; i < ZFS_NUM_DELEG_NOTES; i++) {
-               const char *perm_name = zfs_deleg_perm_tbl[i].z_perm;
-               zfs_deleg_note_t perm_note = zfs_deleg_perm_tbl[i].z_note;
-               const char *perm_type = deleg_perm_type(perm_note);
-               const char *perm_comment = deleg_perm_comment(perm_note);
-               (void) fprintf(fp, fmt, perm_name, perm_type, perm_comment);
-       }
-
-       for (i = 0; i < ZFS_NUM_PROPS; i++) {
-               zprop_desc_t *pd = &pdtbl[i];
-               if (pd->pd_visible != B_TRUE)
-                       continue;
-
-               if (pd->pd_attr == PROP_READONLY)
-                       continue;
-
-               props[count++] = pd->pd_name;
-       }
-       props[count] = NULL;
-
-       qsort(props, count, sizeof (char *), prop_cmp);
-
-       for (i = 0; i < count; i++)
-               (void) fprintf(fp, fmt, props[i], gettext("property"), "");
-
-       if (msg != NULL)
-               (void) fprintf(fp, gettext("\nzfs: error: %s"), msg);
-
-       exit(requested ? 0 : 2);
-}
-
-static inline const char *
-munge_args(int argc, char **argv, boolean_t un, size_t expected_argc,
-    char **permsp)
-{
-       if (un && argc == expected_argc - 1)
-               *permsp = NULL;
-       else if (argc == expected_argc)
-               *permsp = argv[argc - 2];
-       else
-               allow_usage(un, B_FALSE,
-                   gettext("wrong number of parameters\n"));
-
-       return (argv[argc - 1]);
-}
-
-static void
-parse_allow_args(int argc, char **argv, boolean_t un, struct allow_opts *opts)
-{
-       int uge_sum = opts->user + opts->group + opts->everyone;
-       int csuge_sum = opts->create + opts->set + uge_sum;
-       int ldcsuge_sum = csuge_sum + opts->local + opts->descend;
-       int all_sum = un ? ldcsuge_sum + opts->recursive : ldcsuge_sum;
-
-       if (uge_sum > 1)
-               allow_usage(un, B_FALSE,
-                   gettext("-u, -g, and -e are mutually exclusive\n"));
-
-       if (opts->prt_usage) {
-               if (argc == 0 && all_sum == 0)
-                       allow_usage(un, B_TRUE, NULL);
-               else
-                       usage(B_FALSE);
-       }
-
-       if (opts->set) {
-               if (csuge_sum > 1)
-                       allow_usage(un, B_FALSE,
-                           gettext("invalid options combined with -s\n"));
-
-               opts->dataset = munge_args(argc, argv, un, 3, &opts->perms);
-               if (argv[0][0] != '@')
-                       allow_usage(un, B_FALSE,
-                           gettext("invalid set name: missing '@' prefix\n"));
-               opts->who = argv[0];
-       } else if (opts->create) {
-               if (ldcsuge_sum > 1)
-                       allow_usage(un, B_FALSE,
-                           gettext("invalid options combined with -c\n"));
-               opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
-       } else if (opts->everyone) {
-               if (csuge_sum > 1)
-                       allow_usage(un, B_FALSE,
-                           gettext("invalid options combined with -e\n"));
-               opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
-       } else if (uge_sum == 0 && argc > 0 && strcmp(argv[0], "everyone")
-           == 0) {
-               opts->everyone = B_TRUE;
-               argc--;
-               argv++;
-               opts->dataset = munge_args(argc, argv, un, 2, &opts->perms);
-       } else if (argc == 1 && !un) {
-               opts->prt_perms = B_TRUE;
-               opts->dataset = argv[argc-1];
-       } else {
-               opts->dataset = munge_args(argc, argv, un, 3, &opts->perms);
-               opts->who = argv[0];
-       }
-
-       if (!opts->local && !opts->descend) {
-               opts->local = B_TRUE;
-               opts->descend = B_TRUE;
-       }
-}
-
-static void
-store_allow_perm(zfs_deleg_who_type_t type, boolean_t local, boolean_t descend,
-    const char *who, char *perms, nvlist_t *top_nvl)
-{
-       int i;
-       char ld[2] = { '\0', '\0' };
-       char who_buf[ZFS_MAXNAMELEN+32];
-       char base_type = ZFS_DELEG_WHO_UNKNOWN;
-       char set_type = ZFS_DELEG_WHO_UNKNOWN;
-       nvlist_t *base_nvl = NULL;
-       nvlist_t *set_nvl = NULL;
-       nvlist_t *nvl;
-
-       if (nvlist_alloc(&base_nvl, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-       if (nvlist_alloc(&set_nvl, NV_UNIQUE_NAME, 0) !=  0)
-               nomem();
-
-       switch (type) {
-       case ZFS_DELEG_NAMED_SET_SETS:
-       case ZFS_DELEG_NAMED_SET:
-               set_type = ZFS_DELEG_NAMED_SET_SETS;
-               base_type = ZFS_DELEG_NAMED_SET;
-               ld[0] = ZFS_DELEG_NA;
-               break;
-       case ZFS_DELEG_CREATE_SETS:
-       case ZFS_DELEG_CREATE:
-               set_type = ZFS_DELEG_CREATE_SETS;
-               base_type = ZFS_DELEG_CREATE;
-               ld[0] = ZFS_DELEG_NA;
-               break;
-       case ZFS_DELEG_USER_SETS:
-       case ZFS_DELEG_USER:
-               set_type = ZFS_DELEG_USER_SETS;
-               base_type = ZFS_DELEG_USER;
-               if (local)
-                       ld[0] = ZFS_DELEG_LOCAL;
-               if (descend)
-                       ld[1] = ZFS_DELEG_DESCENDENT;
-               break;
-       case ZFS_DELEG_GROUP_SETS:
-       case ZFS_DELEG_GROUP:
-               set_type = ZFS_DELEG_GROUP_SETS;
-               base_type = ZFS_DELEG_GROUP;
-               if (local)
-                       ld[0] = ZFS_DELEG_LOCAL;
-               if (descend)
-                       ld[1] = ZFS_DELEG_DESCENDENT;
-               break;
-       case ZFS_DELEG_EVERYONE_SETS:
-       case ZFS_DELEG_EVERYONE:
-               set_type = ZFS_DELEG_EVERYONE_SETS;
-               base_type = ZFS_DELEG_EVERYONE;
-               if (local)
-                       ld[0] = ZFS_DELEG_LOCAL;
-               if (descend)
-                       ld[1] = ZFS_DELEG_DESCENDENT;
-       default:
-               break;
-       }
-
-       if (perms != NULL) {
-               char *curr = perms;
-               char *end = curr + strlen(perms);
-
-               while (curr < end) {
-                       char *delim = strchr(curr, ',');
-                       if (delim == NULL)
-                               delim = end;
-                       else
-                               *delim = '\0';
-
-                       if (curr[0] == '@')
-                               nvl = set_nvl;
-                       else
-                               nvl = base_nvl;
-
-                       (void) nvlist_add_boolean(nvl, curr);
-                       if (delim != end)
-                               *delim = ',';
-                       curr = delim + 1;
-               }
-
-               for (i = 0; i < 2; i++) {
-                       char locality = ld[i];
-                       if (locality == 0)
-                               continue;
-
-                       if (!nvlist_empty(base_nvl)) {
-                               if (who != NULL)
-                                       (void) snprintf(who_buf,
-                                           sizeof (who_buf), "%c%c$%s",
-                                           base_type, locality, who);
-                               else
-                                       (void) snprintf(who_buf,
-                                           sizeof (who_buf), "%c%c$",
-                                           base_type, locality);
-
-                               (void) nvlist_add_nvlist(top_nvl, who_buf,
-                                   base_nvl);
-                       }
-
-
-                       if (!nvlist_empty(set_nvl)) {
-                               if (who != NULL)
-                                       (void) snprintf(who_buf,
-                                           sizeof (who_buf), "%c%c$%s",
-                                           set_type, locality, who);
-                               else
-                                       (void) snprintf(who_buf,
-                                           sizeof (who_buf), "%c%c$",
-                                           set_type, locality);
-
-                               (void) nvlist_add_nvlist(top_nvl, who_buf,
-                                   set_nvl);
-                       }
-               }
-       } else {
-               for (i = 0; i < 2; i++) {
-                       char locality = ld[i];
-                       if (locality == 0)
-                               continue;
-
-                       if (who != NULL)
-                               (void) snprintf(who_buf, sizeof (who_buf),
-                                   "%c%c$%s", base_type, locality, who);
-                       else
-                               (void) snprintf(who_buf, sizeof (who_buf),
-                                   "%c%c$", base_type, locality);
-                       (void) nvlist_add_boolean(top_nvl, who_buf);
-
-                       if (who != NULL)
-                               (void) snprintf(who_buf, sizeof (who_buf),
-                                   "%c%c$%s", set_type, locality, who);
-                       else
-                               (void) snprintf(who_buf, sizeof (who_buf),
-                                   "%c%c$", set_type, locality);
-                       (void) nvlist_add_boolean(top_nvl, who_buf);
-               }
-       }
-}
-
-static int
-construct_fsacl_list(boolean_t un, struct allow_opts *opts, nvlist_t **nvlp)
-{
-       if (nvlist_alloc(nvlp, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-
-       if (opts->set) {
-               store_allow_perm(ZFS_DELEG_NAMED_SET, opts->local,
-                   opts->descend, opts->who, opts->perms, *nvlp);
-       } else if (opts->create) {
-               store_allow_perm(ZFS_DELEG_CREATE, opts->local,
-                   opts->descend, NULL, opts->perms, *nvlp);
-       } else if (opts->everyone) {
-               store_allow_perm(ZFS_DELEG_EVERYONE, opts->local,
-                   opts->descend, NULL, opts->perms, *nvlp);
-       } else {
-               char *curr = opts->who;
-               char *end = curr + strlen(curr);
-
-               while (curr < end) {
-                       const char *who;
-                       zfs_deleg_who_type_t who_type = ZFS_DELEG_WHO_UNKNOWN;
-                       char *endch;
-                       char *delim = strchr(curr, ',');
-                       char errbuf[256];
-                       char id[64];
-                       struct passwd *p = NULL;
-                       struct group *g = NULL;
-
-                       uid_t rid;
-                       if (delim == NULL)
-                               delim = end;
-                       else
-                               *delim = '\0';
-
-                       rid = (uid_t)strtol(curr, &endch, 0);
-                       if (opts->user) {
-                               who_type = ZFS_DELEG_USER;
-                               if (*endch != '\0')
-                                       p = getpwnam(curr);
-                               else
-                                       p = getpwuid(rid);
-
-                               if (p != NULL)
-                                       rid = p->pw_uid;
-                               else {
-                                       (void) snprintf(errbuf, 256, gettext(
-                                           "invalid user %s"), curr);
-                                       allow_usage(un, B_TRUE, errbuf);
-                               }
-                       } else if (opts->group) {
-                               who_type = ZFS_DELEG_GROUP;
-                               if (*endch != '\0')
-                                       g = getgrnam(curr);
-                               else
-                                       g = getgrgid(rid);
-
-                               if (g != NULL)
-                                       rid = g->gr_gid;
-                               else {
-                                       (void) snprintf(errbuf, 256, gettext(
-                                           "invalid group %s"),  curr);
-                                       allow_usage(un, B_TRUE, errbuf);
-                               }
-                       } else {
-                               if (*endch != '\0') {
-                                       p = getpwnam(curr);
-                               } else {
-                                       p = getpwuid(rid);
-                               }
-
-                               if (p == NULL) {
-                                       if (*endch != '\0') {
-                                               g = getgrnam(curr);
-                                       } else {
-                                               g = getgrgid(rid);
-                                       }
-                               }
-
-                               if (p != NULL) {
-                                       who_type = ZFS_DELEG_USER;
-                                       rid = p->pw_uid;
-                               } else if (g != NULL) {
-                                       who_type = ZFS_DELEG_GROUP;
-                                       rid = g->gr_gid;
-                               } else {
-                                       (void) snprintf(errbuf, 256, gettext(
-                                           "invalid user/group %s"), curr);
-                                       allow_usage(un, B_TRUE, errbuf);
-                               }
-                       }
-
-                       (void) sprintf(id, "%u", rid);
-                       who = id;
-
-                       store_allow_perm(who_type, opts->local,
-                           opts->descend, who, opts->perms, *nvlp);
-                       curr = delim + 1;
-               }
-       }
-
-       return (0);
-}
-
-static void
-print_set_creat_perms(uu_avl_t *who_avl)
-{
-       const char *sc_title[] = {
-               gettext("Permission sets:\n"),
-               gettext("Create time permissions:\n"),
-               NULL
-       };
-       const char **title_ptr = sc_title;
-       who_perm_node_t *who_node = NULL;
-       int prev_weight = -1;
-
-       for (who_node = uu_avl_first(who_avl); who_node != NULL;
-           who_node = uu_avl_next(who_avl, who_node)) {
-               uu_avl_t *avl = who_node->who_perm.who_deleg_perm_avl;
-               zfs_deleg_who_type_t who_type = who_node->who_perm.who_type;
-               const char *who_name = who_node->who_perm.who_name;
-               int weight = who_type2weight(who_type);
-               boolean_t first = B_TRUE;
-               deleg_perm_node_t *deleg_node;
-
-               if (prev_weight != weight) {
-                       (void) printf("%s", *title_ptr++);
-                       prev_weight = weight;
-               }
-
-               if (who_name == NULL || strnlen(who_name, 1) == 0)
-                       (void) printf("\t");
-               else
-                       (void) printf("\t%s ", who_name);
-
-               for (deleg_node = uu_avl_first(avl); deleg_node != NULL;
-                   deleg_node = uu_avl_next(avl, deleg_node)) {
-                       if (first) {
-                               (void) printf("%s",
-                                   deleg_node->dpn_perm.dp_name);
-                               first = B_FALSE;
-                       } else
-                               (void) printf(",%s",
-                                   deleg_node->dpn_perm.dp_name);
-               }
-
-               (void) printf("\n");
-       }
-}
-
-static void inline
-print_uge_deleg_perms(uu_avl_t *who_avl, boolean_t local, boolean_t descend,
-    const char *title)
-{
-       who_perm_node_t *who_node = NULL;
-       boolean_t prt_title = B_TRUE;
-       uu_avl_walk_t *walk;
-
-       if ((walk = uu_avl_walk_start(who_avl, UU_WALK_ROBUST)) == NULL)
-               nomem();
-
-       while ((who_node = uu_avl_walk_next(walk)) != NULL) {
-               const char *who_name = who_node->who_perm.who_name;
-               const char *nice_who_name = who_node->who_perm.who_ug_name;
-               uu_avl_t *avl = who_node->who_perm.who_deleg_perm_avl;
-               zfs_deleg_who_type_t who_type = who_node->who_perm.who_type;
-               char delim = ' ';
-               deleg_perm_node_t *deleg_node;
-               boolean_t prt_who = B_TRUE;
-
-               for (deleg_node = uu_avl_first(avl);
-                   deleg_node != NULL;
-                   deleg_node = uu_avl_next(avl, deleg_node)) {
-                       if (local != deleg_node->dpn_perm.dp_local ||
-                           descend != deleg_node->dpn_perm.dp_descend)
-                               continue;
-
-                       if (prt_who) {
-                               const char *who = NULL;
-                               if (prt_title) {
-                                       prt_title = B_FALSE;
-                                       (void) printf("%s", title);
-                               }
-
-                               switch (who_type) {
-                               case ZFS_DELEG_USER_SETS:
-                               case ZFS_DELEG_USER:
-                                       who = gettext("user");
-                                       if (nice_who_name)
-                                               who_name  = nice_who_name;
-                                       break;
-                               case ZFS_DELEG_GROUP_SETS:
-                               case ZFS_DELEG_GROUP:
-                                       who = gettext("group");
-                                       if (nice_who_name)
-                                               who_name  = nice_who_name;
-                                       break;
-                               case ZFS_DELEG_EVERYONE_SETS:
-                               case ZFS_DELEG_EVERYONE:
-                                       who = gettext("everyone");
-                                       who_name = NULL;
-                               default:
-                                       break;
-                               }
-
-                               prt_who = B_FALSE;
-                               if (who_name == NULL)
-                                       (void) printf("\t%s", who);
-                               else
-                                       (void) printf("\t%s %s", who, who_name);
-                       }
-
-                       (void) printf("%c%s", delim,
-                           deleg_node->dpn_perm.dp_name);
-                       delim = ',';
-               }
-
-               if (!prt_who)
-                       (void) printf("\n");
-       }
-
-       uu_avl_walk_end(walk);
-}
-
-static void
-print_fs_perms(fs_perm_set_t *fspset)
-{
-       fs_perm_node_t *node = NULL;
-       char buf[ZFS_MAXNAMELEN+32];
-       const char *dsname = buf;
-
-       for (node = uu_list_first(fspset->fsps_list); node != NULL;
-           node = uu_list_next(fspset->fsps_list, node)) {
-               uu_avl_t *sc_avl = node->fspn_fsperm.fsp_sc_avl;
-               uu_avl_t *uge_avl = node->fspn_fsperm.fsp_uge_avl;
-               int left = 0;
-
-               (void) snprintf(buf, ZFS_MAXNAMELEN+32,
-                   gettext("---- Permissions on %s "),
-                   node->fspn_fsperm.fsp_name);
-               (void) printf("%s", dsname);
-               left = 70 - strlen(buf);
-               while (left-- > 0)
-                       (void) printf("-");
-               (void) printf("\n");
-
-               print_set_creat_perms(sc_avl);
-               print_uge_deleg_perms(uge_avl, B_TRUE, B_FALSE,
-                   gettext("Local permissions:\n"));
-               print_uge_deleg_perms(uge_avl, B_FALSE, B_TRUE,
-                   gettext("Descendent permissions:\n"));
-               print_uge_deleg_perms(uge_avl, B_TRUE, B_TRUE,
-                   gettext("Local+Descendent permissions:\n"));
-       }
-}
-
-static fs_perm_set_t fs_perm_set = { NULL, NULL, NULL, NULL };
-
-struct deleg_perms {
-       boolean_t un;
-       nvlist_t *nvl;
-};
-
-static int
-set_deleg_perms(zfs_handle_t *zhp, void *data)
-{
-       struct deleg_perms *perms = (struct deleg_perms *)data;
-       zfs_type_t zfs_type = zfs_get_type(zhp);
-
-       if (zfs_type != ZFS_TYPE_FILESYSTEM && zfs_type != ZFS_TYPE_VOLUME)
-               return (0);
-
-       return (zfs_set_fsacl(zhp, perms->un, perms->nvl));
-}
-
-static int
-zfs_do_allow_unallow_impl(int argc, char **argv, boolean_t un)
-{
-       zfs_handle_t *zhp;
-       nvlist_t *perm_nvl = NULL;
-       nvlist_t *update_perm_nvl = NULL;
-       int error = 1;
-       int c;
-       struct allow_opts opts = { 0 };
-
-       const char *optstr = un ? "ldugecsrh" : "ldugecsh";
-
-       /* check opts */
-       while ((c = getopt(argc, argv, optstr)) != -1) {
-               switch (c) {
-               case 'l':
-                       opts.local = B_TRUE;
-                       break;
-               case 'd':
-                       opts.descend = B_TRUE;
-                       break;
-               case 'u':
-                       opts.user = B_TRUE;
-                       break;
-               case 'g':
-                       opts.group = B_TRUE;
-                       break;
-               case 'e':
-                       opts.everyone = B_TRUE;
-                       break;
-               case 's':
-                       opts.set = B_TRUE;
-                       break;
-               case 'c':
-                       opts.create = B_TRUE;
-                       break;
-               case 'r':
-                       opts.recursive = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case 'h':
-                       opts.prt_usage = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check arguments */
-       parse_allow_args(argc, argv, un, &opts);
-
-       /* try to open the dataset */
-       if ((zhp = zfs_open(g_zfs, opts.dataset, ZFS_TYPE_FILESYSTEM |
-           ZFS_TYPE_VOLUME)) == NULL) {
-               (void) fprintf(stderr, "Failed to open dataset: %s\n",
-                   opts.dataset);
-               return (-1);
-       }
-
-       if (zfs_get_fsacl(zhp, &perm_nvl) != 0)
-               goto cleanup2;
-
-       fs_perm_set_init(&fs_perm_set);
-       if (parse_fs_perm_set(&fs_perm_set, perm_nvl) != 0) {
-               (void) fprintf(stderr, "Failed to parse fsacl permissions\n");
-               goto cleanup1;
-       }
-
-       if (opts.prt_perms)
-               print_fs_perms(&fs_perm_set);
-       else {
-               (void) construct_fsacl_list(un, &opts, &update_perm_nvl);
-               if (zfs_set_fsacl(zhp, un, update_perm_nvl) != 0)
-                       goto cleanup0;
-
-               if (un && opts.recursive) {
-                       struct deleg_perms data = { un, update_perm_nvl };
-                       if (zfs_iter_filesystems(zhp, set_deleg_perms,
-                           &data) != 0)
-                               goto cleanup0;
-               }
-       }
-
-       error = 0;
-
-cleanup0:
-       nvlist_free(perm_nvl);
-       if (update_perm_nvl != NULL)
-               nvlist_free(update_perm_nvl);
-cleanup1:
-       fs_perm_set_fini(&fs_perm_set);
-cleanup2:
-       zfs_close(zhp);
-
-       return (error);
-}
-
-static int
-zfs_do_allow(int argc, char **argv)
-{
-       return (zfs_do_allow_unallow_impl(argc, argv, B_FALSE));
-}
-
-static int
-zfs_do_unallow(int argc, char **argv)
-{
-       return (zfs_do_allow_unallow_impl(argc, argv, B_TRUE));
-}
-
-static int
-zfs_do_hold_rele_impl(int argc, char **argv, boolean_t holding)
-{
-       int errors = 0;
-       int i;
-       const char *tag;
-       boolean_t recursive = B_FALSE;
-       const char *opts = holding ? "rt" : "r";
-       int c;
-
-       /* check options */
-       while ((c = getopt(argc, argv, opts)) != -1) {
-               switch (c) {
-               case 'r':
-                       recursive = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 2)
-               usage(B_FALSE);
-
-       tag = argv[0];
-       --argc;
-       ++argv;
-
-       if (holding && tag[0] == '.') {
-               /* tags starting with '.' are reserved for libzfs */
-               (void) fprintf(stderr, gettext("tag may not start with '.'\n"));
-               usage(B_FALSE);
-       }
-
-       for (i = 0; i < argc; ++i) {
-               zfs_handle_t *zhp;
-               char parent[ZFS_MAXNAMELEN];
-               const char *delim;
-               char *path = argv[i];
-
-               delim = strchr(path, '@');
-               if (delim == NULL) {
-                       (void) fprintf(stderr,
-                           gettext("'%s' is not a snapshot\n"), path);
-                       ++errors;
-                       continue;
-               }
-               (void) strncpy(parent, path, delim - path);
-               parent[delim - path] = '\0';
-
-               zhp = zfs_open(g_zfs, parent,
-                   ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-               if (zhp == NULL) {
-                       ++errors;
-                       continue;
-               }
-               if (holding) {
-                       if (zfs_hold(zhp, delim+1, tag, recursive, -1) != 0)
-                               ++errors;
-               } else {
-                       if (zfs_release(zhp, delim+1, tag, recursive) != 0)
-                               ++errors;
-               }
-               zfs_close(zhp);
-       }
-
-       return (errors != 0);
-}
-
-/*
- * zfs hold [-r] [-t] <tag> <snap> ...
- *
- *     -r      Recursively hold
- *
- * Apply a user-hold with the given tag to the list of snapshots.
- */
-static int
-zfs_do_hold(int argc, char **argv)
-{
-       return (zfs_do_hold_rele_impl(argc, argv, B_TRUE));
-}
-
-/*
- * zfs release [-r] <tag> <snap> ...
- *
- *     -r      Recursively release
- *
- * Release a user-hold with the given tag from the list of snapshots.
- */
-static int
-zfs_do_release(int argc, char **argv)
-{
-       return (zfs_do_hold_rele_impl(argc, argv, B_FALSE));
-}
-
-typedef struct holds_cbdata {
-       boolean_t       cb_recursive;
-       const char      *cb_snapname;
-       nvlist_t        **cb_nvlp;
-       size_t          cb_max_namelen;
-       size_t          cb_max_taglen;
-} holds_cbdata_t;
-
-#define        STRFTIME_FMT_STR "%a %b %e %k:%M %Y"
-#define        DATETIME_BUF_LEN (32)
-/*
- *
- */
-static void
-print_holds(boolean_t scripted, int nwidth, int tagwidth, nvlist_t *nvl)
-{
-       int i;
-       nvpair_t *nvp = NULL;
-       char *hdr_cols[] = { "NAME", "TAG", "TIMESTAMP" };
-       const char *col;
-
-       if (!scripted) {
-               for (i = 0; i < 3; i++) {
-                       col = gettext(hdr_cols[i]);
-                       if (i < 2)
-                               (void) printf("%-*s  ", i ? tagwidth : nwidth,
-                                   col);
-                       else
-                               (void) printf("%s\n", col);
-               }
-       }
-
-       while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
-               char *zname = nvpair_name(nvp);
-               nvlist_t *nvl2;
-               nvpair_t *nvp2 = NULL;
-               (void) nvpair_value_nvlist(nvp, &nvl2);
-               while ((nvp2 = nvlist_next_nvpair(nvl2, nvp2)) != NULL) {
-                       char tsbuf[DATETIME_BUF_LEN];
-                       char *tagname = nvpair_name(nvp2);
-                       uint64_t val = 0;
-                       time_t time;
-                       struct tm t;
-                       char sep = scripted ? '\t' : ' ';
-                       int sepnum = scripted ? 1 : 2;
-
-                       (void) nvpair_value_uint64(nvp2, &val);
-                       time = (time_t)val;
-                       (void) localtime_r(&time, &t);
-                       (void) strftime(tsbuf, DATETIME_BUF_LEN,
-                           gettext(STRFTIME_FMT_STR), &t);
-
-                       (void) printf("%-*s%*c%-*s%*c%s\n", nwidth, zname,
-                           sepnum, sep, tagwidth, tagname, sepnum, sep, tsbuf);
-               }
-       }
-}
-
-/*
- * Generic callback function to list a dataset or snapshot.
- */
-static int
-holds_callback(zfs_handle_t *zhp, void *data)
-{
-       holds_cbdata_t *cbp = data;
-       nvlist_t *top_nvl = *cbp->cb_nvlp;
-       nvlist_t *nvl = NULL;
-       nvpair_t *nvp = NULL;
-       const char *zname = zfs_get_name(zhp);
-       size_t znamelen = strnlen(zname, ZFS_MAXNAMELEN);
-
-       if (cbp->cb_recursive) {
-               const char *snapname;
-               char *delim  = strchr(zname, '@');
-               if (delim == NULL)
-                       return (0);
-
-               snapname = delim + 1;
-               if (strcmp(cbp->cb_snapname, snapname))
-                       return (0);
-       }
-
-       if (zfs_get_holds(zhp, &nvl) != 0)
-               return (-1);
-
-       if (znamelen > cbp->cb_max_namelen)
-               cbp->cb_max_namelen  = znamelen;
-
-       while ((nvp = nvlist_next_nvpair(nvl, nvp)) != NULL) {
-               const char *tag = nvpair_name(nvp);
-               size_t taglen = strnlen(tag, MAXNAMELEN);
-               if (taglen > cbp->cb_max_taglen)
-                       cbp->cb_max_taglen  = taglen;
-       }
-
-       return (nvlist_add_nvlist(top_nvl, zname, nvl));
-}
-
-/*
- * zfs holds [-r] <snap> ...
- *
- *     -r      Recursively hold
- */
-static int
-zfs_do_holds(int argc, char **argv)
-{
-       int errors = 0;
-       int c;
-       int i;
-       boolean_t scripted = B_FALSE;
-       boolean_t recursive = B_FALSE;
-       const char *opts = "rH";
-       nvlist_t *nvl;
-
-       int types = ZFS_TYPE_SNAPSHOT;
-       holds_cbdata_t cb = { 0 };
-
-       int limit = 0;
-       int ret = 0;
-       int flags = 0;
-
-       /* check options */
-       while ((c = getopt(argc, argv, opts)) != -1) {
-               switch (c) {
-               case 'r':
-                       recursive = B_TRUE;
-                       break;
-               case 'H':
-                       scripted = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       if (recursive) {
-               types |= ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME;
-               flags |= ZFS_ITER_RECURSE;
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1)
-               usage(B_FALSE);
-
-       if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0)
-               nomem();
-
-       for (i = 0; i < argc; ++i) {
-               char *snapshot = argv[i];
-               const char *delim;
-               const char *snapname;
-
-               delim = strchr(snapshot, '@');
-               if (delim == NULL) {
-                       (void) fprintf(stderr,
-                           gettext("'%s' is not a snapshot\n"), snapshot);
-                       ++errors;
-                       continue;
-               }
-               snapname = delim + 1;
-               if (recursive)
-                       snapshot[delim - snapshot] = '\0';
-
-               cb.cb_recursive = recursive;
-               cb.cb_snapname = snapname;
-               cb.cb_nvlp = &nvl;
-
-               /*
-                *  1. collect holds data, set format options
-                */
-               ret = zfs_for_each(argc, argv, flags, types, NULL, NULL, limit,
-                   holds_callback, &cb);
-               if (ret != 0)
-                       ++errors;
-       }
-
-       /*
-        *  2. print holds data
-        */
-       print_holds(scripted, cb.cb_max_namelen, cb.cb_max_taglen, nvl);
-
-       if (nvlist_empty(nvl))
-               (void) fprintf(stderr, gettext("no datasets available\n"));
-
-       nvlist_free(nvl);
-
-       return (0 != errors);
-}
-
-#define        CHECK_SPINNER 30
-#define        SPINNER_TIME 3          /* seconds */
-#define        MOUNT_TIME 5            /* seconds */
-
-static int
-get_one_dataset(zfs_handle_t *zhp, void *data)
-{
-       static char *spin[] = { "-", "\\", "|", "/" };
-       static int spinval = 0;
-       static int spincheck = 0;
-       static time_t last_spin_time = (time_t)0;
-       get_all_cb_t *cbp = data;
-       zfs_type_t type = zfs_get_type(zhp);
-
-       if (cbp->cb_verbose) {
-               if (--spincheck < 0) {
-                       time_t now = time(NULL);
-                       if (last_spin_time + SPINNER_TIME < now) {
-                               update_progress(spin[spinval++ % 4]);
-                               last_spin_time = now;
-                       }
-                       spincheck = CHECK_SPINNER;
-               }
-       }
-
-       /*
-        * Iterate over any nested datasets.
-        */
-       if (zfs_iter_filesystems(zhp, get_one_dataset, data) != 0) {
-               zfs_close(zhp);
-               return (1);
-       }
-
-       /*
-        * Skip any datasets whose type does not match.
-        */
-       if ((type & ZFS_TYPE_FILESYSTEM) == 0) {
-               zfs_close(zhp);
-               return (0);
-       }
-       libzfs_add_handle(cbp, zhp);
-       assert(cbp->cb_used <= cbp->cb_alloc);
-
-       return (0);
-}
-
-static void
-get_all_datasets(zfs_handle_t ***dslist, size_t *count, boolean_t verbose)
-{
-       get_all_cb_t cb = { 0 };
-       cb.cb_verbose = verbose;
-       cb.cb_getone = get_one_dataset;
-
-       if (verbose)
-               set_progress_header(gettext("Reading ZFS config"));
-       (void) zfs_iter_root(g_zfs, get_one_dataset, &cb);
-
-       *dslist = cb.cb_handles;
-       *count = cb.cb_used;
-
-       if (verbose)
-               finish_progress(gettext("done."));
-}
-
-/*
- * Generic callback for sharing or mounting filesystems.  Because the code is so
- * similar, we have a common function with an extra parameter to determine which
- * mode we are using.
- */
-#define        OP_SHARE        0x1
-#define        OP_MOUNT        0x2
-
-/*
- * Share or mount a dataset.
- */
-static int
-share_mount_one(zfs_handle_t *zhp, int op, int flags, char *protocol,
-    boolean_t explicit, const char *options)
-{
-       char mountpoint[ZFS_MAXPROPLEN];
-       char shareopts[ZFS_MAXPROPLEN];
-       char smbshareopts[ZFS_MAXPROPLEN];
-       const char *cmdname = op == OP_SHARE ? "share" : "mount";
-       struct mnttab mnt;
-       uint64_t zoned, canmount;
-       boolean_t shared_nfs, shared_smb;
-
-       assert(zfs_get_type(zhp) & ZFS_TYPE_FILESYSTEM);
-
-       /*
-        * Check to make sure we can mount/share this dataset.  If we
-        * are in the global zone and the filesystem is exported to a
-        * local zone, or if we are in a local zone and the
-        * filesystem is not exported, then it is an error.
-        */
-       zoned = zfs_prop_get_int(zhp, ZFS_PROP_ZONED);
-
-       if (zoned && getzoneid() == GLOBAL_ZONEID) {
-               if (!explicit)
-                       return (0);
-
-               (void) fprintf(stderr, gettext("cannot %s '%s': "
-                   "dataset is exported to a local zone\n"), cmdname,
-                   zfs_get_name(zhp));
-               return (1);
-
-       } else if (!zoned && getzoneid() != GLOBAL_ZONEID) {
-               if (!explicit)
-                       return (0);
-
-               (void) fprintf(stderr, gettext("cannot %s '%s': "
-                   "permission denied\n"), cmdname,
-                   zfs_get_name(zhp));
-               return (1);
-       }
-
-       /*
-        * Ignore any filesystems which don't apply to us. This
-        * includes those with a legacy mountpoint, or those with
-        * legacy share options.
-        */
-       verify(zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mountpoint,
-           sizeof (mountpoint), NULL, NULL, 0, B_FALSE) == 0);
-       verify(zfs_prop_get(zhp, ZFS_PROP_SHARENFS, shareopts,
-           sizeof (shareopts), NULL, NULL, 0, B_FALSE) == 0);
-       verify(zfs_prop_get(zhp, ZFS_PROP_SHARESMB, smbshareopts,
-           sizeof (smbshareopts), NULL, NULL, 0, B_FALSE) == 0);
-
-       if (op == OP_SHARE && strcmp(shareopts, "off") == 0 &&
-           strcmp(smbshareopts, "off") == 0) {
-               if (!explicit)
-                       return (0);
-
-               (void) fprintf(stderr, gettext("cannot share '%s': "
-                   "legacy share\n"), zfs_get_name(zhp));
-               (void) fprintf(stderr, gettext("use share(1M) to "
-                   "share this filesystem, or set "
-                   "sharenfs property on\n"));
-               return (1);
-       }
-
-       /*
-        * We cannot share or mount legacy filesystems. If the
-        * shareopts is non-legacy but the mountpoint is legacy, we
-        * treat it as a legacy share.
-        */
-       if (strcmp(mountpoint, "legacy") == 0) {
-               if (!explicit)
-                       return (0);
-
-               (void) fprintf(stderr, gettext("cannot %s '%s': "
-                   "legacy mountpoint\n"), cmdname, zfs_get_name(zhp));
-               (void) fprintf(stderr, gettext("use %s(1M) to "
-                   "%s this filesystem\n"), cmdname, cmdname);
-               return (1);
-       }
-
-       if (strcmp(mountpoint, "none") == 0) {
-               if (!explicit)
-                       return (0);
-
-               (void) fprintf(stderr, gettext("cannot %s '%s': no "
-                   "mountpoint set\n"), cmdname, zfs_get_name(zhp));
-               return (1);
-       }
-
-       /*
-        * canmount     explicit        outcome
-        * on           no              pass through
-        * on           yes             pass through
-        * off          no              return 0
-        * off          yes             display error, return 1
-        * noauto       no              return 0
-        * noauto       yes             pass through
-        */
-       canmount = zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT);
-       if (canmount == ZFS_CANMOUNT_OFF) {
-               if (!explicit)
-                       return (0);
-
-               (void) fprintf(stderr, gettext("cannot %s '%s': "
-                   "'canmount' property is set to 'off'\n"), cmdname,
-                   zfs_get_name(zhp));
-               return (1);
-       } else if (canmount == ZFS_CANMOUNT_NOAUTO && !explicit) {
-               return (0);
-       }
-
-       /*
-        * At this point, we have verified that the mountpoint and/or
-        * shareopts are appropriate for auto management. If the
-        * filesystem is already mounted or shared, return (failing
-        * for explicit requests); otherwise mount or share the
-        * filesystem.
-        */
-       switch (op) {
-       case OP_SHARE:
-
-               shared_nfs = zfs_is_shared_nfs(zhp, NULL);
-               shared_smb = zfs_is_shared_smb(zhp, NULL);
-
-               if ((shared_nfs && shared_smb) ||
-                   ((shared_nfs && strcmp(shareopts, "on") == 0) &&
-                   (strcmp(smbshareopts, "off") == 0)) ||
-                   ((shared_smb && strcmp(smbshareopts, "on") == 0) &&
-                   (strcmp(shareopts, "off") == 0))) {
-                       if (!explicit)
-                               return (0);
-
-                       (void) fprintf(stderr, gettext("cannot share "
-                           "'%s': filesystem already shared\n"),
-                           zfs_get_name(zhp));
-                       return (1);
-               }
-
-               if (!zfs_is_mounted(zhp, NULL) &&
-                   zfs_mount(zhp, NULL, 0) != 0)
-                       return (1);
-
-               if (protocol == NULL) {
-                       if (zfs_shareall(zhp) != 0)
-                               return (1);
-               } else if (strcmp(protocol, "nfs") == 0) {
-                       if (zfs_share_nfs(zhp))
-                               return (1);
-               } else if (strcmp(protocol, "smb") == 0) {
-                       if (zfs_share_smb(zhp))
-                               return (1);
-               } else {
-                       (void) fprintf(stderr, gettext("cannot share "
-                           "'%s': invalid share type '%s' "
-                           "specified\n"),
-                           zfs_get_name(zhp), protocol);
-                       return (1);
-               }
-
-               break;
-
-       case OP_MOUNT:
-               if (options == NULL)
-                       mnt.mnt_mntopts = "";
-               else
-                       mnt.mnt_mntopts = (char *)options;
-
-               if (!hasmntopt(&mnt, MNTOPT_REMOUNT) &&
-                   zfs_is_mounted(zhp, NULL)) {
-                       if (!explicit)
-                               return (0);
-
-                       (void) fprintf(stderr, gettext("cannot mount "
-                           "'%s': filesystem already mounted\n"),
-                           zfs_get_name(zhp));
-                       return (1);
-               }
-
-               if (zfs_mount(zhp, options, flags) != 0)
-                       return (1);
-               break;
-       }
-
-       return (0);
-}
-
-/*
- * Reports progress in the form "(current/total)".  Not thread-safe.
- */
-static void
-report_mount_progress(int current, int total)
-{
-       static time_t last_progress_time = 0;
-       time_t now = time(NULL);
-       char info[32];
-
-       /* report 1..n instead of 0..n-1 */
-       ++current;
-
-       /* display header if we're here for the first time */
-       if (current == 1) {
-               set_progress_header(gettext("Mounting ZFS filesystems"));
-       } else if (current != total && last_progress_time + MOUNT_TIME >= now) {
-               /* too soon to report again */
-               return;
-       }
-
-       last_progress_time = now;
-
-       (void) sprintf(info, "(%d/%d)", current, total);
-
-       if (current == total)
-               finish_progress(info);
-       else
-               update_progress(info);
-}
-
-static void
-append_options(char *mntopts, char *newopts)
-{
-       int len = strlen(mntopts);
-
-       /* original length plus new string to append plus 1 for the comma */
-       if (len + 1 + strlen(newopts) >= MNT_LINE_MAX) {
-               (void) fprintf(stderr, gettext("the opts argument for "
-                   "'%s' option is too long (more than %d chars)\n"),
-                   "-o", MNT_LINE_MAX);
-               usage(B_FALSE);
-       }
-
-       if (*mntopts)
-               mntopts[len++] = ',';
-
-       (void) strcpy(&mntopts[len], newopts);
-}
-
-static int
-share_mount(int op, int argc, char **argv)
-{
-       int do_all = 0;
-       boolean_t verbose = B_FALSE;
-       int c, ret = 0;
-       char *options = NULL;
-       int flags = 0;
-
-       /* check options */
-       while ((c = getopt(argc, argv, op == OP_MOUNT ? ":avo:O" : "a"))
-           != -1) {
-               switch (c) {
-               case 'a':
-                       do_all = 1;
-                       break;
-               case 'v':
-                       verbose = B_TRUE;
-                       break;
-               case 'o':
-                       if (*optarg == '\0') {
-                               (void) fprintf(stderr, gettext("empty mount "
-                                   "options (-o) specified\n"));
-                               usage(B_FALSE);
-                       }
-
-                       if (options == NULL)
-                               options = safe_malloc(MNT_LINE_MAX + 1);
-
-                       /* option validation is done later */
-                       append_options(options, optarg);
-                       break;
-               case 'O':
-                       flags |= MS_OVERLAY;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (do_all) {
-               zfs_handle_t **dslist = NULL;
-               size_t i, count = 0;
-               char *protocol = NULL;
-
-               if (op == OP_SHARE && argc > 0) {
-                       if (strcmp(argv[0], "nfs") != 0 &&
-                           strcmp(argv[0], "smb") != 0) {
-                               (void) fprintf(stderr, gettext("share type "
-                                   "must be 'nfs' or 'smb'\n"));
-                               usage(B_FALSE);
-                       }
-                       protocol = argv[0];
-                       argc--;
-                       argv++;
-               }
-
-               if (argc != 0) {
-                       (void) fprintf(stderr, gettext("too many arguments\n"));
-                       usage(B_FALSE);
-               }
-
-               start_progress_timer();
-               get_all_datasets(&dslist, &count, verbose);
-
-               if (count == 0)
-                       return (0);
-
-               qsort(dslist, count, sizeof (void *), libzfs_dataset_cmp);
-
-               for (i = 0; i < count; i++) {
-                       if (verbose)
-                               report_mount_progress(i, count);
-
-                       if (share_mount_one(dslist[i], op, flags, protocol,
-                           B_FALSE, options) != 0)
-                               ret = 1;
-                       zfs_close(dslist[i]);
-               }
-
-               free(dslist);
-       } else if (argc == 0) {
-               struct mnttab entry;
-
-               if ((op == OP_SHARE) || (options != NULL)) {
-                       (void) fprintf(stderr, gettext("missing filesystem "
-                           "argument (specify -a for all)\n"));
-                       usage(B_FALSE);
-               }
-
-               /*
-                * When mount is given no arguments, go through /etc/mtab and
-                * display any active ZFS mounts.  We hide any snapshots, since
-                * they are controlled automatically.
-                */
-
-               /* Reopen MNTTAB to prevent reading stale data from open file */
-               if (freopen(MNTTAB, "r", mnttab_file) == NULL)
-                       return (ENOENT);
-
-               while (getmntent(mnttab_file, &entry) == 0) {
-                       if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0 ||
-                           strchr(entry.mnt_special, '@') != NULL)
-                               continue;
-
-                       (void) printf("%-30s  %s\n", entry.mnt_special,
-                           entry.mnt_mountp);
-               }
-
-       } else {
-               zfs_handle_t *zhp;
-
-               if (argc > 1) {
-                       (void) fprintf(stderr,
-                           gettext("too many arguments\n"));
-                       usage(B_FALSE);
-               }
-
-               if ((zhp = zfs_open(g_zfs, argv[0],
-                   ZFS_TYPE_FILESYSTEM)) == NULL) {
-                       ret = 1;
-               } else {
-                       ret = share_mount_one(zhp, op, flags, NULL, B_TRUE,
-                           options);
-                       zfs_close(zhp);
-               }
-       }
-
-       return (ret);
-}
-
-/*
- * zfs mount -a [nfs]
- * zfs mount filesystem
- *
- * Mount all filesystems, or mount the given filesystem.
- */
-static int
-zfs_do_mount(int argc, char **argv)
-{
-       return (share_mount(OP_MOUNT, argc, argv));
-}
-
-/*
- * zfs share -a [nfs | smb]
- * zfs share filesystem
- *
- * Share all filesystems, or share the given filesystem.
- */
-static int
-zfs_do_share(int argc, char **argv)
-{
-       return (share_mount(OP_SHARE, argc, argv));
-}
-
-typedef struct unshare_unmount_node {
-       zfs_handle_t    *un_zhp;
-       char            *un_mountp;
-       uu_avl_node_t   un_avlnode;
-} unshare_unmount_node_t;
-
-/* ARGSUSED */
-static int
-unshare_unmount_compare(const void *larg, const void *rarg, void *unused)
-{
-       const unshare_unmount_node_t *l = larg;
-       const unshare_unmount_node_t *r = rarg;
-
-       return (strcmp(l->un_mountp, r->un_mountp));
-}
-
-/*
- * Convenience routine used by zfs_do_umount() and manual_unmount().  Given an
- * absolute path, find the entry /etc/mtab, verify that its a ZFS filesystem,
- * and unmount it appropriately.
- */
-static int
-unshare_unmount_path(int op, char *path, int flags, boolean_t is_manual)
-{
-       zfs_handle_t *zhp;
-       int ret = 0;
-       struct stat64 statbuf;
-       struct extmnttab entry;
-       const char *cmdname = (op == OP_SHARE) ? "unshare" : "unmount";
-       ino_t path_inode;
-
-       /*
-        * Search for the path in /etc/mtab.  Rather than looking for the
-        * specific path, which can be fooled by non-standard paths (i.e. ".."
-        * or "//"), we stat() the path and search for the corresponding
-        * (major,minor) device pair.
-        */
-       if (stat64(path, &statbuf) != 0) {
-               (void) fprintf(stderr, gettext("cannot %s '%s': %s\n"),
-                   cmdname, path, strerror(errno));
-               return (1);
-       }
-       path_inode = statbuf.st_ino;
-
-       /*
-        * Search for the given (major,minor) pair in the mount table.
-        */
-
-       /* Reopen MNTTAB to prevent reading stale data from open file */
-       if (freopen(MNTTAB, "r", mnttab_file) == NULL)
-               return (ENOENT);
-
-       while ((ret = getextmntent(mnttab_file, &entry, 0)) == 0) {
-               if (entry.mnt_major == major(statbuf.st_dev) &&
-                   entry.mnt_minor == minor(statbuf.st_dev))
-                       break;
-       }
-       if (ret != 0) {
-               if (op == OP_SHARE) {
-                       (void) fprintf(stderr, gettext("cannot %s '%s': not "
-                           "currently mounted\n"), cmdname, path);
-                       return (1);
-               }
-               (void) fprintf(stderr, gettext("warning: %s not in mtab\n"),
-                   path);
-               if ((ret = umount2(path, flags)) != 0)
-                       (void) fprintf(stderr, gettext("%s: %s\n"), path,
-                           strerror(errno));
-               return (ret != 0);
-       }
-
-       if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) {
-               (void) fprintf(stderr, gettext("cannot %s '%s': not a ZFS "
-                   "filesystem\n"), cmdname, path);
-               return (1);
-       }
-
-       if ((zhp = zfs_open(g_zfs, entry.mnt_special,
-           ZFS_TYPE_FILESYSTEM)) == NULL)
-               return (1);
-
-       ret = 1;
-       if (stat64(entry.mnt_mountp, &statbuf) != 0) {
-               (void) fprintf(stderr, gettext("cannot %s '%s': %s\n"),
-                   cmdname, path, strerror(errno));
-               goto out;
-       } else if (statbuf.st_ino != path_inode) {
-               (void) fprintf(stderr, gettext("cannot "
-                   "%s '%s': not a mountpoint\n"), cmdname, path);
-               goto out;
-       }
-
-       if (op == OP_SHARE) {
-               char nfs_mnt_prop[ZFS_MAXPROPLEN];
-               char smbshare_prop[ZFS_MAXPROPLEN];
-
-               verify(zfs_prop_get(zhp, ZFS_PROP_SHARENFS, nfs_mnt_prop,
-                   sizeof (nfs_mnt_prop), NULL, NULL, 0, B_FALSE) == 0);
-               verify(zfs_prop_get(zhp, ZFS_PROP_SHARESMB, smbshare_prop,
-                   sizeof (smbshare_prop), NULL, NULL, 0, B_FALSE) == 0);
-
-               if (strcmp(nfs_mnt_prop, "off") == 0 &&
-                   strcmp(smbshare_prop, "off") == 0) {
-                       (void) fprintf(stderr, gettext("cannot unshare "
-                           "'%s': legacy share\n"), path);
-                       (void) fprintf(stderr, gettext("use exportfs(8) "
-                           "or smbcontrol(1) to unshare this filesystem\n"));
-               } else if (!zfs_is_shared(zhp)) {
-                       (void) fprintf(stderr, gettext("cannot unshare '%s': "
-                           "not currently shared\n"), path);
-               } else {
-                       ret = zfs_unshareall_bypath(zhp, path);
-               }
-       } else {
-               char mtpt_prop[ZFS_MAXPROPLEN];
-
-               verify(zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mtpt_prop,
-                   sizeof (mtpt_prop), NULL, NULL, 0, B_FALSE) == 0);
-
-               if (is_manual) {
-                       ret = zfs_unmount(zhp, NULL, flags);
-               } else if (strcmp(mtpt_prop, "legacy") == 0) {
-                       (void) fprintf(stderr, gettext("cannot unmount "
-                           "'%s': legacy mountpoint\n"),
-                           zfs_get_name(zhp));
-                       (void) fprintf(stderr, gettext("use umount(8) "
-                           "to unmount this filesystem\n"));
-               } else {
-                       ret = zfs_unmountall(zhp, flags);
-               }
-       }
-
-out:
-       zfs_close(zhp);
-
-       return (ret != 0);
-}
-
-/*
- * Generic callback for unsharing or unmounting a filesystem.
- */
-static int
-unshare_unmount(int op, int argc, char **argv)
-{
-       int do_all = 0;
-       int flags = 0;
-       int ret = 0;
-       int c;
-       zfs_handle_t *zhp;
-       char nfs_mnt_prop[ZFS_MAXPROPLEN];
-       char sharesmb[ZFS_MAXPROPLEN];
-
-       /* check options */
-       while ((c = getopt(argc, argv, op == OP_SHARE ? "a" : "af")) != -1) {
-               switch (c) {
-               case 'a':
-                       do_all = 1;
-                       break;
-               case 'f':
-                       flags = MS_FORCE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (do_all) {
-               /*
-                * We could make use of zfs_for_each() to walk all datasets in
-                * the system, but this would be very inefficient, especially
-                * since we would have to linearly search /etc/mtab for each
-                * one.  Instead, do one pass through /etc/mtab looking for
-                * zfs entries and call zfs_unmount() for each one.
-                *
-                * Things get a little tricky if the administrator has created
-                * mountpoints beneath other ZFS filesystems.  In this case, we
-                * have to unmount the deepest filesystems first.  To accomplish
-                * this, we place all the mountpoints in an AVL tree sorted by
-                * the special type (dataset name), and walk the result in
-                * reverse to make sure to get any snapshots first.
-                */
-               struct mnttab entry;
-               uu_avl_pool_t *pool;
-               uu_avl_t *tree = NULL;
-               unshare_unmount_node_t *node;
-               uu_avl_index_t idx;
-               uu_avl_walk_t *walk;
-
-               if (argc != 0) {
-                       (void) fprintf(stderr, gettext("too many arguments\n"));
-                       usage(B_FALSE);
-               }
-
-               if (((pool = uu_avl_pool_create("unmount_pool",
-                   sizeof (unshare_unmount_node_t),
-                   offsetof(unshare_unmount_node_t, un_avlnode),
-                   unshare_unmount_compare, UU_DEFAULT)) == NULL) ||
-                   ((tree = uu_avl_create(pool, NULL, UU_DEFAULT)) == NULL))
-                       nomem();
-
-               /* Reopen MNTTAB to prevent reading stale data from open file */
-               if (freopen(MNTTAB, "r", mnttab_file) == NULL)
-                       return (ENOENT);
-
-               while (getmntent(mnttab_file, &entry) == 0) {
-
-                       /* ignore non-ZFS entries */
-                       if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0)
-                               continue;
-
-                       /* ignore snapshots */
-                       if (strchr(entry.mnt_special, '@') != NULL)
-                               continue;
-
-                       if ((zhp = zfs_open(g_zfs, entry.mnt_special,
-                           ZFS_TYPE_FILESYSTEM)) == NULL) {
-                               ret = 1;
-                               continue;
-                       }
-
-                       switch (op) {
-                       case OP_SHARE:
-                               verify(zfs_prop_get(zhp, ZFS_PROP_SHARENFS,
-                                   nfs_mnt_prop,
-                                   sizeof (nfs_mnt_prop),
-                                   NULL, NULL, 0, B_FALSE) == 0);
-                               if (strcmp(nfs_mnt_prop, "off") != 0)
-                                       break;
-                               verify(zfs_prop_get(zhp, ZFS_PROP_SHARESMB,
-                                   nfs_mnt_prop,
-                                   sizeof (nfs_mnt_prop),
-                                   NULL, NULL, 0, B_FALSE) == 0);
-                               if (strcmp(nfs_mnt_prop, "off") == 0)
-                                       continue;
-                               break;
-                       case OP_MOUNT:
-                               /* Ignore legacy mounts */
-                               verify(zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT,
-                                   nfs_mnt_prop,
-                                   sizeof (nfs_mnt_prop),
-                                   NULL, NULL, 0, B_FALSE) == 0);
-                               if (strcmp(nfs_mnt_prop, "legacy") == 0)
-                                       continue;
-                               /* Ignore canmount=noauto mounts */
-                               if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) ==
-                                   ZFS_CANMOUNT_NOAUTO)
-                                       continue;
-                       default:
-                               break;
-                       }
-
-                       node = safe_malloc(sizeof (unshare_unmount_node_t));
-                       node->un_zhp = zhp;
-                       node->un_mountp = safe_strdup(entry.mnt_mountp);
-
-                       uu_avl_node_init(node, &node->un_avlnode, pool);
-
-                       if (uu_avl_find(tree, node, NULL, &idx) == NULL) {
-                               uu_avl_insert(tree, node, idx);
-                       } else {
-                               zfs_close(node->un_zhp);
-                               free(node->un_mountp);
-                               free(node);
-                       }
-               }
-
-               /*
-                * Walk the AVL tree in reverse, unmounting each filesystem and
-                * removing it from the AVL tree in the process.
-                */
-               if ((walk = uu_avl_walk_start(tree,
-                   UU_WALK_REVERSE | UU_WALK_ROBUST)) == NULL)
-                       nomem();
-
-               while ((node = uu_avl_walk_next(walk)) != NULL) {
-                       uu_avl_remove(tree, node);
-
-                       switch (op) {
-                       case OP_SHARE:
-                               if (zfs_unshareall_bypath(node->un_zhp,
-                                   node->un_mountp) != 0)
-                                       ret = 1;
-                               break;
-
-                       case OP_MOUNT:
-                               if (zfs_unmount(node->un_zhp,
-                                   node->un_mountp, flags) != 0)
-                                       ret = 1;
-                               break;
-                       }
-
-                       zfs_close(node->un_zhp);
-                       free(node->un_mountp);
-                       free(node);
-               }
-
-               uu_avl_walk_end(walk);
-               uu_avl_destroy(tree);
-               uu_avl_pool_destroy(pool);
-
-       } else {
-               if (argc != 1) {
-                       if (argc == 0)
-                               (void) fprintf(stderr,
-                                   gettext("missing filesystem argument\n"));
-                       else
-                               (void) fprintf(stderr,
-                                   gettext("too many arguments\n"));
-                       usage(B_FALSE);
-               }
-
-               /*
-                * We have an argument, but it may be a full path or a ZFS
-                * filesystem.  Pass full paths off to unmount_path() (shared by
-                * manual_unmount), otherwise open the filesystem and pass to
-                * zfs_unmount().
-                */
-               if (argv[0][0] == '/')
-                       return (unshare_unmount_path(op, argv[0],
-                           flags, B_FALSE));
-
-               if ((zhp = zfs_open(g_zfs, argv[0],
-                   ZFS_TYPE_FILESYSTEM)) == NULL)
-                       return (1);
-
-               verify(zfs_prop_get(zhp, op == OP_SHARE ?
-                   ZFS_PROP_SHARENFS : ZFS_PROP_MOUNTPOINT,
-                   nfs_mnt_prop, sizeof (nfs_mnt_prop), NULL,
-                   NULL, 0, B_FALSE) == 0);
-
-               switch (op) {
-               case OP_SHARE:
-                       verify(zfs_prop_get(zhp, ZFS_PROP_SHARENFS,
-                           nfs_mnt_prop,
-                           sizeof (nfs_mnt_prop),
-                           NULL, NULL, 0, B_FALSE) == 0);
-                       verify(zfs_prop_get(zhp, ZFS_PROP_SHARESMB,
-                           sharesmb, sizeof (sharesmb), NULL, NULL,
-                           0, B_FALSE) == 0);
-
-                       if (strcmp(nfs_mnt_prop, "off") == 0 &&
-                           strcmp(sharesmb, "off") == 0) {
-                               (void) fprintf(stderr, gettext("cannot "
-                                   "unshare '%s': legacy share\n"),
-                                   zfs_get_name(zhp));
-                               (void) fprintf(stderr, gettext("use "
-                                   "unshare(1M) to unshare this "
-                                   "filesystem\n"));
-                               ret = 1;
-                       } else if (!zfs_is_shared(zhp)) {
-                               (void) fprintf(stderr, gettext("cannot "
-                                   "unshare '%s': not currently "
-                                   "shared\n"), zfs_get_name(zhp));
-                               ret = 1;
-                       } else if (zfs_unshareall(zhp) != 0) {
-                               ret = 1;
-                       }
-                       break;
-
-               case OP_MOUNT:
-                       if (strcmp(nfs_mnt_prop, "legacy") == 0) {
-                               (void) fprintf(stderr, gettext("cannot "
-                                   "unmount '%s': legacy "
-                                   "mountpoint\n"), zfs_get_name(zhp));
-                               (void) fprintf(stderr, gettext("use "
-                                   "umount(1M) to unmount this "
-                                   "filesystem\n"));
-                               ret = 1;
-                       } else if (!zfs_is_mounted(zhp, NULL)) {
-                               (void) fprintf(stderr, gettext("cannot "
-                                   "unmount '%s': not currently "
-                                   "mounted\n"),
-                                   zfs_get_name(zhp));
-                               ret = 1;
-                       } else if (zfs_unmountall(zhp, flags) != 0) {
-                               ret = 1;
-                       }
-                       break;
-               }
-
-               zfs_close(zhp);
-       }
-
-       return (ret);
-}
-
-/*
- * zfs unmount -a
- * zfs unmount filesystem
- *
- * Unmount all filesystems, or a specific ZFS filesystem.
- */
-static int
-zfs_do_unmount(int argc, char **argv)
-{
-       return (unshare_unmount(OP_MOUNT, argc, argv));
-}
-
-/*
- * zfs unshare -a
- * zfs unshare filesystem
- *
- * Unshare all filesystems, or a specific ZFS filesystem.
- */
-static int
-zfs_do_unshare(int argc, char **argv)
-{
-       return (unshare_unmount(OP_SHARE, argc, argv));
-}
-
-static int
-find_command_idx(char *command, int *idx)
-{
-       int i;
-
-       for (i = 0; i < NCOMMAND; i++) {
-               if (command_table[i].name == NULL)
-                       continue;
-
-               if (strcmp(command, command_table[i].name) == 0) {
-                       *idx = i;
-                       return (0);
-               }
-       }
-       return (1);
-}
-
-static int
-zfs_do_diff(int argc, char **argv)
-{
-       zfs_handle_t *zhp;
-       int flags = 0;
-       char *tosnap = NULL;
-       char *fromsnap = NULL;
-       char *atp, *copy;
-       int err = 0;
-       int c;
-
-       while ((c = getopt(argc, argv, "FHt")) != -1) {
-               switch (c) {
-               case 'F':
-                       flags |= ZFS_DIFF_CLASSIFY;
-                       break;
-               case 'H':
-                       flags |= ZFS_DIFF_PARSEABLE;
-                       break;
-               case 't':
-                       flags |= ZFS_DIFF_TIMESTAMP;
-                       break;
-               default:
-                       (void) fprintf(stderr,
-                           gettext("invalid option '%c'\n"), optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 1) {
-               (void) fprintf(stderr,
-               gettext("must provide at least one snapshot name\n"));
-               usage(B_FALSE);
-       }
-
-       if (argc > 2) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       fromsnap = argv[0];
-       tosnap = (argc == 2) ? argv[1] : NULL;
-
-       copy = NULL;
-       if (*fromsnap != '@')
-               copy = strdup(fromsnap);
-       else if (tosnap)
-               copy = strdup(tosnap);
-       if (copy == NULL)
-               usage(B_FALSE);
-
-       if ((atp = strchr(copy, '@')))
-               *atp = '\0';
-
-       if ((zhp = zfs_open(g_zfs, copy, ZFS_TYPE_FILESYSTEM)) == NULL)
-               return (1);
-
-       free(copy);
-
-       /*
-        * Ignore SIGPIPE so that the library can give us
-        * information on any failure
-        */
-       (void) sigignore(SIGPIPE);
-
-       err = zfs_show_diffs(zhp, STDOUT_FILENO, fromsnap, tosnap, flags);
-
-       zfs_close(zhp);
-
-       return (err != 0);
-}
-
-/*
- * zfs bookmark <fs@snap> <fs#bmark>
- *
- * Creates a bookmark with the given name from the given snapshot.
- */
-static int
-zfs_do_bookmark(int argc, char **argv)
-{
-       char snapname[ZFS_MAXNAMELEN];
-       zfs_handle_t *zhp;
-       nvlist_t *nvl;
-       int ret = 0;
-       int c;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "")) != -1) {
-               switch (c) {
-               case '?':
-                       (void) fprintf(stderr,
-                           gettext("invalid option '%c'\n"), optopt);
-                       goto usage;
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing snapshot argument\n"));
-               goto usage;
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing bookmark argument\n"));
-               goto usage;
-       }
-
-       if (strchr(argv[1], '#') == NULL) {
-               (void) fprintf(stderr,
-                   gettext("invalid bookmark name '%s' -- "
-                   "must contain a '#'\n"), argv[1]);
-               goto usage;
-       }
-
-       if (argv[0][0] == '@') {
-               /*
-                * Snapshot name begins with @.
-                * Default to same fs as bookmark.
-                */
-               (void) strncpy(snapname, argv[1], sizeof (snapname));
-               *strchr(snapname, '#') = '\0';
-               (void) strlcat(snapname, argv[0], sizeof (snapname));
-       } else {
-               (void) strncpy(snapname, argv[0], sizeof (snapname));
-       }
-       zhp = zfs_open(g_zfs, snapname, ZFS_TYPE_SNAPSHOT);
-       if (zhp == NULL)
-               goto usage;
-       zfs_close(zhp);
-
-
-       nvl = fnvlist_alloc();
-       fnvlist_add_string(nvl, argv[1], snapname);
-       ret = lzc_bookmark(nvl, NULL);
-       fnvlist_free(nvl);
-
-       if (ret != 0) {
-               const char *err_msg;
-               char errbuf[1024];
-
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "cannot create bookmark '%s'"), argv[1]);
-
-               switch (ret) {
-               case EXDEV:
-                       err_msg = "bookmark is in a different pool";
-                       break;
-               case EEXIST:
-                       err_msg = "bookmark exists";
-                       break;
-               case EINVAL:
-                       err_msg = "invalid argument";
-                       break;
-               case ENOTSUP:
-                       err_msg = "bookmark feature not enabled";
-                       break;
-               case ENOSPC:
-                       err_msg = "out of space";
-                       break;
-               default:
-                       err_msg = "unknown error";
-                       break;
-               }
-               (void) fprintf(stderr, "%s: %s\n", errbuf,
-                   dgettext(TEXT_DOMAIN, err_msg));
-       }
-
-       return (ret != 0);
-
-usage:
-       usage(B_FALSE);
-       return (-1);
-}
-
-int
-main(int argc, char **argv)
-{
-       int ret = 0;
-       int i = 0;
-       char *cmdname;
-
-       (void) setlocale(LC_ALL, "");
-       (void) textdomain(TEXT_DOMAIN);
-
-       dprintf_setup(&argc, argv);
-
-       opterr = 0;
-
-       /*
-        * Make sure the user has specified some command.
-        */
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing command\n"));
-               usage(B_FALSE);
-       }
-
-       cmdname = argv[1];
-
-       /*
-        * The 'umount' command is an alias for 'unmount'
-        */
-       if (strcmp(cmdname, "umount") == 0)
-               cmdname = "unmount";
-
-       /*
-        * The 'recv' command is an alias for 'receive'
-        */
-       if (strcmp(cmdname, "recv") == 0)
-               cmdname = "receive";
-
-       /*
-        * The 'snap' command is an alias for 'snapshot'
-        */
-       if (strcmp(cmdname, "snap") == 0)
-               cmdname = "snapshot";
-
-       /*
-        * Special case '-?'
-        */
-       if ((strcmp(cmdname, "-?") == 0) ||
-           (strcmp(cmdname, "--help") == 0))
-               usage(B_TRUE);
-
-       if ((g_zfs = libzfs_init()) == NULL) {
-               (void) fprintf(stderr, "%s", libzfs_error_init(errno));
-               return (1);
-       }
-
-       mnttab_file = g_zfs->libzfs_mnttab;
-
-       zfs_save_arguments(argc, argv, history_str, sizeof (history_str));
-
-       libzfs_print_on_error(g_zfs, B_TRUE);
-
-       /*
-        * Run the appropriate command.
-        */
-       libzfs_mnttab_cache(g_zfs, B_TRUE);
-       if (find_command_idx(cmdname, &i) == 0) {
-               current_command = &command_table[i];
-               ret = command_table[i].func(argc - 1, argv + 1);
-       } else if (strchr(cmdname, '=') != NULL) {
-               verify(find_command_idx("set", &i) == 0);
-               current_command = &command_table[i];
-               ret = command_table[i].func(argc, argv);
-       } else {
-               (void) fprintf(stderr, gettext("unrecognized "
-                   "command '%s'\n"), cmdname);
-               usage(B_FALSE);
-               ret = 1;
-       }
-
-       if (ret == 0 && log_history)
-               (void) zpool_log_history(g_zfs, history_str);
-
-       libzfs_fini(g_zfs);
-
-       /*
-        * The 'ZFS_ABORT' environment variable causes us to dump core on exit
-        * for the purposes of running ::findleaks.
-        */
-       if (getenv("ZFS_ABORT") != NULL) {
-               (void) printf("dumping core by request\n");
-               abort();
-       }
-
-       return (ret);
-}
diff --git a/zfs/cmd/zfs/zfs_util.h b/zfs/cmd/zfs/zfs_util.h
deleted file mode 100644 (file)
index 3ddff9e..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef        _ZFS_UTIL_H
-#define        _ZFS_UTIL_H
-
-#include <libzfs.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-void * safe_malloc(size_t size);
-void nomem(void);
-libzfs_handle_t *g_zfs;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ZFS_UTIL_H */
diff --git a/zfs/cmd/zhack/.gitignore b/zfs/cmd/zhack/.gitignore
deleted file mode 100644 (file)
index 763a188..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zhack
diff --git a/zfs/cmd/zhack/Makefile.am b/zfs/cmd/zhack/Makefile.am
deleted file mode 100644 (file)
index 53e3241..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-sbin_PROGRAMS = zhack
-
-zhack_SOURCES = \
-       zhack.c
-
-zhack_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
-
-zhack_LDADD += $(ZLIB)
diff --git a/zfs/cmd/zhack/Makefile.in b/zfs/cmd/zhack/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zhack/zhack.c b/zfs/cmd/zhack/zhack.c
deleted file mode 100644 (file)
index 3f86714..0000000
+++ /dev/null
@@ -1,571 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
- * Copyright (c) 2013 Steven Hartland. All rights reserved.
- */
-
-/*
- * zhack is a debugging tool that can write changes to ZFS pool using libzpool
- * for testing purposes. Altering pools with zhack is unsupported and may
- * result in corrupted pools.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <ctype.h>
-#include <sys/zfs_context.h>
-#include <sys/spa.h>
-#include <sys/spa_impl.h>
-#include <sys/dmu.h>
-#include <sys/zap.h>
-#include <sys/zfs_znode.h>
-#include <sys/dsl_synctask.h>
-#include <sys/vdev.h>
-#include <sys/fs/zfs.h>
-#include <sys/dmu_objset.h>
-#include <sys/dsl_pool.h>
-#include <sys/zio_checksum.h>
-#include <sys/zio_compress.h>
-#include <sys/zfeature.h>
-#include <sys/dmu_tx.h>
-#undef ZFS_MAXNAMELEN
-#include <libzfs.h>
-
-extern boolean_t zfeature_checks_disable;
-
-const char cmdname[] = "zhack";
-libzfs_handle_t *g_zfs;
-static importargs_t g_importargs;
-static char *g_pool;
-static boolean_t g_readonly;
-
-static void
-usage(void)
-{
-       (void) fprintf(stderr,
-           "Usage: %s [-c cachefile] [-d dir] <subcommand> <args> ...\n"
-           "where <subcommand> <args> is one of the following:\n"
-           "\n", cmdname);
-
-       (void) fprintf(stderr,
-           "    feature stat <pool>\n"
-           "        print information about enabled features\n"
-           "    feature enable [-d desc] <pool> <feature>\n"
-           "        add a new enabled feature to the pool\n"
-           "        -d <desc> sets the feature's description\n"
-           "    feature ref [-md] <pool> <feature>\n"
-           "        change the refcount on the given feature\n"
-           "        -d decrease instead of increase the refcount\n"
-           "        -m add the feature to the label if increasing refcount\n"
-           "\n"
-           "    <feature> : should be a feature guid\n");
-       exit(1);
-}
-
-
-static void
-fatal(spa_t *spa, void *tag, const char *fmt, ...)
-{
-       va_list ap;
-
-       if (spa != NULL) {
-               spa_close(spa, tag);
-               (void) spa_export(g_pool, NULL, B_TRUE, B_FALSE);
-       }
-
-       va_start(ap, fmt);
-       (void) fprintf(stderr, "%s: ", cmdname);
-       (void) vfprintf(stderr, fmt, ap);
-       va_end(ap);
-       (void) fprintf(stderr, "\n");
-
-       exit(1);
-}
-
-/* ARGSUSED */
-static int
-space_delta_cb(dmu_object_type_t bonustype, void *data,
-    uint64_t *userp, uint64_t *groupp)
-{
-       /*
-        * Is it a valid type of object to track?
-        */
-       if (bonustype != DMU_OT_ZNODE && bonustype != DMU_OT_SA)
-               return (ENOENT);
-       (void) fprintf(stderr, "modifying object that needs user accounting");
-       abort();
-       /* NOTREACHED */
-}
-
-/*
- * Target is the dataset whose pool we want to open.
- */
-static void
-import_pool(const char *target, boolean_t readonly)
-{
-       nvlist_t *config;
-       nvlist_t *pools;
-       int error;
-       char *sepp;
-       spa_t *spa;
-       nvpair_t *elem;
-       nvlist_t *props;
-       char *name;
-
-       kernel_init(readonly ? FREAD : (FREAD | FWRITE));
-       g_zfs = libzfs_init();
-       ASSERT(g_zfs != NULL);
-
-       dmu_objset_register_type(DMU_OST_ZFS, space_delta_cb);
-
-       g_readonly = readonly;
-
-       /*
-        * If we only want readonly access, it's OK if we find
-        * a potentially-active (ie, imported into the kernel) pool from the
-        * default cachefile.
-        */
-       if (readonly && spa_open(target, &spa, FTAG) == 0) {
-               spa_close(spa, FTAG);
-               return;
-       }
-
-       g_importargs.unique = B_TRUE;
-       g_importargs.can_be_active = readonly;
-       g_pool = strdup(target);
-       if ((sepp = strpbrk(g_pool, "/@")) != NULL)
-               *sepp = '\0';
-       g_importargs.poolname = g_pool;
-       pools = zpool_search_import(g_zfs, &g_importargs);
-
-       if (nvlist_empty(pools)) {
-               if (!g_importargs.can_be_active) {
-                       g_importargs.can_be_active = B_TRUE;
-                       if (zpool_search_import(g_zfs, &g_importargs) != NULL ||
-                           spa_open(target, &spa, FTAG) == 0) {
-                               fatal(spa, FTAG, "cannot import '%s': pool is "
-                                   "active; run " "\"zpool export %s\" "
-                                   "first\n", g_pool, g_pool);
-                       }
-               }
-
-               fatal(NULL, FTAG, "cannot import '%s': no such pool "
-                   "available\n", g_pool);
-       }
-
-       elem = nvlist_next_nvpair(pools, NULL);
-       name = nvpair_name(elem);
-       VERIFY(nvpair_value_nvlist(elem, &config) == 0);
-
-       props = NULL;
-       if (readonly) {
-               VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
-               VERIFY(nvlist_add_uint64(props,
-                   zpool_prop_to_name(ZPOOL_PROP_READONLY), 1) == 0);
-       }
-
-       zfeature_checks_disable = B_TRUE;
-       error = spa_import(name, config, props, ZFS_IMPORT_NORMAL);
-       zfeature_checks_disable = B_FALSE;
-       if (error == EEXIST)
-               error = 0;
-
-       if (error)
-               fatal(NULL, FTAG, "can't import '%s': %s", name,
-                   strerror(error));
-}
-
-static void
-zhack_spa_open(const char *target, boolean_t readonly, void *tag, spa_t **spa)
-{
-       int err;
-
-       import_pool(target, readonly);
-
-       zfeature_checks_disable = B_TRUE;
-       err = spa_open(target, spa, tag);
-       zfeature_checks_disable = B_FALSE;
-
-       if (err != 0)
-               fatal(*spa, FTAG, "cannot open '%s': %s", target,
-                   strerror(err));
-       if (spa_version(*spa) < SPA_VERSION_FEATURES) {
-               fatal(*spa, FTAG, "'%s' has version %d, features not enabled",
-                   target, (int)spa_version(*spa));
-       }
-}
-
-static void
-dump_obj(objset_t *os, uint64_t obj, const char *name)
-{
-       zap_cursor_t zc;
-       zap_attribute_t za;
-
-       (void) printf("%s_obj:\n", name);
-
-       for (zap_cursor_init(&zc, os, obj);
-           zap_cursor_retrieve(&zc, &za) == 0;
-           zap_cursor_advance(&zc)) {
-               if (za.za_integer_length == 8) {
-                       ASSERT(za.za_num_integers == 1);
-                       (void) printf("\t%s = %llu\n",
-                           za.za_name, (u_longlong_t)za.za_first_integer);
-               } else {
-                       ASSERT(za.za_integer_length == 1);
-                       char val[1024];
-                       VERIFY(zap_lookup(os, obj, za.za_name,
-                           1, sizeof (val), val) == 0);
-                       (void) printf("\t%s = %s\n", za.za_name, val);
-               }
-       }
-       zap_cursor_fini(&zc);
-}
-
-static void
-dump_mos(spa_t *spa)
-{
-       nvlist_t *nv = spa->spa_label_features;
-       nvpair_t *pair;
-
-       (void) printf("label config:\n");
-       for (pair = nvlist_next_nvpair(nv, NULL);
-           pair != NULL;
-           pair = nvlist_next_nvpair(nv, pair)) {
-               (void) printf("\t%s\n", nvpair_name(pair));
-       }
-}
-
-static void
-zhack_do_feature_stat(int argc, char **argv)
-{
-       spa_t *spa;
-       objset_t *os;
-       char *target;
-
-       argc--;
-       argv++;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, "error: missing pool name\n");
-               usage();
-       }
-       target = argv[0];
-
-       zhack_spa_open(target, B_TRUE, FTAG, &spa);
-       os = spa->spa_meta_objset;
-
-       dump_obj(os, spa->spa_feat_for_read_obj, "for_read");
-       dump_obj(os, spa->spa_feat_for_write_obj, "for_write");
-       dump_obj(os, spa->spa_feat_desc_obj, "descriptions");
-       if (spa_feature_is_active(spa, SPA_FEATURE_ENABLED_TXG)) {
-               dump_obj(os, spa->spa_feat_enabled_txg_obj, "enabled_txg");
-       }
-       dump_mos(spa);
-
-       spa_close(spa, FTAG);
-}
-
-static void
-zhack_feature_enable_sync(void *arg, dmu_tx_t *tx)
-{
-       spa_t *spa = dmu_tx_pool(tx)->dp_spa;
-       zfeature_info_t *feature = arg;
-
-       feature_enable_sync(spa, feature, tx);
-
-       spa_history_log_internal(spa, "zhack enable feature", tx,
-           "name=%s can_readonly=%u",
-           feature->fi_guid, feature->fi_can_readonly);
-}
-
-static void
-zhack_do_feature_enable(int argc, char **argv)
-{
-       char c;
-       char *desc, *target;
-       spa_t *spa;
-       objset_t *mos;
-       zfeature_info_t feature;
-       spa_feature_t nodeps[] = { SPA_FEATURE_NONE };
-
-       /*
-        * Features are not added to the pool's label until their refcounts
-        * are incremented, so fi_mos can just be left as false for now.
-        */
-       desc = NULL;
-       feature.fi_uname = "zhack";
-       feature.fi_mos = B_FALSE;
-       feature.fi_can_readonly = B_FALSE;
-       feature.fi_activate_on_enable = B_FALSE;
-       feature.fi_depends = nodeps;
-       feature.fi_feature = SPA_FEATURE_NONE;
-
-       optind = 1;
-       while ((c = getopt(argc, argv, "rmd:")) != -1) {
-               switch (c) {
-               case 'r':
-                       feature.fi_can_readonly = B_TRUE;
-                       break;
-               case 'd':
-                       desc = strdup(optarg);
-                       break;
-               default:
-                       usage();
-                       break;
-               }
-       }
-
-       if (desc == NULL)
-               desc = strdup("zhack injected");
-       feature.fi_desc = desc;
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 2) {
-               (void) fprintf(stderr, "error: missing feature or pool name\n");
-               usage();
-       }
-       target = argv[0];
-       feature.fi_guid = argv[1];
-
-       if (!zfeature_is_valid_guid(feature.fi_guid))
-               fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid);
-
-       zhack_spa_open(target, B_FALSE, FTAG, &spa);
-       mos = spa->spa_meta_objset;
-
-       if (zfeature_is_supported(feature.fi_guid))
-               fatal(spa, FTAG, "'%s' is a real feature, will not enable");
-       if (0 == zap_contains(mos, spa->spa_feat_desc_obj, feature.fi_guid))
-               fatal(spa, FTAG, "feature already enabled: %s",
-                   feature.fi_guid);
-
-       VERIFY0(dsl_sync_task(spa_name(spa), NULL,
-           zhack_feature_enable_sync, &feature, 5, ZFS_SPACE_CHECK_NORMAL));
-
-       spa_close(spa, FTAG);
-
-       free(desc);
-}
-
-static void
-feature_incr_sync(void *arg, dmu_tx_t *tx)
-{
-       spa_t *spa = dmu_tx_pool(tx)->dp_spa;
-       zfeature_info_t *feature = arg;
-       uint64_t refcount;
-
-       VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
-       feature_sync(spa, feature, refcount + 1, tx);
-       spa_history_log_internal(spa, "zhack feature incr", tx,
-           "name=%s", feature->fi_guid);
-}
-
-static void
-feature_decr_sync(void *arg, dmu_tx_t *tx)
-{
-       spa_t *spa = dmu_tx_pool(tx)->dp_spa;
-       zfeature_info_t *feature = arg;
-       uint64_t refcount;
-
-       VERIFY0(feature_get_refcount_from_disk(spa, feature, &refcount));
-       feature_sync(spa, feature, refcount - 1, tx);
-       spa_history_log_internal(spa, "zhack feature decr", tx,
-           "name=%s", feature->fi_guid);
-}
-
-static void
-zhack_do_feature_ref(int argc, char **argv)
-{
-       char c;
-       char *target;
-       boolean_t decr = B_FALSE;
-       spa_t *spa;
-       objset_t *mos;
-       zfeature_info_t feature;
-       spa_feature_t nodeps[] = { SPA_FEATURE_NONE };
-
-       /*
-        * fi_desc does not matter here because it was written to disk
-        * when the feature was enabled, but we need to properly set the
-        * feature for read or write based on the information we read off
-        * disk later.
-        */
-       feature.fi_uname = "zhack";
-       feature.fi_mos = B_FALSE;
-       feature.fi_desc = NULL;
-       feature.fi_depends = nodeps;
-       feature.fi_feature = SPA_FEATURE_NONE;
-
-       optind = 1;
-       while ((c = getopt(argc, argv, "md")) != -1) {
-               switch (c) {
-               case 'm':
-                       feature.fi_mos = B_TRUE;
-                       break;
-               case 'd':
-                       decr = B_TRUE;
-                       break;
-               default:
-                       usage();
-                       break;
-               }
-       }
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 2) {
-               (void) fprintf(stderr, "error: missing feature or pool name\n");
-               usage();
-       }
-       target = argv[0];
-       feature.fi_guid = argv[1];
-
-       if (!zfeature_is_valid_guid(feature.fi_guid))
-               fatal(NULL, FTAG, "invalid feature guid: %s", feature.fi_guid);
-
-       zhack_spa_open(target, B_FALSE, FTAG, &spa);
-       mos = spa->spa_meta_objset;
-
-       if (zfeature_is_supported(feature.fi_guid)) {
-               fatal(spa, FTAG,
-                   "'%s' is a real feature, will not change refcount");
-       }
-
-       if (0 == zap_contains(mos, spa->spa_feat_for_read_obj,
-           feature.fi_guid)) {
-               feature.fi_can_readonly = B_FALSE;
-       } else if (0 == zap_contains(mos, spa->spa_feat_for_write_obj,
-           feature.fi_guid)) {
-               feature.fi_can_readonly = B_TRUE;
-       } else {
-               fatal(spa, FTAG, "feature is not enabled: %s", feature.fi_guid);
-       }
-
-       if (decr) {
-               uint64_t count;
-               if (feature_get_refcount_from_disk(spa, &feature,
-                   &count) == 0 && count != 0) {
-                       fatal(spa, FTAG, "feature refcount already 0: %s",
-                           feature.fi_guid);
-               }
-       }
-
-       VERIFY0(dsl_sync_task(spa_name(spa), NULL,
-           decr ? feature_decr_sync : feature_incr_sync, &feature,
-           5, ZFS_SPACE_CHECK_NORMAL));
-
-       spa_close(spa, FTAG);
-}
-
-static int
-zhack_do_feature(int argc, char **argv)
-{
-       char *subcommand;
-
-       argc--;
-       argv++;
-       if (argc == 0) {
-               (void) fprintf(stderr,
-                   "error: no feature operation specified\n");
-               usage();
-       }
-
-       subcommand = argv[0];
-       if (strcmp(subcommand, "stat") == 0) {
-               zhack_do_feature_stat(argc, argv);
-       } else if (strcmp(subcommand, "enable") == 0) {
-               zhack_do_feature_enable(argc, argv);
-       } else if (strcmp(subcommand, "ref") == 0) {
-               zhack_do_feature_ref(argc, argv);
-       } else {
-               (void) fprintf(stderr, "error: unknown subcommand: %s\n",
-                   subcommand);
-               usage();
-       }
-
-       return (0);
-}
-
-#define        MAX_NUM_PATHS 1024
-
-int
-main(int argc, char **argv)
-{
-       extern void zfs_prop_init(void);
-
-       char *path[MAX_NUM_PATHS];
-       const char *subcommand;
-       int rv = 0;
-       char c;
-
-       g_importargs.path = path;
-
-       dprintf_setup(&argc, argv);
-       zfs_prop_init();
-
-       while ((c = getopt(argc, argv, "c:d:")) != -1) {
-               switch (c) {
-               case 'c':
-                       g_importargs.cachefile = optarg;
-                       break;
-               case 'd':
-                       assert(g_importargs.paths < MAX_NUM_PATHS);
-                       g_importargs.path[g_importargs.paths++] = optarg;
-                       break;
-               default:
-                       usage();
-                       break;
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-       optind = 1;
-
-       if (argc == 0) {
-               (void) fprintf(stderr, "error: no command specified\n");
-               usage();
-       }
-
-       subcommand = argv[0];
-
-       if (strcmp(subcommand, "feature") == 0) {
-               rv = zhack_do_feature(argc, argv);
-       } else {
-               (void) fprintf(stderr, "error: unknown subcommand: %s\n",
-                   subcommand);
-               usage();
-       }
-
-       if (!g_readonly && spa_export(g_pool, NULL, B_TRUE, B_FALSE) != 0) {
-               fatal(NULL, FTAG, "pool export failed; "
-                   "changes may not be committed to disk\n");
-       }
-
-       libzfs_fini(g_zfs);
-       kernel_fini();
-
-       return (rv);
-}
diff --git a/zfs/cmd/zinject/.gitignore b/zfs/cmd/zinject/.gitignore
deleted file mode 100644 (file)
index bded840..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zinject
diff --git a/zfs/cmd/zinject/Makefile.am b/zfs/cmd/zinject/Makefile.am
deleted file mode 100644 (file)
index 2500bee..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-sbin_PROGRAMS = zinject
-
-zinject_SOURCES = \
-       translate.c \
-       zinject.c \
-       zinject.h
-
-zinject_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
diff --git a/zfs/cmd/zinject/Makefile.in b/zfs/cmd/zinject/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zinject/translate.c b/zfs/cmd/zinject/translate.c
deleted file mode 100644 (file)
index 5cc9d9f..0000000
+++ /dev/null
@@ -1,519 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2006, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-#include <libzfs.h>
-
-#include <sys/zfs_context.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdarg.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <sys/file.h>
-#include <sys/mntent.h>
-#include <sys/mnttab.h>
-#include <sys/param.h>
-#include <sys/stat.h>
-
-#include <sys/dmu.h>
-#include <sys/dmu_objset.h>
-#include <sys/dnode.h>
-#include <sys/vdev_impl.h>
-
-#include <sys/mkdev.h>
-
-#include "zinject.h"
-
-extern void kernel_init(int);
-extern void kernel_fini(void);
-
-static int debug;
-
-static void
-ziprintf(const char *fmt, ...)
-{
-       va_list ap;
-
-       if (!debug)
-               return;
-
-       va_start(ap, fmt);
-       (void) vprintf(fmt, ap);
-       va_end(ap);
-}
-
-static void
-compress_slashes(const char *src, char *dest)
-{
-       while (*src != '\0') {
-               *dest = *src++;
-               while (*dest == '/' && *src == '/')
-                       ++src;
-               ++dest;
-       }
-       *dest = '\0';
-}
-
-/*
- * Given a full path to a file, translate into a dataset name and a relative
- * path within the dataset.  'dataset' must be at least MAXNAMELEN characters,
- * and 'relpath' must be at least MAXPATHLEN characters.  We also pass a stat64
- * buffer, which we need later to get the object ID.
- */
-static int
-parse_pathname(const char *inpath, char *dataset, char *relpath,
-    struct stat64 *statbuf)
-{
-       struct extmnttab mp;
-       FILE *fp;
-       int match;
-       const char *rel;
-       char fullpath[MAXPATHLEN];
-
-       compress_slashes(inpath, fullpath);
-
-       if (fullpath[0] != '/') {
-               (void) fprintf(stderr, "invalid object '%s': must be full "
-                   "path\n", fullpath);
-               usage();
-               return (-1);
-       }
-
-       if (strlen(fullpath) >= MAXPATHLEN) {
-               (void) fprintf(stderr, "invalid object; pathname too long\n");
-               return (-1);
-       }
-
-       if (stat64(fullpath, statbuf) != 0) {
-               (void) fprintf(stderr, "cannot open '%s': %s\n",
-                   fullpath, strerror(errno));
-               return (-1);
-       }
-
-#ifdef HAVE_SETMNTENT
-       if ((fp = setmntent(MNTTAB, "r")) == NULL) {
-#else
-       if ((fp = fopen(MNTTAB, "r")) == NULL) {
-#endif
-               (void) fprintf(stderr, "cannot open /etc/mtab\n");
-               return (-1);
-       }
-
-       match = 0;
-       while (getextmntent(fp, &mp, sizeof (mp)) == 0) {
-               if (makedev(mp.mnt_major, mp.mnt_minor) == statbuf->st_dev) {
-                       match = 1;
-                       break;
-               }
-       }
-
-       if (!match) {
-               (void) fprintf(stderr, "cannot find mountpoint for '%s'\n",
-                   fullpath);
-               return (-1);
-       }
-
-       if (strcmp(mp.mnt_fstype, MNTTYPE_ZFS) != 0) {
-               (void) fprintf(stderr, "invalid path '%s': not a ZFS "
-                   "filesystem\n", fullpath);
-               return (-1);
-       }
-
-       if (strncmp(fullpath, mp.mnt_mountp, strlen(mp.mnt_mountp)) != 0) {
-               (void) fprintf(stderr, "invalid path '%s': mountpoint "
-                   "doesn't match path\n", fullpath);
-               return (-1);
-       }
-
-       (void) strcpy(dataset, mp.mnt_special);
-
-       rel = fullpath + strlen(mp.mnt_mountp);
-       if (rel[0] == '/')
-               rel++;
-       (void) strcpy(relpath, rel);
-
-       return (0);
-}
-
-/*
- * Convert from a (dataset, path) pair into a (objset, object) pair.  Note that
- * we grab the object number from the inode number, since looking this up via
- * libzpool is a real pain.
- */
-/* ARGSUSED */
-static int
-object_from_path(const char *dataset, const char *path, struct stat64 *statbuf,
-    zinject_record_t *record)
-{
-       objset_t *os;
-       int err;
-
-       /*
-        * Before doing any libzpool operations, call sync() to ensure that the
-        * on-disk state is consistent with the in-core state.
-        */
-       sync();
-
-       err = dmu_objset_own(dataset, DMU_OST_ZFS, B_TRUE, FTAG, &os);
-       if (err != 0) {
-               (void) fprintf(stderr, "cannot open dataset '%s': %s\n",
-                   dataset, strerror(err));
-               return (-1);
-       }
-
-       record->zi_objset = dmu_objset_id(os);
-       record->zi_object = statbuf->st_ino;
-
-       dmu_objset_disown(os, FTAG);
-
-       return (0);
-}
-
-/*
- * Calculate the real range based on the type, level, and range given.
- */
-static int
-calculate_range(const char *dataset, err_type_t type, int level, char *range,
-    zinject_record_t *record)
-{
-       objset_t *os = NULL;
-       dnode_t *dn = NULL;
-       int err;
-       int ret = -1;
-
-       /*
-        * Determine the numeric range from the string.
-        */
-       if (range == NULL) {
-               /*
-                * If range is unspecified, set the range to [0,-1], which
-                * indicates that the whole object should be treated as an
-                * error.
-                */
-               record->zi_start = 0;
-               record->zi_end = -1ULL;
-       } else {
-               char *end;
-
-               /* XXX add support for suffixes */
-               record->zi_start = strtoull(range, &end, 10);
-
-
-               if (*end == '\0')
-                       record->zi_end = record->zi_start + 1;
-               else if (*end == ',')
-                       record->zi_end = strtoull(end + 1, &end, 10);
-
-               if (*end != '\0') {
-                       (void) fprintf(stderr, "invalid range '%s': must be "
-                           "a numeric range of the form 'start[,end]'\n",
-                           range);
-                       goto out;
-               }
-       }
-
-       switch (type) {
-       default:
-               break;
-       case TYPE_DATA:
-               break;
-
-       case TYPE_DNODE:
-               /*
-                * If this is a request to inject faults into the dnode, then we
-                * must translate the current (objset,object) pair into an
-                * offset within the metadnode for the objset.  Specifying any
-                * kind of range with type 'dnode' is illegal.
-                */
-               if (range != NULL) {
-                       (void) fprintf(stderr, "range cannot be specified when "
-                           "type is 'dnode'\n");
-                       goto out;
-               }
-
-               record->zi_start = record->zi_object * sizeof (dnode_phys_t);
-               record->zi_end = record->zi_start + sizeof (dnode_phys_t);
-               record->zi_object = 0;
-               break;
-       }
-
-       /*
-        * Get the dnode associated with object, so we can calculate the block
-        * size.
-        */
-       if ((err = dmu_objset_own(dataset, DMU_OST_ANY,
-           B_TRUE, FTAG, &os)) != 0) {
-               (void) fprintf(stderr, "cannot open dataset '%s': %s\n",
-                   dataset, strerror(err));
-               goto out;
-       }
-
-       if (record->zi_object == 0) {
-               dn = DMU_META_DNODE(os);
-       } else {
-               err = dnode_hold(os, record->zi_object, FTAG, &dn);
-               if (err != 0) {
-                       (void) fprintf(stderr, "failed to hold dnode "
-                           "for object %llu\n",
-                           (u_longlong_t)record->zi_object);
-                       goto out;
-               }
-       }
-
-
-       ziprintf("data shift: %d\n", (int)dn->dn_datablkshift);
-       ziprintf(" ind shift: %d\n", (int)dn->dn_indblkshift);
-
-       /*
-        * Translate range into block IDs.
-        */
-       if (record->zi_start != 0 || record->zi_end != -1ULL) {
-               record->zi_start >>= dn->dn_datablkshift;
-               record->zi_end >>= dn->dn_datablkshift;
-       }
-
-       /*
-        * Check level, and then translate level 0 blkids into ranges
-        * appropriate for level of indirection.
-        */
-       record->zi_level = level;
-       if (level > 0) {
-               ziprintf("level 0 blkid range: [%llu, %llu]\n",
-                   record->zi_start, record->zi_end);
-
-               if (level >= dn->dn_nlevels) {
-                       (void) fprintf(stderr, "level %d exceeds max level "
-                           "of object (%d)\n", level, dn->dn_nlevels - 1);
-                       goto out;
-               }
-
-               if (record->zi_start != 0 || record->zi_end != 0) {
-                       int shift = dn->dn_indblkshift - SPA_BLKPTRSHIFT;
-
-                       for (; level > 0; level--) {
-                               record->zi_start >>= shift;
-                               record->zi_end >>= shift;
-                       }
-               }
-       }
-
-       ret = 0;
-out:
-       if (dn) {
-               if (dn != DMU_META_DNODE(os))
-                       dnode_rele(dn, FTAG);
-       }
-       if (os)
-               dmu_objset_disown(os, FTAG);
-
-       return (ret);
-}
-
-int
-translate_record(err_type_t type, const char *object, const char *range,
-    int level, zinject_record_t *record, char *poolname, char *dataset)
-{
-       char path[MAXPATHLEN];
-       char *slash;
-       struct stat64 statbuf;
-       int ret = -1;
-
-       kernel_init(FREAD);
-
-       debug = (getenv("ZINJECT_DEBUG") != NULL);
-
-       ziprintf("translating: %s\n", object);
-
-       if (MOS_TYPE(type)) {
-               /*
-                * MOS objects are treated specially.
-                */
-               switch (type) {
-               default:
-                       break;
-               case TYPE_MOS:
-                       record->zi_type = 0;
-                       break;
-               case TYPE_MOSDIR:
-                       record->zi_type = DMU_OT_OBJECT_DIRECTORY;
-                       break;
-               case TYPE_METASLAB:
-                       record->zi_type = DMU_OT_OBJECT_ARRAY;
-                       break;
-               case TYPE_CONFIG:
-                       record->zi_type = DMU_OT_PACKED_NVLIST;
-                       break;
-               case TYPE_BPOBJ:
-                       record->zi_type = DMU_OT_BPOBJ;
-                       break;
-               case TYPE_SPACEMAP:
-                       record->zi_type = DMU_OT_SPACE_MAP;
-                       break;
-               case TYPE_ERRLOG:
-                       record->zi_type = DMU_OT_ERROR_LOG;
-                       break;
-               }
-
-               dataset[0] = '\0';
-               (void) strcpy(poolname, object);
-               return (0);
-       }
-
-       /*
-        * Convert a full path into a (dataset, file) pair.
-        */
-       if (parse_pathname(object, dataset, path, &statbuf) != 0)
-               goto err;
-
-       ziprintf("   dataset: %s\n", dataset);
-       ziprintf("      path: %s\n", path);
-
-       /*
-        * Convert (dataset, file) into (objset, object)
-        */
-       if (object_from_path(dataset, path, &statbuf, record) != 0)
-               goto err;
-
-       ziprintf("raw objset: %llu\n", record->zi_objset);
-       ziprintf("raw object: %llu\n", record->zi_object);
-
-       /*
-        * For the given object, calculate the real (type, level, range)
-        */
-       if (calculate_range(dataset, type, level, (char *)range, record) != 0)
-               goto err;
-
-       ziprintf("    objset: %llu\n", record->zi_objset);
-       ziprintf("    object: %llu\n", record->zi_object);
-       if (record->zi_start == 0 &&
-           record->zi_end == -1ULL)
-               ziprintf("     range: all\n");
-       else
-               ziprintf("     range: [%llu, %llu]\n", record->zi_start,
-                   record->zi_end);
-
-       /*
-        * Copy the pool name
-        */
-       (void) strcpy(poolname, dataset);
-       if ((slash = strchr(poolname, '/')) != NULL)
-               *slash = '\0';
-
-       ret = 0;
-
-err:
-       kernel_fini();
-       return (ret);
-}
-
-int
-translate_raw(const char *str, zinject_record_t *record)
-{
-       /*
-        * A raw bookmark of the form objset:object:level:blkid, where each
-        * number is a hexidecimal value.
-        */
-       if (sscanf(str, "%llx:%llx:%x:%llx", (u_longlong_t *)&record->zi_objset,
-           (u_longlong_t *)&record->zi_object, &record->zi_level,
-           (u_longlong_t *)&record->zi_start) != 4) {
-               (void) fprintf(stderr, "bad raw spec '%s': must be of the form "
-                   "'objset:object:level:blkid'\n", str);
-               return (-1);
-       }
-
-       record->zi_end = record->zi_start;
-
-       return (0);
-}
-
-int
-translate_device(const char *pool, const char *device, err_type_t label_type,
-    zinject_record_t *record)
-{
-       char *end;
-       zpool_handle_t *zhp;
-       nvlist_t *tgt;
-       boolean_t isspare, iscache;
-
-       /*
-        * Given a device name or GUID, create an appropriate injection record
-        * with zi_guid set.
-        */
-       if ((zhp = zpool_open(g_zfs, pool)) == NULL)
-               return (-1);
-
-       record->zi_guid = strtoull(device, &end, 0);
-       if (record->zi_guid == 0 || *end != '\0') {
-               tgt = zpool_find_vdev(zhp, device, &isspare, &iscache, NULL);
-
-               if (tgt == NULL) {
-                       (void) fprintf(stderr, "cannot find device '%s' in "
-                           "pool '%s'\n", device, pool);
-                       return (-1);
-               }
-
-               verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID,
-                   &record->zi_guid) == 0);
-       }
-
-       /*
-        * Device faults can take on three different forms:
-        * 1). delayed or hanging I/O
-        * 2). zfs label faults
-        * 3). generic disk faults
-        */
-       if (record->zi_timer != 0) {
-               record->zi_cmd = ZINJECT_DELAY_IO;
-       } else if (label_type != TYPE_INVAL) {
-               record->zi_cmd = ZINJECT_LABEL_FAULT;
-       } else {
-               record->zi_cmd = ZINJECT_DEVICE_FAULT;
-       }
-
-       switch (label_type) {
-       default:
-               break;
-       case TYPE_LABEL_UBERBLOCK:
-               record->zi_start = offsetof(vdev_label_t, vl_uberblock[0]);
-               record->zi_end = record->zi_start + VDEV_UBERBLOCK_RING - 1;
-               break;
-       case TYPE_LABEL_NVLIST:
-               record->zi_start = offsetof(vdev_label_t, vl_vdev_phys);
-               record->zi_end = record->zi_start + VDEV_PHYS_SIZE - 1;
-               break;
-       case TYPE_LABEL_PAD1:
-               record->zi_start = offsetof(vdev_label_t, vl_pad1);
-               record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1;
-               break;
-       case TYPE_LABEL_PAD2:
-               record->zi_start = offsetof(vdev_label_t, vl_pad2);
-               record->zi_end = record->zi_start + VDEV_PAD_SIZE - 1;
-               break;
-       }
-       return (0);
-}
diff --git a/zfs/cmd/zinject/zinject.c b/zfs/cmd/zinject/zinject.c
deleted file mode 100644 (file)
index f64e504..0000000
+++ /dev/null
@@ -1,983 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-/*
- * ZFS Fault Injector
- *
- * This userland component takes a set of options and uses libzpool to translate
- * from a user-visible object type and name to an internal representation.
- * There are two basic types of faults: device faults and data faults.
- *
- *
- * DEVICE FAULTS
- *
- * Errors can be injected into a particular vdev using the '-d' option.  This
- * option takes a path or vdev GUID to uniquely identify the device within a
- * pool.  There are two types of errors that can be injected, EIO and ENXIO,
- * that can be controlled through the '-e' option.  The default is ENXIO.  For
- * EIO failures, any attempt to read data from the device will return EIO, but
- * subsequent attempt to reopen the device will succeed.  For ENXIO failures,
- * any attempt to read from the device will return EIO, but any attempt to
- * reopen the device will also return ENXIO.
- * For label faults, the -L option must be specified. This allows faults
- * to be injected into either the nvlist, uberblock, pad1, or pad2 region
- * of all the labels for the specified device.
- *
- * This form of the command looks like:
- *
- *     zinject -d device [-e errno] [-L <uber | nvlist | pad1 | pad2>] pool
- *
- *
- * DATA FAULTS
- *
- * We begin with a tuple of the form:
- *
- *     <type,level,range,object>
- *
- *     type    A string describing the type of data to target.  Each type
- *             implicitly describes how to interpret 'object'. Currently,
- *             the following values are supported:
- *
- *             data            User data for a file
- *             dnode           Dnode for a file or directory
- *
- *             The following MOS objects are special.  Instead of injecting
- *             errors on a particular object or blkid, we inject errors across
- *             all objects of the given type.
- *
- *             mos             Any data in the MOS
- *             mosdir          object directory
- *             config          pool configuration
- *             bpobj           blkptr list
- *             spacemap        spacemap
- *             metaslab        metaslab
- *             errlog          persistent error log
- *
- *     level   Object level.  Defaults to '0', not applicable to all types.  If
- *             a range is given, this corresponds to the indirect block
- *             corresponding to the specific range.
- *
- *     range   A numerical range [start,end) within the object.  Defaults to
- *             the full size of the file.
- *
- *     object  A string describing the logical location of the object.  For
- *             files and directories (currently the only supported types),
- *             this is the path of the object on disk.
- *
- * This is translated, via libzpool, into the following internal representation:
- *
- *     <type,objset,object,level,range>
- *
- * These types should be self-explanatory.  This tuple is then passed to the
- * kernel via a special ioctl() to initiate fault injection for the given
- * object.  Note that 'type' is not strictly necessary for fault injection, but
- * is used when translating existing faults into a human-readable string.
- *
- *
- * The command itself takes one of the forms:
- *
- *     zinject
- *     zinject <-a | -u pool>
- *     zinject -c <id|all>
- *     zinject [-q] <-t type> [-f freq] [-u] [-a] [-m] [-e errno] [-l level]
- *         [-r range] <object>
- *     zinject [-f freq] [-a] [-m] [-u] -b objset:object:level:start:end pool
- *
- * With no arguments, the command prints all currently registered injection
- * handlers, with their numeric identifiers.
- *
- * The '-c' option will clear the given handler, or all handlers if 'all' is
- * specified.
- *
- * The '-e' option takes a string describing the errno to simulate.  This must
- * be either 'io' or 'checksum'.  In most cases this will result in the same
- * behavior, but RAID-Z will produce a different set of ereports for this
- * situation.
- *
- * The '-a', '-u', and '-m' flags toggle internal flush behavior.  If '-a' is
- * specified, then the ARC cache is flushed appropriately.  If '-u' is
- * specified, then the underlying SPA is unloaded.  Either of these flags can be
- * specified independently of any other handlers.  The '-m' flag automatically
- * does an unmount and remount of the underlying dataset to aid in flushing the
- * cache.
- *
- * The '-f' flag controls the frequency of errors injected, expressed as a
- * integer percentage between 1 and 100.  The default is 100.
- *
- * The this form is responsible for actually injecting the handler into the
- * framework.  It takes the arguments described above, translates them to the
- * internal tuple using libzpool, and then issues an ioctl() to register the
- * handler.
- *
- * The final form can target a specific bookmark, regardless of whether a
- * human-readable interface has been designed.  It allows developers to specify
- * a particular block by number.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-
-#include <sys/fs/zfs.h>
-#include <sys/mount.h>
-
-#include <libzfs.h>
-
-#undef verify  /* both libzfs.h and zfs_context.h want to define this */
-
-#include "zinject.h"
-
-libzfs_handle_t *g_zfs;
-int zfs_fd;
-
-#define        ECKSUM  EBADE
-
-static const char *errtable[TYPE_INVAL] = {
-       "data",
-       "dnode",
-       "mos",
-       "mosdir",
-       "metaslab",
-       "config",
-       "bpobj",
-       "spacemap",
-       "errlog",
-       "uber",
-       "nvlist",
-       "pad1",
-       "pad2"
-};
-
-static err_type_t
-name_to_type(const char *arg)
-{
-       int i;
-       for (i = 0; i < TYPE_INVAL; i++)
-               if (strcmp(errtable[i], arg) == 0)
-                       return (i);
-
-       return (TYPE_INVAL);
-}
-
-static const char *
-type_to_name(uint64_t type)
-{
-       switch (type) {
-       case DMU_OT_OBJECT_DIRECTORY:
-               return ("mosdir");
-       case DMU_OT_OBJECT_ARRAY:
-               return ("metaslab");
-       case DMU_OT_PACKED_NVLIST:
-               return ("config");
-       case DMU_OT_BPOBJ:
-               return ("bpobj");
-       case DMU_OT_SPACE_MAP:
-               return ("spacemap");
-       case DMU_OT_ERROR_LOG:
-               return ("errlog");
-       default:
-               return ("-");
-       }
-}
-
-
-/*
- * Print usage message.
- */
-void
-usage(void)
-{
-       (void) printf(
-           "usage:\n"
-           "\n"
-           "\tzinject\n"
-           "\n"
-           "\t\tList all active injection records.\n"
-           "\n"
-           "\tzinject -c <id|all>\n"
-           "\n"
-           "\t\tClear the particular record (if given a numeric ID), or\n"
-           "\t\tall records if 'all' is specificed.\n"
-           "\n"
-           "\tzinject -p <function name> pool\n"
-           "\t\tInject a panic fault at the specified function. Only \n"
-           "\t\tfunctions which call spa_vdev_config_exit(), or \n"
-           "\t\tspa_vdev_exit() will trigger a panic.\n"
-           "\n"
-           "\tzinject -d device [-e errno] [-L <nvlist|uber|pad1|pad2>] [-F]\n"
-           "\t    [-T <read|write|free|claim|all> pool\n"
-           "\t\tInject a fault into a particular device or the device's\n"
-           "\t\tlabel.  Label injection can either be 'nvlist', 'uber',\n "
-           "\t\t'pad1', or 'pad2'.\n"
-           "\t\t'errno' can be 'nxio' (the default), 'io', or 'dtl'.\n"
-           "\n"
-           "\tzinject -d device -A <degrade|fault> -D <delay secs> pool\n"
-           "\t\tPerform a specific action on a particular device.\n"
-           "\n"
-           "\tzinject -I [-s <seconds> | -g <txgs>] pool\n"
-           "\t\tCause the pool to stop writing blocks yet not\n"
-           "\t\treport errors for a duration.  Simulates buggy hardware\n"
-           "\t\tthat fails to honor cache flush requests.\n"
-           "\t\tDefault duration is 30 seconds.  The machine is panicked\n"
-           "\t\tat the end of the duration.\n"
-           "\n"
-           "\tzinject -b objset:object:level:blkid pool\n"
-           "\n"
-           "\t\tInject an error into pool 'pool' with the numeric bookmark\n"
-           "\t\tspecified by the remaining tuple.  Each number is in\n"
-           "\t\thexidecimal, and only one block can be specified.\n"
-           "\n"
-           "\tzinject [-q] <-t type> [-e errno] [-l level] [-r range]\n"
-           "\t    [-a] [-m] [-u] [-f freq] <object>\n"
-           "\n"
-           "\t\tInject an error into the object specified by the '-t' option\n"
-           "\t\tand the object descriptor.  The 'object' parameter is\n"
-           "\t\tinterperted depending on the '-t' option.\n"
-           "\n"
-           "\t\t-q\tQuiet mode.  Only print out the handler number added.\n"
-           "\t\t-e\tInject a specific error.  Must be either 'io' or\n"
-           "\t\t\t'checksum'.  Default is 'io'.\n"
-           "\t\t-l\tInject error at a particular block level. Default is "
-           "0.\n"
-           "\t\t-m\tAutomatically remount underlying filesystem.\n"
-           "\t\t-r\tInject error over a particular logical range of an\n"
-           "\t\t\tobject.  Will be translated to the appropriate blkid\n"
-           "\t\t\trange according to the object's properties.\n"
-           "\t\t-a\tFlush the ARC cache.  Can be specified without any\n"
-           "\t\t\tassociated object.\n"
-           "\t\t-u\tUnload the associated pool.  Can be specified with only\n"
-           "\t\t\ta pool object.\n"
-           "\t\t-f\tOnly inject errors a fraction of the time.  Expressed as\n"
-           "\t\t\ta percentage between 1 and 100.\n"
-           "\n"
-           "\t-t data\t\tInject an error into the plain file contents of a\n"
-           "\t\t\tfile.  The object must be specified as a complete path\n"
-           "\t\t\tto a file on a ZFS filesystem.\n"
-           "\n"
-           "\t-t dnode\tInject an error into the metadnode in the block\n"
-           "\t\t\tcorresponding to the dnode for a file or directory.  The\n"
-           "\t\t\t'-r' option is incompatible with this mode.  The object\n"
-           "\t\t\tis specified as a complete path to a file or directory\n"
-           "\t\t\ton a ZFS filesystem.\n"
-           "\n"
-           "\t-t <mos>\tInject errors into the MOS for objects of the given\n"
-           "\t\t\ttype.  Valid types are: mos, mosdir, config, bpobj,\n"
-           "\t\t\tspacemap, metaslab, errlog.  The only valid <object> is\n"
-           "\t\t\tthe poolname.\n");
-}
-
-static int
-iter_handlers(int (*func)(int, const char *, zinject_record_t *, void *),
-    void *data)
-{
-       zfs_cmd_t zc = {"\0"};
-       int ret;
-
-       while (ioctl(zfs_fd, ZFS_IOC_INJECT_LIST_NEXT, &zc) == 0)
-               if ((ret = func((int)zc.zc_guid, zc.zc_name,
-                   &zc.zc_inject_record, data)) != 0)
-                       return (ret);
-
-       if (errno != ENOENT) {
-               (void) fprintf(stderr, "Unable to list handlers: %s\n",
-                   strerror(errno));
-               return (-1);
-       }
-
-       return (0);
-}
-
-static int
-print_data_handler(int id, const char *pool, zinject_record_t *record,
-    void *data)
-{
-       int *count = data;
-
-       if (record->zi_guid != 0 || record->zi_func[0] != '\0')
-               return (0);
-
-       if (*count == 0) {
-               (void) printf("%3s  %-15s  %-6s  %-6s  %-8s  %3s  %-15s\n",
-                   "ID", "POOL", "OBJSET", "OBJECT", "TYPE", "LVL",  "RANGE");
-               (void) printf("---  ---------------  ------  "
-                   "------  --------  ---  ---------------\n");
-       }
-
-       *count += 1;
-
-       (void) printf("%3d  %-15s  %-6llu  %-6llu  %-8s  %3d  ", id, pool,
-           (u_longlong_t)record->zi_objset, (u_longlong_t)record->zi_object,
-           type_to_name(record->zi_type), record->zi_level);
-
-       if (record->zi_start == 0 &&
-           record->zi_end == -1ULL)
-               (void) printf("all\n");
-       else
-               (void) printf("[%llu, %llu]\n", (u_longlong_t)record->zi_start,
-                   (u_longlong_t)record->zi_end);
-
-       return (0);
-}
-
-static int
-print_device_handler(int id, const char *pool, zinject_record_t *record,
-    void *data)
-{
-       int *count = data;
-
-       if (record->zi_guid == 0 || record->zi_func[0] != '\0')
-               return (0);
-
-       if (*count == 0) {
-               (void) printf("%3s  %-15s  %s\n", "ID", "POOL", "GUID");
-               (void) printf("---  ---------------  ----------------\n");
-       }
-
-       *count += 1;
-
-       (void) printf("%3d  %-15s  %llx\n", id, pool,
-           (u_longlong_t)record->zi_guid);
-
-       return (0);
-}
-
-static int
-print_panic_handler(int id, const char *pool, zinject_record_t *record,
-    void *data)
-{
-       int *count = data;
-
-       if (record->zi_func[0] == '\0')
-               return (0);
-
-       if (*count == 0) {
-               (void) printf("%3s  %-15s  %s\n", "ID", "POOL", "FUNCTION");
-               (void) printf("---  ---------------  ----------------\n");
-       }
-
-       *count += 1;
-
-       (void) printf("%3d  %-15s  %s\n", id, pool, record->zi_func);
-
-       return (0);
-}
-
-/*
- * Print all registered error handlers.  Returns the number of handlers
- * registered.
- */
-static int
-print_all_handlers(void)
-{
-       int count = 0, total = 0;
-
-       (void) iter_handlers(print_device_handler, &count);
-       if (count > 0) {
-               total += count;
-               (void) printf("\n");
-               count = 0;
-       }
-
-       (void) iter_handlers(print_data_handler, &count);
-       if (count > 0) {
-               total += count;
-               (void) printf("\n");
-               count = 0;
-       }
-
-       (void) iter_handlers(print_panic_handler, &count);
-
-       return (count + total);
-}
-
-/* ARGSUSED */
-static int
-cancel_one_handler(int id, const char *pool, zinject_record_t *record,
-    void *data)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       zc.zc_guid = (uint64_t)id;
-
-       if (ioctl(zfs_fd, ZFS_IOC_CLEAR_FAULT, &zc) != 0) {
-               (void) fprintf(stderr, "failed to remove handler %d: %s\n",
-                   id, strerror(errno));
-               return (1);
-       }
-
-       return (0);
-}
-
-/*
- * Remove all fault injection handlers.
- */
-static int
-cancel_all_handlers(void)
-{
-       int ret = iter_handlers(cancel_one_handler, NULL);
-
-       if (ret == 0)
-               (void) printf("removed all registered handlers\n");
-
-       return (ret);
-}
-
-/*
- * Remove a specific fault injection handler.
- */
-static int
-cancel_handler(int id)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       zc.zc_guid = (uint64_t)id;
-
-       if (ioctl(zfs_fd, ZFS_IOC_CLEAR_FAULT, &zc) != 0) {
-               (void) fprintf(stderr, "failed to remove handler %d: %s\n",
-                   id, strerror(errno));
-               return (1);
-       }
-
-       (void) printf("removed handler %d\n", id);
-
-       return (0);
-}
-
-/*
- * Register a new fault injection handler.
- */
-static int
-register_handler(const char *pool, int flags, zinject_record_t *record,
-    int quiet)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       (void) strcpy(zc.zc_name, pool);
-       zc.zc_inject_record = *record;
-       zc.zc_guid = flags;
-
-       if (ioctl(zfs_fd, ZFS_IOC_INJECT_FAULT, &zc) != 0) {
-               (void) fprintf(stderr, "failed to add handler: %s\n",
-                   strerror(errno));
-               return (1);
-       }
-
-       if (flags & ZINJECT_NULL)
-               return (0);
-
-       if (quiet) {
-               (void) printf("%llu\n", (u_longlong_t)zc.zc_guid);
-       } else {
-               (void) printf("Added handler %llu with the following "
-                   "properties:\n", (u_longlong_t)zc.zc_guid);
-               (void) printf("  pool: %s\n", pool);
-               if (record->zi_guid) {
-                       (void) printf("  vdev: %llx\n",
-                           (u_longlong_t)record->zi_guid);
-               } else if (record->zi_func[0] != '\0') {
-                       (void) printf("  panic function: %s\n",
-                           record->zi_func);
-               } else if (record->zi_duration > 0) {
-                       (void) printf(" time: %lld seconds\n",
-                           (u_longlong_t)record->zi_duration);
-               } else if (record->zi_duration < 0) {
-                       (void) printf(" txgs: %lld \n",
-                           (u_longlong_t)-record->zi_duration);
-               } else {
-                       (void) printf("objset: %llu\n",
-                           (u_longlong_t)record->zi_objset);
-                       (void) printf("object: %llu\n",
-                           (u_longlong_t)record->zi_object);
-                       (void) printf("  type: %llu\n",
-                           (u_longlong_t)record->zi_type);
-                       (void) printf(" level: %d\n", record->zi_level);
-                       if (record->zi_start == 0 &&
-                           record->zi_end == -1ULL)
-                               (void) printf(" range: all\n");
-                       else
-                               (void) printf(" range: [%llu, %llu)\n",
-                                   (u_longlong_t)record->zi_start,
-                                   (u_longlong_t)record->zi_end);
-               }
-       }
-
-       return (0);
-}
-
-int
-perform_action(const char *pool, zinject_record_t *record, int cmd)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       ASSERT(cmd == VDEV_STATE_DEGRADED || cmd == VDEV_STATE_FAULTED);
-       (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name));
-       zc.zc_guid = record->zi_guid;
-       zc.zc_cookie = cmd;
-
-       if (ioctl(zfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0)
-               return (0);
-
-       return (1);
-}
-
-int
-main(int argc, char **argv)
-{
-       int c;
-       char *range = NULL;
-       char *cancel = NULL;
-       char *end;
-       char *raw = NULL;
-       char *device = NULL;
-       int level = 0;
-       int quiet = 0;
-       int error = 0;
-       int domount = 0;
-       int io_type = ZIO_TYPES;
-       int action = VDEV_STATE_UNKNOWN;
-       err_type_t type = TYPE_INVAL;
-       err_type_t label = TYPE_INVAL;
-       zinject_record_t record = { 0 };
-       char pool[MAXNAMELEN];
-       char dataset[MAXNAMELEN];
-       zfs_handle_t *zhp = NULL;
-       int nowrites = 0;
-       int dur_txg = 0;
-       int dur_secs = 0;
-       int ret;
-       int flags = 0;
-
-       if ((g_zfs = libzfs_init()) == NULL) {
-               (void) fprintf(stderr, "%s", libzfs_error_init(errno));
-               return (1);
-       }
-
-       libzfs_print_on_error(g_zfs, B_TRUE);
-
-       if ((zfs_fd = open(ZFS_DEV, O_RDWR)) < 0) {
-               (void) fprintf(stderr, "failed to open ZFS device\n");
-               return (1);
-       }
-
-       if (argc == 1) {
-               /*
-                * No arguments.  Print the available handlers.  If there are no
-                * available handlers, direct the user to '-h' for help
-                * information.
-                */
-               if (print_all_handlers() == 0) {
-                       (void) printf("No handlers registered.\n");
-                       (void) printf("Run 'zinject -h' for usage "
-                           "information.\n");
-               }
-
-               return (0);
-       }
-
-       while ((c = getopt(argc, argv,
-           ":aA:b:d:D:f:Fg:qhIc:t:T:l:mr:s:e:uL:p:")) != -1) {
-               switch (c) {
-               case 'a':
-                       flags |= ZINJECT_FLUSH_ARC;
-                       break;
-               case 'A':
-                       if (strcasecmp(optarg, "degrade") == 0) {
-                               action = VDEV_STATE_DEGRADED;
-                       } else if (strcasecmp(optarg, "fault") == 0) {
-                               action = VDEV_STATE_FAULTED;
-                       } else {
-                               (void) fprintf(stderr, "invalid action '%s': "
-                                   "must be 'degrade' or 'fault'\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case 'b':
-                       raw = optarg;
-                       break;
-               case 'c':
-                       cancel = optarg;
-                       break;
-               case 'd':
-                       device = optarg;
-                       break;
-               case 'D':
-                       errno = 0;
-                       record.zi_timer = strtoull(optarg, &end, 10);
-                       if (errno != 0 || *end != '\0') {
-                               (void) fprintf(stderr, "invalid i/o delay "
-                                   "value: '%s'\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case 'e':
-                       if (strcasecmp(optarg, "io") == 0) {
-                               error = EIO;
-                       } else if (strcasecmp(optarg, "checksum") == 0) {
-                               error = ECKSUM;
-                       } else if (strcasecmp(optarg, "nxio") == 0) {
-                               error = ENXIO;
-                       } else if (strcasecmp(optarg, "dtl") == 0) {
-                               error = ECHILD;
-                       } else {
-                               (void) fprintf(stderr, "invalid error type "
-                                   "'%s': must be 'io', 'checksum' or "
-                                   "'nxio'\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case 'f':
-                       record.zi_freq = atoi(optarg);
-                       if (record.zi_freq < 1 || record.zi_freq > 100) {
-                               (void) fprintf(stderr, "frequency range must "
-                                   "be in the range (0, 100]\n");
-                               return (1);
-                       }
-                       break;
-               case 'F':
-                       record.zi_failfast = B_TRUE;
-                       break;
-               case 'g':
-                       dur_txg = 1;
-                       record.zi_duration = (int)strtol(optarg, &end, 10);
-                       if (record.zi_duration <= 0 || *end != '\0') {
-                               (void) fprintf(stderr, "invalid duration '%s': "
-                                   "must be a positive integer\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       /* store duration of txgs as its negative */
-                       record.zi_duration *= -1;
-                       break;
-               case 'h':
-                       usage();
-                       return (0);
-               case 'I':
-                       /* default duration, if one hasn't yet been defined */
-                       nowrites = 1;
-                       if (dur_secs == 0 && dur_txg == 0)
-                               record.zi_duration = 30;
-                       break;
-               case 'l':
-                       level = (int)strtol(optarg, &end, 10);
-                       if (*end != '\0') {
-                               (void) fprintf(stderr, "invalid level '%s': "
-                                   "must be an integer\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case 'm':
-                       domount = 1;
-                       break;
-               case 'p':
-                       (void) strlcpy(record.zi_func, optarg,
-                           sizeof (record.zi_func));
-                       record.zi_cmd = ZINJECT_PANIC;
-                       break;
-               case 'q':
-                       quiet = 1;
-                       break;
-               case 'r':
-                       range = optarg;
-                       break;
-               case 's':
-                       dur_secs = 1;
-                       record.zi_duration = (int)strtol(optarg, &end, 10);
-                       if (record.zi_duration <= 0 || *end != '\0') {
-                               (void) fprintf(stderr, "invalid duration '%s': "
-                                   "must be a positive integer\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case 'T':
-                       if (strcasecmp(optarg, "read") == 0) {
-                               io_type = ZIO_TYPE_READ;
-                       } else if (strcasecmp(optarg, "write") == 0) {
-                               io_type = ZIO_TYPE_WRITE;
-                       } else if (strcasecmp(optarg, "free") == 0) {
-                               io_type = ZIO_TYPE_FREE;
-                       } else if (strcasecmp(optarg, "claim") == 0) {
-                               io_type = ZIO_TYPE_CLAIM;
-                       } else if (strcasecmp(optarg, "all") == 0) {
-                               io_type = ZIO_TYPES;
-                       } else {
-                               (void) fprintf(stderr, "invalid I/O type "
-                                   "'%s': must be 'read', 'write', 'free', "
-                                   "'claim' or 'all'\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case 't':
-                       if ((type = name_to_type(optarg)) == TYPE_INVAL &&
-                           !MOS_TYPE(type)) {
-                               (void) fprintf(stderr, "invalid type '%s'\n",
-                                   optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case 'u':
-                       flags |= ZINJECT_UNLOAD_SPA;
-                       break;
-               case 'L':
-                       if ((label = name_to_type(optarg)) == TYPE_INVAL &&
-                           !LABEL_TYPE(type)) {
-                               (void) fprintf(stderr, "invalid label type "
-                                   "'%s'\n", optarg);
-                               usage();
-                               return (1);
-                       }
-                       break;
-               case ':':
-                       (void) fprintf(stderr, "option -%c requires an "
-                           "operand\n", optopt);
-                       usage();
-                       return (1);
-               case '?':
-                       (void) fprintf(stderr, "invalid option '%c'\n",
-                           optopt);
-                       usage();
-                       return (2);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (record.zi_duration != 0)
-               record.zi_cmd = ZINJECT_IGNORED_WRITES;
-
-       if (cancel != NULL) {
-               /*
-                * '-c' is invalid with any other options.
-                */
-               if (raw != NULL || range != NULL || type != TYPE_INVAL ||
-                   level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) {
-                       (void) fprintf(stderr, "cancel (-c) incompatible with "
-                           "any other options\n");
-                       usage();
-                       return (2);
-               }
-               if (argc != 0) {
-                       (void) fprintf(stderr, "extraneous argument to '-c'\n");
-                       usage();
-                       return (2);
-               }
-
-               if (strcmp(cancel, "all") == 0) {
-                       return (cancel_all_handlers());
-               } else {
-                       int id = (int)strtol(cancel, &end, 10);
-                       if (*end != '\0') {
-                               (void) fprintf(stderr, "invalid handle id '%s':"
-                                   " must be an integer or 'all'\n", cancel);
-                               usage();
-                               return (1);
-                       }
-                       return (cancel_handler(id));
-               }
-       }
-
-       if (device != NULL) {
-               /*
-                * Device (-d) injection uses a completely different mechanism
-                * for doing injection, so handle it separately here.
-                */
-               if (raw != NULL || range != NULL || type != TYPE_INVAL ||
-                   level != 0 || record.zi_cmd != ZINJECT_UNINITIALIZED) {
-                       (void) fprintf(stderr, "device (-d) incompatible with "
-                           "data error injection\n");
-                       usage();
-                       return (2);
-               }
-
-               if (argc != 1) {
-                       (void) fprintf(stderr, "device (-d) injection requires "
-                           "a single pool name\n");
-                       usage();
-                       return (2);
-               }
-
-               (void) strcpy(pool, argv[0]);
-               dataset[0] = '\0';
-
-               if (error == ECKSUM) {
-                       (void) fprintf(stderr, "device error type must be "
-                           "'io' or 'nxio'\n");
-                       return (1);
-               }
-
-               record.zi_iotype = io_type;
-               if (translate_device(pool, device, label, &record) != 0)
-                       return (1);
-               if (!error)
-                       error = ENXIO;
-
-               if (action != VDEV_STATE_UNKNOWN)
-                       return (perform_action(pool, &record, action));
-
-       } else if (raw != NULL) {
-               if (range != NULL || type != TYPE_INVAL || level != 0 ||
-                   record.zi_cmd != ZINJECT_UNINITIALIZED) {
-                       (void) fprintf(stderr, "raw (-b) format with "
-                           "any other options\n");
-                       usage();
-                       return (2);
-               }
-
-               if (argc != 1) {
-                       (void) fprintf(stderr, "raw (-b) format expects a "
-                           "single pool name\n");
-                       usage();
-                       return (2);
-               }
-
-               (void) strcpy(pool, argv[0]);
-               dataset[0] = '\0';
-
-               if (error == ENXIO) {
-                       (void) fprintf(stderr, "data error type must be "
-                           "'checksum' or 'io'\n");
-                       return (1);
-               }
-
-               record.zi_cmd = ZINJECT_DATA_FAULT;
-               if (translate_raw(raw, &record) != 0)
-                       return (1);
-               if (!error)
-                       error = EIO;
-       } else if (record.zi_cmd == ZINJECT_PANIC) {
-               if (raw != NULL || range != NULL || type != TYPE_INVAL ||
-                   level != 0 || device != NULL) {
-                       (void) fprintf(stderr, "panic (-p) incompatible with "
-                           "other options\n");
-                       usage();
-                       return (2);
-               }
-
-               if (argc < 1 || argc > 2) {
-                       (void) fprintf(stderr, "panic (-p) injection requires "
-                           "a single pool name and an optional id\n");
-                       usage();
-                       return (2);
-               }
-
-               (void) strcpy(pool, argv[0]);
-               if (argv[1] != NULL)
-                       record.zi_type = atoi(argv[1]);
-               dataset[0] = '\0';
-       } else if (record.zi_cmd == ZINJECT_IGNORED_WRITES) {
-               if (nowrites == 0) {
-                       (void) fprintf(stderr, "-s or -g meaningless "
-                           "without -I (ignore writes)\n");
-                       usage();
-                       return (2);
-               } else if (dur_secs && dur_txg) {
-                       (void) fprintf(stderr, "choose a duration either "
-                           "in seconds (-s) or a number of txgs (-g) "
-                           "but not both\n");
-                       usage();
-                       return (2);
-               } else if (argc != 1) {
-                       (void) fprintf(stderr, "ignore writes (-I) "
-                           "injection requires a single pool name\n");
-                       usage();
-                       return (2);
-               }
-
-               (void) strcpy(pool, argv[0]);
-               dataset[0] = '\0';
-       } else if (type == TYPE_INVAL) {
-               if (flags == 0) {
-                       (void) fprintf(stderr, "at least one of '-b', '-d', "
-                           "'-t', '-a', '-p', '-I' or '-u' "
-                           "must be specified\n");
-                       usage();
-                       return (2);
-               }
-
-               if (argc == 1 && (flags & ZINJECT_UNLOAD_SPA)) {
-                       (void) strcpy(pool, argv[0]);
-                       dataset[0] = '\0';
-               } else if (argc != 0) {
-                       (void) fprintf(stderr, "extraneous argument for "
-                           "'-f'\n");
-                       usage();
-                       return (2);
-               }
-
-               flags |= ZINJECT_NULL;
-       } else {
-               if (argc != 1) {
-                       (void) fprintf(stderr, "missing object\n");
-                       usage();
-                       return (2);
-               }
-
-               if (error == ENXIO) {
-                       (void) fprintf(stderr, "data error type must be "
-                           "'checksum' or 'io'\n");
-                       return (1);
-               }
-
-               record.zi_cmd = ZINJECT_DATA_FAULT;
-               if (translate_record(type, argv[0], range, level, &record, pool,
-                   dataset) != 0)
-                       return (1);
-               if (!error)
-                       error = EIO;
-       }
-
-       /*
-        * If this is pool-wide metadata, unmount everything.  The ioctl() will
-        * unload the pool, so that we trigger spa-wide reopen of metadata next
-        * time we access the pool.
-        */
-       if (dataset[0] != '\0' && domount) {
-               if ((zhp = zfs_open(g_zfs, dataset, ZFS_TYPE_DATASET)) == NULL)
-                       return (1);
-               if (zfs_unmount(zhp, NULL, 0) != 0)
-                       return (1);
-       }
-
-       record.zi_error = error;
-
-       ret = register_handler(pool, flags, &record, quiet);
-
-       if (dataset[0] != '\0' && domount)
-               ret = (zfs_mount(zhp, NULL, 0) != 0);
-
-       libzfs_fini(g_zfs);
-
-       return (ret);
-}
diff --git a/zfs/cmd/zinject/zinject.h b/zfs/cmd/zinject/zinject.h
deleted file mode 100644 (file)
index 46fdcad..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef        _ZINJECT_H
-#define        _ZINJECT_H
-
-#include <sys/zfs_ioctl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef enum {
-       TYPE_DATA,              /* plain file contents          */
-       TYPE_DNODE,             /* metadnode contents           */
-       TYPE_MOS,               /* all MOS data                 */
-       TYPE_MOSDIR,            /* MOS object directory         */
-       TYPE_METASLAB,          /* metaslab objects             */
-       TYPE_CONFIG,            /* MOS config                   */
-       TYPE_BPOBJ,             /* block pointer list           */
-       TYPE_SPACEMAP,          /* space map objects            */
-       TYPE_ERRLOG,            /* persistent error log         */
-       TYPE_LABEL_UBERBLOCK,   /* label specific uberblock     */
-       TYPE_LABEL_NVLIST,      /* label specific nvlist        */
-       TYPE_LABEL_PAD1,        /* label specific 8K pad1 area  */
-       TYPE_LABEL_PAD2,        /* label specific 8K pad2 area  */
-       TYPE_INVAL
-} err_type_t;
-
-#define        MOS_TYPE(t)     \
-       ((t) >= TYPE_MOS && (t) < TYPE_LABEL_UBERBLOCK)
-
-#define        LABEL_TYPE(t)   \
-       ((t) >= TYPE_LABEL_UBERBLOCK && (t) < TYPE_INVAL)
-
-int translate_record(err_type_t type, const char *object, const char *range,
-    int level, zinject_record_t *record, char *poolname, char *dataset);
-int translate_raw(const char *raw, zinject_record_t *record);
-int translate_device(const char *pool, const char *device,
-    err_type_t label_type, zinject_record_t *record);
-void usage(void);
-
-extern libzfs_handle_t *g_zfs;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _ZINJECT_H */
diff --git a/zfs/cmd/zpios/.gitignore b/zfs/cmd/zpios/.gitignore
deleted file mode 100644 (file)
index b83e1d0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zpios
diff --git a/zfs/cmd/zpios/Makefile.am b/zfs/cmd/zpios/Makefile.am
deleted file mode 100644 (file)
index 9dabb65..0000000
+++ /dev/null
@@ -1,11 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include
-
-sbin_PROGRAMS = zpios
-
-zpios_SOURCES = \
-       zpios_main.c \
-       zpios_util.c \
-       zpios.h
diff --git a/zfs/cmd/zpios/Makefile.in b/zfs/cmd/zpios/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zpios/zpios.h b/zfs/cmd/zpios/zpios.h
deleted file mode 100644 (file)
index 4a69b9e..0000000
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- *  ZPIOS is a heavily modified version of the original PIOS test code.
- *  It is designed to have the test code running in the Linux kernel
- *  against ZFS while still being flexibly controled from user space.
- *
- *  Copyright (C) 2008-2010 Lawrence Livermore National Security, LLC.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
- *  LLNL-CODE-403049
- *
- *  Original PIOS Test Code
- *  Copyright (C) 2004 Cluster File Systems, Inc.
- *  Written by Peter Braam <braam@clusterfs.com>
- *             Atul Vidwansa <atul@clusterfs.com>
- *             Milind Dumbare <milind@clusterfs.com>
- *
- *  This file is part of ZFS on Linux.
- *  For details, see <http://zfsonlinux.org/>.
- *
- *  ZPIOS is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- *
- *  ZPIOS is distributed in the hope that it will be useful, but WITHOUT
- *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- *  for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with ZPIOS.  If not, see <http://www.gnu.org/licenses/>.
- *
- *  Copyright (c) 2015, Intel Corporation.
- */
-
-#ifndef _ZPIOS_H
-#define        _ZPIOS_H
-
-#include <zpios-ctl.h>
-
-#define        VERSION_SIZE            64
-
-/* Regular expressions */
-#define        REGEX_NUMBERS           "^[0-9]+$"
-#define        REGEX_NUMBERS_COMMA     "^([0-9]+,)*[0-9]+$"
-#define        REGEX_SIZE              "^[0-9]+[kKmMgGtT]?$"
-#define        REGEX_SIZE_COMMA        "^([0-9]+[kKmMgGtT]?,)*[0-9]+[kKmMgGtT]?$"
-
-/* Flags for low, high, incr */
-#define        FLAG_SET                0x01
-#define        FLAG_LOW                0x02
-#define        FLAG_HIGH               0x04
-#define        FLAG_INCR               0x08
-
-#define        TRUE                    1
-#define        FALSE                   0
-
-#define        KB                      (1024)
-#define        MB                      (KB * 1024)
-#define        GB                      (MB * 1024)
-#define        TB                      (GB * 1024)
-
-#define        KMGT_SIZE               16
-
-/*
- * All offsets, sizes and counts can be passed to the application in
- * multiple ways.
- * 1. a value (stored in val[0], val_count will be 1)
- * 2. a comma separated list of values (stored in val[], using val_count)
- * 3. a range and block sizes, low, high, factor (val_count must be 0)
- */
-typedef struct pios_range_repeat {
-       uint64_t val[32];               /* Comma sep array, or low, high, inc */
-       uint64_t val_count;             /* Num of values */
-       uint64_t val_low;
-       uint64_t val_high;
-       uint64_t val_inc_perc;
-       uint64_t next_val;              /* For multiple runs in get_next() */
-} range_repeat_t;
-
-typedef struct cmd_args {
-       range_repeat_t T;               /* Thread count */
-       range_repeat_t N;               /* Region count */
-       range_repeat_t O;               /* Offset count */
-       range_repeat_t C;               /* Chunksize */
-       range_repeat_t S;               /* Regionsize */
-       range_repeat_t B;               /* Blocksize */
-
-       const char *pool;               /* Pool */
-       const char *name;               /* Name */
-       uint32_t flags;                 /* Flags */
-       uint32_t block_size;            /* ZFS block size */
-       uint32_t io_type;               /* DMUIO only */
-       uint32_t verbose;               /* Verbose */
-       uint32_t human_readable;        /* Human readable output */
-
-       uint64_t regionnoise;           /* Region noise */
-       uint64_t chunknoise;            /* Chunk noise */
-       uint64_t thread_delay;          /* Thread delay */
-
-       char pre[ZPIOS_PATH_SIZE];      /* Pre-exec hook */
-       char post[ZPIOS_PATH_SIZE];     /* Post-exec hook */
-       char log[ZPIOS_PATH_SIZE];      /* Requested log dir */
-
-       /* Control */
-       int current_id;
-       uint64_t current_T;
-       uint64_t current_N;
-       uint64_t current_C;
-       uint64_t current_S;
-       uint64_t current_O;
-       uint64_t current_B;
-
-       uint32_t rc;
-} cmd_args_t;
-
-int set_count(char *pattern1, char *pattern2, range_repeat_t *range,
-    char *optarg, uint32_t *flags, char *arg);
-int set_lhi(char *pattern, range_repeat_t *range, char *optarg,
-    int flag, uint32_t *flag_thread, char *arg);
-int set_noise(uint64_t *noise, char *optarg, char *arg);
-int set_load_params(cmd_args_t *args, char *optarg);
-int check_mutual_exclusive_command_lines(uint32_t flag, char *arg);
-void print_stats_header(cmd_args_t *args);
-void print_stats(cmd_args_t *args, zpios_cmd_t *cmd);
-
-#endif /* _ZPIOS_H */
diff --git a/zfs/cmd/zpios/zpios_main.c b/zfs/cmd/zpios/zpios_main.c
deleted file mode 100644 (file)
index e6e88f6..0000000
+++ /dev/null
@@ -1,680 +0,0 @@
-/*
- *  ZPIOS is a heavily modified version of the original PIOS test code.
- *  It is designed to have the test code running in the Linux kernel
- *  against ZFS while still being flexibly controlled from user space.
- *
- *  Copyright (C) 2008-2010 Lawrence Livermore National Security, LLC.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
- *  LLNL-CODE-403049
- *
- *  Original PIOS Test Code
- *  Copyright (C) 2004 Cluster File Systems, Inc.
- *  Written by Peter Braam <braam@clusterfs.com>
- *             Atul Vidwansa <atul@clusterfs.com>
- *             Milind Dumbare <milind@clusterfs.com>
- *
- *  This file is part of ZFS on Linux.
- *  For details, see <http://zfsonlinux.org/>.
- *
- *  ZPIOS is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- *
- *  ZPIOS is distributed in the hope that it will be useful, but WITHOUT
- *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- *  for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with ZPIOS.  If not, see <http://www.gnu.org/licenses/>.
- *
- *  Copyright (c) 2015, Intel Corporation.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <getopt.h>
-#include <assert.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <sys/ioctl.h>
-#include "zpios.h"
-
-static const char short_opt[] =
-       "t:l:h:e:n:i:j:k:o:m:q:r:c:a:b:g:s:A:B:C:"
-       "S:L:p:M:xP:R:G:I:N:T:VzOfHv?";
-static const struct option long_opt[] = {
-       {"threadcount",         required_argument,      0,      't' },
-       {"threadcount_low",     required_argument,      0,      'l' },
-       {"threadcount_high",    required_argument,      0,      'h' },
-       {"threadcount_incr",    required_argument,      0,      'e' },
-       {"regioncount",         required_argument,      0,      'n' },
-       {"regioncount_low",     required_argument,      0,      'i' },
-       {"regioncount_high",    required_argument,      0,      'j' },
-       {"regioncount_incr",    required_argument,      0,      'k' },
-       {"offset",              required_argument,      0,      'o' },
-       {"offset_low",          required_argument,      0,      'm' },
-       {"offset_high",         required_argument,      0,      'q' },
-       {"offset_incr",         required_argument,      0,      'r' },
-       {"chunksize",           required_argument,      0,      'c' },
-       {"chunksize_low",       required_argument,      0,      'a' },
-       {"chunksize_high",      required_argument,      0,      'b' },
-       {"chunksize_incr",      required_argument,      0,      'g' },
-       {"regionsize",          required_argument,      0,      's' },
-       {"regionsize_low",      required_argument,      0,      'A' },
-       {"regionsize_high",     required_argument,      0,      'B' },
-       {"regionsize_incr",     required_argument,      0,      'C' },
-       {"blocksize",           required_argument,      0,      'S' },
-       {"load",                required_argument,      0,      'L' },
-       {"pool",                required_argument,      0,      'p' },
-       {"name",                required_argument,      0,      'M' },
-       {"cleanup",             no_argument,            0,      'x' },
-       {"prerun",              required_argument,      0,      'P' },
-       {"postrun",             required_argument,      0,      'R' },
-       {"log",                 required_argument,      0,      'G' },
-       {"regionnoise",         required_argument,      0,      'I' },
-       {"chunknoise",          required_argument,      0,      'N' },
-       {"threaddelay",         required_argument,      0,      'T' },
-       {"verify",              no_argument,            0,      'V' },
-       {"zerocopy",            no_argument,            0,      'z' },
-       {"nowait",              no_argument,            0,      'O' },
-       {"noprefetch",          no_argument,            0,      'f' },
-       {"human-readable",      no_argument,            0,      'H' },
-       {"verbose",             no_argument,            0,      'v' },
-       {"help",                no_argument,            0,      '?' },
-       { 0,                    0,                      0,      0 },
-};
-
-static int zpiosctl_fd;                                /* Control file descriptor */
-static char zpios_version[VERSION_SIZE];       /* Kernel version string */
-static char *zpios_buffer = NULL;              /* Scratch space area */
-static int zpios_buffer_size = 0;              /* Scratch space size */
-
-static int
-usage(void)
-{
-       fprintf(stderr, "Usage: zpios\n");
-       fprintf(stderr,
-               "       --threadcount       -t    =values\n"
-               "       --threadcount_low   -l    =value\n"
-               "       --threadcount_high  -h    =value\n"
-               "       --threadcount_incr  -e    =value\n"
-               "       --regioncount       -n    =values\n"
-               "       --regioncount_low   -i    =value\n"
-               "       --regioncount_high  -j    =value\n"
-               "       --regioncount_incr  -k    =value\n"
-               "       --offset            -o    =values\n"
-               "       --offset_low        -m    =value\n"
-               "       --offset_high       -q    =value\n"
-               "       --offset_incr       -r    =value\n"
-               "       --chunksize         -c    =values\n"
-               "       --chunksize_low     -a    =value\n"
-               "       --chunksize_high    -b    =value\n"
-               "       --chunksize_incr    -g    =value\n"
-               "       --regionsize        -s    =values\n"
-               "       --regionsize_low    -A    =value\n"
-               "       --regionsize_high   -B    =value\n"
-               "       --regionsize_incr   -C    =value\n"
-               "       --blocksize         -S    =values\n"
-               "       --load              -L    =dmuio|ssf|fpp\n"
-               "       --pool              -p    =pool name\n"
-               "       --name              -M    =test name\n"
-               "       --cleanup           -x\n"
-               "       --prerun            -P    =pre-command\n"
-               "       --postrun           -R    =post-command\n"
-               "       --log               -G    =log directory\n"
-               "       --regionnoise       -I    =shift\n"
-               "       --chunknoise        -N    =bytes\n"
-               "       --threaddelay       -T    =jiffies\n"
-               "       --verify            -V\n"
-               "       --zerocopy          -z\n"
-               "       --nowait            -O\n"
-               "       --noprefetch        -f\n"
-               "       --human-readable    -H\n"
-               "       --verbose           -v    =increase verbosity\n"
-               "       --help              -?    =this help\n\n");
-
-       return (0);
-}
-
-static void args_fini(cmd_args_t *args)
-{
-       assert(args != NULL);
-       free(args);
-}
-
-/* block size is 128K to 16M, power of 2 */
-#define        MIN_BLKSIZE     (128ULL << 10)
-#define        MAX_BLKSIZE     (16ULL << 20)
-#define        POW_OF_TWO(x)   (((x) & ((x) - 1)) == 0)
-
-static cmd_args_t *
-args_init(int argc, char **argv)
-{
-       cmd_args_t *args;
-       uint32_t fl_th = 0;
-       uint32_t fl_rc = 0;
-       uint32_t fl_of = 0;
-       uint32_t fl_rs = 0;
-       uint32_t fl_cs = 0;
-       uint32_t fl_bs = 0;
-       int c, rc, i;
-
-       if (argc == 1) {
-               usage();
-               return ((cmd_args_t *)NULL);
-       }
-
-       /* Configure and populate the args structures */
-       args = malloc(sizeof (*args));
-       if (args == NULL)
-               return (NULL);
-
-       memset(args, 0, sizeof (*args));
-
-       /* provide a default block size of 128K */
-       args->B.next_val = 0;
-       args->B.val[0] = MIN_BLKSIZE;
-       args->B.val_count = 1;
-
-       while ((c = getopt_long(argc, argv, short_opt, long_opt, NULL)) != -1) {
-               rc = 0;
-
-               switch (c) {
-               case 't': /* --thread count */
-                       rc = set_count(REGEX_NUMBERS, REGEX_NUMBERS_COMMA,
-                           &args->T, optarg, &fl_th, "threadcount");
-                       break;
-               case 'l': /* --threadcount_low */
-                       rc = set_lhi(REGEX_NUMBERS, &args->T, optarg,
-                           FLAG_LOW, &fl_th, "threadcount_low");
-                       break;
-               case 'h': /* --threadcount_high */
-                       rc = set_lhi(REGEX_NUMBERS, &args->T, optarg,
-                           FLAG_HIGH, &fl_th, "threadcount_high");
-                       break;
-               case 'e': /* --threadcount_inc */
-                       rc = set_lhi(REGEX_NUMBERS, &args->T, optarg,
-                           FLAG_INCR, &fl_th, "threadcount_incr");
-                       break;
-               case 'n': /* --regioncount */
-                       rc = set_count(REGEX_NUMBERS, REGEX_NUMBERS_COMMA,
-                           &args->N, optarg, &fl_rc, "regioncount");
-                       break;
-               case 'i': /* --regioncount_low */
-                       rc = set_lhi(REGEX_NUMBERS, &args->N, optarg,
-                           FLAG_LOW, &fl_rc, "regioncount_low");
-                       break;
-               case 'j': /* --regioncount_high */
-                       rc = set_lhi(REGEX_NUMBERS, &args->N, optarg,
-                           FLAG_HIGH, &fl_rc, "regioncount_high");
-                       break;
-               case 'k': /* --regioncount_inc */
-                       rc = set_lhi(REGEX_NUMBERS, &args->N, optarg,
-                           FLAG_INCR, &fl_rc, "regioncount_incr");
-                       break;
-               case 'o': /* --offset */
-                       rc = set_count(REGEX_SIZE, REGEX_SIZE_COMMA,
-                           &args->O, optarg, &fl_of, "offset");
-                       break;
-               case 'm': /* --offset_low */
-                       rc = set_lhi(REGEX_SIZE, &args->O, optarg,
-                           FLAG_LOW, &fl_of, "offset_low");
-                       break;
-               case 'q': /* --offset_high */
-                       rc = set_lhi(REGEX_SIZE, &args->O, optarg,
-                           FLAG_HIGH, &fl_of, "offset_high");
-                       break;
-               case 'r': /* --offset_inc */
-                       rc = set_lhi(REGEX_NUMBERS, &args->O, optarg,
-                           FLAG_INCR, &fl_of, "offset_incr");
-                       break;
-               case 'c': /* --chunksize */
-                       rc = set_count(REGEX_SIZE, REGEX_SIZE_COMMA,
-                           &args->C, optarg, &fl_cs, "chunksize");
-                       break;
-               case 'a': /* --chunksize_low */
-                       rc = set_lhi(REGEX_SIZE, &args->C, optarg,
-                           FLAG_LOW, &fl_cs, "chunksize_low");
-                       break;
-               case 'b': /* --chunksize_high */
-                       rc = set_lhi(REGEX_SIZE, &args->C, optarg,
-                           FLAG_HIGH, &fl_cs, "chunksize_high");
-                       break;
-               case 'g': /* --chunksize_inc */
-                       rc = set_lhi(REGEX_NUMBERS, &args->C, optarg,
-                           FLAG_INCR, &fl_cs, "chunksize_incr");
-                       break;
-               case 's': /* --regionsize */
-                       rc = set_count(REGEX_SIZE, REGEX_SIZE_COMMA,
-                           &args->S, optarg, &fl_rs, "regionsize");
-                       break;
-               case 'A': /* --regionsize_low */
-                       rc = set_lhi(REGEX_SIZE, &args->S, optarg,
-                           FLAG_LOW, &fl_rs, "regionsize_low");
-                       break;
-               case 'B': /* --regionsize_high */
-                       rc = set_lhi(REGEX_SIZE, &args->S, optarg,
-                           FLAG_HIGH, &fl_rs, "regionsize_high");
-                       break;
-               case 'C': /* --regionsize_inc */
-                       rc = set_lhi(REGEX_NUMBERS, &args->S, optarg,
-                           FLAG_INCR, &fl_rs, "regionsize_incr");
-                       break;
-               case 'S': /* --blocksize */
-                       rc = set_count(REGEX_SIZE, REGEX_SIZE_COMMA,
-                           &args->B, optarg, &fl_bs, "blocksize");
-                       break;
-               case 'L': /* --load */
-                       rc = set_load_params(args, optarg);
-                       break;
-               case 'p': /* --pool */
-                       args->pool = optarg;
-                       break;
-               case 'M':
-                       args->name = optarg;
-                       break;
-               case 'x': /* --cleanup */
-                       args->flags |= DMU_REMOVE;
-                       break;
-               case 'P': /* --prerun */
-                       strncpy(args->pre, optarg, ZPIOS_PATH_SIZE - 1);
-                       break;
-               case 'R': /* --postrun */
-                       strncpy(args->post, optarg, ZPIOS_PATH_SIZE - 1);
-                       break;
-               case 'G': /* --log */
-                       strncpy(args->log, optarg, ZPIOS_PATH_SIZE - 1);
-                       break;
-               case 'I': /* --regionnoise */
-                       rc = set_noise(&args->regionnoise, optarg,
-                           "regionnoise");
-                       break;
-               case 'N': /* --chunknoise */
-                       rc = set_noise(&args->chunknoise, optarg, "chunknoise");
-                       break;
-               case 'T': /* --threaddelay */
-                       rc = set_noise(&args->thread_delay, optarg,
-                           "threaddelay");
-                       break;
-               case 'V': /* --verify */
-                       args->flags |= DMU_VERIFY;
-                       break;
-               case 'z': /* --zerocopy */
-                       args->flags |= (DMU_WRITE_ZC | DMU_READ_ZC);
-                       break;
-               case 'O': /* --nowait */
-                       args->flags |= DMU_WRITE_NOWAIT;
-                       break;
-               case 'f': /* --noprefetch */
-                       args->flags |= DMU_READ_NOPF;
-                       break;
-               case 'H': /* --human-readable */
-                       args->human_readable = 1;
-                       break;
-               case 'v': /* --verbose */
-                       args->verbose++;
-                       break;
-               case '?':
-                       rc = 1;
-                       break;
-               default:
-                       fprintf(stderr, "Unknown option '%s'\n",
-                           argv[optind - 1]);
-                       rc = EINVAL;
-                       break;
-               }
-
-               if (rc) {
-                       usage();
-                       args_fini(args);
-                       return (NULL);
-               }
-       }
-
-       check_mutual_exclusive_command_lines(fl_th, "threadcount");
-       check_mutual_exclusive_command_lines(fl_rc, "regioncount");
-       check_mutual_exclusive_command_lines(fl_of, "offset");
-       check_mutual_exclusive_command_lines(fl_rs, "regionsize");
-       check_mutual_exclusive_command_lines(fl_cs, "chunksize");
-
-       if (args->pool == NULL) {
-               fprintf(stderr, "Error: Pool not specificed\n");
-               usage();
-               args_fini(args);
-               return (NULL);
-       }
-
-       if ((args->flags & (DMU_WRITE_ZC | DMU_READ_ZC)) &&
-           (args->flags & DMU_VERIFY)) {
-               fprintf(stderr, "Error, --zerocopy incompatible --verify, "
-                   "used for performance analysis only\n");
-               usage();
-               args_fini(args);
-               return (NULL);
-       }
-
-       /* validate block size(s) */
-       for (i = 0; i < args->B.val_count; i++) {
-               int bs = args->B.val[i];
-
-               if (bs < MIN_BLKSIZE || bs > MAX_BLKSIZE || !POW_OF_TWO(bs)) {
-                       fprintf(stderr, "Error: invalid block size %d\n", bs);
-                       args_fini(args);
-                       return (NULL);
-               }
-       }
-
-       return (args);
-}
-
-static int
-dev_clear(void)
-{
-       zpios_cfg_t cfg;
-       int rc;
-
-       memset(&cfg, 0, sizeof (cfg));
-       cfg.cfg_magic = ZPIOS_CFG_MAGIC;
-       cfg.cfg_cmd   = ZPIOS_CFG_BUFFER_CLEAR;
-       cfg.cfg_arg1  = 0;
-
-       rc = ioctl(zpiosctl_fd, ZPIOS_CFG, &cfg);
-       if (rc)
-               fprintf(stderr, "Ioctl() error %lu / %d: %d\n",
-                   (unsigned long) ZPIOS_CFG, cfg.cfg_cmd, errno);
-
-       lseek(zpiosctl_fd, 0, SEEK_SET);
-
-       return (rc);
-}
-
-/* Passing a size of zero simply results in querying the current size */
-static int
-dev_size(int size)
-{
-       zpios_cfg_t cfg;
-       int rc;
-
-       memset(&cfg, 0, sizeof (cfg));
-       cfg.cfg_magic = ZPIOS_CFG_MAGIC;
-       cfg.cfg_cmd   = ZPIOS_CFG_BUFFER_SIZE;
-       cfg.cfg_arg1  = size;
-
-       rc = ioctl(zpiosctl_fd, ZPIOS_CFG, &cfg);
-       if (rc) {
-               fprintf(stderr, "Ioctl() error %lu / %d: %d\n",
-                   (unsigned long) ZPIOS_CFG, cfg.cfg_cmd, errno);
-               return (rc);
-       }
-
-       return (cfg.cfg_rc1);
-}
-
-static void
-dev_fini(void)
-{
-       if (zpios_buffer)
-               free(zpios_buffer);
-
-       if (zpiosctl_fd != -1) {
-               if (close(zpiosctl_fd) == -1) {
-                       fprintf(stderr, "Unable to close %s: %d\n",
-                           ZPIOS_DEV, errno);
-               }
-       }
-}
-
-static int
-dev_init(void)
-{
-       int rc;
-
-       zpiosctl_fd = open(ZPIOS_DEV, O_RDONLY);
-       if (zpiosctl_fd == -1) {
-               fprintf(stderr, "Unable to open %s: %d\n"
-                   "Is the zpios module loaded?\n", ZPIOS_DEV, errno);
-               rc = errno;
-               goto error;
-       }
-
-       if ((rc = dev_clear()))
-               goto error;
-
-       if ((rc = dev_size(0)) < 0)
-               goto error;
-
-       zpios_buffer_size = rc;
-       zpios_buffer = (char *)malloc(zpios_buffer_size);
-       if (zpios_buffer == NULL) {
-               rc = ENOMEM;
-               goto error;
-       }
-
-       memset(zpios_buffer, 0, zpios_buffer_size);
-       return (0);
-error:
-       if (zpiosctl_fd != -1) {
-               if (close(zpiosctl_fd) == -1) {
-                       fprintf(stderr, "Unable to close %s: %d\n",
-                           ZPIOS_DEV, errno);
-               }
-       }
-
-       return (rc);
-}
-
-static int
-get_next(uint64_t *val, range_repeat_t *range)
-{
-       /* if low, incr, high is given */
-       if (range->val_count == 0) {
-               *val = (range->val_low) +
-                   (range->val_low * range->next_val / 100);
-
-               if (*val > range->val_high)
-                       return (0); /* No more values, limit exceeded */
-
-               if (!range->next_val)
-                       range->next_val = range->val_inc_perc;
-               else
-                       range->next_val = range->next_val + range->val_inc_perc;
-
-               return (1); /* more values to come */
-
-       /* if only one val is given */
-       } else if (range->val_count == 1) {
-               if (range->next_val)
-                       return (0); /* No more values, we only have one */
-
-               *val = range->val[0];
-               range->next_val = 1;
-               return (1); /* more values to come */
-
-       /* if comma separated values are given */
-       } else if (range->val_count > 1) {
-               if (range->next_val > range->val_count - 1)
-                       return (0); /* No more values, limit exceeded */
-
-               *val = range->val[range->next_val];
-               range->next_val++;
-               return (1); /* more values to come */
-       }
-
-       return (0);
-}
-
-static int
-run_one(cmd_args_t *args, uint32_t id, uint32_t T, uint32_t N,
-    uint64_t C, uint64_t S, uint64_t O, uint64_t B)
-{
-       zpios_cmd_t *cmd;
-       int rc, rc2, cmd_size;
-
-       dev_clear();
-
-       cmd_size =
-               sizeof (zpios_cmd_t)
-               + ((T + N + 1) * sizeof (zpios_stats_t));
-       cmd = (zpios_cmd_t *)malloc(cmd_size);
-       if (cmd == NULL)
-               return (ENOMEM);
-
-       memset(cmd, 0, cmd_size);
-       cmd->cmd_magic = ZPIOS_CMD_MAGIC;
-       strncpy(cmd->cmd_pool, args->pool, ZPIOS_NAME_SIZE - 1);
-       strncpy(cmd->cmd_pre, args->pre, ZPIOS_PATH_SIZE - 1);
-       strncpy(cmd->cmd_post, args->post, ZPIOS_PATH_SIZE - 1);
-       strncpy(cmd->cmd_log, args->log, ZPIOS_PATH_SIZE - 1);
-       cmd->cmd_id = id;
-       cmd->cmd_chunk_size = C;
-       cmd->cmd_thread_count = T;
-       cmd->cmd_region_count = N;
-       cmd->cmd_region_size = S;
-       cmd->cmd_offset = O;
-       cmd->cmd_block_size = B;
-       cmd->cmd_region_noise = args->regionnoise;
-       cmd->cmd_chunk_noise = args->chunknoise;
-       cmd->cmd_thread_delay = args->thread_delay;
-       cmd->cmd_flags = args->flags;
-       cmd->cmd_data_size = (T + N + 1) * sizeof (zpios_stats_t);
-
-       rc = ioctl(zpiosctl_fd, ZPIOS_CMD, cmd);
-       if (rc)
-               args->rc = errno;
-
-       print_stats(args, cmd);
-
-       if (args->verbose) {
-               rc2 = read(zpiosctl_fd, zpios_buffer, zpios_buffer_size - 1);
-               if (rc2 < 0) {
-                       fprintf(stdout, "Error reading results: %d\n", rc2);
-               } else if ((rc2 > 0) && (strlen(zpios_buffer) > 0)) {
-                       fprintf(stdout, "\n%s\n", zpios_buffer);
-                       fflush(stdout);
-               }
-       }
-
-       free(cmd);
-
-       return (rc);
-}
-
-static int
-run_offsets(cmd_args_t *args)
-{
-       int rc = 0;
-
-       while (rc == 0 && get_next(&args->current_O, &args->O)) {
-               rc = run_one(args, args->current_id,
-                   args->current_T, args->current_N, args->current_C,
-                   args->current_S, args->current_O, args->current_B);
-               args->current_id++;
-       }
-
-       args->O.next_val = 0;
-       return (rc);
-}
-
-static int
-run_region_counts(cmd_args_t *args)
-{
-       int rc = 0;
-
-       while (rc == 0 && get_next((uint64_t *)&args->current_N, &args->N))
-               rc = run_offsets(args);
-
-       args->N.next_val = 0;
-       return (rc);
-}
-
-static int
-run_region_sizes(cmd_args_t *args)
-{
-       int rc = 0;
-
-       while (rc == 0 && get_next(&args->current_S, &args->S)) {
-               if (args->current_S < args->current_C) {
-                       fprintf(stderr, "Error: in any run chunksize must "
-                           "be strictly smaller than regionsize.\n");
-                       return (EINVAL);
-               }
-
-               rc = run_region_counts(args);
-       }
-
-       args->S.next_val = 0;
-       return (rc);
-}
-
-static int
-run_chunk_sizes(cmd_args_t *args)
-{
-       int rc = 0;
-
-       while (rc == 0 && get_next(&args->current_C, &args->C)) {
-               rc = run_region_sizes(args);
-       }
-
-       args->C.next_val = 0;
-       return (rc);
-}
-
-static int
-run_block_sizes(cmd_args_t *args)
-{
-       int rc = 0;
-
-       while (rc == 0 && get_next(&args->current_B, &args->B)) {
-               rc = run_chunk_sizes(args);
-       }
-
-       args->B.next_val = 0;
-       return (rc);
-}
-
-
-static int
-run_thread_counts(cmd_args_t *args)
-{
-       int rc = 0;
-
-       while (rc == 0 && get_next((uint64_t *)&args->current_T, &args->T))
-               rc = run_block_sizes(args);
-
-       return (rc);
-}
-
-int
-main(int argc, char **argv)
-{
-       cmd_args_t *args;
-       int rc = 0;
-
-       /* Argument init and parsing */
-       if ((args = args_init(argc, argv)) == NULL) {
-               rc = -1;
-               goto out;
-       }
-
-       /* Device specific init */
-       if ((rc = dev_init()))
-               goto out;
-
-       /* Generic kernel version string */
-       if (args->verbose)
-               fprintf(stdout, "%s", zpios_version);
-
-       print_stats_header(args);
-       rc = run_thread_counts(args);
-out:
-       if (args != NULL)
-               args_fini(args);
-
-       dev_fini();
-       return (rc);
-}
diff --git a/zfs/cmd/zpios/zpios_util.c b/zfs/cmd/zpios/zpios_util.c
deleted file mode 100644 (file)
index 2d248ed..0000000
+++ /dev/null
@@ -1,472 +0,0 @@
-/*
- *  ZPIOS is a heavily modified version of the original PIOS test code.
- *  It is designed to have the test code running in the Linux kernel
- *  against ZFS while still being flexibly controled from user space.
- *
- *  Copyright (C) 2008-2010 Lawrence Livermore National Security, LLC.
- *  Produced at Lawrence Livermore National Laboratory (cf, DISCLAIMER).
- *  Written by Brian Behlendorf <behlendorf1@llnl.gov>.
- *  LLNL-CODE-403049
- *
- *  Original PIOS Test Code
- *  Copyright (C) 2004 Cluster File Systems, Inc.
- *  Written by Peter Braam <braam@clusterfs.com>
- *             Atul Vidwansa <atul@clusterfs.com>
- *             Milind Dumbare <milind@clusterfs.com>
- *
- *  This file is part of ZFS on Linux.
- *  For details, see <http://zfsonlinux.org/>.
- *
- *  ZPIOS is free software; you can redistribute it and/or modify it
- *  under the terms of the GNU General Public License as published by the
- *  Free Software Foundation; either version 2 of the License, or (at your
- *  option) any later version.
- *
- *  ZPIOS is distributed in the hope that it will be useful, but WITHOUT
- *  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
- *  FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
- *  for more details.
- *
- *  You should have received a copy of the GNU General Public License along
- *  with ZPIOS.  If not, see <http://www.gnu.org/licenses/>.
- *
- *  Copyright (c) 2015, Intel Corporation.
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-#include <string.h>
-#include <errno.h>
-#include <assert.h>
-#include <regex.h>
-#include "zpios.h"
-
-/* extracts an unsigned int (64) and K,M,G,T from the string */
-/* and returns a 64 bit value converted to the proper units */
-static int
-kmgt_to_uint64(const char *str, uint64_t *val)
-{
-       char *endptr;
-       int rc = 0;
-
-       *val = strtoll(str, &endptr, 0);
-       if ((str == endptr) && (*val == 0))
-               return (EINVAL);
-
-       switch (endptr[0]) {
-               case 'k': case 'K':
-                       *val = (*val) << 10;
-                       break;
-               case 'm': case 'M':
-                       *val = (*val) << 20;
-                       break;
-               case 'g': case 'G':
-                       *val = (*val) << 30;
-                       break;
-               case 't': case 'T':
-                       *val = (*val) << 40;
-                       break;
-               case '\0':
-                       break;
-               default:
-                       rc = EINVAL;
-       }
-
-       return (rc);
-}
-
-static char *
-uint64_to_kmgt(char *str, uint64_t val)
-{
-       char postfix[] = "kmgt";
-       int i = -1;
-
-       while ((val >= KB) && (i < 4)) {
-               val = (val >> 10);
-               i++;
-       }
-
-       if (i >= 4)
-               (void) snprintf(str, KMGT_SIZE-1, "inf");
-       else
-               (void) snprintf(str, KMGT_SIZE-1, "%lu%c", (unsigned long)val,
-                   (i == -1) ? '\0' : postfix[i]);
-
-       return (str);
-}
-
-static char *
-kmgt_per_sec(char *str, uint64_t v, double t)
-{
-       char postfix[] = "kmgt";
-       double val = ((double)v) / t;
-       int i = -1;
-
-       while ((val >= (double)KB) && (i < 4)) {
-               val /= (double)KB;
-               i++;
-       }
-
-       if (i >= 4)
-               (void) snprintf(str, KMGT_SIZE-1, "inf");
-       else
-               (void) snprintf(str, KMGT_SIZE-1, "%.2f%c", val,
-                   (i == -1) ? '\0' : postfix[i]);
-
-       return (str);
-}
-
-static char *
-print_flags(char *str, uint32_t flags)
-{
-       str[0] = (flags & DMU_WRITE)  ? 'w' : '-';
-       str[1] = (flags & DMU_READ)   ? 'r' : '-';
-       str[2] = (flags & DMU_VERIFY) ? 'v' : '-';
-       str[3] = (flags & DMU_REMOVE) ? 'c' : '-';
-       str[4] = (flags & DMU_FPP)    ? 'p' : 's';
-       str[5] = (flags & (DMU_WRITE_ZC | DMU_READ_ZC)) ? 'z' : '-';
-       str[6] = (flags & DMU_WRITE_NOWAIT) ? 'O' : '-';
-       str[7] = '\0';
-
-       return (str);
-}
-
-static int
-regex_match(const char *string, char *pattern)
-{
-       regex_t re = { 0 };
-       int rc;
-
-       rc = regcomp(&re, pattern, REG_EXTENDED | REG_NOSUB | REG_ICASE);
-       if (rc) {
-               fprintf(stderr, "Error: Couldn't do regcomp, %d\n", rc);
-               return (rc);
-       }
-
-       rc = regexec(&re, string, (size_t) 0, NULL, 0);
-       regfree(&re);
-
-       return (rc);
-}
-
-/* fills the pios_range_repeat structure of comma separated values */
-static int
-split_string(const char *optarg, char *pattern, range_repeat_t *range)
-{
-       const char comma[] = ",";
-       char *cp, *token[32];
-       int rc, i = 0;
-
-       if ((rc = regex_match(optarg, pattern)))
-               return (rc);
-
-       cp = strdup(optarg);
-       if (cp == NULL)
-               return (ENOMEM);
-
-       do {
-               /*
-                * STRTOK(3) Each subsequent call, with a null pointer as the
-                * value of the * first  argument, starts searching from the
-                * saved pointer and behaves as described above.
-                */
-               token[i] = strtok(cp, comma);
-               cp = NULL;
-       } while ((token[i++] != NULL) && (i < 32));
-
-       range->val_count = i - 1;
-
-       for (i = 0; i < range->val_count; i++)
-               kmgt_to_uint64(token[i], &range->val[i]);
-
-       free(cp);
-       return (0);
-}
-
-int
-set_count(char *pattern1, char *pattern2, range_repeat_t *range,
-    char *optarg, uint32_t *flags, char *arg)
-{
-       uint64_t count = range->val_count;
-
-       if (flags)
-               *flags |= FLAG_SET;
-
-       range->next_val = 0;
-
-       if (regex_match(optarg, pattern1) == 0) {
-               kmgt_to_uint64(optarg, &range->val[0]);
-               range->val_count = 1;
-       } else if (split_string(optarg, pattern2, range) < 0) {
-               fprintf(stderr, "Error: Incorrect pattern for %s, '%s'\n",
-                   arg, optarg);
-               return (EINVAL);
-       } else if (count == range->val_count) {
-               fprintf(stderr, "Error: input ignored for %s, '%s'\n",
-                   arg, optarg);
-       }
-
-       return (0);
-}
-
-/*
- * Validates the value with regular expression and sets low, high, incr
- * according to value at which flag will be set. Sets the flag after.
- */
-int
-set_lhi(char *pattern, range_repeat_t *range, char *optarg,
-    int flag, uint32_t *flag_thread, char *arg)
-{
-       int rc;
-
-       if ((rc = regex_match(optarg, pattern))) {
-               fprintf(stderr, "Error: Wrong pattern in %s, '%s'\n",
-                       arg, optarg);
-               return (rc);
-       }
-
-       switch (flag) {
-               case FLAG_LOW:
-                       kmgt_to_uint64(optarg, &range->val_low);
-                       break;
-               case FLAG_HIGH:
-                       kmgt_to_uint64(optarg, &range->val_high);
-                       break;
-               case FLAG_INCR:
-                       kmgt_to_uint64(optarg, &range->val_inc_perc);
-                       break;
-               default:
-                       assert(0);
-       }
-
-       *flag_thread |= flag;
-
-       return (0);
-}
-
-int
-set_noise(uint64_t *noise, char *optarg, char *arg)
-{
-       if (regex_match(optarg, REGEX_NUMBERS) == 0) {
-               kmgt_to_uint64(optarg, noise);
-       } else {
-               fprintf(stderr, "Error: Incorrect pattern for %s\n", arg);
-               return (EINVAL);
-       }
-
-       return (0);
-}
-
-int
-set_load_params(cmd_args_t *args, char *optarg)
-{
-       char *param, *search, comma[] = ",";
-       int rc = 0;
-
-       search = strdup(optarg);
-       if (search == NULL)
-               return (ENOMEM);
-
-       while ((param = strtok(search, comma)) != NULL) {
-               search = NULL;
-
-               if (strcmp("fpp", param) == 0) {
-                       args->flags |= DMU_FPP; /* File Per Process/Thread */
-               } else if (strcmp("ssf", param) == 0) {
-                       args->flags &= ~DMU_FPP; /* Single Shared File */
-               } else if (strcmp("dmuio", param) == 0) {
-                       args->io_type |= DMU_IO;
-                       args->flags |= (DMU_WRITE | DMU_READ);
-               } else {
-                       fprintf(stderr, "Invalid load: %s\n", param);
-                       rc = EINVAL;
-               }
-       }
-
-       free(search);
-
-       return (rc);
-}
-
-
-/*
- * Checks the low, high, increment values against the single value for
- * mutual exclusion, for e.g threadcount is mutually exclusive to
- * threadcount_low, ..._high, ..._incr
- */
-int
-check_mutual_exclusive_command_lines(uint32_t flag, char *arg)
-{
-       if ((flag & FLAG_SET) && (flag & (FLAG_LOW | FLAG_HIGH | FLAG_INCR))) {
-               fprintf(stderr, "Error: --%s can not be given with --%s_low, "
-                   "--%s_high or --%s_incr.\n", arg, arg, arg, arg);
-               return (0);
-       }
-
-       if ((flag & (FLAG_LOW | FLAG_HIGH | FLAG_INCR)) && !(flag & FLAG_SET)) {
-               if (flag != (FLAG_LOW | FLAG_HIGH | FLAG_INCR)) {
-                       fprintf(stderr, "Error: One or more values missing "
-                           "from --%s_low, --%s_high, --%s_incr.\n",
-                           arg, arg, arg);
-                       return (0);
-               }
-       }
-
-       return (1);
-}
-
-void
-print_stats_header(cmd_args_t *args)
-{
-       if (args->verbose) {
-               printf(
-                   "status    name        id\tth-cnt\trg-cnt\trg-sz\t"
-                   "ch-sz\toffset\trg-no\tch-no\tth-dly\tflags\tblksz\ttime\t"
-                   "cr-time\trm-time\twr-time\trd-time\twr-data\twr-ch\t"
-                   "wr-bw\trd-data\trd-ch\trd-bw\n");
-               printf(
-                   "-------------------------------------------------"
-                   "-------------------------------------------------"
-                   "-------------------------------------------------"
-                   "--------------------------------------------------\n");
-       } else {
-               printf(
-                   "status    name        id\t"
-                   "wr-data\twr-ch\twr-bw\t"
-                   "rd-data\trd-ch\trd-bw\n");
-               printf(
-                   "-----------------------------------------"
-                   "--------------------------------------\n");
-       }
-}
-
-static void
-print_stats_human_readable(cmd_args_t *args, zpios_cmd_t *cmd)
-{
-       zpios_stats_t *summary_stats;
-       double t_time, wr_time, rd_time, cr_time, rm_time;
-       char str[KMGT_SIZE];
-
-       if (args->rc)
-               printf("FAIL: %3d ", args->rc);
-       else
-               printf("PASS:     ");
-
-       printf("%-12s", args->name ? args->name : ZPIOS_NAME);
-       printf("%2u\t", cmd->cmd_id);
-
-       if (args->verbose) {
-               printf("%u\t", cmd->cmd_thread_count);
-               printf("%u\t", cmd->cmd_region_count);
-               printf("%s\t", uint64_to_kmgt(str, cmd->cmd_region_size));
-               printf("%s\t", uint64_to_kmgt(str, cmd->cmd_chunk_size));
-               printf("%s\t", uint64_to_kmgt(str, cmd->cmd_offset));
-               printf("%s\t", uint64_to_kmgt(str, cmd->cmd_region_noise));
-               printf("%s\t", uint64_to_kmgt(str, cmd->cmd_chunk_noise));
-               printf("%s\t", uint64_to_kmgt(str, cmd->cmd_thread_delay));
-               printf("%s\t", print_flags(str, cmd->cmd_flags));
-               printf("%s\t", uint64_to_kmgt(str, cmd->cmd_block_size));
-       }
-
-       if (args->rc) {
-               printf("\n");
-               return;
-       }
-
-       summary_stats = (zpios_stats_t *)cmd->cmd_data_str;
-       t_time  = zpios_timespec_to_double(summary_stats->total_time.delta);
-       wr_time = zpios_timespec_to_double(summary_stats->wr_time.delta);
-       rd_time = zpios_timespec_to_double(summary_stats->rd_time.delta);
-       cr_time = zpios_timespec_to_double(summary_stats->cr_time.delta);
-       rm_time = zpios_timespec_to_double(summary_stats->rm_time.delta);
-
-       if (args->verbose) {
-               printf("%.2f\t", t_time);
-               printf("%.3f\t", cr_time);
-               printf("%.3f\t", rm_time);
-               printf("%.2f\t", wr_time);
-               printf("%.2f\t", rd_time);
-       }
-
-       printf("%s\t", uint64_to_kmgt(str, summary_stats->wr_data));
-       printf("%s\t", uint64_to_kmgt(str, summary_stats->wr_chunks));
-       printf("%s\t", kmgt_per_sec(str, summary_stats->wr_data, wr_time));
-
-       printf("%s\t", uint64_to_kmgt(str, summary_stats->rd_data));
-       printf("%s\t", uint64_to_kmgt(str, summary_stats->rd_chunks));
-       printf("%s\n", kmgt_per_sec(str, summary_stats->rd_data, rd_time));
-       fflush(stdout);
-}
-
-static void
-print_stats_table(cmd_args_t *args, zpios_cmd_t *cmd)
-{
-       zpios_stats_t *summary_stats;
-       double wr_time, rd_time;
-
-       if (args->rc)
-               printf("FAIL: %3d ", args->rc);
-       else
-               printf("PASS:     ");
-
-       printf("%-12s", args->name ? args->name : ZPIOS_NAME);
-       printf("%2u\t", cmd->cmd_id);
-
-       if (args->verbose) {
-               printf("%u\t", cmd->cmd_thread_count);
-               printf("%u\t", cmd->cmd_region_count);
-               printf("%llu\t", (long long unsigned)cmd->cmd_region_size);
-               printf("%llu\t", (long long unsigned)cmd->cmd_chunk_size);
-               printf("%llu\t", (long long unsigned)cmd->cmd_offset);
-               printf("%u\t", cmd->cmd_region_noise);
-               printf("%u\t", cmd->cmd_chunk_noise);
-               printf("%u\t", cmd->cmd_thread_delay);
-               printf("0x%x\t", cmd->cmd_flags);
-               printf("%u\t", cmd->cmd_block_size);
-       }
-
-       if (args->rc) {
-               printf("\n");
-               return;
-       }
-
-       summary_stats = (zpios_stats_t *)cmd->cmd_data_str;
-       wr_time = zpios_timespec_to_double(summary_stats->wr_time.delta);
-       rd_time = zpios_timespec_to_double(summary_stats->rd_time.delta);
-
-       if (args->verbose) {
-               printf("%ld.%02ld\t",
-                   (long)summary_stats->total_time.delta.ts_sec,
-                   (long)summary_stats->total_time.delta.ts_nsec);
-               printf("%ld.%02ld\t",
-                   (long)summary_stats->cr_time.delta.ts_sec,
-                   (long)summary_stats->cr_time.delta.ts_nsec);
-               printf("%ld.%02ld\t",
-                   (long)summary_stats->rm_time.delta.ts_sec,
-                   (long)summary_stats->rm_time.delta.ts_nsec);
-               printf("%ld.%02ld\t",
-                   (long)summary_stats->wr_time.delta.ts_sec,
-                   (long)summary_stats->wr_time.delta.ts_nsec);
-               printf("%ld.%02ld\t",
-                   (long)summary_stats->rd_time.delta.ts_sec,
-                   (long)summary_stats->rd_time.delta.ts_nsec);
-       }
-
-       printf("%lld\t", (long long unsigned)summary_stats->wr_data);
-       printf("%lld\t", (long long unsigned)summary_stats->wr_chunks);
-       printf("%.4f\t", (double)summary_stats->wr_data / wr_time);
-
-       printf("%lld\t", (long long unsigned)summary_stats->rd_data);
-       printf("%lld\t", (long long unsigned)summary_stats->rd_chunks);
-       printf("%.4f\n", (double)summary_stats->rd_data / rd_time);
-       fflush(stdout);
-}
-
-void
-print_stats(cmd_args_t *args, zpios_cmd_t *cmd)
-{
-       if (args->human_readable)
-               print_stats_human_readable(args, cmd);
-       else
-               print_stats_table(args, cmd);
-}
diff --git a/zfs/cmd/zpool/.gitignore b/zfs/cmd/zpool/.gitignore
deleted file mode 100644 (file)
index 8ea518a..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zpool
diff --git a/zfs/cmd/zpool/Makefile.am b/zfs/cmd/zpool/Makefile.am
deleted file mode 100644 (file)
index c11951b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-sbin_PROGRAMS = zpool
-
-zpool_SOURCES = \
-       zpool_iter.c \
-       zpool_main.c \
-       zpool_util.c \
-       zpool_util.h \
-       zpool_vdev.c
-
-zpool_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la \
-       $(LIBBLKID)
diff --git a/zfs/cmd/zpool/Makefile.in b/zfs/cmd/zpool/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zpool/zpool_iter.c b/zfs/cmd/zpool/zpool_iter.c
deleted file mode 100644 (file)
index 952d191..0000000
+++ /dev/null
@@ -1,252 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include <libintl.h>
-#include <libuutil.h>
-#include <stddef.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-
-#include <libzfs.h>
-
-#include "zpool_util.h"
-
-/*
- * Private interface for iterating over pools specified on the command line.
- * Most consumers will call for_each_pool, but in order to support iostat, we
- * allow fined grained control through the zpool_list_t interface.
- */
-
-typedef struct zpool_node {
-       zpool_handle_t  *zn_handle;
-       uu_avl_node_t   zn_avlnode;
-       int             zn_mark;
-} zpool_node_t;
-
-struct zpool_list {
-       boolean_t       zl_findall;
-       uu_avl_t        *zl_avl;
-       uu_avl_pool_t   *zl_pool;
-       zprop_list_t    **zl_proplist;
-};
-
-/* ARGSUSED */
-static int
-zpool_compare(const void *larg, const void *rarg, void *unused)
-{
-       zpool_handle_t *l = ((zpool_node_t *)larg)->zn_handle;
-       zpool_handle_t *r = ((zpool_node_t *)rarg)->zn_handle;
-       const char *lname = zpool_get_name(l);
-       const char *rname = zpool_get_name(r);
-
-       return (strcmp(lname, rname));
-}
-
-/*
- * Callback function for pool_list_get().  Adds the given pool to the AVL tree
- * of known pools.
- */
-static int
-add_pool(zpool_handle_t *zhp, void *data)
-{
-       zpool_list_t *zlp = data;
-       zpool_node_t *node = safe_malloc(sizeof (zpool_node_t));
-       uu_avl_index_t idx;
-
-       node->zn_handle = zhp;
-       uu_avl_node_init(node, &node->zn_avlnode, zlp->zl_pool);
-       if (uu_avl_find(zlp->zl_avl, node, NULL, &idx) == NULL) {
-               if (zlp->zl_proplist &&
-                   zpool_expand_proplist(zhp, zlp->zl_proplist) != 0) {
-                       zpool_close(zhp);
-                       free(node);
-                       return (-1);
-               }
-               uu_avl_insert(zlp->zl_avl, node, idx);
-       } else {
-               zpool_close(zhp);
-               free(node);
-               return (-1);
-       }
-
-       return (0);
-}
-
-/*
- * Create a list of pools based on the given arguments.  If we're given no
- * arguments, then iterate over all pools in the system and add them to the AVL
- * tree.  Otherwise, add only those pool explicitly specified on the command
- * line.
- */
-zpool_list_t *
-pool_list_get(int argc, char **argv, zprop_list_t **proplist, int *err)
-{
-       zpool_list_t *zlp;
-
-       zlp = safe_malloc(sizeof (zpool_list_t));
-
-       zlp->zl_pool = uu_avl_pool_create("zfs_pool", sizeof (zpool_node_t),
-           offsetof(zpool_node_t, zn_avlnode), zpool_compare, UU_DEFAULT);
-
-       if (zlp->zl_pool == NULL)
-               zpool_no_memory();
-
-       if ((zlp->zl_avl = uu_avl_create(zlp->zl_pool, NULL,
-           UU_DEFAULT)) == NULL)
-               zpool_no_memory();
-
-       zlp->zl_proplist = proplist;
-
-       if (argc == 0) {
-               (void) zpool_iter(g_zfs, add_pool, zlp);
-               zlp->zl_findall = B_TRUE;
-       } else {
-               int i;
-
-               for (i = 0; i < argc; i++) {
-                       zpool_handle_t *zhp;
-
-                       if ((zhp = zpool_open_canfail(g_zfs, argv[i]))) {
-                               if (add_pool(zhp, zlp) != 0)
-                                       *err = B_TRUE;
-                       } else {
-                               *err = B_TRUE;
-                       }
-               }
-       }
-
-       return (zlp);
-}
-
-/*
- * Search for any new pools, adding them to the list.  We only add pools when no
- * options were given on the command line.  Otherwise, we keep the list fixed as
- * those that were explicitly specified.
- */
-void
-pool_list_update(zpool_list_t *zlp)
-{
-       if (zlp->zl_findall)
-               (void) zpool_iter(g_zfs, add_pool, zlp);
-}
-
-/*
- * Iterate over all pools in the list, executing the callback for each
- */
-int
-pool_list_iter(zpool_list_t *zlp, int unavail, zpool_iter_f func,
-    void *data)
-{
-       zpool_node_t *node, *next_node;
-       int ret = 0;
-
-       for (node = uu_avl_first(zlp->zl_avl); node != NULL; node = next_node) {
-               next_node = uu_avl_next(zlp->zl_avl, node);
-               if (zpool_get_state(node->zn_handle) != POOL_STATE_UNAVAIL ||
-                   unavail)
-                       ret |= func(node->zn_handle, data);
-       }
-
-       return (ret);
-}
-
-/*
- * Remove the given pool from the list.  When running iostat, we want to remove
- * those pools that no longer exist.
- */
-void
-pool_list_remove(zpool_list_t *zlp, zpool_handle_t *zhp)
-{
-       zpool_node_t search, *node;
-
-       search.zn_handle = zhp;
-       if ((node = uu_avl_find(zlp->zl_avl, &search, NULL, NULL)) != NULL) {
-               uu_avl_remove(zlp->zl_avl, node);
-               zpool_close(node->zn_handle);
-               free(node);
-       }
-}
-
-/*
- * Free all the handles associated with this list.
- */
-void
-pool_list_free(zpool_list_t *zlp)
-{
-       uu_avl_walk_t *walk;
-       zpool_node_t *node;
-
-       if ((walk = uu_avl_walk_start(zlp->zl_avl, UU_WALK_ROBUST)) == NULL) {
-               (void) fprintf(stderr,
-                   gettext("internal error: out of memory"));
-               exit(1);
-       }
-
-       while ((node = uu_avl_walk_next(walk)) != NULL) {
-               uu_avl_remove(zlp->zl_avl, node);
-               zpool_close(node->zn_handle);
-               free(node);
-       }
-
-       uu_avl_walk_end(walk);
-       uu_avl_destroy(zlp->zl_avl);
-       uu_avl_pool_destroy(zlp->zl_pool);
-
-       free(zlp);
-}
-
-/*
- * Returns the number of elements in the pool list.
- */
-int
-pool_list_count(zpool_list_t *zlp)
-{
-       return (uu_avl_numnodes(zlp->zl_avl));
-}
-
-/*
- * High level function which iterates over all pools given on the command line,
- * using the pool_list_* interfaces.
- */
-int
-for_each_pool(int argc, char **argv, boolean_t unavail,
-    zprop_list_t **proplist, zpool_iter_f func, void *data)
-{
-       zpool_list_t *list;
-       int ret = 0;
-
-       if ((list = pool_list_get(argc, argv, proplist, &ret)) == NULL)
-               return (1);
-
-       if (pool_list_iter(list, unavail, func, data) != 0)
-               ret = 1;
-
-       pool_list_free(list);
-
-       return (ret);
-}
diff --git a/zfs/cmd/zpool/zpool_main.c b/zfs/cmd/zpool/zpool_main.c
deleted file mode 100644 (file)
index f32efce..0000000
+++ /dev/null
@@ -1,5990 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
- * Copyright (c) 2012 by Frederik Wessels. All rights reserved.
- * Copyright (c) 2012 by Cyril Plisko. All rights reserved.
- * Copyright (c) 2013 by Prasad Joshi (sTec). All rights reserved.
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <dirent.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <libgen.h>
-#include <libintl.h>
-#include <libuutil.h>
-#include <locale.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include <unistd.h>
-#include <priv.h>
-#include <pwd.h>
-#include <zone.h>
-#include <zfs_prop.h>
-#include <sys/fs/zfs.h>
-#include <sys/stat.h>
-#include <sys/fm/util.h>
-#include <sys/fm/protocol.h>
-#include <sys/zfs_ioctl.h>
-
-#include <libzfs.h>
-
-#include "zpool_util.h"
-#include "zfs_comutil.h"
-#include "zfeature_common.h"
-
-#include "statcommon.h"
-
-static int zpool_do_create(int, char **);
-static int zpool_do_destroy(int, char **);
-
-static int zpool_do_add(int, char **);
-static int zpool_do_remove(int, char **);
-static int zpool_do_labelclear(int, char **);
-
-static int zpool_do_list(int, char **);
-static int zpool_do_iostat(int, char **);
-static int zpool_do_status(int, char **);
-
-static int zpool_do_online(int, char **);
-static int zpool_do_offline(int, char **);
-static int zpool_do_clear(int, char **);
-static int zpool_do_reopen(int, char **);
-
-static int zpool_do_reguid(int, char **);
-
-static int zpool_do_attach(int, char **);
-static int zpool_do_detach(int, char **);
-static int zpool_do_replace(int, char **);
-static int zpool_do_split(int, char **);
-
-static int zpool_do_scrub(int, char **);
-
-static int zpool_do_import(int, char **);
-static int zpool_do_export(int, char **);
-
-static int zpool_do_upgrade(int, char **);
-
-static int zpool_do_history(int, char **);
-static int zpool_do_events(int, char **);
-
-static int zpool_do_get(int, char **);
-static int zpool_do_set(int, char **);
-
-/*
- * These libumem hooks provide a reasonable set of defaults for the allocator's
- * debugging facilities.
- */
-
-#ifdef DEBUG
-const char *
-_umem_debug_init(void)
-{
-       return ("default,verbose"); /* $UMEM_DEBUG setting */
-}
-
-const char *
-_umem_logging_init(void)
-{
-       return ("fail,contents"); /* $UMEM_LOGGING setting */
-}
-#endif
-
-typedef enum {
-       HELP_ADD,
-       HELP_ATTACH,
-       HELP_CLEAR,
-       HELP_CREATE,
-       HELP_DESTROY,
-       HELP_DETACH,
-       HELP_EXPORT,
-       HELP_HISTORY,
-       HELP_IMPORT,
-       HELP_IOSTAT,
-       HELP_LABELCLEAR,
-       HELP_LIST,
-       HELP_OFFLINE,
-       HELP_ONLINE,
-       HELP_REPLACE,
-       HELP_REMOVE,
-       HELP_SCRUB,
-       HELP_STATUS,
-       HELP_UPGRADE,
-       HELP_EVENTS,
-       HELP_GET,
-       HELP_SET,
-       HELP_SPLIT,
-       HELP_REGUID,
-       HELP_REOPEN
-} zpool_help_t;
-
-
-typedef struct zpool_command {
-       const char      *name;
-       int             (*func)(int, char **);
-       zpool_help_t    usage;
-} zpool_command_t;
-
-/*
- * Master command table.  Each ZFS command has a name, associated function, and
- * usage message.  The usage messages need to be internationalized, so we have
- * to have a function to return the usage message based on a command index.
- *
- * These commands are organized according to how they are displayed in the usage
- * message.  An empty command (one with a NULL name) indicates an empty line in
- * the generic usage message.
- */
-static zpool_command_t command_table[] = {
-       { "create",     zpool_do_create,        HELP_CREATE             },
-       { "destroy",    zpool_do_destroy,       HELP_DESTROY            },
-       { NULL },
-       { "add",        zpool_do_add,           HELP_ADD                },
-       { "remove",     zpool_do_remove,        HELP_REMOVE             },
-       { NULL },
-       { "labelclear", zpool_do_labelclear,    HELP_LABELCLEAR         },
-       { NULL },
-       { "list",       zpool_do_list,          HELP_LIST               },
-       { "iostat",     zpool_do_iostat,        HELP_IOSTAT             },
-       { "status",     zpool_do_status,        HELP_STATUS             },
-       { NULL },
-       { "online",     zpool_do_online,        HELP_ONLINE             },
-       { "offline",    zpool_do_offline,       HELP_OFFLINE            },
-       { "clear",      zpool_do_clear,         HELP_CLEAR              },
-       { "reopen",     zpool_do_reopen,        HELP_REOPEN             },
-       { NULL },
-       { "attach",     zpool_do_attach,        HELP_ATTACH             },
-       { "detach",     zpool_do_detach,        HELP_DETACH             },
-       { "replace",    zpool_do_replace,       HELP_REPLACE            },
-       { "split",      zpool_do_split,         HELP_SPLIT              },
-       { NULL },
-       { "scrub",      zpool_do_scrub,         HELP_SCRUB              },
-       { NULL },
-       { "import",     zpool_do_import,        HELP_IMPORT             },
-       { "export",     zpool_do_export,        HELP_EXPORT             },
-       { "upgrade",    zpool_do_upgrade,       HELP_UPGRADE            },
-       { "reguid",     zpool_do_reguid,        HELP_REGUID             },
-       { NULL },
-       { "history",    zpool_do_history,       HELP_HISTORY            },
-       { "events",     zpool_do_events,        HELP_EVENTS             },
-       { NULL },
-       { "get",        zpool_do_get,           HELP_GET                },
-       { "set",        zpool_do_set,           HELP_SET                },
-};
-
-#define        NCOMMAND        (sizeof (command_table) / sizeof (command_table[0]))
-
-static zpool_command_t *current_command;
-static char history_str[HIS_MAX_RECORD_LEN];
-static boolean_t log_history = B_TRUE;
-static uint_t timestamp_fmt = NODATE;
-
-static const char *
-get_usage(zpool_help_t idx) {
-       switch (idx) {
-       case HELP_ADD:
-               return (gettext("\tadd [-fn] [-o property=value] "
-                   "<pool> <vdev> ...\n"));
-       case HELP_ATTACH:
-               return (gettext("\tattach [-f] [-o property=value] "
-                   "<pool> <device> <new-device>\n"));
-       case HELP_CLEAR:
-               return (gettext("\tclear [-nF] <pool> [device]\n"));
-       case HELP_CREATE:
-               return (gettext("\tcreate [-fnd] [-o property=value] ... \n"
-                   "\t    [-O file-system-property=value] ... \n"
-                   "\t    [-m mountpoint] [-R root] <pool> <vdev> ...\n"));
-       case HELP_DESTROY:
-               return (gettext("\tdestroy [-f] <pool>\n"));
-       case HELP_DETACH:
-               return (gettext("\tdetach <pool> <device>\n"));
-       case HELP_EXPORT:
-               return (gettext("\texport [-af] <pool> ...\n"));
-       case HELP_HISTORY:
-               return (gettext("\thistory [-il] [<pool>] ...\n"));
-       case HELP_IMPORT:
-               return (gettext("\timport [-d dir] [-D]\n"
-                   "\timport [-d dir | -c cachefile] [-F [-n]] <pool | id>\n"
-                   "\timport [-o mntopts] [-o property=value] ... \n"
-                   "\t    [-d dir | -c cachefile] [-D] [-f] [-m] [-N] "
-                   "[-R root] [-F [-n]] -a\n"
-                   "\timport [-o mntopts] [-o property=value] ... \n"
-                   "\t    [-d dir | -c cachefile] [-D] [-f] [-m] [-N] "
-                   "[-R root] [-F [-n]]\n"
-                   "\t    <pool | id> [newpool]\n"));
-       case HELP_IOSTAT:
-               return (gettext("\tiostat [-v] [-T d|u] [-y] [pool] ... "
-                   "[interval [count]]\n"));
-       case HELP_LABELCLEAR:
-               return (gettext("\tlabelclear [-f] <vdev>\n"));
-       case HELP_LIST:
-               return (gettext("\tlist [-Hv] [-o property[,...]] "
-                   "[-T d|u] [pool] ... [interval [count]]\n"));
-       case HELP_OFFLINE:
-               return (gettext("\toffline [-t] <pool> <device> ...\n"));
-       case HELP_ONLINE:
-               return (gettext("\tonline <pool> <device> ...\n"));
-       case HELP_REPLACE:
-               return (gettext("\treplace [-f] [-o property=value] "
-                   "<pool> <device> [new-device]\n"));
-       case HELP_REMOVE:
-               return (gettext("\tremove <pool> <device> ...\n"));
-       case HELP_REOPEN:
-               return (gettext("\treopen <pool>\n"));
-       case HELP_SCRUB:
-               return (gettext("\tscrub [-s] <pool> ...\n"));
-       case HELP_STATUS:
-               return (gettext("\tstatus [-vxD] [-T d|u] [pool] ... [interval "
-                   "[count]]\n"));
-       case HELP_UPGRADE:
-               return (gettext("\tupgrade\n"
-                   "\tupgrade -v\n"
-                   "\tupgrade [-V version] <-a | pool ...>\n"));
-       case HELP_EVENTS:
-               return (gettext("\tevents [-vHfc]\n"));
-       case HELP_GET:
-               return (gettext("\tget [-pH] <\"all\" | property[,...]> "
-                   "<pool> ...\n"));
-       case HELP_SET:
-               return (gettext("\tset <property=value> <pool> \n"));
-       case HELP_SPLIT:
-               return (gettext("\tsplit [-n] [-R altroot] [-o mntopts]\n"
-                   "\t    [-o property=value] <pool> <newpool> "
-                   "[<device> ...]\n"));
-       case HELP_REGUID:
-               return (gettext("\treguid <pool>\n"));
-       }
-
-       abort();
-       /* NOTREACHED */
-}
-
-
-/*
- * Callback routine that will print out a pool property value.
- */
-static int
-print_prop_cb(int prop, void *cb)
-{
-       FILE *fp = cb;
-
-       (void) fprintf(fp, "\t%-15s  ", zpool_prop_to_name(prop));
-
-       if (zpool_prop_readonly(prop))
-               (void) fprintf(fp, "  NO   ");
-       else
-               (void) fprintf(fp, " YES   ");
-
-       if (zpool_prop_values(prop) == NULL)
-               (void) fprintf(fp, "-\n");
-       else
-               (void) fprintf(fp, "%s\n", zpool_prop_values(prop));
-
-       return (ZPROP_CONT);
-}
-
-/*
- * Display usage message.  If we're inside a command, display only the usage for
- * that command.  Otherwise, iterate over the entire command table and display
- * a complete usage message.
- */
-void
-usage(boolean_t requested)
-{
-       FILE *fp = requested ? stdout : stderr;
-
-       if (current_command == NULL) {
-               int i;
-
-               (void) fprintf(fp, gettext("usage: zpool command args ...\n"));
-               (void) fprintf(fp,
-                   gettext("where 'command' is one of the following:\n\n"));
-
-               for (i = 0; i < NCOMMAND; i++) {
-                       if (command_table[i].name == NULL)
-                               (void) fprintf(fp, "\n");
-                       else
-                               (void) fprintf(fp, "%s",
-                                   get_usage(command_table[i].usage));
-               }
-       } else {
-               (void) fprintf(fp, gettext("usage:\n"));
-               (void) fprintf(fp, "%s", get_usage(current_command->usage));
-       }
-
-       if (current_command != NULL &&
-           ((strcmp(current_command->name, "set") == 0) ||
-           (strcmp(current_command->name, "get") == 0) ||
-           (strcmp(current_command->name, "list") == 0))) {
-
-               (void) fprintf(fp,
-                   gettext("\nthe following properties are supported:\n"));
-
-               (void) fprintf(fp, "\n\t%-15s  %s   %s\n\n",
-                   "PROPERTY", "EDIT", "VALUES");
-
-               /* Iterate over all properties */
-               (void) zprop_iter(print_prop_cb, fp, B_FALSE, B_TRUE,
-                   ZFS_TYPE_POOL);
-
-               (void) fprintf(fp, "\t%-15s   ", "feature@...");
-               (void) fprintf(fp, "YES   disabled | enabled | active\n");
-
-               (void) fprintf(fp, gettext("\nThe feature@ properties must be "
-                   "appended with a feature name.\nSee zpool-features(5).\n"));
-       }
-
-       /*
-        * See comments at end of main().
-        */
-       if (getenv("ZFS_ABORT") != NULL) {
-               (void) printf("dumping core by request\n");
-               abort();
-       }
-
-       exit(requested ? 0 : 2);
-}
-
-void
-print_vdev_tree(zpool_handle_t *zhp, const char *name, nvlist_t *nv, int indent,
-    boolean_t print_logs)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       char *vname;
-
-       if (name != NULL)
-               (void) printf("\t%*s%s\n", indent, "", name);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               return;
-
-       for (c = 0; c < children; c++) {
-               uint64_t is_log = B_FALSE;
-
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-                   &is_log);
-               if ((is_log && !print_logs) || (!is_log && print_logs))
-                       continue;
-
-               vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE);
-               print_vdev_tree(zhp, vname, child[c], indent + 2,
-                   B_FALSE);
-               free(vname);
-       }
-}
-
-static boolean_t
-prop_list_contains_feature(nvlist_t *proplist)
-{
-       nvpair_t *nvp;
-       for (nvp = nvlist_next_nvpair(proplist, NULL); NULL != nvp;
-           nvp = nvlist_next_nvpair(proplist, nvp)) {
-               if (zpool_prop_feature(nvpair_name(nvp)))
-                       return (B_TRUE);
-       }
-       return (B_FALSE);
-}
-
-/*
- * Add a property pair (name, string-value) into a property nvlist.
- */
-static int
-add_prop_list(const char *propname, char *propval, nvlist_t **props,
-    boolean_t poolprop)
-{
-       zpool_prop_t prop = ZPROP_INVAL;
-       zfs_prop_t fprop;
-       nvlist_t *proplist;
-       const char *normnm;
-       char *strval;
-
-       if (*props == NULL &&
-           nvlist_alloc(props, NV_UNIQUE_NAME, 0) != 0) {
-               (void) fprintf(stderr,
-                   gettext("internal error: out of memory\n"));
-               return (1);
-       }
-
-       proplist = *props;
-
-       if (poolprop) {
-               const char *vname = zpool_prop_to_name(ZPOOL_PROP_VERSION);
-
-               if ((prop = zpool_name_to_prop(propname)) == ZPROP_INVAL &&
-                   !zpool_prop_feature(propname)) {
-                       (void) fprintf(stderr, gettext("property '%s' is "
-                           "not a valid pool property\n"), propname);
-                       return (2);
-               }
-
-               /*
-                * feature@ properties and version should not be specified
-                * at the same time.
-                */
-               if ((prop == ZPROP_INVAL && zpool_prop_feature(propname) &&
-                   nvlist_exists(proplist, vname)) ||
-                   (prop == ZPOOL_PROP_VERSION &&
-                   prop_list_contains_feature(proplist))) {
-                       (void) fprintf(stderr, gettext("'feature@' and "
-                           "'version' properties cannot be specified "
-                           "together\n"));
-                       return (2);
-               }
-
-
-               if (zpool_prop_feature(propname))
-                       normnm = propname;
-               else
-                       normnm = zpool_prop_to_name(prop);
-       } else {
-               if ((fprop = zfs_name_to_prop(propname)) != ZPROP_INVAL) {
-                       normnm = zfs_prop_to_name(fprop);
-               } else {
-                       normnm = propname;
-               }
-       }
-
-       if (nvlist_lookup_string(proplist, normnm, &strval) == 0 &&
-           prop != ZPOOL_PROP_CACHEFILE) {
-               (void) fprintf(stderr, gettext("property '%s' "
-                   "specified multiple times\n"), propname);
-               return (2);
-       }
-
-       if (nvlist_add_string(proplist, normnm, propval) != 0) {
-               (void) fprintf(stderr, gettext("internal "
-                   "error: out of memory\n"));
-               return (1);
-       }
-
-       return (0);
-}
-
-/*
- * Set a default property pair (name, string-value) in a property nvlist
- */
-static int
-add_prop_list_default(const char *propname, char *propval, nvlist_t **props,
-    boolean_t poolprop)
-{
-       char *pval;
-
-       if (nvlist_lookup_string(*props, propname, &pval) == 0)
-               return (0);
-
-       return (add_prop_list(propname, propval, props, B_TRUE));
-}
-
-/*
- * zpool add [-fn] [-o property=value] <pool> <vdev> ...
- *
- *     -f      Force addition of devices, even if they appear in use
- *     -n      Do not add the devices, but display the resulting layout if
- *             they were to be added.
- *     -o      Set property=value.
- *
- * Adds the given vdevs to 'pool'.  As with create, the bulk of this work is
- * handled by get_vdev_spec(), which constructs the nvlist needed to pass to
- * libzfs.
- */
-int
-zpool_do_add(int argc, char **argv)
-{
-       boolean_t force = B_FALSE;
-       boolean_t dryrun = B_FALSE;
-       int c;
-       nvlist_t *nvroot;
-       char *poolname;
-       int ret;
-       zpool_handle_t *zhp;
-       nvlist_t *config;
-       nvlist_t *props = NULL;
-       char *propval;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "fno:")) != -1) {
-               switch (c) {
-               case 'f':
-                       force = B_TRUE;
-                       break;
-               case 'n':
-                       dryrun = B_TRUE;
-                       break;
-               case 'o':
-                       if ((propval = strchr(optarg, '=')) == NULL) {
-                               (void) fprintf(stderr, gettext("missing "
-                                   "'=' for -o option\n"));
-                               usage(B_FALSE);
-                       }
-                       *propval = '\0';
-                       propval++;
-
-                       if ((strcmp(optarg, ZPOOL_CONFIG_ASHIFT) != 0) ||
-                           (add_prop_list(optarg, propval, &props, B_TRUE)))
-                               usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing vdev specification\n"));
-               usage(B_FALSE);
-       }
-
-       poolname = argv[0];
-
-       argc--;
-       argv++;
-
-       if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
-               return (1);
-
-       if ((config = zpool_get_config(zhp, NULL)) == NULL) {
-               (void) fprintf(stderr, gettext("pool '%s' is unavailable\n"),
-                   poolname);
-               zpool_close(zhp);
-               return (1);
-       }
-
-       /* pass off to get_vdev_spec for processing */
-       nvroot = make_root_vdev(zhp, props, force, !force, B_FALSE, dryrun,
-           argc, argv);
-       if (nvroot == NULL) {
-               zpool_close(zhp);
-               return (1);
-       }
-
-       if (dryrun) {
-               nvlist_t *poolnvroot;
-               nvlist_t **l2child;
-               uint_t l2children, c;
-               char *vname;
-               boolean_t hadcache = B_FALSE;
-
-               verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-                   &poolnvroot) == 0);
-
-               (void) printf(gettext("would update '%s' to the following "
-                   "configuration:\n"), zpool_get_name(zhp));
-
-               /* print original main pool and new tree */
-               print_vdev_tree(zhp, poolname, poolnvroot, 0, B_FALSE);
-               print_vdev_tree(zhp, NULL, nvroot, 0, B_FALSE);
-
-               /* Do the same for the logs */
-               if (num_logs(poolnvroot) > 0) {
-                       print_vdev_tree(zhp, "logs", poolnvroot, 0, B_TRUE);
-                       print_vdev_tree(zhp, NULL, nvroot, 0, B_TRUE);
-               } else if (num_logs(nvroot) > 0) {
-                       print_vdev_tree(zhp, "logs", nvroot, 0, B_TRUE);
-               }
-
-               /* Do the same for the caches */
-               if (nvlist_lookup_nvlist_array(poolnvroot, ZPOOL_CONFIG_L2CACHE,
-                   &l2child, &l2children) == 0 && l2children) {
-                       hadcache = B_TRUE;
-                       (void) printf(gettext("\tcache\n"));
-                       for (c = 0; c < l2children; c++) {
-                               vname = zpool_vdev_name(g_zfs, NULL,
-                                   l2child[c], B_FALSE);
-                               (void) printf("\t  %s\n", vname);
-                               free(vname);
-                       }
-               }
-               if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
-                   &l2child, &l2children) == 0 && l2children) {
-                       if (!hadcache)
-                               (void) printf(gettext("\tcache\n"));
-                       for (c = 0; c < l2children; c++) {
-                               vname = zpool_vdev_name(g_zfs, NULL,
-                                   l2child[c], B_FALSE);
-                               (void) printf("\t  %s\n", vname);
-                               free(vname);
-                       }
-               }
-
-               ret = 0;
-       } else {
-               ret = (zpool_add(zhp, nvroot) != 0);
-       }
-
-       nvlist_free(props);
-       nvlist_free(nvroot);
-       zpool_close(zhp);
-
-       return (ret);
-}
-
-/*
- * zpool remove  <pool> <vdev> ...
- *
- * Removes the given vdev from the pool.  Currently, this supports removing
- * spares, cache, and log devices from the pool.
- */
-int
-zpool_do_remove(int argc, char **argv)
-{
-       char *poolname;
-       int i, ret = 0;
-       zpool_handle_t *zhp;
-
-       argc--;
-       argv++;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing device\n"));
-               usage(B_FALSE);
-       }
-
-       poolname = argv[0];
-
-       if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
-               return (1);
-
-       for (i = 1; i < argc; i++) {
-               if (zpool_vdev_remove(zhp, argv[i]) != 0)
-                       ret = 1;
-       }
-
-       return (ret);
-}
-
-/*
- * zpool labelclear <vdev>
- *
- * Verifies that the vdev is not active and zeros out the label information
- * on the device.
- */
-int
-zpool_do_labelclear(int argc, char **argv)
-{
-       char *vdev, *name;
-       int c, fd = -1, ret = 0;
-       pool_state_t state;
-       boolean_t inuse = B_FALSE;
-       boolean_t force = B_FALSE;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "f")) != -1) {
-               switch (c) {
-               case 'f':
-                       force = B_TRUE;
-                       break;
-               default:
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get vdev name */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing vdev device name\n"));
-               usage(B_FALSE);
-       }
-
-       vdev = argv[0];
-       if ((fd = open(vdev, O_RDWR)) < 0) {
-               (void) fprintf(stderr, gettext("Unable to open %s\n"), vdev);
-               return (B_FALSE);
-       }
-
-       name = NULL;
-       if (zpool_in_use(g_zfs, fd, &state, &name, &inuse) != 0) {
-               if (force)
-                       goto wipe_label;
-
-               (void) fprintf(stderr,
-                   gettext("Unable to determine pool state for %s\n"
-                   "Use -f to force the clearing any label data\n"), vdev);
-
-               return (1);
-       }
-
-       if (inuse) {
-               switch (state) {
-               default:
-               case POOL_STATE_ACTIVE:
-               case POOL_STATE_SPARE:
-               case POOL_STATE_L2CACHE:
-                       (void) fprintf(stderr,
-                           gettext("labelclear operation failed.\n"
-                           "\tVdev %s is a member (%s), of pool \"%s\".\n"
-                           "\tTo remove label information from this device, "
-                           "export or destroy\n\tthe pool, or remove %s from "
-                           "the configuration of this pool\n\tand retry the "
-                           "labelclear operation.\n"),
-                           vdev, zpool_pool_state_to_name(state), name, vdev);
-                       ret = 1;
-                       goto errout;
-
-               case POOL_STATE_EXPORTED:
-                       if (force)
-                               break;
-
-                       (void) fprintf(stderr,
-                           gettext("labelclear operation failed.\n\tVdev "
-                           "%s is a member of the exported pool \"%s\".\n"
-                           "\tUse \"zpool labelclear -f %s\" to force the "
-                           "removal of label\n\tinformation.\n"),
-                           vdev, name, vdev);
-                       ret = 1;
-                       goto errout;
-
-               case POOL_STATE_POTENTIALLY_ACTIVE:
-                       if (force)
-                               break;
-
-                       (void) fprintf(stderr,
-                           gettext("labelclear operation failed.\n"
-                           "\tVdev %s is a member of the pool \"%s\".\n"
-                           "\tThis pool is unknown to this system, but may "
-                           "be active on\n\tanother system. Use "
-                           "\'zpool labelclear -f %s\' to force the\n"
-                           "\tremoval of label information.\n"),
-                           vdev, name, vdev);
-                       ret = 1;
-                       goto errout;
-
-               case POOL_STATE_DESTROYED:
-                       /* inuse should never be set for a destroyed pool... */
-                       break;
-               }
-       }
-
-wipe_label:
-       if (zpool_clear_label(fd) != 0) {
-               (void) fprintf(stderr,
-                   gettext("Label clear failed on vdev %s\n"), vdev);
-               ret = 1;
-       }
-
-errout:
-       close(fd);
-       if (name != NULL)
-               free(name);
-
-       return (ret);
-}
-
-/*
- * zpool create [-fnd] [-o property=value] ...
- *             [-O file-system-property=value] ...
- *             [-R root] [-m mountpoint] <pool> <dev> ...
- *
- *     -f      Force creation, even if devices appear in use
- *     -n      Do not create the pool, but display the resulting layout if it
- *             were to be created.
- *      -R     Create a pool under an alternate root
- *      -m     Set default mountpoint for the root dataset.  By default it's
- *             '/<pool>'
- *     -o      Set property=value.
- *     -d      Don't automatically enable all supported pool features
- *             (individual features can be enabled with -o).
- *     -O      Set fsproperty=value in the pool's root file system
- *
- * Creates the named pool according to the given vdev specification.  The
- * bulk of the vdev processing is done in get_vdev_spec() in zpool_vdev.c.  Once
- * we get the nvlist back from get_vdev_spec(), we either print out the contents
- * (if '-n' was specified), or pass it to libzfs to do the creation.
- */
-int
-zpool_do_create(int argc, char **argv)
-{
-       boolean_t force = B_FALSE;
-       boolean_t dryrun = B_FALSE;
-       boolean_t enable_all_pool_feat = B_TRUE;
-       int c;
-       nvlist_t *nvroot = NULL;
-       char *poolname;
-       char *tname = NULL;
-       int ret = 1;
-       char *altroot = NULL;
-       char *mountpoint = NULL;
-       nvlist_t *fsprops = NULL;
-       nvlist_t *props = NULL;
-       char *propval;
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":fndR:m:o:O:t:")) != -1) {
-               switch (c) {
-               case 'f':
-                       force = B_TRUE;
-                       break;
-               case 'n':
-                       dryrun = B_TRUE;
-                       break;
-               case 'd':
-                       enable_all_pool_feat = B_FALSE;
-                       break;
-               case 'R':
-                       altroot = optarg;
-                       if (add_prop_list(zpool_prop_to_name(
-                           ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE))
-                               goto errout;
-                       if (add_prop_list_default(zpool_prop_to_name(
-                           ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE))
-                               goto errout;
-                       break;
-               case 'm':
-                       /* Equivalent to -O mountpoint=optarg */
-                       mountpoint = optarg;
-                       break;
-               case 'o':
-                       if ((propval = strchr(optarg, '=')) == NULL) {
-                               (void) fprintf(stderr, gettext("missing "
-                                   "'=' for -o option\n"));
-                               goto errout;
-                       }
-                       *propval = '\0';
-                       propval++;
-
-                       if (add_prop_list(optarg, propval, &props, B_TRUE))
-                               goto errout;
-
-                       /*
-                        * If the user is creating a pool that doesn't support
-                        * feature flags, don't enable any features.
-                        */
-                       if (zpool_name_to_prop(optarg) == ZPOOL_PROP_VERSION) {
-                               char *end;
-                               u_longlong_t ver;
-
-                               ver = strtoull(propval, &end, 10);
-                               if (*end == '\0' &&
-                                   ver < SPA_VERSION_FEATURES) {
-                                       enable_all_pool_feat = B_FALSE;
-                               }
-                       }
-                       break;
-               case 'O':
-                       if ((propval = strchr(optarg, '=')) == NULL) {
-                               (void) fprintf(stderr, gettext("missing "
-                                   "'=' for -O option\n"));
-                               goto errout;
-                       }
-                       *propval = '\0';
-                       propval++;
-
-                       /*
-                        * Mountpoints are checked and then added later.
-                        * Uniquely among properties, they can be specified
-                        * more than once, to avoid conflict with -m.
-                        */
-                       if (0 == strcmp(optarg,
-                           zfs_prop_to_name(ZFS_PROP_MOUNTPOINT))) {
-                               mountpoint = propval;
-                       } else if (add_prop_list(optarg, propval, &fsprops,
-                           B_FALSE)) {
-                               goto errout;
-                       }
-                       break;
-               case 't':
-                       /*
-                        * Sanity check temporary pool name.
-                        */
-                       if (strchr(optarg, '/') != NULL) {
-                               (void) fprintf(stderr, gettext("cannot create "
-                                   "'%s': invalid character '/' in temporary "
-                                   "name\n"), optarg);
-                               (void) fprintf(stderr, gettext("use 'zfs "
-                                   "create' to create a dataset\n"));
-                               goto errout;
-                       }
-
-                       if (add_prop_list(zpool_prop_to_name(
-                           ZPOOL_PROP_TNAME), optarg, &props, B_TRUE))
-                               goto errout;
-                       if (add_prop_list_default(zpool_prop_to_name(
-                           ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE))
-                               goto errout;
-                       tname = optarg;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       goto badusage;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       goto badusage;
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name argument\n"));
-               goto badusage;
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing vdev specification\n"));
-               goto badusage;
-       }
-
-       poolname = argv[0];
-
-       /*
-        * As a special case, check for use of '/' in the name, and direct the
-        * user to use 'zfs create' instead.
-        */
-       if (strchr(poolname, '/') != NULL) {
-               (void) fprintf(stderr, gettext("cannot create '%s': invalid "
-                   "character '/' in pool name\n"), poolname);
-               (void) fprintf(stderr, gettext("use 'zfs create' to "
-                   "create a dataset\n"));
-               goto errout;
-       }
-
-       /* pass off to get_vdev_spec for bulk processing */
-       nvroot = make_root_vdev(NULL, props, force, !force, B_FALSE, dryrun,
-           argc - 1, argv + 1);
-       if (nvroot == NULL)
-               goto errout;
-
-       /* make_root_vdev() allows 0 toplevel children if there are spares */
-       if (!zfs_allocatable_devs(nvroot)) {
-               (void) fprintf(stderr, gettext("invalid vdev "
-                   "specification: at least one toplevel vdev must be "
-                   "specified\n"));
-               goto errout;
-       }
-
-       if (altroot != NULL && altroot[0] != '/') {
-               (void) fprintf(stderr, gettext("invalid alternate root '%s': "
-                   "must be an absolute path\n"), altroot);
-               goto errout;
-       }
-
-       /*
-        * Check the validity of the mountpoint and direct the user to use the
-        * '-m' mountpoint option if it looks like its in use.
-        */
-       if (mountpoint == NULL ||
-           (strcmp(mountpoint, ZFS_MOUNTPOINT_LEGACY) != 0 &&
-           strcmp(mountpoint, ZFS_MOUNTPOINT_NONE) != 0)) {
-               char buf[MAXPATHLEN];
-               DIR *dirp;
-
-               if (mountpoint && mountpoint[0] != '/') {
-                       (void) fprintf(stderr, gettext("invalid mountpoint "
-                           "'%s': must be an absolute path, 'legacy', or "
-                           "'none'\n"), mountpoint);
-                       goto errout;
-               }
-
-               if (mountpoint == NULL) {
-                       if (altroot != NULL)
-                               (void) snprintf(buf, sizeof (buf), "%s/%s",
-                                   altroot, poolname);
-                       else
-                               (void) snprintf(buf, sizeof (buf), "/%s",
-                                   poolname);
-               } else {
-                       if (altroot != NULL)
-                               (void) snprintf(buf, sizeof (buf), "%s%s",
-                                   altroot, mountpoint);
-                       else
-                               (void) snprintf(buf, sizeof (buf), "%s",
-                                   mountpoint);
-               }
-
-               if ((dirp = opendir(buf)) == NULL && errno != ENOENT) {
-                       (void) fprintf(stderr, gettext("mountpoint '%s' : "
-                           "%s\n"), buf, strerror(errno));
-                       (void) fprintf(stderr, gettext("use '-m' "
-                           "option to provide a different default\n"));
-                       goto errout;
-               } else if (dirp) {
-                       int count = 0;
-
-                       while (count < 3 && readdir(dirp) != NULL)
-                               count++;
-                       (void) closedir(dirp);
-
-                       if (count > 2) {
-                               (void) fprintf(stderr, gettext("mountpoint "
-                                   "'%s' exists and is not empty\n"), buf);
-                               (void) fprintf(stderr, gettext("use '-m' "
-                                   "option to provide a "
-                                   "different default\n"));
-                               goto errout;
-                       }
-               }
-       }
-
-       /*
-        * Now that the mountpoint's validity has been checked, ensure that
-        * the property is set appropriately prior to creating the pool.
-        */
-       if (mountpoint != NULL) {
-               ret = add_prop_list(zfs_prop_to_name(ZFS_PROP_MOUNTPOINT),
-                   mountpoint, &fsprops, B_FALSE);
-               if (ret != 0)
-                       goto errout;
-       }
-
-       ret = 1;
-       if (dryrun) {
-               /*
-                * For a dry run invocation, print out a basic message and run
-                * through all the vdevs in the list and print out in an
-                * appropriate hierarchy.
-                */
-               (void) printf(gettext("would create '%s' with the "
-                   "following layout:\n\n"), poolname);
-
-               print_vdev_tree(NULL, poolname, nvroot, 0, B_FALSE);
-               if (num_logs(nvroot) > 0)
-                       print_vdev_tree(NULL, "logs", nvroot, 0, B_TRUE);
-
-               ret = 0;
-       } else {
-               /*
-                * Hand off to libzfs.
-                */
-               if (enable_all_pool_feat) {
-                       spa_feature_t i;
-                       for (i = 0; i < SPA_FEATURES; i++) {
-                               char propname[MAXPATHLEN];
-                               zfeature_info_t *feat = &spa_feature_table[i];
-
-                               (void) snprintf(propname, sizeof (propname),
-                                   "feature@%s", feat->fi_uname);
-
-                               /*
-                                * Skip feature if user specified it manually
-                                * on the command line.
-                                */
-                               if (nvlist_exists(props, propname))
-                                       continue;
-
-                               ret = add_prop_list(propname,
-                                   ZFS_FEATURE_ENABLED, &props, B_TRUE);
-                               if (ret != 0)
-                                       goto errout;
-                       }
-               }
-
-               ret = 1;
-               if (zpool_create(g_zfs, poolname,
-                   nvroot, props, fsprops) == 0) {
-                       zfs_handle_t *pool = zfs_open(g_zfs,
-                           tname ? tname : poolname, ZFS_TYPE_FILESYSTEM);
-                       if (pool != NULL) {
-                               if (zfs_mount(pool, NULL, 0) == 0)
-                                       ret = zfs_shareall(pool);
-                               zfs_close(pool);
-                       }
-               } else if (libzfs_errno(g_zfs) == EZFS_INVALIDNAME) {
-                       (void) fprintf(stderr, gettext("pool name may have "
-                           "been omitted\n"));
-               }
-       }
-
-errout:
-       nvlist_free(nvroot);
-       nvlist_free(fsprops);
-       nvlist_free(props);
-       return (ret);
-badusage:
-       nvlist_free(fsprops);
-       nvlist_free(props);
-       usage(B_FALSE);
-       return (2);
-}
-
-/*
- * zpool destroy <pool>
- *
- *     -f      Forcefully unmount any datasets
- *
- * Destroy the given pool.  Automatically unmounts any datasets in the pool.
- */
-int
-zpool_do_destroy(int argc, char **argv)
-{
-       boolean_t force = B_FALSE;
-       int c;
-       char *pool;
-       zpool_handle_t *zhp;
-       int ret;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "f")) != -1) {
-               switch (c) {
-               case 'f':
-                       force = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* check arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool argument\n"));
-               usage(B_FALSE);
-       }
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       pool = argv[0];
-
-       if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) {
-               /*
-                * As a special case, check for use of '/' in the name, and
-                * direct the user to use 'zfs destroy' instead.
-                */
-               if (strchr(pool, '/') != NULL)
-                       (void) fprintf(stderr, gettext("use 'zfs destroy' to "
-                           "destroy a dataset\n"));
-               return (1);
-       }
-
-       if (zpool_disable_datasets(zhp, force) != 0) {
-               (void) fprintf(stderr, gettext("could not destroy '%s': "
-                   "could not unmount datasets\n"), zpool_get_name(zhp));
-               return (1);
-       }
-
-       /* The history must be logged as part of the export */
-       log_history = B_FALSE;
-
-       ret = (zpool_destroy(zhp, history_str) != 0);
-
-       zpool_close(zhp);
-
-       return (ret);
-}
-
-typedef struct export_cbdata {
-       boolean_t force;
-       boolean_t hardforce;
-} export_cbdata_t;
-
-/*
- * Export one pool
- */
-int
-zpool_export_one(zpool_handle_t *zhp, void *data)
-{
-       export_cbdata_t *cb = data;
-
-       if (zpool_disable_datasets(zhp, cb->force) != 0)
-               return (1);
-
-       /* The history must be logged as part of the export */
-       log_history = B_FALSE;
-
-       if (cb->hardforce) {
-               if (zpool_export_force(zhp, history_str) != 0)
-                       return (1);
-       } else if (zpool_export(zhp, cb->force, history_str) != 0) {
-               return (1);
-       }
-
-       return (0);
-}
-
-/*
- * zpool export [-f] <pool> ...
- *
- *     -a      Export all pools
- *     -f      Forcefully unmount datasets
- *
- * Export the given pools.  By default, the command will attempt to cleanly
- * unmount any active datasets within the pool.  If the '-f' flag is specified,
- * then the datasets will be forcefully unmounted.
- */
-int
-zpool_do_export(int argc, char **argv)
-{
-       export_cbdata_t cb;
-       boolean_t do_all = B_FALSE;
-       boolean_t force = B_FALSE;
-       boolean_t hardforce = B_FALSE;
-       int c, ret;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "afF")) != -1) {
-               switch (c) {
-               case 'a':
-                       do_all = B_TRUE;
-                       break;
-               case 'f':
-                       force = B_TRUE;
-                       break;
-               case 'F':
-                       hardforce = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       cb.force = force;
-       cb.hardforce = hardforce;
-       argc -= optind;
-       argv += optind;
-
-       if (do_all) {
-               if (argc != 0) {
-                       (void) fprintf(stderr, gettext("too many arguments\n"));
-                       usage(B_FALSE);
-               }
-
-               return (for_each_pool(argc, argv, B_TRUE, NULL,
-                   zpool_export_one, &cb));
-       }
-
-       /* check arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool argument\n"));
-               usage(B_FALSE);
-       }
-
-       ret = for_each_pool(argc, argv, B_TRUE, NULL, zpool_export_one, &cb);
-
-       return (ret);
-}
-
-/*
- * Given a vdev configuration, determine the maximum width needed for the device
- * name column.
- */
-static int
-max_width(zpool_handle_t *zhp, nvlist_t *nv, int depth, int max)
-{
-       char *name = zpool_vdev_name(g_zfs, zhp, nv, B_TRUE);
-       nvlist_t **child;
-       uint_t c, children;
-       int ret;
-
-       if (strlen(name) + depth > max)
-               max = strlen(name) + depth;
-
-       free(name);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if ((ret = max_width(zhp, child[c], depth + 2,
-                           max)) > max)
-                               max = ret;
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if ((ret = max_width(zhp, child[c], depth + 2,
-                           max)) > max)
-                               max = ret;
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if ((ret = max_width(zhp, child[c], depth + 2,
-                           max)) > max)
-                               max = ret;
-       }
-
-
-       return (max);
-}
-
-typedef struct spare_cbdata {
-       uint64_t        cb_guid;
-       zpool_handle_t  *cb_zhp;
-} spare_cbdata_t;
-
-static boolean_t
-find_vdev(nvlist_t *nv, uint64_t search)
-{
-       uint64_t guid;
-       nvlist_t **child;
-       uint_t c, children;
-
-       if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &guid) == 0 &&
-           search == guid)
-               return (B_TRUE);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if (find_vdev(child[c], search))
-                               return (B_TRUE);
-       }
-
-       return (B_FALSE);
-}
-
-static int
-find_spare(zpool_handle_t *zhp, void *data)
-{
-       spare_cbdata_t *cbp = data;
-       nvlist_t *config, *nvroot;
-
-       config = zpool_get_config(zhp, NULL);
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-
-       if (find_vdev(nvroot, cbp->cb_guid)) {
-               cbp->cb_zhp = zhp;
-               return (1);
-       }
-
-       zpool_close(zhp);
-       return (0);
-}
-
-/*
- * Print out configuration state as requested by status_callback.
- */
-void
-print_status_config(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
-    int namewidth, int depth, boolean_t isspare)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       pool_scan_stat_t *ps = NULL;
-       vdev_stat_t *vs;
-       char rbuf[6], wbuf[6], cbuf[6];
-       char *vname;
-       uint64_t notpresent;
-       spare_cbdata_t cb;
-       char *state;
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               children = 0;
-
-       verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
-           (uint64_t **)&vs, &c) == 0);
-
-       state = zpool_state_to_name(vs->vs_state, vs->vs_aux);
-       if (isspare) {
-               /*
-                * For hot spares, we use the terms 'INUSE' and 'AVAILABLE' for
-                * online drives.
-                */
-               if (vs->vs_aux == VDEV_AUX_SPARED)
-                       state = "INUSE";
-               else if (vs->vs_state == VDEV_STATE_HEALTHY)
-                       state = "AVAIL";
-       }
-
-       (void) printf("\t%*s%-*s  %-8s", depth, "", namewidth - depth,
-           name, state);
-
-       if (!isspare) {
-               zfs_nicenum(vs->vs_read_errors, rbuf, sizeof (rbuf));
-               zfs_nicenum(vs->vs_write_errors, wbuf, sizeof (wbuf));
-               zfs_nicenum(vs->vs_checksum_errors, cbuf, sizeof (cbuf));
-               (void) printf(" %5s %5s %5s", rbuf, wbuf, cbuf);
-       }
-
-       if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
-           &notpresent) == 0) {
-               char *path;
-               verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0);
-               (void) printf("  was %s", path);
-       } else if (vs->vs_aux != 0) {
-               (void) printf("  ");
-
-               switch (vs->vs_aux) {
-               case VDEV_AUX_OPEN_FAILED:
-                       (void) printf(gettext("cannot open"));
-                       break;
-
-               case VDEV_AUX_BAD_GUID_SUM:
-                       (void) printf(gettext("missing device"));
-                       break;
-
-               case VDEV_AUX_NO_REPLICAS:
-                       (void) printf(gettext("insufficient replicas"));
-                       break;
-
-               case VDEV_AUX_VERSION_NEWER:
-                       (void) printf(gettext("newer version"));
-                       break;
-
-               case VDEV_AUX_UNSUP_FEAT:
-                       (void) printf(gettext("unsupported feature(s)"));
-                       break;
-
-               case VDEV_AUX_SPARED:
-                       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
-                           &cb.cb_guid) == 0);
-                       if (zpool_iter(g_zfs, find_spare, &cb) == 1) {
-                               if (strcmp(zpool_get_name(cb.cb_zhp),
-                                   zpool_get_name(zhp)) == 0)
-                                       (void) printf(gettext("currently in "
-                                           "use"));
-                               else
-                                       (void) printf(gettext("in use by "
-                                           "pool '%s'"),
-                                           zpool_get_name(cb.cb_zhp));
-                               zpool_close(cb.cb_zhp);
-                       } else {
-                               (void) printf(gettext("currently in use"));
-                       }
-                       break;
-
-               case VDEV_AUX_ERR_EXCEEDED:
-                       (void) printf(gettext("too many errors"));
-                       break;
-
-               case VDEV_AUX_IO_FAILURE:
-                       (void) printf(gettext("experienced I/O failures"));
-                       break;
-
-               case VDEV_AUX_BAD_LOG:
-                       (void) printf(gettext("bad intent log"));
-                       break;
-
-               case VDEV_AUX_EXTERNAL:
-                       (void) printf(gettext("external device fault"));
-                       break;
-
-               case VDEV_AUX_SPLIT_POOL:
-                       (void) printf(gettext("split into new pool"));
-                       break;
-
-               default:
-                       (void) printf(gettext("corrupted data"));
-                       break;
-               }
-       }
-
-       (void) nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_SCAN_STATS,
-           (uint64_t **)&ps, &c);
-
-       if (ps && ps->pss_state == DSS_SCANNING &&
-           vs->vs_scan_processed != 0 && children == 0) {
-               (void) printf(gettext("  (%s)"),
-                   (ps->pss_func == POOL_SCAN_RESILVER) ?
-                   "resilvering" : "repairing");
-       }
-
-       (void) printf("\n");
-
-       for (c = 0; c < children; c++) {
-               uint64_t islog = B_FALSE, ishole = B_FALSE;
-
-               /* Don't print logs or holes here */
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-                   &islog);
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_HOLE,
-                   &ishole);
-               if (islog || ishole)
-                       continue;
-               vname = zpool_vdev_name(g_zfs, zhp, child[c], B_TRUE);
-               print_status_config(zhp, vname, child[c],
-                   namewidth, depth + 2, isspare);
-               free(vname);
-       }
-}
-
-
-/*
- * Print the configuration of an exported pool.  Iterate over all vdevs in the
- * pool, printing out the name and status for each one.
- */
-void
-print_import_config(const char *name, nvlist_t *nv, int namewidth, int depth)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       vdev_stat_t *vs;
-       char *type, *vname;
-
-       verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
-       if (strcmp(type, VDEV_TYPE_MISSING) == 0 ||
-           strcmp(type, VDEV_TYPE_HOLE) == 0)
-               return;
-
-       verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
-           (uint64_t **)&vs, &c) == 0);
-
-       (void) printf("\t%*s%-*s", depth, "", namewidth - depth, name);
-       (void) printf("  %s", zpool_state_to_name(vs->vs_state, vs->vs_aux));
-
-       if (vs->vs_aux != 0) {
-               (void) printf("  ");
-
-               switch (vs->vs_aux) {
-               case VDEV_AUX_OPEN_FAILED:
-                       (void) printf(gettext("cannot open"));
-                       break;
-
-               case VDEV_AUX_BAD_GUID_SUM:
-                       (void) printf(gettext("missing device"));
-                       break;
-
-               case VDEV_AUX_NO_REPLICAS:
-                       (void) printf(gettext("insufficient replicas"));
-                       break;
-
-               case VDEV_AUX_VERSION_NEWER:
-                       (void) printf(gettext("newer version"));
-                       break;
-
-               case VDEV_AUX_UNSUP_FEAT:
-                       (void) printf(gettext("unsupported feature(s)"));
-                       break;
-
-               case VDEV_AUX_ERR_EXCEEDED:
-                       (void) printf(gettext("too many errors"));
-                       break;
-
-               default:
-                       (void) printf(gettext("corrupted data"));
-                       break;
-               }
-       }
-       (void) printf("\n");
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               return;
-
-       for (c = 0; c < children; c++) {
-               uint64_t is_log = B_FALSE;
-
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-                   &is_log);
-               if (is_log)
-                       continue;
-
-               vname = zpool_vdev_name(g_zfs, NULL, child[c], B_TRUE);
-               print_import_config(vname, child[c], namewidth, depth + 2);
-               free(vname);
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
-           &child, &children) == 0) {
-               (void) printf(gettext("\tcache\n"));
-               for (c = 0; c < children; c++) {
-                       vname = zpool_vdev_name(g_zfs, NULL, child[c], B_FALSE);
-                       (void) printf("\t  %s\n", vname);
-                       free(vname);
-               }
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
-           &child, &children) == 0) {
-               (void) printf(gettext("\tspares\n"));
-               for (c = 0; c < children; c++) {
-                       vname = zpool_vdev_name(g_zfs, NULL, child[c], B_FALSE);
-                       (void) printf("\t  %s\n", vname);
-                       free(vname);
-               }
-       }
-}
-
-/*
- * Print log vdevs.
- * Logs are recorded as top level vdevs in the main pool child array
- * but with "is_log" set to 1. We use either print_status_config() or
- * print_import_config() to print the top level logs then any log
- * children (eg mirrored slogs) are printed recursively - which
- * works because only the top level vdev is marked "is_log"
- */
-static void
-print_logs(zpool_handle_t *zhp, nvlist_t *nv, int namewidth, boolean_t verbose)
-{
-       uint_t c, children;
-       nvlist_t **child;
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN, &child,
-           &children) != 0)
-               return;
-
-       (void) printf(gettext("\tlogs\n"));
-
-       for (c = 0; c < children; c++) {
-               uint64_t is_log = B_FALSE;
-               char *name;
-
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-                   &is_log);
-               if (!is_log)
-                       continue;
-               name = zpool_vdev_name(g_zfs, zhp, child[c], B_TRUE);
-               if (verbose)
-                       print_status_config(zhp, name, child[c], namewidth,
-                           2, B_FALSE);
-               else
-                       print_import_config(name, child[c], namewidth, 2);
-               free(name);
-       }
-}
-
-/*
- * Display the status for the given pool.
- */
-static void
-show_import(nvlist_t *config)
-{
-       uint64_t pool_state;
-       vdev_stat_t *vs;
-       char *name;
-       uint64_t guid;
-       char *msgid;
-       nvlist_t *nvroot;
-       zpool_status_t reason;
-       zpool_errata_t errata;
-       const char *health;
-       uint_t vsc;
-       int namewidth;
-       char *comment;
-
-       verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
-           &name) == 0);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
-           &guid) == 0);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
-           &pool_state) == 0);
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-
-       verify(nvlist_lookup_uint64_array(nvroot, ZPOOL_CONFIG_VDEV_STATS,
-           (uint64_t **)&vs, &vsc) == 0);
-       health = zpool_state_to_name(vs->vs_state, vs->vs_aux);
-
-       reason = zpool_import_status(config, &msgid, &errata);
-
-       (void) printf(gettext("   pool: %s\n"), name);
-       (void) printf(gettext("     id: %llu\n"), (u_longlong_t)guid);
-       (void) printf(gettext("  state: %s"), health);
-       if (pool_state == POOL_STATE_DESTROYED)
-               (void) printf(gettext(" (DESTROYED)"));
-       (void) printf("\n");
-
-       switch (reason) {
-       case ZPOOL_STATUS_MISSING_DEV_R:
-       case ZPOOL_STATUS_MISSING_DEV_NR:
-       case ZPOOL_STATUS_BAD_GUID_SUM:
-               (void) printf(gettext(" status: One or more devices are "
-                   "missing from the system.\n"));
-               break;
-
-       case ZPOOL_STATUS_CORRUPT_LABEL_R:
-       case ZPOOL_STATUS_CORRUPT_LABEL_NR:
-               (void) printf(gettext(" status: One or more devices contains "
-                   "corrupted data.\n"));
-               break;
-
-       case ZPOOL_STATUS_CORRUPT_DATA:
-               (void) printf(
-                   gettext(" status: The pool data is corrupted.\n"));
-               break;
-
-       case ZPOOL_STATUS_OFFLINE_DEV:
-               (void) printf(gettext(" status: One or more devices "
-                   "are offlined.\n"));
-               break;
-
-       case ZPOOL_STATUS_CORRUPT_POOL:
-               (void) printf(gettext(" status: The pool metadata is "
-                   "corrupted.\n"));
-               break;
-
-       case ZPOOL_STATUS_VERSION_OLDER:
-               (void) printf(gettext(" status: The pool is formatted using a "
-                   "legacy on-disk version.\n"));
-               break;
-
-       case ZPOOL_STATUS_VERSION_NEWER:
-               (void) printf(gettext(" status: The pool is formatted using an "
-                   "incompatible version.\n"));
-               break;
-
-       case ZPOOL_STATUS_FEAT_DISABLED:
-               (void) printf(gettext(" status: Some supported features are "
-                   "not enabled on the pool.\n"));
-               break;
-
-       case ZPOOL_STATUS_UNSUP_FEAT_READ:
-               (void) printf(gettext("status: The pool uses the following "
-                   "feature(s) not supported on this sytem:\n"));
-               zpool_print_unsup_feat(config);
-               break;
-
-       case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
-               (void) printf(gettext("status: The pool can only be accessed "
-                   "in read-only mode on this system. It\n\tcannot be "
-                   "accessed in read-write mode because it uses the "
-                   "following\n\tfeature(s) not supported on this system:\n"));
-               zpool_print_unsup_feat(config);
-               break;
-
-       case ZPOOL_STATUS_HOSTID_MISMATCH:
-               (void) printf(gettext(" status: The pool was last accessed by "
-                   "another system.\n"));
-               break;
-
-       case ZPOOL_STATUS_FAULTED_DEV_R:
-       case ZPOOL_STATUS_FAULTED_DEV_NR:
-               (void) printf(gettext(" status: One or more devices are "
-                   "faulted.\n"));
-               break;
-
-       case ZPOOL_STATUS_BAD_LOG:
-               (void) printf(gettext(" status: An intent log record cannot be "
-                   "read.\n"));
-               break;
-
-       case ZPOOL_STATUS_RESILVERING:
-               (void) printf(gettext(" status: One or more devices were being "
-                   "resilvered.\n"));
-               break;
-
-       case ZPOOL_STATUS_ERRATA:
-               (void) printf(gettext(" status: Errata #%d detected.\n"),
-                   errata);
-               break;
-
-       default:
-               /*
-                * No other status can be seen when importing pools.
-                */
-               assert(reason == ZPOOL_STATUS_OK);
-       }
-
-       /*
-        * Print out an action according to the overall state of the pool.
-        */
-       if (vs->vs_state == VDEV_STATE_HEALTHY) {
-               if (reason == ZPOOL_STATUS_VERSION_OLDER ||
-                   reason == ZPOOL_STATUS_FEAT_DISABLED) {
-                       (void) printf(gettext(" action: The pool can be "
-                           "imported using its name or numeric identifier, "
-                           "though\n\tsome features will not be available "
-                           "without an explicit 'zpool upgrade'.\n"));
-               } else if (reason == ZPOOL_STATUS_HOSTID_MISMATCH) {
-                       (void) printf(gettext(" action: The pool can be "
-                           "imported using its name or numeric "
-                           "identifier and\n\tthe '-f' flag.\n"));
-               } else if (reason == ZPOOL_STATUS_ERRATA) {
-                       switch (errata) {
-                       case ZPOOL_ERRATA_NONE:
-                               break;
-
-                       case ZPOOL_ERRATA_ZOL_2094_SCRUB:
-                               (void) printf(gettext(" action: The pool can "
-                                   "be imported using its name or numeric "
-                                   "identifier,\n\thowever there is a compat"
-                                   "ibility issue which should be corrected"
-                                   "\n\tby running 'zpool scrub'\n"));
-                               break;
-
-                       case ZPOOL_ERRATA_ZOL_2094_ASYNC_DESTROY:
-                               (void) printf(gettext(" action: The pool can"
-                                   "not be imported with this version of ZFS "
-                                   "due to\n\tan active asynchronous destroy. "
-                                   "Revert to an earlier version\n\tand "
-                                   "allow the destroy to complete before "
-                                   "updating.\n"));
-                               break;
-
-                       default:
-                               /*
-                                * All errata must contain an action message.
-                                */
-                               assert(0);
-                       }
-               } else {
-                       (void) printf(gettext(" action: The pool can be "
-                           "imported using its name or numeric "
-                           "identifier.\n"));
-               }
-       } else if (vs->vs_state == VDEV_STATE_DEGRADED) {
-               (void) printf(gettext(" action: The pool can be imported "
-                   "despite missing or damaged devices.  The\n\tfault "
-                   "tolerance of the pool may be compromised if imported.\n"));
-       } else {
-               switch (reason) {
-               case ZPOOL_STATUS_VERSION_NEWER:
-                       (void) printf(gettext(" action: The pool cannot be "
-                           "imported.  Access the pool on a system running "
-                           "newer\n\tsoftware, or recreate the pool from "
-                           "backup.\n"));
-                       break;
-               case ZPOOL_STATUS_UNSUP_FEAT_READ:
-                       (void) printf(gettext("action: The pool cannot be "
-                           "imported. Access the pool on a system that "
-                           "supports\n\tthe required feature(s), or recreate "
-                           "the pool from backup.\n"));
-                       break;
-               case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
-                       (void) printf(gettext("action: The pool cannot be "
-                           "imported in read-write mode. Import the pool "
-                           "with\n"
-                           "\t\"-o readonly=on\", access the pool on a system "
-                           "that supports the\n\trequired feature(s), or "
-                           "recreate the pool from backup.\n"));
-                       break;
-               case ZPOOL_STATUS_MISSING_DEV_R:
-               case ZPOOL_STATUS_MISSING_DEV_NR:
-               case ZPOOL_STATUS_BAD_GUID_SUM:
-                       (void) printf(gettext(" action: The pool cannot be "
-                           "imported. Attach the missing\n\tdevices and try "
-                           "again.\n"));
-                       break;
-               default:
-                       (void) printf(gettext(" action: The pool cannot be "
-                           "imported due to damaged devices or data.\n"));
-               }
-       }
-
-       /* Print the comment attached to the pool. */
-       if (nvlist_lookup_string(config, ZPOOL_CONFIG_COMMENT, &comment) == 0)
-               (void) printf(gettext("comment: %s\n"), comment);
-
-       /*
-        * If the state is "closed" or "can't open", and the aux state
-        * is "corrupt data":
-        */
-       if (((vs->vs_state == VDEV_STATE_CLOSED) ||
-           (vs->vs_state == VDEV_STATE_CANT_OPEN)) &&
-           (vs->vs_aux == VDEV_AUX_CORRUPT_DATA)) {
-               if (pool_state == POOL_STATE_DESTROYED)
-                       (void) printf(gettext("\tThe pool was destroyed, "
-                           "but can be imported using the '-Df' flags.\n"));
-               else if (pool_state != POOL_STATE_EXPORTED)
-                       (void) printf(gettext("\tThe pool may be active on "
-                           "another system, but can be imported using\n\t"
-                           "the '-f' flag.\n"));
-       }
-
-       if (msgid != NULL)
-               (void) printf(gettext("   see: http://zfsonlinux.org/msg/%s\n"),
-                   msgid);
-
-       (void) printf(gettext(" config:\n\n"));
-
-       namewidth = max_width(NULL, nvroot, 0, 0);
-       if (namewidth < 10)
-               namewidth = 10;
-
-       print_import_config(name, nvroot, namewidth, 0);
-       if (num_logs(nvroot) > 0)
-               print_logs(NULL, nvroot, namewidth, B_FALSE);
-
-       if (reason == ZPOOL_STATUS_BAD_GUID_SUM) {
-               (void) printf(gettext("\n\tAdditional devices are known to "
-                   "be part of this pool, though their\n\texact "
-                   "configuration cannot be determined.\n"));
-       }
-}
-
-/*
- * Perform the import for the given configuration.  This passes the heavy
- * lifting off to zpool_import_props(), and then mounts the datasets contained
- * within the pool.
- */
-static int
-do_import(nvlist_t *config, const char *newname, const char *mntopts,
-    nvlist_t *props, int flags)
-{
-       zpool_handle_t *zhp;
-       char *name;
-       uint64_t state;
-       uint64_t version;
-
-       verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
-           &name) == 0);
-
-       verify(nvlist_lookup_uint64(config,
-           ZPOOL_CONFIG_POOL_STATE, &state) == 0);
-       verify(nvlist_lookup_uint64(config,
-           ZPOOL_CONFIG_VERSION, &version) == 0);
-       if (!SPA_VERSION_IS_SUPPORTED(version)) {
-               (void) fprintf(stderr, gettext("cannot import '%s': pool "
-                   "is formatted using an unsupported ZFS version\n"), name);
-               return (1);
-       } else if (state != POOL_STATE_EXPORTED &&
-           !(flags & ZFS_IMPORT_ANY_HOST)) {
-               uint64_t hostid = 0;
-               unsigned long system_hostid = get_system_hostid();
-
-               (void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID,
-                   &hostid);
-
-               if (hostid != 0 && (unsigned long)hostid != system_hostid) {
-                       char *hostname;
-                       uint64_t timestamp;
-                       time_t t;
-
-                       verify(nvlist_lookup_string(config,
-                           ZPOOL_CONFIG_HOSTNAME, &hostname) == 0);
-                       verify(nvlist_lookup_uint64(config,
-                           ZPOOL_CONFIG_TIMESTAMP, &timestamp) == 0);
-                       t = timestamp;
-                       (void) fprintf(stderr, gettext("cannot import "
-                           "'%s': pool may be in use from other "
-                           "system, it was last accessed by %s "
-                           "(hostid: 0x%lx) on %s"), name, hostname,
-                           (unsigned long)hostid,
-                           asctime(localtime(&t)));
-                       (void) fprintf(stderr, gettext("use '-f' to "
-                           "import anyway\n"));
-                       return (1);
-               }
-       }
-
-       if (zpool_import_props(g_zfs, config, newname, props, flags) != 0)
-               return (1);
-
-       if (newname != NULL)
-               name = (char *)newname;
-
-       if ((zhp = zpool_open_canfail(g_zfs, name)) == NULL)
-               return (1);
-
-       if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL &&
-           !(flags & ZFS_IMPORT_ONLY) &&
-           zpool_enable_datasets(zhp, mntopts, 0) != 0) {
-               zpool_close(zhp);
-               return (1);
-       }
-
-       zpool_close(zhp);
-       return (0);
-}
-
-/*
- * zpool import [-d dir] [-D]
- *       import [-o mntopts] [-o prop=value] ... [-R root] [-D]
- *              [-d dir | -c cachefile] [-f] -a
- *       import [-o mntopts] [-o prop=value] ... [-R root] [-D]
- *              [-d dir | -c cachefile] [-f] [-n] [-F] <pool | id> [newpool]
- *
- *      -c     Read pool information from a cachefile instead of searching
- *             devices.
- *
- *       -d    Scan in a specific directory, other than /dev/.  More than
- *             one directory can be specified using multiple '-d' options.
- *
- *       -D     Scan for previously destroyed pools or import all or only
- *              specified destroyed pools.
- *
- *       -R    Temporarily import the pool, with all mountpoints relative to
- *             the given root.  The pool will remain exported when the machine
- *             is rebooted.
- *
- *       -V    Import even in the presence of faulted vdevs.  This is an
- *             intentionally undocumented option for testing purposes, and
- *             treats the pool configuration as complete, leaving any bad
- *             vdevs in the FAULTED state. In other words, it does verbatim
- *             import.
- *
- *       -f    Force import, even if it appears that the pool is active.
- *
- *       -F     Attempt rewind if necessary.
- *
- *       -n     See if rewind would work, but don't actually rewind.
- *
- *       -N     Import the pool but don't mount datasets.
- *
- *       -T     Specify a starting txg to use for import. This option is
- *             intentionally undocumented option for testing purposes.
- *
- *       -a    Import all pools found.
- *
- *       -o    Set property=value and/or temporary mount options (without '=').
- *
- * The import command scans for pools to import, and import pools based on pool
- * name and GUID.  The pool can also be renamed as part of the import process.
- */
-int
-zpool_do_import(int argc, char **argv)
-{
-       char **searchdirs = NULL;
-       char *env, *envdup = NULL;
-       int nsearch = 0;
-       int c;
-       int err = 0;
-       nvlist_t *pools = NULL;
-       boolean_t do_all = B_FALSE;
-       boolean_t do_destroyed = B_FALSE;
-       char *mntopts = NULL;
-       nvpair_t *elem;
-       nvlist_t *config;
-       uint64_t searchguid = 0;
-       char *searchname = NULL;
-       char *propval;
-       nvlist_t *found_config;
-       nvlist_t *policy = NULL;
-       nvlist_t *props = NULL;
-       boolean_t first;
-       int flags = ZFS_IMPORT_NORMAL;
-       uint32_t rewind_policy = ZPOOL_NO_REWIND;
-       boolean_t dryrun = B_FALSE;
-       boolean_t do_rewind = B_FALSE;
-       boolean_t xtreme_rewind = B_FALSE;
-       uint64_t pool_state, txg = -1ULL;
-       char *cachefile = NULL;
-       importargs_t idata = { 0 };
-       char *endptr;
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":aCc:d:DEfFmnNo:R:tT:VX")) != -1) {
-               switch (c) {
-               case 'a':
-                       do_all = B_TRUE;
-                       break;
-               case 'c':
-                       cachefile = optarg;
-                       break;
-               case 'd':
-                       if (searchdirs == NULL) {
-                               searchdirs = safe_malloc(sizeof (char *));
-                       } else {
-                               char **tmp = safe_malloc((nsearch + 1) *
-                                   sizeof (char *));
-                               bcopy(searchdirs, tmp, nsearch *
-                                   sizeof (char *));
-                               free(searchdirs);
-                               searchdirs = tmp;
-                       }
-                       searchdirs[nsearch++] = optarg;
-                       break;
-               case 'D':
-                       do_destroyed = B_TRUE;
-                       break;
-               case 'f':
-                       flags |= ZFS_IMPORT_ANY_HOST;
-                       break;
-               case 'F':
-                       do_rewind = B_TRUE;
-                       break;
-               case 'm':
-                       flags |= ZFS_IMPORT_MISSING_LOG;
-                       break;
-               case 'n':
-                       dryrun = B_TRUE;
-                       break;
-               case 'N':
-                       flags |= ZFS_IMPORT_ONLY;
-                       break;
-               case 'o':
-                       if ((propval = strchr(optarg, '=')) != NULL) {
-                               *propval = '\0';
-                               propval++;
-                               if (add_prop_list(optarg, propval,
-                                   &props, B_TRUE))
-                                       goto error;
-                       } else {
-                               mntopts = optarg;
-                       }
-                       break;
-               case 'R':
-                       if (add_prop_list(zpool_prop_to_name(
-                           ZPOOL_PROP_ALTROOT), optarg, &props, B_TRUE))
-                               goto error;
-                       if (add_prop_list_default(zpool_prop_to_name(
-                           ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE))
-                               goto error;
-                       break;
-               case 't':
-                       flags |= ZFS_IMPORT_TEMP_NAME;
-                       if (add_prop_list_default(zpool_prop_to_name(
-                           ZPOOL_PROP_CACHEFILE), "none", &props, B_TRUE))
-                               goto error;
-                       break;
-
-               case 'T':
-                       errno = 0;
-                       txg = strtoull(optarg, &endptr, 0);
-                       if (errno != 0 || *endptr != '\0') {
-                               (void) fprintf(stderr,
-                                   gettext("invalid txg value\n"));
-                               usage(B_FALSE);
-                       }
-                       rewind_policy = ZPOOL_DO_REWIND | ZPOOL_EXTREME_REWIND;
-                       break;
-               case 'V':
-                       flags |= ZFS_IMPORT_VERBATIM;
-                       break;
-               case 'X':
-                       xtreme_rewind = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (cachefile && nsearch != 0) {
-               (void) fprintf(stderr, gettext("-c is incompatible with -d\n"));
-               usage(B_FALSE);
-       }
-
-       if ((dryrun || xtreme_rewind) && !do_rewind) {
-               (void) fprintf(stderr,
-                   gettext("-n or -X only meaningful with -F\n"));
-               usage(B_FALSE);
-       }
-       if (dryrun)
-               rewind_policy = ZPOOL_TRY_REWIND;
-       else if (do_rewind)
-               rewind_policy = ZPOOL_DO_REWIND;
-       if (xtreme_rewind)
-               rewind_policy |= ZPOOL_EXTREME_REWIND;
-
-       /* In the future, we can capture further policy and include it here */
-       if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 ||
-           nvlist_add_uint64(policy, ZPOOL_REWIND_REQUEST_TXG, txg) != 0 ||
-           nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0)
-               goto error;
-
-       /* check argument count */
-       if (do_all) {
-               if (argc != 0) {
-                       (void) fprintf(stderr, gettext("too many arguments\n"));
-                       usage(B_FALSE);
-               }
-       } else {
-               if (argc > 2) {
-                       (void) fprintf(stderr, gettext("too many arguments\n"));
-                       usage(B_FALSE);
-               }
-
-               /*
-                * Check for the SYS_CONFIG privilege.  We do this explicitly
-                * here because otherwise any attempt to discover pools will
-                * silently fail.
-                */
-               if (argc == 0 && !priv_ineffect(PRIV_SYS_CONFIG)) {
-                       (void) fprintf(stderr, gettext("cannot "
-                           "discover pools: permission denied\n"));
-                       if (searchdirs != NULL)
-                               free(searchdirs);
-
-                       nvlist_free(policy);
-                       return (1);
-               }
-       }
-
-       /*
-        * Depending on the arguments given, we do one of the following:
-        *
-        *      <none>  Iterate through all pools and display information about
-        *              each one.
-        *
-        *      -a      Iterate through all pools and try to import each one.
-        *
-        *      <id>    Find the pool that corresponds to the given GUID/pool
-        *              name and import that one.
-        *
-        *      -D      Above options applies only to destroyed pools.
-        */
-       if (argc != 0) {
-               char *endptr;
-
-               errno = 0;
-               searchguid = strtoull(argv[0], &endptr, 10);
-               if (errno != 0 || *endptr != '\0') {
-                       searchname = argv[0];
-                       searchguid = 0;
-               }
-               found_config = NULL;
-
-               /*
-                * User specified a name or guid.  Ensure it's unique.
-                */
-               idata.unique = B_TRUE;
-       }
-
-       /*
-        * Check the environment for the preferred search path.
-        */
-       if ((searchdirs == NULL) && (env = getenv("ZPOOL_IMPORT_PATH"))) {
-               char *dir;
-
-               envdup = strdup(env);
-
-               dir = strtok(envdup, ":");
-               while (dir != NULL) {
-                       if (searchdirs == NULL) {
-                               searchdirs = safe_malloc(sizeof (char *));
-                       } else {
-                               char **tmp = safe_malloc((nsearch + 1) *
-                                   sizeof (char *));
-                               bcopy(searchdirs, tmp, nsearch *
-                                   sizeof (char *));
-                               free(searchdirs);
-                               searchdirs = tmp;
-                       }
-                       searchdirs[nsearch++] = dir;
-                       dir = strtok(NULL, ":");
-               }
-       }
-
-       idata.path = searchdirs;
-       idata.paths = nsearch;
-       idata.poolname = searchname;
-       idata.guid = searchguid;
-       idata.cachefile = cachefile;
-
-       pools = zpool_search_import(g_zfs, &idata);
-
-       if (pools != NULL && idata.exists &&
-           (argc == 1 || strcmp(argv[0], argv[1]) == 0)) {
-               (void) fprintf(stderr, gettext("cannot import '%s': "
-                   "a pool with that name already exists\n"),
-                   argv[0]);
-               (void) fprintf(stderr, gettext("use the form '%s "
-                   "<pool | id> <newpool>' to give it a new name\n"),
-                   "zpool import");
-               err = 1;
-       } else if (pools == NULL && idata.exists) {
-               (void) fprintf(stderr, gettext("cannot import '%s': "
-                   "a pool with that name is already created/imported,\n"),
-                   argv[0]);
-               (void) fprintf(stderr, gettext("and no additional pools "
-                   "with that name were found\n"));
-               err = 1;
-       } else if (pools == NULL) {
-               if (argc != 0) {
-                       (void) fprintf(stderr, gettext("cannot import '%s': "
-                           "no such pool available\n"), argv[0]);
-               }
-               err = 1;
-       }
-
-       if (err == 1) {
-               if (searchdirs != NULL)
-                       free(searchdirs);
-               if (envdup != NULL)
-                       free(envdup);
-               nvlist_free(policy);
-               return (1);
-       }
-
-       /*
-        * At this point we have a list of import candidate configs. Even if
-        * we were searching by pool name or guid, we still need to
-        * post-process the list to deal with pool state and possible
-        * duplicate names.
-        */
-       err = 0;
-       elem = NULL;
-       first = B_TRUE;
-       while ((elem = nvlist_next_nvpair(pools, elem)) != NULL) {
-
-               verify(nvpair_value_nvlist(elem, &config) == 0);
-
-               verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
-                   &pool_state) == 0);
-               if (!do_destroyed && pool_state == POOL_STATE_DESTROYED)
-                       continue;
-               if (do_destroyed && pool_state != POOL_STATE_DESTROYED)
-                       continue;
-
-               verify(nvlist_add_nvlist(config, ZPOOL_REWIND_POLICY,
-                   policy) == 0);
-
-               if (argc == 0) {
-                       if (first)
-                               first = B_FALSE;
-                       else if (!do_all)
-                               (void) printf("\n");
-
-                       if (do_all) {
-                               err |= do_import(config, NULL, mntopts,
-                                   props, flags);
-                       } else {
-                               show_import(config);
-                       }
-               } else if (searchname != NULL) {
-                       char *name;
-
-                       /*
-                        * We are searching for a pool based on name.
-                        */
-                       verify(nvlist_lookup_string(config,
-                           ZPOOL_CONFIG_POOL_NAME, &name) == 0);
-
-                       if (strcmp(name, searchname) == 0) {
-                               if (found_config != NULL) {
-                                       (void) fprintf(stderr, gettext(
-                                           "cannot import '%s': more than "
-                                           "one matching pool\n"), searchname);
-                                       (void) fprintf(stderr, gettext(
-                                           "import by numeric ID instead\n"));
-                                       err = B_TRUE;
-                               }
-                               found_config = config;
-                       }
-               } else {
-                       uint64_t guid;
-
-                       /*
-                        * Search for a pool by guid.
-                        */
-                       verify(nvlist_lookup_uint64(config,
-                           ZPOOL_CONFIG_POOL_GUID, &guid) == 0);
-
-                       if (guid == searchguid)
-                               found_config = config;
-               }
-       }
-
-       /*
-        * If we were searching for a specific pool, verify that we found a
-        * pool, and then do the import.
-        */
-       if (argc != 0 && err == 0) {
-               if (found_config == NULL) {
-                       (void) fprintf(stderr, gettext("cannot import '%s': "
-                           "no such pool available\n"), argv[0]);
-                       err = B_TRUE;
-               } else {
-                       err |= do_import(found_config, argc == 1 ? NULL :
-                           argv[1], mntopts, props, flags);
-               }
-       }
-
-       /*
-        * If we were just looking for pools, report an error if none were
-        * found.
-        */
-       if (argc == 0 && first)
-               (void) fprintf(stderr,
-                   gettext("no pools available to import\n"));
-
-error:
-       nvlist_free(props);
-       nvlist_free(pools);
-       nvlist_free(policy);
-       if (searchdirs != NULL)
-               free(searchdirs);
-       if (envdup != NULL)
-               free(envdup);
-
-       return (err ? 1 : 0);
-}
-
-typedef struct iostat_cbdata {
-       boolean_t cb_verbose;
-       int cb_namewidth;
-       int cb_iteration;
-       zpool_list_t *cb_list;
-} iostat_cbdata_t;
-
-static void
-print_iostat_separator(iostat_cbdata_t *cb)
-{
-       int i = 0;
-
-       for (i = 0; i < cb->cb_namewidth; i++)
-               (void) printf("-");
-       (void) printf("  -----  -----  -----  -----  -----  -----\n");
-}
-
-static void
-print_iostat_header(iostat_cbdata_t *cb)
-{
-       (void) printf("%*s     capacity     operations    bandwidth\n",
-           cb->cb_namewidth, "");
-       (void) printf("%-*s  alloc   free   read  write   read  write\n",
-           cb->cb_namewidth, "pool");
-       print_iostat_separator(cb);
-}
-
-/*
- * Display a single statistic.
- */
-static void
-print_one_stat(uint64_t value)
-{
-       char buf[64];
-
-       zfs_nicenum(value, buf, sizeof (buf));
-       (void) printf("  %5s", buf);
-}
-
-/*
- * Print out all the statistics for the given vdev.  This can either be the
- * toplevel configuration, or called recursively.  If 'name' is NULL, then this
- * is a verbose output, and we don't want to display the toplevel pool stats.
- */
-void
-print_vdev_stats(zpool_handle_t *zhp, const char *name, nvlist_t *oldnv,
-    nvlist_t *newnv, iostat_cbdata_t *cb, int depth)
-{
-       nvlist_t **oldchild, **newchild;
-       uint_t c, children;
-       vdev_stat_t *oldvs, *newvs;
-       vdev_stat_t zerovs = { 0 };
-       uint64_t tdelta;
-       double scale;
-       char *vname;
-
-       if (oldnv != NULL) {
-               verify(nvlist_lookup_uint64_array(oldnv,
-                   ZPOOL_CONFIG_VDEV_STATS, (uint64_t **)&oldvs, &c) == 0);
-       } else {
-               oldvs = &zerovs;
-       }
-
-       verify(nvlist_lookup_uint64_array(newnv, ZPOOL_CONFIG_VDEV_STATS,
-           (uint64_t **)&newvs, &c) == 0);
-
-       if (strlen(name) + depth > cb->cb_namewidth)
-               (void) printf("%*s%s", depth, "", name);
-       else
-               (void) printf("%*s%s%*s", depth, "", name,
-                   (int)(cb->cb_namewidth - strlen(name) - depth), "");
-
-       tdelta = newvs->vs_timestamp - oldvs->vs_timestamp;
-
-       if (tdelta == 0)
-               scale = 1.0;
-       else
-               scale = (double)NANOSEC / tdelta;
-
-       /* only toplevel vdevs have capacity stats */
-       if (newvs->vs_space == 0) {
-               (void) printf("      -      -");
-       } else {
-               print_one_stat(newvs->vs_alloc);
-               print_one_stat(newvs->vs_space - newvs->vs_alloc);
-       }
-
-       print_one_stat((uint64_t)(scale * (newvs->vs_ops[ZIO_TYPE_READ] -
-           oldvs->vs_ops[ZIO_TYPE_READ])));
-
-       print_one_stat((uint64_t)(scale * (newvs->vs_ops[ZIO_TYPE_WRITE] -
-           oldvs->vs_ops[ZIO_TYPE_WRITE])));
-
-       print_one_stat((uint64_t)(scale * (newvs->vs_bytes[ZIO_TYPE_READ] -
-           oldvs->vs_bytes[ZIO_TYPE_READ])));
-
-       print_one_stat((uint64_t)(scale * (newvs->vs_bytes[ZIO_TYPE_WRITE] -
-           oldvs->vs_bytes[ZIO_TYPE_WRITE])));
-
-       (void) printf("\n");
-
-       if (!cb->cb_verbose)
-               return;
-
-       if (nvlist_lookup_nvlist_array(newnv, ZPOOL_CONFIG_CHILDREN,
-           &newchild, &children) != 0)
-               return;
-
-       if (oldnv && nvlist_lookup_nvlist_array(oldnv, ZPOOL_CONFIG_CHILDREN,
-           &oldchild, &c) != 0)
-               return;
-
-       for (c = 0; c < children; c++) {
-               uint64_t ishole = B_FALSE, islog = B_FALSE;
-
-               (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_HOLE,
-                   &ishole);
-
-               (void) nvlist_lookup_uint64(newchild[c], ZPOOL_CONFIG_IS_LOG,
-                   &islog);
-
-               if (ishole || islog)
-                       continue;
-
-               vname = zpool_vdev_name(g_zfs, zhp, newchild[c], B_FALSE);
-               print_vdev_stats(zhp, vname, oldnv ? oldchild[c] : NULL,
-                   newchild[c], cb, depth + 2);
-               free(vname);
-       }
-
-       /*
-        * Log device section
-        */
-
-       if (num_logs(newnv) > 0) {
-               (void) printf("%-*s      -      -      -      -      -      "
-                   "-\n", cb->cb_namewidth, "logs");
-
-               for (c = 0; c < children; c++) {
-                       uint64_t islog = B_FALSE;
-                       (void) nvlist_lookup_uint64(newchild[c],
-                           ZPOOL_CONFIG_IS_LOG, &islog);
-
-                       if (islog) {
-                               vname = zpool_vdev_name(g_zfs, zhp, newchild[c],
-                                   B_FALSE);
-                               print_vdev_stats(zhp, vname, oldnv ?
-                                   oldchild[c] : NULL, newchild[c],
-                                   cb, depth + 2);
-                               free(vname);
-                       }
-               }
-
-       }
-
-       /*
-        * Include level 2 ARC devices in iostat output
-        */
-       if (nvlist_lookup_nvlist_array(newnv, ZPOOL_CONFIG_L2CACHE,
-           &newchild, &children) != 0)
-               return;
-
-       if (oldnv && nvlist_lookup_nvlist_array(oldnv, ZPOOL_CONFIG_L2CACHE,
-           &oldchild, &c) != 0)
-               return;
-
-       if (children > 0) {
-               (void) printf("%-*s      -      -      -      -      -      "
-                   "-\n", cb->cb_namewidth, "cache");
-               for (c = 0; c < children; c++) {
-                       vname = zpool_vdev_name(g_zfs, zhp, newchild[c],
-                           B_FALSE);
-                       print_vdev_stats(zhp, vname, oldnv ? oldchild[c] : NULL,
-                           newchild[c], cb, depth + 2);
-                       free(vname);
-               }
-       }
-}
-
-static int
-refresh_iostat(zpool_handle_t *zhp, void *data)
-{
-       iostat_cbdata_t *cb = data;
-       boolean_t missing;
-
-       /*
-        * If the pool has disappeared, remove it from the list and continue.
-        */
-       if (zpool_refresh_stats(zhp, &missing) != 0)
-               return (-1);
-
-       if (missing)
-               pool_list_remove(cb->cb_list, zhp);
-
-       return (0);
-}
-
-/*
- * Callback to print out the iostats for the given pool.
- */
-int
-print_iostat(zpool_handle_t *zhp, void *data)
-{
-       iostat_cbdata_t *cb = data;
-       nvlist_t *oldconfig, *newconfig;
-       nvlist_t *oldnvroot, *newnvroot;
-
-       newconfig = zpool_get_config(zhp, &oldconfig);
-
-       if (cb->cb_iteration == 1)
-               oldconfig = NULL;
-
-       verify(nvlist_lookup_nvlist(newconfig, ZPOOL_CONFIG_VDEV_TREE,
-           &newnvroot) == 0);
-
-       if (oldconfig == NULL)
-               oldnvroot = NULL;
-       else
-               verify(nvlist_lookup_nvlist(oldconfig, ZPOOL_CONFIG_VDEV_TREE,
-                   &oldnvroot) == 0);
-
-       /*
-        * Print out the statistics for the pool.
-        */
-       print_vdev_stats(zhp, zpool_get_name(zhp), oldnvroot, newnvroot, cb, 0);
-
-       if (cb->cb_verbose)
-               print_iostat_separator(cb);
-
-       return (0);
-}
-
-static int
-get_columns(void)
-{
-       struct winsize ws;
-       int columns = 80;
-       int error;
-
-       if (isatty(STDOUT_FILENO)) {
-               error = ioctl(STDOUT_FILENO, TIOCGWINSZ, &ws);
-               if (error == 0)
-                       columns = ws.ws_col;
-       } else {
-               columns = 999;
-       }
-
-       return (columns);
-}
-
-int
-get_namewidth(zpool_handle_t *zhp, void *data)
-{
-       iostat_cbdata_t *cb = data;
-       nvlist_t *config, *nvroot;
-       int columns;
-
-       if ((config = zpool_get_config(zhp, NULL)) != NULL) {
-               verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-                   &nvroot) == 0);
-               if (!cb->cb_verbose)
-                       cb->cb_namewidth = strlen(zpool_get_name(zhp));
-               else
-                       cb->cb_namewidth = max_width(zhp, nvroot, 0,
-                           cb->cb_namewidth);
-       }
-
-       /*
-        * The width must be at least 10, but may be as large as the
-        * column width - 42 so that we can still fit in one line.
-        */
-       columns = get_columns();
-
-       if (cb->cb_namewidth < 10)
-               cb->cb_namewidth = 10;
-       if (cb->cb_namewidth > columns - 42)
-               cb->cb_namewidth = columns - 42;
-
-       return (0);
-}
-
-/*
- * Parse the input string, get the 'interval' and 'count' value if there is one.
- */
-static void
-get_interval_count(int *argcp, char **argv, unsigned long *iv,
-    unsigned long *cnt)
-{
-       unsigned long interval = 0, count = 0;
-       int argc = *argcp;
-
-       /*
-        * Determine if the last argument is an integer or a pool name
-        */
-       if (argc > 0 && isdigit(argv[argc - 1][0])) {
-               char *end;
-
-               errno = 0;
-               interval = strtoul(argv[argc - 1], &end, 10);
-
-               if (*end == '\0' && errno == 0) {
-                       if (interval == 0) {
-                               (void) fprintf(stderr, gettext("interval "
-                                   "cannot be zero\n"));
-                               usage(B_FALSE);
-                       }
-                       /*
-                        * Ignore the last parameter
-                        */
-                       argc--;
-               } else {
-                       /*
-                        * If this is not a valid number, just plow on.  The
-                        * user will get a more informative error message later
-                        * on.
-                        */
-                       interval = 0;
-               }
-       }
-
-       /*
-        * If the last argument is also an integer, then we have both a count
-        * and an interval.
-        */
-       if (argc > 0 && isdigit(argv[argc - 1][0])) {
-               char *end;
-
-               errno = 0;
-               count = interval;
-               interval = strtoul(argv[argc - 1], &end, 10);
-
-               if (*end == '\0' && errno == 0) {
-                       if (interval == 0) {
-                               (void) fprintf(stderr, gettext("interval "
-                                   "cannot be zero\n"));
-                               usage(B_FALSE);
-                       }
-
-                       /*
-                        * Ignore the last parameter
-                        */
-                       argc--;
-               } else {
-                       interval = 0;
-               }
-       }
-
-       *iv = interval;
-       *cnt = count;
-       *argcp = argc;
-}
-
-static void
-get_timestamp_arg(char c)
-{
-       if (c == 'u')
-               timestamp_fmt = UDATE;
-       else if (c == 'd')
-               timestamp_fmt = DDATE;
-       else
-               usage(B_FALSE);
-}
-
-/*
- * zpool iostat [-v] [-T d|u] [pool] ... [interval [count]]
- *
- *     -v      Display statistics for individual vdevs
- *     -T      Display a timestamp in date(1) or Unix format
- *
- * This command can be tricky because we want to be able to deal with pool
- * creation/destruction as well as vdev configuration changes.  The bulk of this
- * processing is handled by the pool_list_* routines in zpool_iter.c.  We rely
- * on pool_list_update() to detect the addition of new pools.  Configuration
- * changes are all handled within libzfs.
- */
-int
-zpool_do_iostat(int argc, char **argv)
-{
-       int c;
-       int ret;
-       int npools;
-       unsigned long interval = 0, count = 0;
-       zpool_list_t *list;
-       boolean_t verbose = B_FALSE;
-       boolean_t omit_since_boot = B_FALSE;
-       iostat_cbdata_t cb;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "T:vy")) != -1) {
-               switch (c) {
-               case 'T':
-                       get_timestamp_arg(*optarg);
-                       break;
-               case 'v':
-                       verbose = B_TRUE;
-                       break;
-               case 'y':
-                       omit_since_boot = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       get_interval_count(&argc, argv, &interval, &count);
-
-       /*
-        * Construct the list of all interesting pools.
-        */
-       ret = 0;
-       if ((list = pool_list_get(argc, argv, NULL, &ret)) == NULL)
-               return (1);
-
-       if (pool_list_count(list) == 0 && argc != 0) {
-               pool_list_free(list);
-               return (1);
-       }
-
-       if (pool_list_count(list) == 0 && interval == 0) {
-               pool_list_free(list);
-               (void) fprintf(stderr, gettext("no pools available\n"));
-               return (1);
-       }
-
-       /*
-        * Enter the main iostat loop.
-        */
-       cb.cb_list = list;
-       cb.cb_verbose = verbose;
-       cb.cb_iteration = 0;
-       cb.cb_namewidth = 0;
-
-       for (;;) {
-               if ((npools = pool_list_count(list)) == 0)
-                       (void) fprintf(stderr, gettext("no pools available\n"));
-               else {
-                       /*
-                        * If this is the first iteration and -y was supplied
-                        * we skip any printing.
-                        */
-                       boolean_t skip = (omit_since_boot &&
-                               cb.cb_iteration == 0);
-
-                       /*
-                        * Refresh all statistics.  This is done as an
-                        * explicit step before calculating the maximum name
-                        * width, so that any * configuration changes are
-                        * properly accounted for.
-                        */
-                       (void) pool_list_iter(list, B_FALSE, refresh_iostat,
-                               &cb);
-
-                       /*
-                        * Iterate over all pools to determine the maximum width
-                        * for the pool / device name column across all pools.
-                        */
-                       cb.cb_namewidth = 0;
-                       (void) pool_list_iter(list, B_FALSE, get_namewidth,
-                               &cb);
-
-                       if (timestamp_fmt != NODATE)
-                               print_timestamp(timestamp_fmt);
-
-                       /*
-                        * If it's the first time and we're not skipping it,
-                        * or either skip or verbose mode, print the header.
-                        */
-                       if ((++cb.cb_iteration == 1 && !skip) ||
-                               (skip != verbose))
-                               print_iostat_header(&cb);
-
-                       if (skip) {
-                               (void) sleep(interval);
-                               continue;
-                       }
-
-                       (void) pool_list_iter(list, B_FALSE, print_iostat, &cb);
-
-                       /*
-                        * If there's more than one pool, and we're not in
-                        * verbose mode (which prints a separator for us),
-                        * then print a separator.
-                        */
-                       if (npools > 1 && !verbose)
-                               print_iostat_separator(&cb);
-
-                       if (verbose)
-                               (void) printf("\n");
-               }
-
-               /*
-                * Flush the output so that redirection to a file isn't buffered
-                * indefinitely.
-                */
-               (void) fflush(stdout);
-
-               if (interval == 0)
-                       break;
-
-               if (count != 0 && --count == 0)
-                       break;
-
-               (void) sleep(interval);
-       }
-
-       pool_list_free(list);
-
-       return (ret);
-}
-
-typedef struct list_cbdata {
-       boolean_t       cb_verbose;
-       int             cb_namewidth;
-       boolean_t       cb_scripted;
-       zprop_list_t    *cb_proplist;
-} list_cbdata_t;
-
-/*
- * Given a list of columns to display, output appropriate headers for each one.
- */
-static void
-print_header(list_cbdata_t *cb)
-{
-       zprop_list_t *pl = cb->cb_proplist;
-       char headerbuf[ZPOOL_MAXPROPLEN];
-       const char *header;
-       boolean_t first = B_TRUE;
-       boolean_t right_justify;
-       size_t width = 0;
-
-       for (; pl != NULL; pl = pl->pl_next) {
-               width = pl->pl_width;
-               if (first && cb->cb_verbose) {
-                       /*
-                        * Reset the width to accommodate the verbose listing
-                        * of devices.
-                        */
-                       width = cb->cb_namewidth;
-               }
-
-               if (!first)
-                       (void) printf("  ");
-               else
-                       first = B_FALSE;
-
-               right_justify = B_FALSE;
-               if (pl->pl_prop != ZPROP_INVAL) {
-                       header = zpool_prop_column_name(pl->pl_prop);
-                       right_justify = zpool_prop_align_right(pl->pl_prop);
-               } else {
-                       int i;
-
-                       for (i = 0; pl->pl_user_prop[i] != '\0'; i++)
-                               headerbuf[i] = toupper(pl->pl_user_prop[i]);
-                       headerbuf[i] = '\0';
-                       header = headerbuf;
-               }
-
-               if (pl->pl_next == NULL && !right_justify)
-                       (void) printf("%s", header);
-               else if (right_justify)
-                       (void) printf("%*s", (int)width, header);
-               else
-                       (void) printf("%-*s", (int)width, header);
-       }
-
-       (void) printf("\n");
-}
-
-/*
- * Given a pool and a list of properties, print out all the properties according
- * to the described layout.
- */
-static void
-print_pool(zpool_handle_t *zhp, list_cbdata_t *cb)
-{
-       zprop_list_t *pl = cb->cb_proplist;
-       boolean_t first = B_TRUE;
-       char property[ZPOOL_MAXPROPLEN];
-       char *propstr;
-       boolean_t right_justify;
-       size_t width;
-
-       for (; pl != NULL; pl = pl->pl_next) {
-
-               width = pl->pl_width;
-               if (first && cb->cb_verbose) {
-                       /*
-                        * Reset the width to accommodate the verbose listing
-                        * of devices.
-                        */
-                       width = cb->cb_namewidth;
-               }
-
-               if (!first) {
-                       if (cb->cb_scripted)
-                               (void) printf("\t");
-                       else
-                               (void) printf("  ");
-               } else {
-                       first = B_FALSE;
-               }
-
-               right_justify = B_FALSE;
-               if (pl->pl_prop != ZPROP_INVAL) {
-                       if (zpool_get_prop(zhp, pl->pl_prop, property,
-                           sizeof (property), NULL) != 0)
-                               propstr = "-";
-                       else
-                               propstr = property;
-
-                       right_justify = zpool_prop_align_right(pl->pl_prop);
-               } else if ((zpool_prop_feature(pl->pl_user_prop) ||
-                   zpool_prop_unsupported(pl->pl_user_prop)) &&
-                   zpool_prop_get_feature(zhp, pl->pl_user_prop, property,
-                   sizeof (property)) == 0) {
-                       propstr = property;
-               } else {
-                       propstr = "-";
-               }
-
-
-               /*
-                * If this is being called in scripted mode, or if this is the
-                * last column and it is left-justified, don't include a width
-                * format specifier.
-                */
-               if (cb->cb_scripted || (pl->pl_next == NULL && !right_justify))
-                       (void) printf("%s", propstr);
-               else if (right_justify)
-                       (void) printf("%*s", (int)width, propstr);
-               else
-                       (void) printf("%-*s", (int)width, propstr);
-       }
-
-       (void) printf("\n");
-}
-
-static void
-print_one_column(zpool_prop_t prop, uint64_t value, boolean_t scripted,
-    boolean_t valid)
-{
-       char propval[64];
-       boolean_t fixed;
-       size_t width = zprop_width(prop, &fixed, ZFS_TYPE_POOL);
-
-       switch (prop) {
-       case ZPOOL_PROP_EXPANDSZ:
-               if (value == 0)
-                       (void) strlcpy(propval, "-", sizeof (propval));
-               else
-                       zfs_nicenum(value, propval, sizeof (propval));
-               break;
-       case ZPOOL_PROP_FRAGMENTATION:
-               if (value == ZFS_FRAG_INVALID) {
-                       (void) strlcpy(propval, "-", sizeof (propval));
-               } else {
-                       (void) snprintf(propval, sizeof (propval), "%llu%%",
-                           (unsigned long long)value);
-               }
-               break;
-       case ZPOOL_PROP_CAPACITY:
-               (void) snprintf(propval, sizeof (propval), "%llu%%",
-                   (unsigned long long)value);
-               break;
-       default:
-               zfs_nicenum(value, propval, sizeof (propval));
-       }
-
-       if (!valid)
-               (void) strlcpy(propval, "-", sizeof (propval));
-
-       if (scripted)
-               (void) printf("\t%s", propval);
-       else
-               (void) printf("  %*s", (int)width, propval);
-}
-
-void
-print_list_stats(zpool_handle_t *zhp, const char *name, nvlist_t *nv,
-    list_cbdata_t *cb, int depth)
-{
-       nvlist_t **child;
-       vdev_stat_t *vs;
-       uint_t c, children;
-       char *vname;
-       boolean_t scripted = cb->cb_scripted;
-
-       verify(nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
-           (uint64_t **)&vs, &c) == 0);
-
-       if (name != NULL) {
-               boolean_t toplevel = (vs->vs_space != 0);
-               uint64_t cap;
-
-               if (scripted)
-                       (void) printf("\t%s", name);
-               else if (strlen(name) + depth > cb->cb_namewidth)
-                       (void) printf("%*s%s", depth, "", name);
-               else
-                       (void) printf("%*s%s%*s", depth, "", name,
-                           (int)(cb->cb_namewidth - strlen(name) - depth), "");
-
-               /*
-                * Print the properties for the individual vdevs. Some
-                * properties are only applicable to toplevel vdevs. The
-                * 'toplevel' boolean value is passed to the print_one_column()
-                * to indicate that the value is valid.
-                */
-               print_one_column(ZPOOL_PROP_SIZE, vs->vs_space, scripted,
-                   toplevel);
-               print_one_column(ZPOOL_PROP_ALLOCATED, vs->vs_alloc, scripted,
-                   toplevel);
-               print_one_column(ZPOOL_PROP_FREE, vs->vs_space - vs->vs_alloc,
-                   scripted, toplevel);
-               print_one_column(ZPOOL_PROP_EXPANDSZ, vs->vs_esize, scripted,
-                   B_TRUE);
-               print_one_column(ZPOOL_PROP_FRAGMENTATION,
-                   vs->vs_fragmentation, scripted,
-                   (vs->vs_fragmentation != ZFS_FRAG_INVALID && toplevel));
-               cap = (vs->vs_space == 0) ? 0 :
-                   (vs->vs_alloc * 100 / vs->vs_space);
-               print_one_column(ZPOOL_PROP_CAPACITY, cap, scripted, toplevel);
-               (void) printf("\n");
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               return;
-
-       for (c = 0; c < children; c++) {
-               uint64_t ishole = B_FALSE;
-
-               if (nvlist_lookup_uint64(child[c],
-                   ZPOOL_CONFIG_IS_HOLE, &ishole) == 0 && ishole)
-                       continue;
-
-               vname = zpool_vdev_name(g_zfs, zhp, child[c], B_FALSE);
-               print_list_stats(zhp, vname, child[c], cb, depth + 2);
-               free(vname);
-       }
-
-       /*
-        * Include level 2 ARC devices in iostat output
-        */
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
-           &child, &children) != 0)
-               return;
-
-       if (children > 0) {
-               (void) printf("%-*s      -      -      -      -      -      "
-                   "-\n", cb->cb_namewidth, "cache");
-               for (c = 0; c < children; c++) {
-                       vname = zpool_vdev_name(g_zfs, zhp, child[c],
-                           B_FALSE);
-                       print_list_stats(zhp, vname, child[c], cb, depth + 2);
-                       free(vname);
-               }
-       }
-}
-
-
-/*
- * Generic callback function to list a pool.
- */
-int
-list_callback(zpool_handle_t *zhp, void *data)
-{
-       list_cbdata_t *cbp = data;
-       nvlist_t *config;
-       nvlist_t *nvroot;
-
-       config = zpool_get_config(zhp, NULL);
-
-       print_pool(zhp, cbp);
-       if (!cbp->cb_verbose)
-               return (0);
-
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-       print_list_stats(zhp, NULL, nvroot, cbp, 0);
-
-       return (0);
-}
-
-/*
- * zpool list [-H] [-o prop[,prop]*] [-T d|u] [pool] ... [interval [count]]
- *
- *     -H      Scripted mode.  Don't display headers, and separate properties
- *             by a single tab.
- *     -o      List of properties to display.  Defaults to
- *             "name,size,allocated,free,expandsize,fragmentation,capacity,"
- *             "dedupratio,health,altroot"
- *     -T      Display a timestamp in date(1) or Unix format
- *
- * List all pools in the system, whether or not they're healthy.  Output space
- * statistics for each one, as well as health status summary.
- */
-int
-zpool_do_list(int argc, char **argv)
-{
-       int c;
-       int ret = 0;
-       list_cbdata_t cb = { 0 };
-       static char default_props[] =
-           "name,size,allocated,free,expandsize,fragmentation,capacity,"
-           "dedupratio,health,altroot";
-       char *props = default_props;
-       unsigned long interval = 0, count = 0;
-       zpool_list_t *list;
-       boolean_t first = B_TRUE;
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":Ho:T:v")) != -1) {
-               switch (c) {
-               case 'H':
-                       cb.cb_scripted = B_TRUE;
-                       break;
-               case 'o':
-                       props = optarg;
-                       break;
-               case 'T':
-                       get_timestamp_arg(*optarg);
-                       break;
-               case 'v':
-                       cb.cb_verbose = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       get_interval_count(&argc, argv, &interval, &count);
-
-       if (zprop_get_list(g_zfs, props, &cb.cb_proplist, ZFS_TYPE_POOL) != 0)
-               usage(B_FALSE);
-
-       for (;;) {
-               if ((list = pool_list_get(argc, argv, &cb.cb_proplist,
-                   &ret)) == NULL)
-                       return (1);
-
-               if (pool_list_count(list) == 0)
-                       break;
-
-               if (timestamp_fmt != NODATE)
-                       print_timestamp(timestamp_fmt);
-
-               if (!cb.cb_scripted && (first || cb.cb_verbose)) {
-                       print_header(&cb);
-                       first = B_FALSE;
-               }
-               ret = pool_list_iter(list, B_TRUE, list_callback, &cb);
-
-               if (interval == 0)
-                       break;
-
-               if (count != 0 && --count == 0)
-                       break;
-
-               pool_list_free(list);
-               (void) sleep(interval);
-       }
-
-       if (argc == 0 && !cb.cb_scripted && pool_list_count(list) == 0) {
-               (void) printf(gettext("no pools available\n"));
-               ret = 0;
-       }
-
-       pool_list_free(list);
-       zprop_free_list(cb.cb_proplist);
-       return (ret);
-}
-
-static int
-zpool_do_attach_or_replace(int argc, char **argv, int replacing)
-{
-       boolean_t force = B_FALSE;
-       int c;
-       nvlist_t *nvroot;
-       char *poolname, *old_disk, *new_disk;
-       zpool_handle_t *zhp;
-       nvlist_t *props = NULL;
-       char *propval;
-       int ret;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "fo:")) != -1) {
-               switch (c) {
-               case 'f':
-                       force = B_TRUE;
-                       break;
-               case 'o':
-                       if ((propval = strchr(optarg, '=')) == NULL) {
-                               (void) fprintf(stderr, gettext("missing "
-                                   "'=' for -o option\n"));
-                               usage(B_FALSE);
-                       }
-                       *propval = '\0';
-                       propval++;
-
-                       if ((strcmp(optarg, ZPOOL_CONFIG_ASHIFT) != 0) ||
-                           (add_prop_list(optarg, propval, &props, B_TRUE)))
-                               usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name argument\n"));
-               usage(B_FALSE);
-       }
-
-       poolname = argv[0];
-
-       if (argc < 2) {
-               (void) fprintf(stderr,
-                   gettext("missing <device> specification\n"));
-               usage(B_FALSE);
-       }
-
-       old_disk = argv[1];
-
-       if (argc < 3) {
-               if (!replacing) {
-                       (void) fprintf(stderr,
-                           gettext("missing <new_device> specification\n"));
-                       usage(B_FALSE);
-               }
-               new_disk = old_disk;
-               argc -= 1;
-               argv += 1;
-       } else {
-               new_disk = argv[2];
-               argc -= 2;
-               argv += 2;
-       }
-
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
-               return (1);
-
-       if (zpool_get_config(zhp, NULL) == NULL) {
-               (void) fprintf(stderr, gettext("pool '%s' is unavailable\n"),
-                   poolname);
-               zpool_close(zhp);
-               return (1);
-       }
-
-       nvroot = make_root_vdev(zhp, props, force, B_FALSE, replacing, B_FALSE,
-           argc, argv);
-       if (nvroot == NULL) {
-               zpool_close(zhp);
-               return (1);
-       }
-
-       ret = zpool_vdev_attach(zhp, old_disk, new_disk, nvroot, replacing);
-
-       nvlist_free(nvroot);
-       zpool_close(zhp);
-
-       return (ret);
-}
-
-/*
- * zpool replace [-f] <pool> <device> <new_device>
- *
- *     -f      Force attach, even if <new_device> appears to be in use.
- *
- * Replace <device> with <new_device>.
- */
-/* ARGSUSED */
-int
-zpool_do_replace(int argc, char **argv)
-{
-       return (zpool_do_attach_or_replace(argc, argv, B_TRUE));
-}
-
-/*
- * zpool attach [-f] [-o property=value] <pool> <device> <new_device>
- *
- *     -f      Force attach, even if <new_device> appears to be in use.
- *     -o      Set property=value.
- *
- * Attach <new_device> to the mirror containing <device>.  If <device> is not
- * part of a mirror, then <device> will be transformed into a mirror of
- * <device> and <new_device>.  In either case, <new_device> will begin life
- * with a DTL of [0, now], and will immediately begin to resilver itself.
- */
-int
-zpool_do_attach(int argc, char **argv)
-{
-       return (zpool_do_attach_or_replace(argc, argv, B_FALSE));
-}
-
-/*
- * zpool detach [-f] <pool> <device>
- *
- *     -f      Force detach of <device>, even if DTLs argue against it
- *             (not supported yet)
- *
- * Detach a device from a mirror.  The operation will be refused if <device>
- * is the last device in the mirror, or if the DTLs indicate that this device
- * has the only valid copy of some data.
- */
-/* ARGSUSED */
-int
-zpool_do_detach(int argc, char **argv)
-{
-       int c;
-       char *poolname, *path;
-       zpool_handle_t *zhp;
-       int ret;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "f")) != -1) {
-               switch (c) {
-               case 'f':
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name argument\n"));
-               usage(B_FALSE);
-       }
-
-       if (argc < 2) {
-               (void) fprintf(stderr,
-                   gettext("missing <device> specification\n"));
-               usage(B_FALSE);
-       }
-
-       poolname = argv[0];
-       path = argv[1];
-
-       if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
-               return (1);
-
-       ret = zpool_vdev_detach(zhp, path);
-
-       zpool_close(zhp);
-
-       return (ret);
-}
-
-/*
- * zpool split [-n] [-o prop=val] ...
- *             [-o mntopt] ...
- *             [-R altroot] <pool> <newpool> [<device> ...]
- *
- *     -n      Do not split the pool, but display the resulting layout if
- *             it were to be split.
- *     -o      Set property=value, or set mount options.
- *     -R      Mount the split-off pool under an alternate root.
- *
- * Splits the named pool and gives it the new pool name.  Devices to be split
- * off may be listed, provided that no more than one device is specified
- * per top-level vdev mirror.  The newly split pool is left in an exported
- * state unless -R is specified.
- *
- * Restrictions: the top-level of the pool pool must only be made up of
- * mirrors; all devices in the pool must be healthy; no device may be
- * undergoing a resilvering operation.
- */
-int
-zpool_do_split(int argc, char **argv)
-{
-       char *srcpool, *newpool, *propval;
-       char *mntopts = NULL;
-       splitflags_t flags;
-       int c, ret = 0;
-       zpool_handle_t *zhp;
-       nvlist_t *config, *props = NULL;
-
-       flags.dryrun = B_FALSE;
-       flags.import = B_FALSE;
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":R:no:")) != -1) {
-               switch (c) {
-               case 'R':
-                       flags.import = B_TRUE;
-                       if (add_prop_list(
-                           zpool_prop_to_name(ZPOOL_PROP_ALTROOT), optarg,
-                           &props, B_TRUE) != 0) {
-                               if (props)
-                                       nvlist_free(props);
-                               usage(B_FALSE);
-                       }
-                       break;
-               case 'n':
-                       flags.dryrun = B_TRUE;
-                       break;
-               case 'o':
-                       if ((propval = strchr(optarg, '=')) != NULL) {
-                               *propval = '\0';
-                               propval++;
-                               if (add_prop_list(optarg, propval,
-                                   &props, B_TRUE) != 0) {
-                                       if (props)
-                                               nvlist_free(props);
-                                       usage(B_FALSE);
-                               }
-                       } else {
-                               mntopts = optarg;
-                       }
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-                       break;
-               }
-       }
-
-       if (!flags.import && mntopts != NULL) {
-               (void) fprintf(stderr, gettext("setting mntopts is only "
-                   "valid when importing the pool\n"));
-               usage(B_FALSE);
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("Missing pool name\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("Missing new pool name\n"));
-               usage(B_FALSE);
-       }
-
-       srcpool = argv[0];
-       newpool = argv[1];
-
-       argc -= 2;
-       argv += 2;
-
-       if ((zhp = zpool_open(g_zfs, srcpool)) == NULL)
-               return (1);
-
-       config = split_mirror_vdev(zhp, newpool, props, flags, argc, argv);
-       if (config == NULL) {
-               ret = 1;
-       } else {
-               if (flags.dryrun) {
-                       (void) printf(gettext("would create '%s' with the "
-                           "following layout:\n\n"), newpool);
-                       print_vdev_tree(NULL, newpool, config, 0, B_FALSE);
-               }
-               nvlist_free(config);
-       }
-
-       zpool_close(zhp);
-
-       if (ret != 0 || flags.dryrun || !flags.import)
-               return (ret);
-
-       /*
-        * The split was successful. Now we need to open the new
-        * pool and import it.
-        */
-       if ((zhp = zpool_open_canfail(g_zfs, newpool)) == NULL)
-               return (1);
-       if (zpool_get_state(zhp) != POOL_STATE_UNAVAIL &&
-           zpool_enable_datasets(zhp, mntopts, 0) != 0) {
-               ret = 1;
-               (void) fprintf(stderr, gettext("Split was successful, but "
-                   "the datasets could not all be mounted\n"));
-               (void) fprintf(stderr, gettext("Try doing '%s' with a "
-                   "different altroot\n"), "zpool import");
-       }
-       zpool_close(zhp);
-
-       return (ret);
-}
-
-
-
-/*
- * zpool online <pool> <device> ...
- */
-int
-zpool_do_online(int argc, char **argv)
-{
-       int c, i;
-       char *poolname;
-       zpool_handle_t *zhp;
-       int ret = 0;
-       vdev_state_t newstate;
-       int flags = 0;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "et")) != -1) {
-               switch (c) {
-               case 'e':
-                       flags |= ZFS_ONLINE_EXPAND;
-                       break;
-               case 't':
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing device name\n"));
-               usage(B_FALSE);
-       }
-
-       poolname = argv[0];
-
-       if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
-               return (1);
-
-       for (i = 1; i < argc; i++) {
-               if (zpool_vdev_online(zhp, argv[i], flags, &newstate) == 0) {
-                       if (newstate != VDEV_STATE_HEALTHY) {
-                               (void) printf(gettext("warning: device '%s' "
-                                   "onlined, but remains in faulted state\n"),
-                                   argv[i]);
-                               if (newstate == VDEV_STATE_FAULTED)
-                                       (void) printf(gettext("use 'zpool "
-                                           "clear' to restore a faulted "
-                                           "device\n"));
-                               else
-                                       (void) printf(gettext("use 'zpool "
-                                           "replace' to replace devices "
-                                           "that are no longer present\n"));
-                       }
-               } else {
-                       ret = 1;
-               }
-       }
-
-       zpool_close(zhp);
-
-       return (ret);
-}
-
-/*
- * zpool offline [-ft] <pool> <device> ...
- *
- *     -f      Force the device into the offline state, even if doing
- *             so would appear to compromise pool availability.
- *             (not supported yet)
- *
- *     -t      Only take the device off-line temporarily.  The offline
- *             state will not be persistent across reboots.
- */
-/* ARGSUSED */
-int
-zpool_do_offline(int argc, char **argv)
-{
-       int c, i;
-       char *poolname;
-       zpool_handle_t *zhp;
-       int ret = 0;
-       boolean_t istmp = B_FALSE;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "ft")) != -1) {
-               switch (c) {
-               case 't':
-                       istmp = B_TRUE;
-                       break;
-               case 'f':
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name\n"));
-               usage(B_FALSE);
-       }
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing device name\n"));
-               usage(B_FALSE);
-       }
-
-       poolname = argv[0];
-
-       if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
-               return (1);
-
-       for (i = 1; i < argc; i++) {
-               if (zpool_vdev_offline(zhp, argv[i], istmp) != 0)
-                       ret = 1;
-       }
-
-       zpool_close(zhp);
-
-       return (ret);
-}
-
-/*
- * zpool clear <pool> [device]
- *
- * Clear all errors associated with a pool or a particular device.
- */
-int
-zpool_do_clear(int argc, char **argv)
-{
-       int c;
-       int ret = 0;
-       boolean_t dryrun = B_FALSE;
-       boolean_t do_rewind = B_FALSE;
-       boolean_t xtreme_rewind = B_FALSE;
-       uint32_t rewind_policy = ZPOOL_NO_REWIND;
-       nvlist_t *policy = NULL;
-       zpool_handle_t *zhp;
-       char *pool, *device;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "FnX")) != -1) {
-               switch (c) {
-               case 'F':
-                       do_rewind = B_TRUE;
-                       break;
-               case 'n':
-                       dryrun = B_TRUE;
-                       break;
-               case 'X':
-                       xtreme_rewind = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name\n"));
-               usage(B_FALSE);
-       }
-
-       if (argc > 2) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       if ((dryrun || xtreme_rewind) && !do_rewind) {
-               (void) fprintf(stderr,
-                   gettext("-n or -X only meaningful with -F\n"));
-               usage(B_FALSE);
-       }
-       if (dryrun)
-               rewind_policy = ZPOOL_TRY_REWIND;
-       else if (do_rewind)
-               rewind_policy = ZPOOL_DO_REWIND;
-       if (xtreme_rewind)
-               rewind_policy |= ZPOOL_EXTREME_REWIND;
-
-       /* In future, further rewind policy choices can be passed along here */
-       if (nvlist_alloc(&policy, NV_UNIQUE_NAME, 0) != 0 ||
-           nvlist_add_uint32(policy, ZPOOL_REWIND_REQUEST, rewind_policy) != 0)
-               return (1);
-
-       pool = argv[0];
-       device = argc == 2 ? argv[1] : NULL;
-
-       if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL) {
-               nvlist_free(policy);
-               return (1);
-       }
-
-       if (zpool_clear(zhp, device, policy) != 0)
-               ret = 1;
-
-       zpool_close(zhp);
-
-       nvlist_free(policy);
-
-       return (ret);
-}
-
-/*
- * zpool reguid <pool>
- */
-int
-zpool_do_reguid(int argc, char **argv)
-{
-       int c;
-       char *poolname;
-       zpool_handle_t *zhp;
-       int ret = 0;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "")) != -1) {
-               switch (c) {
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       /* get pool name and check number of arguments */
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name\n"));
-               usage(B_FALSE);
-       }
-
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       poolname = argv[0];
-       if ((zhp = zpool_open(g_zfs, poolname)) == NULL)
-               return (1);
-
-       ret = zpool_reguid(zhp);
-
-       zpool_close(zhp);
-       return (ret);
-}
-
-
-/*
- * zpool reopen <pool>
- *
- * Reopen the pool so that the kernel can update the sizes of all vdevs.
- */
-int
-zpool_do_reopen(int argc, char **argv)
-{
-       int c;
-       int ret = 0;
-       zpool_handle_t *zhp;
-       char *pool;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "")) != -1) {
-               switch (c) {
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc--;
-       argv++;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name\n"));
-               usage(B_FALSE);
-       }
-
-       if (argc > 1) {
-               (void) fprintf(stderr, gettext("too many arguments\n"));
-               usage(B_FALSE);
-       }
-
-       pool = argv[0];
-       if ((zhp = zpool_open_canfail(g_zfs, pool)) == NULL)
-               return (1);
-
-       ret = zpool_reopen(zhp);
-       zpool_close(zhp);
-       return (ret);
-}
-
-typedef struct scrub_cbdata {
-       int     cb_type;
-       int     cb_argc;
-       char    **cb_argv;
-} scrub_cbdata_t;
-
-int
-scrub_callback(zpool_handle_t *zhp, void *data)
-{
-       scrub_cbdata_t *cb = data;
-       int err;
-
-       /*
-        * Ignore faulted pools.
-        */
-       if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
-               (void) fprintf(stderr, gettext("cannot scrub '%s': pool is "
-                   "currently unavailable\n"), zpool_get_name(zhp));
-               return (1);
-       }
-
-       err = zpool_scan(zhp, cb->cb_type);
-
-       return (err != 0);
-}
-
-/*
- * zpool scrub [-s] <pool> ...
- *
- *     -s      Stop.  Stops any in-progress scrub.
- */
-int
-zpool_do_scrub(int argc, char **argv)
-{
-       int c;
-       scrub_cbdata_t cb;
-
-       cb.cb_type = POOL_SCAN_SCRUB;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "s")) != -1) {
-               switch (c) {
-               case 's':
-                       cb.cb_type = POOL_SCAN_NONE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       cb.cb_argc = argc;
-       cb.cb_argv = argv;
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing pool name argument\n"));
-               usage(B_FALSE);
-       }
-
-       return (for_each_pool(argc, argv, B_TRUE, NULL, scrub_callback, &cb));
-}
-
-typedef struct status_cbdata {
-       int             cb_count;
-       boolean_t       cb_allpools;
-       boolean_t       cb_verbose;
-       boolean_t       cb_explain;
-       boolean_t       cb_first;
-       boolean_t       cb_dedup_stats;
-} status_cbdata_t;
-
-/*
- * Print out detailed scrub status.
- */
-void
-print_scan_status(pool_scan_stat_t *ps)
-{
-       time_t start, end;
-       uint64_t elapsed, mins_left, hours_left;
-       uint64_t pass_exam, examined, total;
-       uint_t rate;
-       double fraction_done;
-       char processed_buf[7], examined_buf[7], total_buf[7], rate_buf[7];
-
-       (void) printf(gettext("  scan: "));
-
-       /* If there's never been a scan, there's not much to say. */
-       if (ps == NULL || ps->pss_func == POOL_SCAN_NONE ||
-           ps->pss_func >= POOL_SCAN_FUNCS) {
-               (void) printf(gettext("none requested\n"));
-               return;
-       }
-
-       start = ps->pss_start_time;
-       end = ps->pss_end_time;
-       zfs_nicenum(ps->pss_processed, processed_buf, sizeof (processed_buf));
-
-       assert(ps->pss_func == POOL_SCAN_SCRUB ||
-           ps->pss_func == POOL_SCAN_RESILVER);
-       /*
-        * Scan is finished or canceled.
-        */
-       if (ps->pss_state == DSS_FINISHED) {
-               uint64_t minutes_taken = (end - start) / 60;
-               char *fmt = NULL;
-
-               if (ps->pss_func == POOL_SCAN_SCRUB) {
-                       fmt = gettext("scrub repaired %s in %lluh%um with "
-                           "%llu errors on %s");
-               } else if (ps->pss_func == POOL_SCAN_RESILVER) {
-                       fmt = gettext("resilvered %s in %lluh%um with "
-                           "%llu errors on %s");
-               }
-               /* LINTED */
-               (void) printf(fmt, processed_buf,
-                   (u_longlong_t)(minutes_taken / 60),
-                   (uint_t)(minutes_taken % 60),
-                   (u_longlong_t)ps->pss_errors,
-                   ctime((time_t *)&end));
-               return;
-       } else if (ps->pss_state == DSS_CANCELED) {
-               if (ps->pss_func == POOL_SCAN_SCRUB) {
-                       (void) printf(gettext("scrub canceled on %s"),
-                           ctime(&end));
-               } else if (ps->pss_func == POOL_SCAN_RESILVER) {
-                       (void) printf(gettext("resilver canceled on %s"),
-                           ctime(&end));
-               }
-               return;
-       }
-
-       assert(ps->pss_state == DSS_SCANNING);
-
-       /*
-        * Scan is in progress.
-        */
-       if (ps->pss_func == POOL_SCAN_SCRUB) {
-               (void) printf(gettext("scrub in progress since %s"),
-                   ctime(&start));
-       } else if (ps->pss_func == POOL_SCAN_RESILVER) {
-               (void) printf(gettext("resilver in progress since %s"),
-                   ctime(&start));
-       }
-
-       examined = ps->pss_examined ? ps->pss_examined : 1;
-       total = ps->pss_to_examine;
-       fraction_done = (double)examined / total;
-
-       /* elapsed time for this pass */
-       elapsed = time(NULL) - ps->pss_pass_start;
-       elapsed = elapsed ? elapsed : 1;
-       pass_exam = ps->pss_pass_exam ? ps->pss_pass_exam : 1;
-       rate = pass_exam / elapsed;
-       rate = rate ? rate : 1;
-       mins_left = ((total - examined) / rate) / 60;
-       hours_left = mins_left / 60;
-
-       zfs_nicenum(examined, examined_buf, sizeof (examined_buf));
-       zfs_nicenum(total, total_buf, sizeof (total_buf));
-       zfs_nicenum(rate, rate_buf, sizeof (rate_buf));
-
-       /*
-        * do not print estimated time if hours_left is more than 30 days
-        */
-       (void) printf(gettext("\t%s scanned out of %s at %s/s"),
-           examined_buf, total_buf, rate_buf);
-       if (hours_left < (30 * 24)) {
-               (void) printf(gettext(", %lluh%um to go\n"),
-                   (u_longlong_t)hours_left, (uint_t)(mins_left % 60));
-       } else {
-               (void) printf(gettext(
-                   ", (scan is slow, no estimated time)\n"));
-       }
-
-       if (ps->pss_func == POOL_SCAN_RESILVER) {
-               (void) printf(gettext("\t%s resilvered, %.2f%% done\n"),
-                   processed_buf, 100 * fraction_done);
-       } else if (ps->pss_func == POOL_SCAN_SCRUB) {
-               (void) printf(gettext("\t%s repaired, %.2f%% done\n"),
-                   processed_buf, 100 * fraction_done);
-       }
-}
-
-static void
-print_error_log(zpool_handle_t *zhp)
-{
-       nvlist_t *nverrlist = NULL;
-       nvpair_t *elem;
-       char *pathname;
-       size_t len = MAXPATHLEN * 2;
-
-       if (zpool_get_errlog(zhp, &nverrlist) != 0) {
-               (void) printf("errors: List of errors unavailable "
-                   "(insufficient privileges)\n");
-               return;
-       }
-
-       (void) printf("errors: Permanent errors have been "
-           "detected in the following files:\n\n");
-
-       pathname = safe_malloc(len);
-       elem = NULL;
-       while ((elem = nvlist_next_nvpair(nverrlist, elem)) != NULL) {
-               nvlist_t *nv;
-               uint64_t dsobj, obj;
-
-               verify(nvpair_value_nvlist(elem, &nv) == 0);
-               verify(nvlist_lookup_uint64(nv, ZPOOL_ERR_DATASET,
-                   &dsobj) == 0);
-               verify(nvlist_lookup_uint64(nv, ZPOOL_ERR_OBJECT,
-                   &obj) == 0);
-               zpool_obj_to_path(zhp, dsobj, obj, pathname, len);
-               (void) printf("%7s %s\n", "", pathname);
-       }
-       free(pathname);
-       nvlist_free(nverrlist);
-}
-
-static void
-print_spares(zpool_handle_t *zhp, nvlist_t **spares, uint_t nspares,
-    int namewidth)
-{
-       uint_t i;
-       char *name;
-
-       if (nspares == 0)
-               return;
-
-       (void) printf(gettext("\tspares\n"));
-
-       for (i = 0; i < nspares; i++) {
-               name = zpool_vdev_name(g_zfs, zhp, spares[i], B_FALSE);
-               print_status_config(zhp, name, spares[i],
-                   namewidth, 2, B_TRUE);
-               free(name);
-       }
-}
-
-static void
-print_l2cache(zpool_handle_t *zhp, nvlist_t **l2cache, uint_t nl2cache,
-    int namewidth)
-{
-       uint_t i;
-       char *name;
-
-       if (nl2cache == 0)
-               return;
-
-       (void) printf(gettext("\tcache\n"));
-
-       for (i = 0; i < nl2cache; i++) {
-               name = zpool_vdev_name(g_zfs, zhp, l2cache[i], B_FALSE);
-               print_status_config(zhp, name, l2cache[i],
-                   namewidth, 2, B_FALSE);
-               free(name);
-       }
-}
-
-static void
-print_dedup_stats(nvlist_t *config)
-{
-       ddt_histogram_t *ddh;
-       ddt_stat_t *dds;
-       ddt_object_t *ddo;
-       uint_t c;
-
-       /*
-        * If the pool was faulted then we may not have been able to
-        * obtain the config. Otherwise, if we have anything in the dedup
-        * table continue processing the stats.
-        */
-       if (nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_OBJ_STATS,
-           (uint64_t **)&ddo, &c) != 0)
-               return;
-
-       (void) printf("\n");
-       (void) printf(gettext(" dedup: "));
-       if (ddo->ddo_count == 0) {
-               (void) printf(gettext("no DDT entries\n"));
-               return;
-       }
-
-       (void) printf("DDT entries %llu, size %llu on disk, %llu in core\n",
-           (u_longlong_t)ddo->ddo_count,
-           (u_longlong_t)ddo->ddo_dspace,
-           (u_longlong_t)ddo->ddo_mspace);
-
-       verify(nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_STATS,
-           (uint64_t **)&dds, &c) == 0);
-       verify(nvlist_lookup_uint64_array(config, ZPOOL_CONFIG_DDT_HISTOGRAM,
-           (uint64_t **)&ddh, &c) == 0);
-       zpool_dump_ddt(dds, ddh);
-}
-
-/*
- * Display a summary of pool status.  Displays a summary such as:
- *
- *        pool: tank
- *     status: DEGRADED
- *     reason: One or more devices ...
- *         see: http://zfsonlinux.org/msg/ZFS-xxxx-01
- *     config:
- *             mirror          DEGRADED
- *                c1t0d0       OK
- *                c2t0d0       UNAVAIL
- *
- * When given the '-v' option, we print out the complete config.  If the '-e'
- * option is specified, then we print out error rate information as well.
- */
-int
-status_callback(zpool_handle_t *zhp, void *data)
-{
-       status_cbdata_t *cbp = data;
-       nvlist_t *config, *nvroot;
-       char *msgid;
-       zpool_status_t reason;
-       zpool_errata_t errata;
-       const char *health;
-       uint_t c;
-       vdev_stat_t *vs;
-
-       config = zpool_get_config(zhp, NULL);
-       reason = zpool_get_status(zhp, &msgid, &errata);
-
-       cbp->cb_count++;
-
-       /*
-        * If we were given 'zpool status -x', only report those pools with
-        * problems.
-        */
-       if (cbp->cb_explain &&
-           (reason == ZPOOL_STATUS_OK ||
-           reason == ZPOOL_STATUS_VERSION_OLDER ||
-           reason == ZPOOL_STATUS_FEAT_DISABLED)) {
-               if (!cbp->cb_allpools) {
-                       (void) printf(gettext("pool '%s' is healthy\n"),
-                           zpool_get_name(zhp));
-                       if (cbp->cb_first)
-                               cbp->cb_first = B_FALSE;
-               }
-               return (0);
-       }
-
-       if (cbp->cb_first)
-               cbp->cb_first = B_FALSE;
-       else
-               (void) printf("\n");
-
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-       verify(nvlist_lookup_uint64_array(nvroot, ZPOOL_CONFIG_VDEV_STATS,
-           (uint64_t **)&vs, &c) == 0);
-       health = zpool_state_to_name(vs->vs_state, vs->vs_aux);
-
-       (void) printf(gettext("  pool: %s\n"), zpool_get_name(zhp));
-       (void) printf(gettext(" state: %s\n"), health);
-
-       switch (reason) {
-       case ZPOOL_STATUS_MISSING_DEV_R:
-               (void) printf(gettext("status: One or more devices could not "
-                   "be opened.  Sufficient replicas exist for\n\tthe pool to "
-                   "continue functioning in a degraded state.\n"));
-               (void) printf(gettext("action: Attach the missing device and "
-                   "online it using 'zpool online'.\n"));
-               break;
-
-       case ZPOOL_STATUS_MISSING_DEV_NR:
-               (void) printf(gettext("status: One or more devices could not "
-                   "be opened.  There are insufficient\n\treplicas for the "
-                   "pool to continue functioning.\n"));
-               (void) printf(gettext("action: Attach the missing device and "
-                   "online it using 'zpool online'.\n"));
-               break;
-
-       case ZPOOL_STATUS_CORRUPT_LABEL_R:
-               (void) printf(gettext("status: One or more devices could not "
-                   "be used because the label is missing or\n\tinvalid.  "
-                   "Sufficient replicas exist for the pool to continue\n\t"
-                   "functioning in a degraded state.\n"));
-               (void) printf(gettext("action: Replace the device using "
-                   "'zpool replace'.\n"));
-               break;
-
-       case ZPOOL_STATUS_CORRUPT_LABEL_NR:
-               (void) printf(gettext("status: One or more devices could not "
-                   "be used because the label is missing \n\tor invalid.  "
-                   "There are insufficient replicas for the pool to "
-                   "continue\n\tfunctioning.\n"));
-               zpool_explain_recover(zpool_get_handle(zhp),
-                   zpool_get_name(zhp), reason, config);
-               break;
-
-       case ZPOOL_STATUS_FAILING_DEV:
-               (void) printf(gettext("status: One or more devices has "
-                   "experienced an unrecoverable error.  An\n\tattempt was "
-                   "made to correct the error.  Applications are "
-                   "unaffected.\n"));
-               (void) printf(gettext("action: Determine if the device needs "
-                   "to be replaced, and clear the errors\n\tusing "
-                   "'zpool clear' or replace the device with 'zpool "
-                   "replace'.\n"));
-               break;
-
-       case ZPOOL_STATUS_OFFLINE_DEV:
-               (void) printf(gettext("status: One or more devices has "
-                   "been taken offline by the administrator.\n\tSufficient "
-                   "replicas exist for the pool to continue functioning in "
-                   "a\n\tdegraded state.\n"));
-               (void) printf(gettext("action: Online the device using "
-                   "'zpool online' or replace the device with\n\t'zpool "
-                   "replace'.\n"));
-               break;
-
-       case ZPOOL_STATUS_REMOVED_DEV:
-               (void) printf(gettext("status: One or more devices has "
-                   "been removed by the administrator.\n\tSufficient "
-                   "replicas exist for the pool to continue functioning in "
-                   "a\n\tdegraded state.\n"));
-               (void) printf(gettext("action: Online the device using "
-                   "'zpool online' or replace the device with\n\t'zpool "
-                   "replace'.\n"));
-               break;
-
-       case ZPOOL_STATUS_RESILVERING:
-               (void) printf(gettext("status: One or more devices is "
-                   "currently being resilvered.  The pool will\n\tcontinue "
-                   "to function, possibly in a degraded state.\n"));
-               (void) printf(gettext("action: Wait for the resilver to "
-                   "complete.\n"));
-               break;
-
-       case ZPOOL_STATUS_CORRUPT_DATA:
-               (void) printf(gettext("status: One or more devices has "
-                   "experienced an error resulting in data\n\tcorruption.  "
-                   "Applications may be affected.\n"));
-               (void) printf(gettext("action: Restore the file in question "
-                   "if possible.  Otherwise restore the\n\tentire pool from "
-                   "backup.\n"));
-               break;
-
-       case ZPOOL_STATUS_CORRUPT_POOL:
-               (void) printf(gettext("status: The pool metadata is corrupted "
-                   "and the pool cannot be opened.\n"));
-               zpool_explain_recover(zpool_get_handle(zhp),
-                   zpool_get_name(zhp), reason, config);
-               break;
-
-       case ZPOOL_STATUS_VERSION_OLDER:
-               (void) printf(gettext("status: The pool is formatted using a "
-                   "legacy on-disk format.  The pool can\n\tstill be used, "
-                   "but some features are unavailable.\n"));
-               (void) printf(gettext("action: Upgrade the pool using 'zpool "
-                   "upgrade'.  Once this is done, the\n\tpool will no longer "
-                   "be accessible on software that does not support\n\t"
-                   "feature flags.\n"));
-               break;
-
-       case ZPOOL_STATUS_VERSION_NEWER:
-               (void) printf(gettext("status: The pool has been upgraded to a "
-                   "newer, incompatible on-disk version.\n\tThe pool cannot "
-                   "be accessed on this system.\n"));
-               (void) printf(gettext("action: Access the pool from a system "
-                   "running more recent software, or\n\trestore the pool from "
-                   "backup.\n"));
-               break;
-
-       case ZPOOL_STATUS_FEAT_DISABLED:
-               (void) printf(gettext("status: Some supported features are not "
-                   "enabled on the pool. The pool can\n\tstill be used, but "
-                   "some features are unavailable.\n"));
-               (void) printf(gettext("action: Enable all features using "
-                   "'zpool upgrade'. Once this is done,\n\tthe pool may no "
-                   "longer be accessible by software that does not support\n\t"
-                   "the features. See zpool-features(5) for details.\n"));
-               break;
-
-       case ZPOOL_STATUS_UNSUP_FEAT_READ:
-               (void) printf(gettext("status: The pool cannot be accessed on "
-                   "this system because it uses the\n\tfollowing feature(s) "
-                   "not supported on this system:\n"));
-               zpool_print_unsup_feat(config);
-               (void) printf("\n");
-               (void) printf(gettext("action: Access the pool from a system "
-                   "that supports the required feature(s),\n\tor restore the "
-                   "pool from backup.\n"));
-               break;
-
-       case ZPOOL_STATUS_UNSUP_FEAT_WRITE:
-               (void) printf(gettext("status: The pool can only be accessed "
-                   "in read-only mode on this system. It\n\tcannot be "
-                   "accessed in read-write mode because it uses the "
-                   "following\n\tfeature(s) not supported on this system:\n"));
-               zpool_print_unsup_feat(config);
-               (void) printf("\n");
-               (void) printf(gettext("action: The pool cannot be accessed in "
-                   "read-write mode. Import the pool with\n"
-                   "\t\"-o readonly=on\", access the pool from a system that "
-                   "supports the\n\trequired feature(s), or restore the "
-                   "pool from backup.\n"));
-               break;
-
-       case ZPOOL_STATUS_FAULTED_DEV_R:
-               (void) printf(gettext("status: One or more devices are "
-                   "faulted in response to persistent errors.\n\tSufficient "
-                   "replicas exist for the pool to continue functioning "
-                   "in a\n\tdegraded state.\n"));
-               (void) printf(gettext("action: Replace the faulted device, "
-                   "or use 'zpool clear' to mark the device\n\trepaired.\n"));
-               break;
-
-       case ZPOOL_STATUS_FAULTED_DEV_NR:
-               (void) printf(gettext("status: One or more devices are "
-                   "faulted in response to persistent errors.  There are "
-                   "insufficient replicas for the pool to\n\tcontinue "
-                   "functioning.\n"));
-               (void) printf(gettext("action: Destroy and re-create the pool "
-                   "from a backup source.  Manually marking the device\n"
-                   "\trepaired using 'zpool clear' may allow some data "
-                   "to be recovered.\n"));
-               break;
-
-       case ZPOOL_STATUS_IO_FAILURE_WAIT:
-       case ZPOOL_STATUS_IO_FAILURE_CONTINUE:
-               (void) printf(gettext("status: One or more devices are "
-                   "faulted in response to IO failures.\n"));
-               (void) printf(gettext("action: Make sure the affected devices "
-                   "are connected, then run 'zpool clear'.\n"));
-               break;
-
-       case ZPOOL_STATUS_BAD_LOG:
-               (void) printf(gettext("status: An intent log record "
-                   "could not be read.\n"
-                   "\tWaiting for adminstrator intervention to fix the "
-                   "faulted pool.\n"));
-               (void) printf(gettext("action: Either restore the affected "
-                   "device(s) and run 'zpool online',\n"
-                   "\tor ignore the intent log records by running "
-                   "'zpool clear'.\n"));
-               break;
-
-       case ZPOOL_STATUS_HOSTID_MISMATCH:
-               (void) printf(gettext("status: Mismatch between pool hostid "
-                   "and system hostid on imported pool.\n\tThis pool was "
-                   "previously imported into a system with a different "
-                   "hostid,\n\tand then was verbatim imported into this "
-                   "system.\n"));
-               (void) printf(gettext("action: Export this pool on all systems "
-                   "on which it is imported.\n"
-                   "\tThen import it to correct the mismatch.\n"));
-               break;
-
-       case ZPOOL_STATUS_ERRATA:
-               (void) printf(gettext("status: Errata #%d detected.\n"),
-                   errata);
-
-               switch (errata) {
-               case ZPOOL_ERRATA_NONE:
-                       break;
-
-               case ZPOOL_ERRATA_ZOL_2094_SCRUB:
-                       (void) printf(gettext("action: To correct the issue "
-                           "run 'zpool scrub'.\n"));
-                       break;
-
-               default:
-                       /*
-                        * All errata which allow the pool to be imported
-                        * must contain an action message.
-                        */
-                       assert(0);
-               }
-               break;
-
-       default:
-               /*
-                * The remaining errors can't actually be generated, yet.
-                */
-               assert(reason == ZPOOL_STATUS_OK);
-       }
-
-       if (msgid != NULL)
-               (void) printf(gettext("   see: http://zfsonlinux.org/msg/%s\n"),
-                   msgid);
-
-       if (config != NULL) {
-               int namewidth;
-               uint64_t nerr;
-               nvlist_t **spares, **l2cache;
-               uint_t nspares, nl2cache;
-               pool_scan_stat_t *ps = NULL;
-
-               (void) nvlist_lookup_uint64_array(nvroot,
-                   ZPOOL_CONFIG_SCAN_STATS, (uint64_t **)&ps, &c);
-               print_scan_status(ps);
-
-               namewidth = max_width(zhp, nvroot, 0, 0);
-               if (namewidth < 10)
-                       namewidth = 10;
-
-               (void) printf(gettext("config:\n\n"));
-               (void) printf(gettext("\t%-*s  %-8s %5s %5s %5s\n"), namewidth,
-                   "NAME", "STATE", "READ", "WRITE", "CKSUM");
-               print_status_config(zhp, zpool_get_name(zhp), nvroot,
-                   namewidth, 0, B_FALSE);
-
-               if (num_logs(nvroot) > 0)
-                       print_logs(zhp, nvroot, namewidth, B_TRUE);
-               if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
-                   &l2cache, &nl2cache) == 0)
-                       print_l2cache(zhp, l2cache, nl2cache, namewidth);
-
-               if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
-                   &spares, &nspares) == 0)
-                       print_spares(zhp, spares, nspares, namewidth);
-
-               if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_ERRCOUNT,
-                   &nerr) == 0) {
-                       nvlist_t *nverrlist = NULL;
-
-                       /*
-                        * If the approximate error count is small, get a
-                        * precise count by fetching the entire log and
-                        * uniquifying the results.
-                        */
-                       if (nerr > 0 && nerr < 100 && !cbp->cb_verbose &&
-                           zpool_get_errlog(zhp, &nverrlist) == 0) {
-                               nvpair_t *elem;
-
-                               elem = NULL;
-                               nerr = 0;
-                               while ((elem = nvlist_next_nvpair(nverrlist,
-                                   elem)) != NULL) {
-                                       nerr++;
-                               }
-                       }
-                       nvlist_free(nverrlist);
-
-                       (void) printf("\n");
-
-                       if (nerr == 0)
-                               (void) printf(gettext("errors: No known data "
-                                   "errors\n"));
-                       else if (!cbp->cb_verbose)
-                               (void) printf(gettext("errors: %llu data "
-                                   "errors, use '-v' for a list\n"),
-                                   (u_longlong_t)nerr);
-                       else
-                               print_error_log(zhp);
-               }
-
-               if (cbp->cb_dedup_stats)
-                       print_dedup_stats(config);
-       } else {
-               (void) printf(gettext("config: The configuration cannot be "
-                   "determined.\n"));
-       }
-
-       return (0);
-}
-
-/*
- * zpool status [-vx] [-T d|u] [pool] ... [interval [count]]
- *
- *     -v      Display complete error logs
- *     -x      Display only pools with potential problems
- *     -D      Display dedup status (undocumented)
- *     -T      Display a timestamp in date(1) or Unix format
- *
- * Describes the health status of all pools or some subset.
- */
-int
-zpool_do_status(int argc, char **argv)
-{
-       int c;
-       int ret;
-       unsigned long interval = 0, count = 0;
-       status_cbdata_t cb = { 0 };
-
-       /* check options */
-       while ((c = getopt(argc, argv, "vxDT:")) != -1) {
-               switch (c) {
-               case 'v':
-                       cb.cb_verbose = B_TRUE;
-                       break;
-               case 'x':
-                       cb.cb_explain = B_TRUE;
-                       break;
-               case 'D':
-                       cb.cb_dedup_stats = B_TRUE;
-                       break;
-               case 'T':
-                       get_timestamp_arg(*optarg);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       get_interval_count(&argc, argv, &interval, &count);
-
-       if (argc == 0)
-               cb.cb_allpools = B_TRUE;
-
-       cb.cb_first = B_TRUE;
-
-       for (;;) {
-               if (timestamp_fmt != NODATE)
-                       print_timestamp(timestamp_fmt);
-
-               ret = for_each_pool(argc, argv, B_TRUE, NULL,
-                   status_callback, &cb);
-
-               if (argc == 0 && cb.cb_count == 0)
-                       (void) fprintf(stderr, gettext("no pools available\n"));
-               else if (cb.cb_explain && cb.cb_first && cb.cb_allpools)
-                       (void) printf(gettext("all pools are healthy\n"));
-
-               if (ret != 0)
-                       return (ret);
-
-               if (interval == 0)
-                       break;
-
-               if (count != 0 && --count == 0)
-                       break;
-
-               (void) sleep(interval);
-       }
-
-       return (0);
-}
-
-typedef struct upgrade_cbdata {
-       int     cb_first;
-       int     cb_argc;
-       uint64_t cb_version;
-       char    **cb_argv;
-} upgrade_cbdata_t;
-
-static int
-check_unsupp_fs(zfs_handle_t *zhp, void *unsupp_fs)
-{
-       int zfs_version = (int) zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
-       int *count = (int *)unsupp_fs;
-
-       if (zfs_version > ZPL_VERSION) {
-               (void) printf(gettext("%s (v%d) is not supported by this "
-                   "implementation of ZFS.\n"),
-                   zfs_get_name(zhp), zfs_version);
-               (*count)++;
-       }
-
-       zfs_iter_filesystems(zhp, check_unsupp_fs, unsupp_fs);
-
-       zfs_close(zhp);
-
-       return (0);
-}
-
-static int
-upgrade_version(zpool_handle_t *zhp, uint64_t version)
-{
-       int ret;
-       nvlist_t *config;
-       uint64_t oldversion;
-       int unsupp_fs = 0;
-
-       config = zpool_get_config(zhp, NULL);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
-           &oldversion) == 0);
-
-       assert(SPA_VERSION_IS_SUPPORTED(oldversion));
-       assert(oldversion < version);
-
-       ret = zfs_iter_root(zpool_get_handle(zhp), check_unsupp_fs, &unsupp_fs);
-       if (ret != 0)
-               return (ret);
-
-       if (unsupp_fs) {
-               (void) fprintf(stderr, gettext("Upgrade not performed due "
-                   "to %d unsupported filesystems (max v%d).\n"),
-                   unsupp_fs, (int) ZPL_VERSION);
-               return (1);
-       }
-
-       ret = zpool_upgrade(zhp, version);
-       if (ret != 0)
-               return (ret);
-
-       if (version >= SPA_VERSION_FEATURES) {
-               (void) printf(gettext("Successfully upgraded "
-                   "'%s' from version %llu to feature flags.\n"),
-                   zpool_get_name(zhp), (u_longlong_t) oldversion);
-       } else {
-               (void) printf(gettext("Successfully upgraded "
-                   "'%s' from version %llu to version %llu.\n"),
-                   zpool_get_name(zhp), (u_longlong_t) oldversion,
-                   (u_longlong_t) version);
-       }
-
-       return (0);
-}
-
-static int
-upgrade_enable_all(zpool_handle_t *zhp, int *countp)
-{
-       int i, ret, count;
-       boolean_t firstff = B_TRUE;
-       nvlist_t *enabled = zpool_get_features(zhp);
-
-       count = 0;
-       for (i = 0; i < SPA_FEATURES; i++) {
-               const char *fname = spa_feature_table[i].fi_uname;
-               const char *fguid = spa_feature_table[i].fi_guid;
-               if (!nvlist_exists(enabled, fguid)) {
-                       char *propname;
-                       verify(-1 != asprintf(&propname, "feature@%s", fname));
-                       ret = zpool_set_prop(zhp, propname,
-                           ZFS_FEATURE_ENABLED);
-                       if (ret != 0) {
-                               free(propname);
-                               return (ret);
-                       }
-                       count++;
-
-                       if (firstff) {
-                               (void) printf(gettext("Enabled the "
-                                   "following features on '%s':\n"),
-                                   zpool_get_name(zhp));
-                               firstff = B_FALSE;
-                       }
-                       (void) printf(gettext("  %s\n"), fname);
-                       free(propname);
-               }
-       }
-
-       if (countp != NULL)
-               *countp = count;
-       return (0);
-}
-
-static int
-upgrade_cb(zpool_handle_t *zhp, void *arg)
-{
-       upgrade_cbdata_t *cbp = arg;
-       nvlist_t *config;
-       uint64_t version;
-       boolean_t printnl = B_FALSE;
-       int ret;
-
-       config = zpool_get_config(zhp, NULL);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
-           &version) == 0);
-
-       assert(SPA_VERSION_IS_SUPPORTED(version));
-
-       if (version < cbp->cb_version) {
-               cbp->cb_first = B_FALSE;
-               ret = upgrade_version(zhp, cbp->cb_version);
-               if (ret != 0)
-                       return (ret);
-               printnl = B_TRUE;
-
-               /*
-                * If they did "zpool upgrade -a", then we could
-                * be doing ioctls to different pools.  We need
-                * to log this history once to each pool, and bypass
-                * the normal history logging that happens in main().
-                */
-               (void) zpool_log_history(g_zfs, history_str);
-               log_history = B_FALSE;
-       }
-
-       if (cbp->cb_version >= SPA_VERSION_FEATURES) {
-               int count;
-               ret = upgrade_enable_all(zhp, &count);
-               if (ret != 0)
-                       return (ret);
-
-               if (count > 0) {
-                       cbp->cb_first = B_FALSE;
-                       printnl = B_TRUE;
-               }
-       }
-
-       if (printnl) {
-               (void) printf(gettext("\n"));
-       }
-
-       return (0);
-}
-
-static int
-upgrade_list_older_cb(zpool_handle_t *zhp, void *arg)
-{
-       upgrade_cbdata_t *cbp = arg;
-       nvlist_t *config;
-       uint64_t version;
-
-       config = zpool_get_config(zhp, NULL);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
-           &version) == 0);
-
-       assert(SPA_VERSION_IS_SUPPORTED(version));
-
-       if (version < SPA_VERSION_FEATURES) {
-               if (cbp->cb_first) {
-                       (void) printf(gettext("The following pools are "
-                           "formatted with legacy version numbers and can\n"
-                           "be upgraded to use feature flags.  After "
-                           "being upgraded, these pools\nwill no "
-                           "longer be accessible by software that does not "
-                           "support feature\nflags.\n\n"));
-                       (void) printf(gettext("VER  POOL\n"));
-                       (void) printf(gettext("---  ------------\n"));
-                       cbp->cb_first = B_FALSE;
-               }
-
-               (void) printf("%2llu   %s\n", (u_longlong_t)version,
-                   zpool_get_name(zhp));
-       }
-
-       return (0);
-}
-
-static int
-upgrade_list_disabled_cb(zpool_handle_t *zhp, void *arg)
-{
-       upgrade_cbdata_t *cbp = arg;
-       nvlist_t *config;
-       uint64_t version;
-
-       config = zpool_get_config(zhp, NULL);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
-           &version) == 0);
-
-       if (version >= SPA_VERSION_FEATURES) {
-               int i;
-               boolean_t poolfirst = B_TRUE;
-               nvlist_t *enabled = zpool_get_features(zhp);
-
-               for (i = 0; i < SPA_FEATURES; i++) {
-                       const char *fguid = spa_feature_table[i].fi_guid;
-                       const char *fname = spa_feature_table[i].fi_uname;
-                       if (!nvlist_exists(enabled, fguid)) {
-                               if (cbp->cb_first) {
-                                       (void) printf(gettext("\nSome "
-                                           "supported features are not "
-                                           "enabled on the following pools. "
-                                           "Once a\nfeature is enabled the "
-                                           "pool may become incompatible with "
-                                           "software\nthat does not support "
-                                           "the feature. See "
-                                           "zpool-features(5) for "
-                                           "details.\n\n"));
-                                       (void) printf(gettext("POOL  "
-                                           "FEATURE\n"));
-                                       (void) printf(gettext("------"
-                                           "---------\n"));
-                                       cbp->cb_first = B_FALSE;
-                               }
-
-                               if (poolfirst) {
-                                       (void) printf(gettext("%s\n"),
-                                           zpool_get_name(zhp));
-                                       poolfirst = B_FALSE;
-                               }
-
-                               (void) printf(gettext("      %s\n"), fname);
-                       }
-                       /*
-                        * If they did "zpool upgrade -a", then we could
-                        * be doing ioctls to different pools.  We need
-                        * to log this history once to each pool, and bypass
-                        * the normal history logging that happens in main().
-                        */
-                       (void) zpool_log_history(g_zfs, history_str);
-                       log_history = B_FALSE;
-               }
-       }
-
-       return (0);
-}
-
-/* ARGSUSED */
-static int
-upgrade_one(zpool_handle_t *zhp, void *data)
-{
-       boolean_t printnl = B_FALSE;
-       upgrade_cbdata_t *cbp = data;
-       uint64_t cur_version;
-       int ret;
-
-       if (strcmp("log", zpool_get_name(zhp)) == 0) {
-               (void) fprintf(stderr, gettext("'log' is now a reserved word\n"
-                   "Pool 'log' must be renamed using export and import"
-                   " to upgrade.\n"));
-               return (1);
-       }
-
-       cur_version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL);
-       if (cur_version > cbp->cb_version) {
-               (void) printf(gettext("Pool '%s' is already formatted "
-                   "using more current version '%llu'.\n\n"),
-                   zpool_get_name(zhp), (u_longlong_t) cur_version);
-               return (0);
-       }
-
-       if (cbp->cb_version != SPA_VERSION && cur_version == cbp->cb_version) {
-               (void) printf(gettext("Pool '%s' is already formatted "
-                   "using version %llu.\n\n"), zpool_get_name(zhp),
-                   (u_longlong_t) cbp->cb_version);
-               return (0);
-       }
-
-       if (cur_version != cbp->cb_version) {
-               printnl = B_TRUE;
-               ret = upgrade_version(zhp, cbp->cb_version);
-               if (ret != 0)
-                       return (ret);
-       }
-
-       if (cbp->cb_version >= SPA_VERSION_FEATURES) {
-               int count = 0;
-               ret = upgrade_enable_all(zhp, &count);
-               if (ret != 0)
-                       return (ret);
-
-               if (count != 0) {
-                       printnl = B_TRUE;
-               } else if (cur_version == SPA_VERSION) {
-                       (void) printf(gettext("Pool '%s' already has all "
-                           "supported features enabled.\n"),
-                           zpool_get_name(zhp));
-               }
-       }
-
-       if (printnl) {
-               (void) printf(gettext("\n"));
-       }
-
-       return (0);
-}
-
-/*
- * zpool upgrade
- * zpool upgrade -v
- * zpool upgrade [-V version] <-a | pool ...>
- *
- * With no arguments, display downrev'd ZFS pool available for upgrade.
- * Individual pools can be upgraded by specifying the pool, and '-a' will
- * upgrade all pools.
- */
-int
-zpool_do_upgrade(int argc, char **argv)
-{
-       int c;
-       upgrade_cbdata_t cb = { 0 };
-       int ret = 0;
-       boolean_t showversions = B_FALSE;
-       boolean_t upgradeall = B_FALSE;
-       char *end;
-
-
-       /* check options */
-       while ((c = getopt(argc, argv, ":avV:")) != -1) {
-               switch (c) {
-               case 'a':
-                       upgradeall = B_TRUE;
-                       break;
-               case 'v':
-                       showversions = B_TRUE;
-                       break;
-               case 'V':
-                       cb.cb_version = strtoll(optarg, &end, 10);
-                       if (*end != '\0' ||
-                           !SPA_VERSION_IS_SUPPORTED(cb.cb_version)) {
-                               (void) fprintf(stderr,
-                                   gettext("invalid version '%s'\n"), optarg);
-                               usage(B_FALSE);
-                       }
-                       break;
-               case ':':
-                       (void) fprintf(stderr, gettext("missing argument for "
-                           "'%c' option\n"), optopt);
-                       usage(B_FALSE);
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       cb.cb_argc = argc;
-       cb.cb_argv = argv;
-       argc -= optind;
-       argv += optind;
-
-       if (cb.cb_version == 0) {
-               cb.cb_version = SPA_VERSION;
-       } else if (!upgradeall && argc == 0) {
-               (void) fprintf(stderr, gettext("-V option is "
-                   "incompatible with other arguments\n"));
-               usage(B_FALSE);
-       }
-
-       if (showversions) {
-               if (upgradeall || argc != 0) {
-                       (void) fprintf(stderr, gettext("-v option is "
-                           "incompatible with other arguments\n"));
-                       usage(B_FALSE);
-               }
-       } else if (upgradeall) {
-               if (argc != 0) {
-                       (void) fprintf(stderr, gettext("-a option should not "
-                           "be used along with a pool name\n"));
-                       usage(B_FALSE);
-               }
-       }
-
-       (void) printf(gettext("This system supports ZFS pool feature "
-           "flags.\n\n"));
-       if (showversions) {
-               int i;
-
-               (void) printf(gettext("The following features are "
-                   "supported:\n\n"));
-               (void) printf(gettext("FEAT DESCRIPTION\n"));
-               (void) printf("----------------------------------------------"
-                   "---------------\n");
-               for (i = 0; i < SPA_FEATURES; i++) {
-                       zfeature_info_t *fi = &spa_feature_table[i];
-                       const char *ro = fi->fi_can_readonly ?
-                           " (read-only compatible)" : "";
-
-                       (void) printf("%-37s%s\n", fi->fi_uname, ro);
-                       (void) printf("     %s\n", fi->fi_desc);
-               }
-               (void) printf("\n");
-
-               (void) printf(gettext("The following legacy versions are also "
-                   "supported:\n\n"));
-               (void) printf(gettext("VER  DESCRIPTION\n"));
-               (void) printf("---  -----------------------------------------"
-                   "---------------\n");
-               (void) printf(gettext(" 1   Initial ZFS version\n"));
-               (void) printf(gettext(" 2   Ditto blocks "
-                   "(replicated metadata)\n"));
-               (void) printf(gettext(" 3   Hot spares and double parity "
-                   "RAID-Z\n"));
-               (void) printf(gettext(" 4   zpool history\n"));
-               (void) printf(gettext(" 5   Compression using the gzip "
-                   "algorithm\n"));
-               (void) printf(gettext(" 6   bootfs pool property\n"));
-               (void) printf(gettext(" 7   Separate intent log devices\n"));
-               (void) printf(gettext(" 8   Delegated administration\n"));
-               (void) printf(gettext(" 9   refquota and refreservation "
-                   "properties\n"));
-               (void) printf(gettext(" 10  Cache devices\n"));
-               (void) printf(gettext(" 11  Improved scrub performance\n"));
-               (void) printf(gettext(" 12  Snapshot properties\n"));
-               (void) printf(gettext(" 13  snapused property\n"));
-               (void) printf(gettext(" 14  passthrough-x aclinherit\n"));
-               (void) printf(gettext(" 15  user/group space accounting\n"));
-               (void) printf(gettext(" 16  stmf property support\n"));
-               (void) printf(gettext(" 17  Triple-parity RAID-Z\n"));
-               (void) printf(gettext(" 18  Snapshot user holds\n"));
-               (void) printf(gettext(" 19  Log device removal\n"));
-               (void) printf(gettext(" 20  Compression using zle "
-                   "(zero-length encoding)\n"));
-               (void) printf(gettext(" 21  Deduplication\n"));
-               (void) printf(gettext(" 22  Received properties\n"));
-               (void) printf(gettext(" 23  Slim ZIL\n"));
-               (void) printf(gettext(" 24  System attributes\n"));
-               (void) printf(gettext(" 25  Improved scrub stats\n"));
-               (void) printf(gettext(" 26  Improved snapshot deletion "
-                   "performance\n"));
-               (void) printf(gettext(" 27  Improved snapshot creation "
-                   "performance\n"));
-               (void) printf(gettext(" 28  Multiple vdev replacements\n"));
-               (void) printf(gettext("\nFor more information on a particular "
-                   "version, including supported releases,\n"));
-               (void) printf(gettext("see the ZFS Administration Guide.\n\n"));
-       } else if (argc == 0 && upgradeall) {
-               cb.cb_first = B_TRUE;
-               ret = zpool_iter(g_zfs, upgrade_cb, &cb);
-               if (ret == 0 && cb.cb_first) {
-                       if (cb.cb_version == SPA_VERSION) {
-                               (void) printf(gettext("All pools are already "
-                                   "formatted using feature flags.\n\n"));
-                               (void) printf(gettext("Every feature flags "
-                                   "pool already has all supported features "
-                                   "enabled.\n"));
-                       } else {
-                               (void) printf(gettext("All pools are already "
-                                   "formatted with version %llu or higher.\n"),
-                                   (u_longlong_t) cb.cb_version);
-                       }
-               }
-       } else if (argc == 0) {
-               cb.cb_first = B_TRUE;
-               ret = zpool_iter(g_zfs, upgrade_list_older_cb, &cb);
-               assert(ret == 0);
-
-               if (cb.cb_first) {
-                       (void) printf(gettext("All pools are formatted "
-                           "using feature flags.\n\n"));
-               } else {
-                       (void) printf(gettext("\nUse 'zpool upgrade -v' "
-                           "for a list of available legacy versions.\n"));
-               }
-
-               cb.cb_first = B_TRUE;
-               ret = zpool_iter(g_zfs, upgrade_list_disabled_cb, &cb);
-               assert(ret == 0);
-
-               if (cb.cb_first) {
-                       (void) printf(gettext("Every feature flags pool has "
-                           "all supported features enabled.\n"));
-               } else {
-                       (void) printf(gettext("\n"));
-               }
-       } else {
-               ret = for_each_pool(argc, argv, B_FALSE, NULL,
-                   upgrade_one, &cb);
-       }
-
-       return (ret);
-}
-
-typedef struct hist_cbdata {
-       boolean_t first;
-       boolean_t longfmt;
-       boolean_t internal;
-} hist_cbdata_t;
-
-/*
- * Print out the command history for a specific pool.
- */
-static int
-get_history_one(zpool_handle_t *zhp, void *data)
-{
-       nvlist_t *nvhis;
-       nvlist_t **records;
-       uint_t numrecords;
-       int ret, i;
-       hist_cbdata_t *cb = (hist_cbdata_t *)data;
-
-       cb->first = B_FALSE;
-
-       (void) printf(gettext("History for '%s':\n"), zpool_get_name(zhp));
-
-       if ((ret = zpool_get_history(zhp, &nvhis)) != 0)
-               return (ret);
-
-       verify(nvlist_lookup_nvlist_array(nvhis, ZPOOL_HIST_RECORD,
-           &records, &numrecords) == 0);
-       for (i = 0; i < numrecords; i++) {
-               nvlist_t *rec = records[i];
-               char tbuf[30] = "";
-
-               if (nvlist_exists(rec, ZPOOL_HIST_TIME)) {
-                       time_t tsec;
-                       struct tm t;
-
-                       tsec = fnvlist_lookup_uint64(records[i],
-                           ZPOOL_HIST_TIME);
-                       (void) localtime_r(&tsec, &t);
-                       (void) strftime(tbuf, sizeof (tbuf), "%F.%T", &t);
-               }
-
-               if (nvlist_exists(rec, ZPOOL_HIST_CMD)) {
-                       (void) printf("%s %s", tbuf,
-                           fnvlist_lookup_string(rec, ZPOOL_HIST_CMD));
-               } else if (nvlist_exists(rec, ZPOOL_HIST_INT_EVENT)) {
-                       int ievent =
-                           fnvlist_lookup_uint64(rec, ZPOOL_HIST_INT_EVENT);
-                       if (!cb->internal)
-                               continue;
-                       if (ievent >= ZFS_NUM_LEGACY_HISTORY_EVENTS) {
-                               (void) printf("%s unrecognized record:\n",
-                                   tbuf);
-                               dump_nvlist(rec, 4);
-                               continue;
-                       }
-                       (void) printf("%s [internal %s txg:%lld] %s", tbuf,
-                           zfs_history_event_names[ievent],
-                           (longlong_t) fnvlist_lookup_uint64(
-                           rec, ZPOOL_HIST_TXG),
-                           fnvlist_lookup_string(rec, ZPOOL_HIST_INT_STR));
-               } else if (nvlist_exists(rec, ZPOOL_HIST_INT_NAME)) {
-                       if (!cb->internal)
-                               continue;
-                       (void) printf("%s [txg:%lld] %s", tbuf,
-                           (longlong_t) fnvlist_lookup_uint64(
-                           rec, ZPOOL_HIST_TXG),
-                           fnvlist_lookup_string(rec, ZPOOL_HIST_INT_NAME));
-                       if (nvlist_exists(rec, ZPOOL_HIST_DSNAME)) {
-                               (void) printf(" %s (%llu)",
-                                   fnvlist_lookup_string(rec,
-                                   ZPOOL_HIST_DSNAME),
-                                   (u_longlong_t)fnvlist_lookup_uint64(rec,
-                                   ZPOOL_HIST_DSID));
-                       }
-                       (void) printf(" %s", fnvlist_lookup_string(rec,
-                           ZPOOL_HIST_INT_STR));
-               } else if (nvlist_exists(rec, ZPOOL_HIST_IOCTL)) {
-                       if (!cb->internal)
-                               continue;
-                       (void) printf("%s ioctl %s\n", tbuf,
-                           fnvlist_lookup_string(rec, ZPOOL_HIST_IOCTL));
-                       if (nvlist_exists(rec, ZPOOL_HIST_INPUT_NVL)) {
-                               (void) printf("    input:\n");
-                               dump_nvlist(fnvlist_lookup_nvlist(rec,
-                                   ZPOOL_HIST_INPUT_NVL), 8);
-                       }
-                       if (nvlist_exists(rec, ZPOOL_HIST_OUTPUT_NVL)) {
-                               (void) printf("    output:\n");
-                               dump_nvlist(fnvlist_lookup_nvlist(rec,
-                                   ZPOOL_HIST_OUTPUT_NVL), 8);
-                       }
-               } else {
-                       if (!cb->internal)
-                               continue;
-                       (void) printf("%s unrecognized record:\n", tbuf);
-                       dump_nvlist(rec, 4);
-               }
-
-               if (!cb->longfmt) {
-                       (void) printf("\n");
-                       continue;
-               }
-               (void) printf(" [");
-               if (nvlist_exists(rec, ZPOOL_HIST_WHO)) {
-                       uid_t who = fnvlist_lookup_uint64(rec, ZPOOL_HIST_WHO);
-                       struct passwd *pwd = getpwuid(who);
-                       (void) printf("user %d ", (int)who);
-                       if (pwd != NULL)
-                               (void) printf("(%s) ", pwd->pw_name);
-               }
-               if (nvlist_exists(rec, ZPOOL_HIST_HOST)) {
-                       (void) printf("on %s",
-                           fnvlist_lookup_string(rec, ZPOOL_HIST_HOST));
-               }
-               if (nvlist_exists(rec, ZPOOL_HIST_ZONE)) {
-                       (void) printf(":%s",
-                           fnvlist_lookup_string(rec, ZPOOL_HIST_ZONE));
-               }
-
-               (void) printf("]");
-               (void) printf("\n");
-       }
-       (void) printf("\n");
-       nvlist_free(nvhis);
-
-       return (ret);
-}
-
-/*
- * zpool history <pool>
- *
- * Displays the history of commands that modified pools.
- */
-int
-zpool_do_history(int argc, char **argv)
-{
-       hist_cbdata_t cbdata = { 0 };
-       int ret;
-       int c;
-
-       cbdata.first = B_TRUE;
-       /* check options */
-       while ((c = getopt(argc, argv, "li")) != -1) {
-               switch (c) {
-               case 'l':
-                       cbdata.longfmt = B_TRUE;
-                       break;
-               case 'i':
-                       cbdata.internal = B_TRUE;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-       argc -= optind;
-       argv += optind;
-
-       ret = for_each_pool(argc, argv, B_FALSE,  NULL, get_history_one,
-           &cbdata);
-
-       if (argc == 0 && cbdata.first == B_TRUE) {
-               (void) fprintf(stderr, gettext("no pools available\n"));
-               return (0);
-       }
-
-       return (ret);
-}
-
-typedef struct ev_opts {
-       int verbose;
-       int scripted;
-       int follow;
-       int clear;
-} ev_opts_t;
-
-static void
-zpool_do_events_short(nvlist_t *nvl)
-{
-       char ctime_str[26], str[32], *ptr;
-       int64_t *tv;
-       uint_t n;
-
-       verify(nvlist_lookup_int64_array(nvl, FM_EREPORT_TIME, &tv, &n) == 0);
-       memset(str, ' ', 32);
-       (void) ctime_r((const time_t *)&tv[0], ctime_str);
-       (void) strncpy(str, ctime_str+4,  6);           /* 'Jun 30' */
-       (void) strncpy(str+7, ctime_str+20, 4);         /* '1993' */
-       (void) strncpy(str+12, ctime_str+11, 8);        /* '21:49:08' */
-       (void) sprintf(str+20, ".%09lld", (longlong_t)tv[1]); /* '.123456789' */
-       (void) printf(gettext("%s "), str);
-
-       verify(nvlist_lookup_string(nvl, FM_CLASS, &ptr) == 0);
-       (void) printf(gettext("%s\n"), ptr);
-}
-
-static void
-zpool_do_events_nvprint(nvlist_t *nvl, int depth)
-{
-       nvpair_t *nvp;
-
-       for (nvp = nvlist_next_nvpair(nvl, NULL);
-           nvp != NULL; nvp = nvlist_next_nvpair(nvl, nvp)) {
-
-               data_type_t type = nvpair_type(nvp);
-               const char *name = nvpair_name(nvp);
-
-               boolean_t b;
-               uint8_t i8;
-               uint16_t i16;
-               uint32_t i32;
-               uint64_t i64;
-               char *str;
-               nvlist_t *cnv;
-
-               printf(gettext("%*s%s = "), depth, "", name);
-
-               switch (type) {
-               case DATA_TYPE_BOOLEAN:
-                       printf(gettext("%s"), "1");
-                       break;
-
-               case DATA_TYPE_BOOLEAN_VALUE:
-                       (void) nvpair_value_boolean_value(nvp, &b);
-                       printf(gettext("%s"), b ? "1" : "0");
-                       break;
-
-               case DATA_TYPE_BYTE:
-                       (void) nvpair_value_byte(nvp, &i8);
-                       printf(gettext("0x%x"), i8);
-                       break;
-
-               case DATA_TYPE_INT8:
-                       (void) nvpair_value_int8(nvp, (void *)&i8);
-                       printf(gettext("0x%x"), i8);
-                       break;
-
-               case DATA_TYPE_UINT8:
-                       (void) nvpair_value_uint8(nvp, &i8);
-                       printf(gettext("0x%x"), i8);
-                       break;
-
-               case DATA_TYPE_INT16:
-                       (void) nvpair_value_int16(nvp, (void *)&i16);
-                       printf(gettext("0x%x"), i16);
-                       break;
-
-               case DATA_TYPE_UINT16:
-                       (void) nvpair_value_uint16(nvp, &i16);
-                       printf(gettext("0x%x"), i16);
-                       break;
-
-               case DATA_TYPE_INT32:
-                       (void) nvpair_value_int32(nvp, (void *)&i32);
-                       printf(gettext("0x%x"), i32);
-                       break;
-
-               case DATA_TYPE_UINT32:
-                       (void) nvpair_value_uint32(nvp, &i32);
-                       printf(gettext("0x%x"), i32);
-                       break;
-
-               case DATA_TYPE_INT64:
-                       (void) nvpair_value_int64(nvp, (void *)&i64);
-                       printf(gettext("0x%llx"), (u_longlong_t)i64);
-                       break;
-
-               case DATA_TYPE_UINT64:
-                       (void) nvpair_value_uint64(nvp, &i64);
-                       printf(gettext("0x%llx"), (u_longlong_t)i64);
-                       break;
-
-               case DATA_TYPE_HRTIME:
-                       (void) nvpair_value_hrtime(nvp, (void *)&i64);
-                       printf(gettext("0x%llx"), (u_longlong_t)i64);
-                       break;
-
-               case DATA_TYPE_STRING:
-                       (void) nvpair_value_string(nvp, &str);
-                       printf(gettext("\"%s\""), str ? str : "<NULL>");
-                       break;
-
-               case DATA_TYPE_NVLIST:
-                       printf(gettext("(embedded nvlist)\n"));
-                       (void) nvpair_value_nvlist(nvp, &cnv);
-                       zpool_do_events_nvprint(cnv, depth + 8);
-                       printf(gettext("%*s(end %s)"), depth, "", name);
-                       break;
-
-               case DATA_TYPE_NVLIST_ARRAY: {
-                       nvlist_t **val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_nvlist_array(nvp, &val, &nelem);
-                       printf(gettext("(%d embedded nvlists)\n"), nelem);
-                       for (i = 0; i < nelem; i++) {
-                               printf(gettext("%*s%s[%d] = %s\n"),
-                                   depth, "", name, i, "(embedded nvlist)");
-                               zpool_do_events_nvprint(val[i], depth + 8);
-                               printf(gettext("%*s(end %s[%i])\n"),
-                                   depth, "", name, i);
-                       }
-                       printf(gettext("%*s(end %s)\n"), depth, "", name);
-                       }
-                       break;
-
-               case DATA_TYPE_INT8_ARRAY: {
-                       int8_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_int8_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%x "), val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_UINT8_ARRAY: {
-                       uint8_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_uint8_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%x "), val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_INT16_ARRAY: {
-                       int16_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_int16_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%x "), val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_UINT16_ARRAY: {
-                       uint16_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_uint16_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%x "), val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_INT32_ARRAY: {
-                       int32_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_int32_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%x "), val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_UINT32_ARRAY: {
-                       uint32_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_uint32_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%x "), val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_INT64_ARRAY: {
-                       int64_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_int64_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%llx "),
-                                   (u_longlong_t)val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_UINT64_ARRAY: {
-                       uint64_t *val;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_uint64_array(nvp, &val, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("0x%llx "),
-                                   (u_longlong_t)val[i]);
-
-                       break;
-                       }
-
-               case DATA_TYPE_STRING_ARRAY: {
-                       char **str;
-                       uint_t i, nelem;
-
-                       (void) nvpair_value_string_array(nvp, &str, &nelem);
-                       for (i = 0; i < nelem; i++)
-                               printf(gettext("\"%s\" "),
-                                   str[i] ? str[i] : "<NULL>");
-
-                       break;
-                       }
-
-               case DATA_TYPE_BOOLEAN_ARRAY:
-               case DATA_TYPE_BYTE_ARRAY:
-               case DATA_TYPE_DOUBLE:
-               case DATA_TYPE_UNKNOWN:
-                       printf(gettext("<unknown>"));
-                       break;
-               }
-
-               printf(gettext("\n"));
-       }
-}
-
-static int
-zpool_do_events_next(ev_opts_t *opts)
-{
-       nvlist_t *nvl;
-       int zevent_fd, ret, dropped;
-
-       zevent_fd = open(ZFS_DEV, O_RDWR);
-       VERIFY(zevent_fd >= 0);
-
-       if (!opts->scripted)
-               (void) printf(gettext("%-30s %s\n"), "TIME", "CLASS");
-
-       while (1) {
-               ret = zpool_events_next(g_zfs, &nvl, &dropped,
-                   (opts->follow ? ZEVENT_NONE : ZEVENT_NONBLOCK), zevent_fd);
-               if (ret || nvl == NULL)
-                       break;
-
-               if (dropped > 0)
-                       (void) printf(gettext("dropped %d events\n"), dropped);
-
-               zpool_do_events_short(nvl);
-
-               if (opts->verbose) {
-                       zpool_do_events_nvprint(nvl, 8);
-                       printf(gettext("\n"));
-               }
-               (void) fflush(stdout);
-
-               nvlist_free(nvl);
-       }
-
-       VERIFY(0 == close(zevent_fd));
-
-       return (ret);
-}
-
-static int
-zpool_do_events_clear(ev_opts_t *opts)
-{
-       int count, ret;
-
-       ret = zpool_events_clear(g_zfs, &count);
-       if (!ret)
-               (void) printf(gettext("cleared %d events\n"), count);
-
-       return (ret);
-}
-
-/*
- * zpool events [-vfc]
- *
- * Displays events logs by ZFS.
- */
-int
-zpool_do_events(int argc, char **argv)
-{
-       ev_opts_t opts = { 0 };
-       int ret;
-       int c;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "vHfc")) != -1) {
-               switch (c) {
-               case 'v':
-                       opts.verbose = 1;
-                       break;
-               case 'H':
-                       opts.scripted = 1;
-                       break;
-               case 'f':
-                       opts.follow = 1;
-                       break;
-               case 'c':
-                       opts.clear = 1;
-                       break;
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-       argc -= optind;
-       argv += optind;
-
-       if (opts.clear)
-               ret = zpool_do_events_clear(&opts);
-       else
-               ret = zpool_do_events_next(&opts);
-
-       return (ret);
-}
-
-static int
-get_callback(zpool_handle_t *zhp, void *data)
-{
-       zprop_get_cbdata_t *cbp = (zprop_get_cbdata_t *)data;
-       char value[MAXNAMELEN];
-       zprop_source_t srctype;
-       zprop_list_t *pl;
-
-       for (pl = cbp->cb_proplist; pl != NULL; pl = pl->pl_next) {
-
-               /*
-                * Skip the special fake placeholder. This will also skip
-                * over the name property when 'all' is specified.
-                */
-               if (pl->pl_prop == ZPOOL_PROP_NAME &&
-                   pl == cbp->cb_proplist)
-                       continue;
-
-               if (pl->pl_prop == ZPROP_INVAL &&
-                   (zpool_prop_feature(pl->pl_user_prop) ||
-                   zpool_prop_unsupported(pl->pl_user_prop))) {
-                       srctype = ZPROP_SRC_LOCAL;
-
-                       if (zpool_prop_get_feature(zhp, pl->pl_user_prop,
-                           value, sizeof (value)) == 0) {
-                               zprop_print_one_property(zpool_get_name(zhp),
-                                   cbp, pl->pl_user_prop, value, srctype,
-                                   NULL, NULL);
-                       }
-               } else {
-                       if (zpool_get_prop_literal(zhp, pl->pl_prop, value,
-                           sizeof (value), &srctype, cbp->cb_literal) != 0)
-                               continue;
-
-                       zprop_print_one_property(zpool_get_name(zhp), cbp,
-                           zpool_prop_to_name(pl->pl_prop), value, srctype,
-                           NULL, NULL);
-               }
-       }
-       return (0);
-}
-
-int
-zpool_do_get(int argc, char **argv)
-{
-       zprop_get_cbdata_t cb = { 0 };
-       zprop_list_t fake_name = { 0 };
-       int c, ret;
-
-       /* check options */
-       while ((c = getopt(argc, argv, "pH")) != -1) {
-               switch (c) {
-               case 'p':
-                       cb.cb_literal = B_TRUE;
-                       break;
-
-               case 'H':
-                       cb.cb_scripted = B_TRUE;
-                       break;
-
-               case '?':
-                       (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                           optopt);
-                       usage(B_FALSE);
-               }
-       }
-
-       argc -= optind;
-       argv += optind;
-
-       if (argc < 1) {
-               (void) fprintf(stderr, gettext("missing property "
-                   "argument\n"));
-               usage(B_FALSE);
-       }
-
-       cb.cb_first = B_TRUE;
-       cb.cb_sources = ZPROP_SRC_ALL;
-       cb.cb_columns[0] = GET_COL_NAME;
-       cb.cb_columns[1] = GET_COL_PROPERTY;
-       cb.cb_columns[2] = GET_COL_VALUE;
-       cb.cb_columns[3] = GET_COL_SOURCE;
-       cb.cb_type = ZFS_TYPE_POOL;
-
-       if (zprop_get_list(g_zfs, argv[0], &cb.cb_proplist, ZFS_TYPE_POOL) != 0)
-               usage(B_FALSE);
-
-       argc--;
-       argv++;
-
-       if (cb.cb_proplist != NULL) {
-               fake_name.pl_prop = ZPOOL_PROP_NAME;
-               fake_name.pl_width = strlen(gettext("NAME"));
-               fake_name.pl_next = cb.cb_proplist;
-               cb.cb_proplist = &fake_name;
-       }
-
-       ret = for_each_pool(argc, argv, B_TRUE, &cb.cb_proplist,
-           get_callback, &cb);
-
-       if (cb.cb_proplist == &fake_name)
-               zprop_free_list(fake_name.pl_next);
-       else
-               zprop_free_list(cb.cb_proplist);
-
-       return (ret);
-}
-
-typedef struct set_cbdata {
-       char *cb_propname;
-       char *cb_value;
-       boolean_t cb_any_successful;
-} set_cbdata_t;
-
-int
-set_callback(zpool_handle_t *zhp, void *data)
-{
-       int error;
-       set_cbdata_t *cb = (set_cbdata_t *)data;
-
-       error = zpool_set_prop(zhp, cb->cb_propname, cb->cb_value);
-
-       if (!error)
-               cb->cb_any_successful = B_TRUE;
-
-       return (error);
-}
-
-int
-zpool_do_set(int argc, char **argv)
-{
-       set_cbdata_t cb = { 0 };
-       int error;
-
-       if (argc > 1 && argv[1][0] == '-') {
-               (void) fprintf(stderr, gettext("invalid option '%c'\n"),
-                   argv[1][1]);
-               usage(B_FALSE);
-       }
-
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing property=value "
-                   "argument\n"));
-               usage(B_FALSE);
-       }
-
-       if (argc < 3) {
-               (void) fprintf(stderr, gettext("missing pool name\n"));
-               usage(B_FALSE);
-       }
-
-       if (argc > 3) {
-               (void) fprintf(stderr, gettext("too many pool names\n"));
-               usage(B_FALSE);
-       }
-
-       cb.cb_propname = argv[1];
-       cb.cb_value = strchr(cb.cb_propname, '=');
-       if (cb.cb_value == NULL) {
-               (void) fprintf(stderr, gettext("missing value in "
-                   "property=value argument\n"));
-               usage(B_FALSE);
-       }
-
-       *(cb.cb_value) = '\0';
-       cb.cb_value++;
-
-       error = for_each_pool(argc - 2, argv + 2, B_TRUE, NULL,
-           set_callback, &cb);
-
-       return (error);
-}
-
-static int
-find_command_idx(char *command, int *idx)
-{
-       int i;
-
-       for (i = 0; i < NCOMMAND; i++) {
-               if (command_table[i].name == NULL)
-                       continue;
-
-               if (strcmp(command, command_table[i].name) == 0) {
-                       *idx = i;
-                       return (0);
-               }
-       }
-       return (1);
-}
-
-int
-main(int argc, char **argv)
-{
-       int ret;
-       int i = 0;
-       char *cmdname;
-
-       (void) setlocale(LC_ALL, "");
-       (void) textdomain(TEXT_DOMAIN);
-
-       dprintf_setup(&argc, argv);
-
-       opterr = 0;
-
-       /*
-        * Make sure the user has specified some command.
-        */
-       if (argc < 2) {
-               (void) fprintf(stderr, gettext("missing command\n"));
-               usage(B_FALSE);
-       }
-
-       cmdname = argv[1];
-
-       /*
-        * Special case '-?'
-        */
-       if ((strcmp(cmdname, "-?") == 0) || strcmp(cmdname, "--help") == 0)
-               usage(B_TRUE);
-
-       if ((g_zfs = libzfs_init()) == NULL) {
-               (void) fprintf(stderr, "%s", libzfs_error_init(errno));
-               return (1);
-       }
-
-       libzfs_print_on_error(g_zfs, B_TRUE);
-
-       zfs_save_arguments(argc, argv, history_str, sizeof (history_str));
-
-       /*
-        * Run the appropriate command.
-        */
-       if (find_command_idx(cmdname, &i) == 0) {
-               current_command = &command_table[i];
-               ret = command_table[i].func(argc - 1, argv + 1);
-       } else if (strchr(cmdname, '=')) {
-               verify(find_command_idx("set", &i) == 0);
-               current_command = &command_table[i];
-               ret = command_table[i].func(argc, argv);
-       } else if (strcmp(cmdname, "freeze") == 0 && argc == 3) {
-               /*
-                * 'freeze' is a vile debugging abomination, so we treat
-                * it as such.
-                */
-               char buf[16384];
-               int fd = open(ZFS_DEV, O_RDWR);
-               (void) strcpy((void *)buf, argv[2]);
-               return (!!ioctl(fd, ZFS_IOC_POOL_FREEZE, buf));
-       } else {
-               (void) fprintf(stderr, gettext("unrecognized "
-                   "command '%s'\n"), cmdname);
-               usage(B_FALSE);
-               ret = 1;
-       }
-
-       if (ret == 0 && log_history)
-               (void) zpool_log_history(g_zfs, history_str);
-
-       libzfs_fini(g_zfs);
-
-       /*
-        * The 'ZFS_ABORT' environment variable causes us to dump core on exit
-        * for the purposes of running ::findleaks.
-        */
-       if (getenv("ZFS_ABORT") != NULL) {
-               (void) printf("dumping core by request\n");
-               abort();
-       }
-
-       return (ret);
-}
diff --git a/zfs/cmd/zpool/zpool_util.c b/zfs/cmd/zpool/zpool_util.c
deleted file mode 100644 (file)
index c7a002e..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <errno.h>
-#include <libgen.h>
-#include <libintl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-
-#include "zpool_util.h"
-
-/*
- * Utility function to guarantee malloc() success.
- */
-void *
-safe_malloc(size_t size)
-{
-       void *data;
-
-       if ((data = calloc(1, size)) == NULL) {
-               (void) fprintf(stderr, "internal error: out of memory\n");
-               exit(1);
-       }
-
-       return (data);
-}
-
-/*
- * Display an out of memory error message and abort the current program.
- */
-void
-zpool_no_memory(void)
-{
-       assert(errno == ENOMEM);
-       (void) fprintf(stderr,
-           gettext("internal error: out of memory\n"));
-       exit(1);
-}
-
-/*
- * Return the number of logs in supplied nvlist
- */
-uint_t
-num_logs(nvlist_t *nv)
-{
-       uint_t nlogs = 0;
-       uint_t c, children;
-       nvlist_t **child;
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               return (0);
-
-       for (c = 0; c < children; c++) {
-               uint64_t is_log = B_FALSE;
-
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-                   &is_log);
-               if (is_log)
-                       nlogs++;
-       }
-       return (nlogs);
-}
diff --git a/zfs/cmd/zpool/zpool_util.h b/zfs/cmd/zpool/zpool_util.h
deleted file mode 100644 (file)
index 1b4ce51..0000000
+++ /dev/null
@@ -1,73 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef        ZPOOL_UTIL_H
-#define        ZPOOL_UTIL_H
-
-#include <libnvpair.h>
-#include <libzfs.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Basic utility functions
- */
-void *safe_malloc(size_t);
-void zpool_no_memory(void);
-uint_t num_logs(nvlist_t *nv);
-
-/*
- * Virtual device functions
- */
-
-nvlist_t *make_root_vdev(zpool_handle_t *zhp, nvlist_t *props, int force,
-    int check_rep, boolean_t replacing, boolean_t dryrun, int argc,
-    char **argv);
-nvlist_t *split_mirror_vdev(zpool_handle_t *zhp, char *newname,
-    nvlist_t *props, splitflags_t flags, int argc, char **argv);
-
-/*
- * Pool list functions
- */
-int for_each_pool(int, char **, boolean_t unavail, zprop_list_t **,
-    zpool_iter_f, void *);
-
-typedef struct zpool_list zpool_list_t;
-
-zpool_list_t *pool_list_get(int, char **, zprop_list_t **, int *);
-void pool_list_update(zpool_list_t *);
-int pool_list_iter(zpool_list_t *, int unavail, zpool_iter_f, void *);
-void pool_list_free(zpool_list_t *);
-int pool_list_count(zpool_list_t *);
-void pool_list_remove(zpool_list_t *, zpool_handle_t *);
-
-libzfs_handle_t *g_zfs;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* ZPOOL_UTIL_H */
diff --git a/zfs/cmd/zpool/zpool_vdev.c b/zfs/cmd/zpool/zpool_vdev.c
deleted file mode 100644 (file)
index cae2014..0000000
+++ /dev/null
@@ -1,1739 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
- */
-
-/*
- * Functions to convert between a list of vdevs and an nvlist representing the
- * configuration.  Each entry in the list can be one of:
- *
- *     Device vdevs
- *             disk=(path=..., devid=...)
- *             file=(path=...)
- *
- *     Group vdevs
- *             raidz[1|2]=(...)
- *             mirror=(...)
- *
- *     Hot spares
- *
- * While the underlying implementation supports it, group vdevs cannot contain
- * other group vdevs.  All userland verification of devices is contained within
- * this file.  If successful, the nvlist returned can be passed directly to the
- * kernel; we've done as much verification as possible in userland.
- *
- * Hot spares are a special case, and passed down as an array of disk vdevs, at
- * the same level as the root of the vdev tree.
- *
- * The only function exported by this file is 'make_root_vdev'.  The
- * function performs several passes:
- *
- *     1. Construct the vdev specification.  Performs syntax validation and
- *         makes sure each device is valid.
- *     2. Check for devices in use.  Using libblkid to make sure that no
- *         devices are also in use.  Some can be overridden using the 'force'
- *         flag, others cannot.
- *     3. Check for replication errors if the 'force' flag is not specified.
- *         validates that the replication level is consistent across the
- *         entire pool.
- *     4. Call libzfs to label any whole disks with an EFI label.
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <devid.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <libintl.h>
-#include <libnvpair.h>
-#include <limits.h>
-#include <scsi/scsi.h>
-#include <scsi/sg.h>
-#include <stdio.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/efi_partition.h>
-#include <sys/stat.h>
-#include <sys/vtoc.h>
-#include <sys/mntent.h>
-#include <uuid/uuid.h>
-#ifdef HAVE_LIBBLKID
-#include <blkid/blkid.h>
-#else
-#define        blkid_cache void *
-#endif /* HAVE_LIBBLKID */
-
-#include "zpool_util.h"
-#include <sys/zfs_context.h>
-
-/*
- * For any given vdev specification, we can have multiple errors.  The
- * vdev_error() function keeps track of whether we have seen an error yet, and
- * prints out a header if its the first error we've seen.
- */
-boolean_t error_seen;
-boolean_t is_force;
-
-typedef struct vdev_disk_db_entry
-{
-       char id[24];
-       int sector_size;
-} vdev_disk_db_entry_t;
-
-/*
- * Database of block devices that lie about physical sector sizes.  The
- * identification string must be precisely 24 characters to avoid false
- * negatives
- */
-static vdev_disk_db_entry_t vdev_disk_database[] = {
-       {"ATA     ADATA SSD S396 3", 8192},
-       {"ATA     APPLE SSD SM128E", 8192},
-       {"ATA     APPLE SSD SM256E", 8192},
-       {"ATA     APPLE SSD SM512E", 8192},
-       {"ATA     APPLE SSD SM768E", 8192},
-       {"ATA     C400-MTFDDAC064M", 8192},
-       {"ATA     C400-MTFDDAC128M", 8192},
-       {"ATA     C400-MTFDDAC256M", 8192},
-       {"ATA     C400-MTFDDAC512M", 8192},
-       {"ATA     Corsair Force 3 ", 8192},
-       {"ATA     Corsair Force GS", 8192},
-       {"ATA     INTEL SSDSA2CT04", 8192},
-       {"ATA     INTEL SSDSA2BZ10", 8192},
-       {"ATA     INTEL SSDSA2BZ20", 8192},
-       {"ATA     INTEL SSDSA2BZ30", 8192},
-       {"ATA     INTEL SSDSA2CW04", 8192},
-       {"ATA     INTEL SSDSA2CW08", 8192},
-       {"ATA     INTEL SSDSA2CW12", 8192},
-       {"ATA     INTEL SSDSA2CW16", 8192},
-       {"ATA     INTEL SSDSA2CW30", 8192},
-       {"ATA     INTEL SSDSA2CW60", 8192},
-       {"ATA     INTEL SSDSC2CT06", 8192},
-       {"ATA     INTEL SSDSC2CT12", 8192},
-       {"ATA     INTEL SSDSC2CT18", 8192},
-       {"ATA     INTEL SSDSC2CT24", 8192},
-       {"ATA     INTEL SSDSC2CW06", 8192},
-       {"ATA     INTEL SSDSC2CW12", 8192},
-       {"ATA     INTEL SSDSC2CW18", 8192},
-       {"ATA     INTEL SSDSC2CW24", 8192},
-       {"ATA     INTEL SSDSC2CW48", 8192},
-       {"ATA     KINGSTON SH100S3", 8192},
-       {"ATA     KINGSTON SH103S3", 8192},
-       {"ATA     M4-CT064M4SSD2  ", 8192},
-       {"ATA     M4-CT128M4SSD2  ", 8192},
-       {"ATA     M4-CT256M4SSD2  ", 8192},
-       {"ATA     M4-CT512M4SSD2  ", 8192},
-       {"ATA     OCZ-AGILITY2    ", 8192},
-       {"ATA     OCZ-AGILITY3    ", 8192},
-       {"ATA     OCZ-VERTEX2 3.5 ", 8192},
-       {"ATA     OCZ-VERTEX3     ", 8192},
-       {"ATA     OCZ-VERTEX3 LT  ", 8192},
-       {"ATA     OCZ-VERTEX3 MI  ", 8192},
-       {"ATA     OCZ-VERTEX4     ", 8192},
-       {"ATA     SAMSUNG MZ7WD120", 8192},
-       {"ATA     SAMSUNG MZ7WD240", 8192},
-       {"ATA     SAMSUNG MZ7WD480", 8192},
-       {"ATA     SAMSUNG MZ7WD960", 8192},
-       {"ATA     SAMSUNG SSD 830 ", 8192},
-       {"ATA     Samsung SSD 840 ", 8192},
-       {"ATA     SanDisk SSD U100", 8192},
-       {"ATA     TOSHIBA THNSNH06", 8192},
-       {"ATA     TOSHIBA THNSNH12", 8192},
-       {"ATA     TOSHIBA THNSNH25", 8192},
-       {"ATA     TOSHIBA THNSNH51", 8192},
-       {"ATA     APPLE SSD TS064C", 4096},
-       {"ATA     APPLE SSD TS128C", 4096},
-       {"ATA     APPLE SSD TS256C", 4096},
-       {"ATA     APPLE SSD TS512C", 4096},
-       {"ATA     INTEL SSDSA2M040", 4096},
-       {"ATA     INTEL SSDSA2M080", 4096},
-       {"ATA     INTEL SSDSA2M160", 4096},
-       {"ATA     INTEL SSDSC2MH12", 4096},
-       {"ATA     INTEL SSDSC2MH25", 4096},
-       {"ATA     OCZ CORE_SSD    ", 4096},
-       {"ATA     OCZ-VERTEX      ", 4096},
-       {"ATA     SAMSUNG MCCOE32G", 4096},
-       {"ATA     SAMSUNG MCCOE64G", 4096},
-       {"ATA     SAMSUNG SSD PM80", 4096},
-       /* Flash drives optimized for 4KB IOs on larger pages */
-       {"ATA     INTEL SSDSC2BA10", 4096},
-       {"ATA     INTEL SSDSC2BA20", 4096},
-       {"ATA     INTEL SSDSC2BA40", 4096},
-       {"ATA     INTEL SSDSC2BA80", 4096},
-       {"ATA     INTEL SSDSC2BB08", 4096},
-       {"ATA     INTEL SSDSC2BB12", 4096},
-       {"ATA     INTEL SSDSC2BB16", 4096},
-       {"ATA     INTEL SSDSC2BB24", 4096},
-       {"ATA     INTEL SSDSC2BB30", 4096},
-       {"ATA     INTEL SSDSC2BB40", 4096},
-       {"ATA     INTEL SSDSC2BB48", 4096},
-       {"ATA     INTEL SSDSC2BB60", 4096},
-       {"ATA     INTEL SSDSC2BB80", 4096},
-       {"ATA     INTEL SSDSC2BW24", 4096},
-       {"ATA     INTEL SSDSC2BP24", 4096},
-       {"ATA     INTEL SSDSC2BP48", 4096},
-       {"NA      SmrtStorSDLKAE9W", 4096},
-       /* Imported from Open Solaris */
-       {"ATA     MARVELL SD88SA02", 4096},
-       /* Advanced format Hard drives */
-       {"ATA     Hitachi HDS5C303", 4096},
-       {"ATA     SAMSUNG HD204UI ", 4096},
-       {"ATA     ST2000DL004 HD20", 4096},
-       {"ATA     WDC WD10EARS-00M", 4096},
-       {"ATA     WDC WD10EARS-00S", 4096},
-       {"ATA     WDC WD10EARS-00Z", 4096},
-       {"ATA     WDC WD15EARS-00M", 4096},
-       {"ATA     WDC WD15EARS-00S", 4096},
-       {"ATA     WDC WD15EARS-00Z", 4096},
-       {"ATA     WDC WD20EARS-00M", 4096},
-       {"ATA     WDC WD20EARS-00S", 4096},
-       {"ATA     WDC WD20EARS-00Z", 4096},
-       {"ATA     WDC WD1600BEVT-0", 4096},
-       {"ATA     WDC WD2500BEVT-0", 4096},
-       {"ATA     WDC WD3200BEVT-0", 4096},
-       {"ATA     WDC WD5000BEVT-0", 4096},
-       /* Virtual disks: Assume zvols with default volblocksize */
-#if 0
-       {"ATA     QEMU HARDDISK   ", 8192},
-       {"IET     VIRTUAL-DISK    ", 8192},
-       {"OI      COMSTAR         ", 8192},
-       {"SUN     COMSTAR         ", 8192},
-       {"NETAPP  LUN             ", 8192},
-#endif
-};
-
-static const int vdev_disk_database_size =
-       sizeof (vdev_disk_database) / sizeof (vdev_disk_database[0]);
-
-#define        INQ_REPLY_LEN   96
-#define        INQ_CMD_LEN     6
-
-static boolean_t
-check_sector_size_database(char *path, int *sector_size)
-{
-       unsigned char inq_buff[INQ_REPLY_LEN];
-       unsigned char sense_buffer[32];
-       unsigned char inq_cmd_blk[INQ_CMD_LEN] =
-           {INQUIRY, 0, 0, 0, INQ_REPLY_LEN, 0};
-       sg_io_hdr_t io_hdr;
-       int error;
-       int fd;
-       int i;
-
-       /* Prepare INQUIRY command */
-       memset(&io_hdr, 0, sizeof (sg_io_hdr_t));
-       io_hdr.interface_id = 'S';
-       io_hdr.cmd_len = sizeof (inq_cmd_blk);
-       io_hdr.mx_sb_len = sizeof (sense_buffer);
-       io_hdr.dxfer_direction = SG_DXFER_FROM_DEV;
-       io_hdr.dxfer_len = INQ_REPLY_LEN;
-       io_hdr.dxferp = inq_buff;
-       io_hdr.cmdp = inq_cmd_blk;
-       io_hdr.sbp = sense_buffer;
-       io_hdr.timeout = 10;            /* 10 milliseconds is ample time */
-
-       if ((fd = open(path, O_RDONLY|O_DIRECT)) < 0)
-               return (B_FALSE);
-
-       error = ioctl(fd, SG_IO, (unsigned long) &io_hdr);
-
-       (void) close(fd);
-
-       if (error < 0)
-               return (B_FALSE);
-
-       if ((io_hdr.info & SG_INFO_OK_MASK) != SG_INFO_OK)
-               return (B_FALSE);
-
-       for (i = 0; i < vdev_disk_database_size; i++) {
-               if (memcmp(inq_buff + 8, vdev_disk_database[i].id, 24))
-                       continue;
-
-               *sector_size = vdev_disk_database[i].sector_size;
-               return (B_TRUE);
-       }
-
-       return (B_FALSE);
-}
-
-/*PRINTFLIKE1*/
-static void
-vdev_error(const char *fmt, ...)
-{
-       va_list ap;
-
-       if (!error_seen) {
-               (void) fprintf(stderr, gettext("invalid vdev specification\n"));
-               if (!is_force)
-                       (void) fprintf(stderr, gettext("use '-f' to override "
-                           "the following errors:\n"));
-               else
-                       (void) fprintf(stderr, gettext("the following errors "
-                           "must be manually repaired:\n"));
-               error_seen = B_TRUE;
-       }
-
-       va_start(ap, fmt);
-       (void) vfprintf(stderr, fmt, ap);
-       va_end(ap);
-}
-
-/*
- * Check that a file is valid.  All we can do in this case is check that it's
- * not in use by another pool, and not in use by swap.
- */
-static int
-check_file(const char *file, boolean_t force, boolean_t isspare)
-{
-       char  *name;
-       int fd;
-       int ret = 0;
-       pool_state_t state;
-       boolean_t inuse;
-
-       if ((fd = open(file, O_RDONLY)) < 0)
-               return (0);
-
-       if (zpool_in_use(g_zfs, fd, &state, &name, &inuse) == 0 && inuse) {
-               const char *desc;
-
-               switch (state) {
-               case POOL_STATE_ACTIVE:
-                       desc = gettext("active");
-                       break;
-
-               case POOL_STATE_EXPORTED:
-                       desc = gettext("exported");
-                       break;
-
-               case POOL_STATE_POTENTIALLY_ACTIVE:
-                       desc = gettext("potentially active");
-                       break;
-
-               default:
-                       desc = gettext("unknown");
-                       break;
-               }
-
-               /*
-                * Allow hot spares to be shared between pools.
-                */
-               if (state == POOL_STATE_SPARE && isspare)
-                       return (0);
-
-               if (state == POOL_STATE_ACTIVE ||
-                   state == POOL_STATE_SPARE || !force) {
-                       switch (state) {
-                       case POOL_STATE_SPARE:
-                               vdev_error(gettext("%s is reserved as a hot "
-                                   "spare for pool %s\n"), file, name);
-                               break;
-                       default:
-                               vdev_error(gettext("%s is part of %s pool "
-                                   "'%s'\n"), file, desc, name);
-                               break;
-                       }
-                       ret = -1;
-               }
-
-               free(name);
-       }
-
-       (void) close(fd);
-       return (ret);
-}
-
-static void
-check_error(int err)
-{
-       (void) fprintf(stderr, gettext("warning: device in use checking "
-           "failed: %s\n"), strerror(err));
-}
-
-static int
-check_slice(const char *path, blkid_cache cache, int force, boolean_t isspare)
-{
-       int err;
-#ifdef HAVE_LIBBLKID
-       char *value;
-
-       /* No valid type detected device is safe to use */
-       value = blkid_get_tag_value(cache, "TYPE", path);
-       if (value == NULL)
-               return (0);
-
-       /*
-        * If libblkid detects a ZFS device, we check the device
-        * using check_file() to see if it's safe.  The one safe
-        * case is a spare device shared between multiple pools.
-        */
-       if (strcmp(value, "zfs_member") == 0) {
-               err = check_file(path, force, isspare);
-       } else {
-               if (force) {
-                       err = 0;
-               } else {
-                       err = -1;
-                       vdev_error(gettext("%s contains a filesystem of "
-                           "type '%s'\n"), path, value);
-               }
-       }
-
-       free(value);
-#else
-       err = check_file(path, force, isspare);
-#endif /* HAVE_LIBBLKID */
-
-       return (err);
-}
-
-/*
- * Validate a whole disk.  Iterate over all slices on the disk and make sure
- * that none is in use by calling check_slice().
- */
-static int
-check_disk(const char *path, blkid_cache cache, int force,
-    boolean_t isspare, boolean_t iswholedisk)
-{
-       struct dk_gpt *vtoc;
-       char slice_path[MAXPATHLEN];
-       int err = 0;
-       int fd, i;
-
-       /* This is not a wholedisk we only check the given partition */
-       if (!iswholedisk)
-               return (check_slice(path, cache, force, isspare));
-
-       /*
-        * When the device is a whole disk try to read the efi partition
-        * label.  If this is successful we safely check the all of the
-        * partitions.  However, when it fails it may simply be because
-        * the disk is partitioned via the MBR.  Since we currently can
-        * not easily decode the MBR return a failure and prompt to the
-        * user to use force option since we cannot check the partitions.
-        */
-       if ((fd = open(path, O_RDONLY|O_DIRECT)) < 0) {
-               check_error(errno);
-               return (-1);
-       }
-
-       if ((err = efi_alloc_and_read(fd, &vtoc)) != 0) {
-               (void) close(fd);
-
-               if (force) {
-                       return (0);
-               } else {
-                       vdev_error(gettext("%s does not contain an EFI "
-                           "label but it may contain partition\n"
-                           "information in the MBR.\n"), path);
-                       return (-1);
-               }
-       }
-
-       /*
-        * The primary efi partition label is damaged however the secondary
-        * label at the end of the device is intact.  Rather than use this
-        * label we should play it safe and treat this as a non efi device.
-        */
-       if (vtoc->efi_flags & EFI_GPT_PRIMARY_CORRUPT) {
-               efi_free(vtoc);
-               (void) close(fd);
-
-               if (force) {
-                       /* Partitions will no be created using the backup */
-                       return (0);
-               } else {
-                       vdev_error(gettext("%s contains a corrupt primary "
-                           "EFI label.\n"), path);
-                       return (-1);
-               }
-       }
-
-       for (i = 0; i < vtoc->efi_nparts; i++) {
-
-               if (vtoc->efi_parts[i].p_tag == V_UNASSIGNED ||
-                   uuid_is_null((uchar_t *)&vtoc->efi_parts[i].p_guid))
-                       continue;
-
-               if (strncmp(path, UDISK_ROOT, strlen(UDISK_ROOT)) == 0)
-                       (void) snprintf(slice_path, sizeof (slice_path),
-                           "%s%s%d", path, "-part", i+1);
-               else
-                       (void) snprintf(slice_path, sizeof (slice_path),
-                           "%s%s%d", path, isdigit(path[strlen(path)-1]) ?
-                           "p" : "", i+1);
-
-               err = check_slice(slice_path, cache, force, isspare);
-               if (err)
-                       break;
-       }
-
-       efi_free(vtoc);
-       (void) close(fd);
-
-       return (err);
-}
-
-static int
-check_device(const char *path, boolean_t force,
-    boolean_t isspare, boolean_t iswholedisk)
-{
-       static blkid_cache cache = NULL;
-
-#ifdef HAVE_LIBBLKID
-       /*
-        * There is no easy way to add a correct blkid_put_cache() call,
-        * memory will be reclaimed when the command exits.
-        */
-       if (cache == NULL) {
-               int err;
-
-               if ((err = blkid_get_cache(&cache, NULL)) != 0) {
-                       check_error(err);
-                       return (-1);
-               }
-
-               if ((err = blkid_probe_all(cache)) != 0) {
-                       blkid_put_cache(cache);
-                       check_error(err);
-                       return (-1);
-               }
-       }
-#endif /* HAVE_LIBBLKID */
-
-       return (check_disk(path, cache, force, isspare, iswholedisk));
-}
-
-/*
- * By "whole disk" we mean an entire physical disk (something we can
- * label, toggle the write cache on, etc.) as opposed to the full
- * capacity of a pseudo-device such as lofi or did.  We act as if we
- * are labeling the disk, which should be a pretty good test of whether
- * it's a viable device or not.  Returns B_TRUE if it is and B_FALSE if
- * it isn't.
- */
-static boolean_t
-is_whole_disk(const char *path)
-{
-       struct dk_gpt *label;
-       int fd;
-
-       if ((fd = open(path, O_RDONLY|O_DIRECT)) < 0)
-               return (B_FALSE);
-       if (efi_alloc_and_init(fd, EFI_NUMPAR, &label) != 0) {
-               (void) close(fd);
-               return (B_FALSE);
-       }
-       efi_free(label);
-       (void) close(fd);
-       return (B_TRUE);
-}
-
-/*
- * This may be a shorthand device path or it could be total gibberish.
- * Check to see if it is a known device available in zfs_vdev_paths.
- * As part of this check, see if we've been given an entire disk
- * (minus the slice number).
- */
-static int
-is_shorthand_path(const char *arg, char *path,
-    struct stat64 *statbuf, boolean_t *wholedisk)
-{
-       int error;
-
-       error = zfs_resolve_shortname(arg, path, MAXPATHLEN);
-       if (error == 0) {
-               *wholedisk = is_whole_disk(path);
-               if (*wholedisk || (stat64(path, statbuf) == 0))
-                       return (0);
-       }
-
-       strlcpy(path, arg, sizeof (path));
-       memset(statbuf, 0, sizeof (*statbuf));
-       *wholedisk = B_FALSE;
-
-       return (error);
-}
-
-/*
- * Determine if the given path is a hot spare within the given configuration.
- * If no configuration is given we rely solely on the label.
- */
-static boolean_t
-is_spare(nvlist_t *config, const char *path)
-{
-       int fd;
-       pool_state_t state;
-       char *name = NULL;
-       nvlist_t *label;
-       uint64_t guid, spareguid;
-       nvlist_t *nvroot;
-       nvlist_t **spares;
-       uint_t i, nspares;
-       boolean_t inuse;
-
-       if ((fd = open(path, O_RDONLY)) < 0)
-               return (B_FALSE);
-
-       if (zpool_in_use(g_zfs, fd, &state, &name, &inuse) != 0 ||
-           !inuse ||
-           state != POOL_STATE_SPARE ||
-           zpool_read_label(fd, &label, NULL) != 0) {
-               free(name);
-               (void) close(fd);
-               return (B_FALSE);
-       }
-       free(name);
-       (void) close(fd);
-
-       if (config == NULL)
-               return (B_TRUE);
-
-       verify(nvlist_lookup_uint64(label, ZPOOL_CONFIG_GUID, &guid) == 0);
-       nvlist_free(label);
-
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-       if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
-           &spares, &nspares) == 0) {
-               for (i = 0; i < nspares; i++) {
-                       verify(nvlist_lookup_uint64(spares[i],
-                           ZPOOL_CONFIG_GUID, &spareguid) == 0);
-                       if (spareguid == guid)
-                               return (B_TRUE);
-               }
-       }
-
-       return (B_FALSE);
-}
-
-/*
- * Create a leaf vdev.  Determine if this is a file or a device.  If it's a
- * device, fill in the device id to make a complete nvlist.  Valid forms for a
- * leaf vdev are:
- *
- *     /dev/xxx        Complete disk path
- *     /xxx            Full path to file
- *     xxx             Shorthand for <zfs_vdev_paths>/xxx
- */
-static nvlist_t *
-make_leaf_vdev(nvlist_t *props, const char *arg, uint64_t is_log)
-{
-       char path[MAXPATHLEN];
-       struct stat64 statbuf;
-       nvlist_t *vdev = NULL;
-       char *type = NULL;
-       boolean_t wholedisk = B_FALSE;
-       uint64_t ashift = 0;
-       int err;
-
-       /*
-        * Determine what type of vdev this is, and put the full path into
-        * 'path'.  We detect whether this is a device of file afterwards by
-        * checking the st_mode of the file.
-        */
-       if (arg[0] == '/') {
-               /*
-                * Complete device or file path.  Exact type is determined by
-                * examining the file descriptor afterwards.  Symbolic links
-                * are resolved to their real paths for the is_whole_disk()
-                * and S_ISBLK/S_ISREG type checks.  However, we are careful
-                * to store the given path as ZPOOL_CONFIG_PATH to ensure we
-                * can leverage udev's persistent device labels.
-                */
-               if (realpath(arg, path) == NULL) {
-                       (void) fprintf(stderr,
-                           gettext("cannot resolve path '%s'\n"), arg);
-                       return (NULL);
-               }
-
-               wholedisk = is_whole_disk(path);
-               if (!wholedisk && (stat64(path, &statbuf) != 0)) {
-                       (void) fprintf(stderr,
-                           gettext("cannot open '%s': %s\n"),
-                           path, strerror(errno));
-                       return (NULL);
-               }
-
-               /* After is_whole_disk() check restore original passed path */
-               strlcpy(path, arg, MAXPATHLEN);
-       } else {
-               err = is_shorthand_path(arg, path, &statbuf, &wholedisk);
-               if (err != 0) {
-                       /*
-                        * If we got ENOENT, then the user gave us
-                        * gibberish, so try to direct them with a
-                        * reasonable error message.  Otherwise,
-                        * regurgitate strerror() since it's the best we
-                        * can do.
-                        */
-                       if (err == ENOENT) {
-                               (void) fprintf(stderr,
-                                   gettext("cannot open '%s': no such "
-                                   "device in %s\n"), arg, DISK_ROOT);
-                               (void) fprintf(stderr,
-                                   gettext("must be a full path or "
-                                   "shorthand device name\n"));
-                               return (NULL);
-                       } else {
-                               (void) fprintf(stderr,
-                                   gettext("cannot open '%s': %s\n"),
-                                   path, strerror(errno));
-                               return (NULL);
-                       }
-               }
-       }
-
-       /*
-        * Determine whether this is a device or a file.
-        */
-       if (wholedisk || S_ISBLK(statbuf.st_mode)) {
-               type = VDEV_TYPE_DISK;
-       } else if (S_ISREG(statbuf.st_mode)) {
-               type = VDEV_TYPE_FILE;
-       } else {
-               (void) fprintf(stderr, gettext("cannot use '%s': must be a "
-                   "block device or regular file\n"), path);
-               return (NULL);
-       }
-
-       /*
-        * Finally, we have the complete device or file, and we know that it is
-        * acceptable to use.  Construct the nvlist to describe this vdev.  All
-        * vdevs have a 'path' element, and devices also have a 'devid' element.
-        */
-       verify(nvlist_alloc(&vdev, NV_UNIQUE_NAME, 0) == 0);
-       verify(nvlist_add_string(vdev, ZPOOL_CONFIG_PATH, path) == 0);
-       verify(nvlist_add_string(vdev, ZPOOL_CONFIG_TYPE, type) == 0);
-       verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_IS_LOG, is_log) == 0);
-       if (strcmp(type, VDEV_TYPE_DISK) == 0)
-               verify(nvlist_add_uint64(vdev, ZPOOL_CONFIG_WHOLE_DISK,
-                   (uint64_t)wholedisk) == 0);
-
-       /*
-        * Override defaults if custom properties are provided.
-        */
-       if (props != NULL) {
-               char *value = NULL;
-
-               if (nvlist_lookup_string(props,
-                   zpool_prop_to_name(ZPOOL_PROP_ASHIFT), &value) == 0)
-                       zfs_nicestrtonum(NULL, value, &ashift);
-       }
-
-       /*
-        * If the device is known to incorrectly report its physical sector
-        * size explicitly provide the known correct value.
-        */
-       if (ashift == 0) {
-               int sector_size;
-
-               if (check_sector_size_database(path, &sector_size) == B_TRUE)
-                       ashift = highbit64(sector_size) - 1;
-       }
-
-       if (ashift > 0)
-               nvlist_add_uint64(vdev, ZPOOL_CONFIG_ASHIFT, ashift);
-
-       return (vdev);
-}
-
-/*
- * Go through and verify the replication level of the pool is consistent.
- * Performs the following checks:
- *
- *     For the new spec, verifies that devices in mirrors and raidz are the
- *     same size.
- *
- *     If the current configuration already has inconsistent replication
- *     levels, ignore any other potential problems in the new spec.
- *
- *     Otherwise, make sure that the current spec (if there is one) and the new
- *     spec have consistent replication levels.
- */
-typedef struct replication_level {
-       char *zprl_type;
-       uint64_t zprl_children;
-       uint64_t zprl_parity;
-} replication_level_t;
-
-#define        ZPOOL_FUZZ      (16 * 1024 * 1024)
-
-/*
- * Given a list of toplevel vdevs, return the current replication level.  If
- * the config is inconsistent, then NULL is returned.  If 'fatal' is set, then
- * an error message will be displayed for each self-inconsistent vdev.
- */
-static replication_level_t *
-get_replication(nvlist_t *nvroot, boolean_t fatal)
-{
-       nvlist_t **top;
-       uint_t t, toplevels;
-       nvlist_t **child;
-       uint_t c, children;
-       nvlist_t *nv;
-       char *type;
-       replication_level_t lastrep = { 0 }, rep, *ret;
-       boolean_t dontreport;
-
-       ret = safe_malloc(sizeof (replication_level_t));
-
-       verify(nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
-           &top, &toplevels) == 0);
-
-       lastrep.zprl_type = NULL;
-       for (t = 0; t < toplevels; t++) {
-               uint64_t is_log = B_FALSE;
-
-               nv = top[t];
-
-               /*
-                * For separate logs we ignore the top level vdev replication
-                * constraints.
-                */
-               (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_IS_LOG, &is_log);
-               if (is_log)
-                       continue;
-
-               verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE,
-                   &type) == 0);
-               if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-                   &child, &children) != 0) {
-                       /*
-                        * This is a 'file' or 'disk' vdev.
-                        */
-                       rep.zprl_type = type;
-                       rep.zprl_children = 1;
-                       rep.zprl_parity = 0;
-               } else {
-                       uint64_t vdev_size;
-
-                       /*
-                        * This is a mirror or RAID-Z vdev.  Go through and make
-                        * sure the contents are all the same (files vs. disks),
-                        * keeping track of the number of elements in the
-                        * process.
-                        *
-                        * We also check that the size of each vdev (if it can
-                        * be determined) is the same.
-                        */
-                       rep.zprl_type = type;
-                       rep.zprl_children = 0;
-
-                       if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) {
-                               verify(nvlist_lookup_uint64(nv,
-                                   ZPOOL_CONFIG_NPARITY,
-                                   &rep.zprl_parity) == 0);
-                               assert(rep.zprl_parity != 0);
-                       } else {
-                               rep.zprl_parity = 0;
-                       }
-
-                       /*
-                        * The 'dontreport' variable indicates that we've
-                        * already reported an error for this spec, so don't
-                        * bother doing it again.
-                        */
-                       type = NULL;
-                       dontreport = 0;
-                       vdev_size = -1ULL;
-                       for (c = 0; c < children; c++) {
-                               nvlist_t *cnv = child[c];
-                               char *path;
-                               struct stat64 statbuf;
-                               uint64_t size = -1ULL;
-                               char *childtype;
-                               int fd, err;
-
-                               rep.zprl_children++;
-
-                               verify(nvlist_lookup_string(cnv,
-                                   ZPOOL_CONFIG_TYPE, &childtype) == 0);
-
-                               /*
-                                * If this is a replacing or spare vdev, then
-                                * get the real first child of the vdev.
-                                */
-                               if (strcmp(childtype,
-                                   VDEV_TYPE_REPLACING) == 0 ||
-                                   strcmp(childtype, VDEV_TYPE_SPARE) == 0) {
-                                       nvlist_t **rchild;
-                                       uint_t rchildren;
-
-                                       verify(nvlist_lookup_nvlist_array(cnv,
-                                           ZPOOL_CONFIG_CHILDREN, &rchild,
-                                           &rchildren) == 0);
-                                       assert(rchildren == 2);
-                                       cnv = rchild[0];
-
-                                       verify(nvlist_lookup_string(cnv,
-                                           ZPOOL_CONFIG_TYPE,
-                                           &childtype) == 0);
-                               }
-
-                               verify(nvlist_lookup_string(cnv,
-                                   ZPOOL_CONFIG_PATH, &path) == 0);
-
-                               /*
-                                * If we have a raidz/mirror that combines disks
-                                * with files, report it as an error.
-                                */
-                               if (!dontreport && type != NULL &&
-                                   strcmp(type, childtype) != 0) {
-                                       if (ret != NULL)
-                                               free(ret);
-                                       ret = NULL;
-                                       if (fatal)
-                                               vdev_error(gettext(
-                                                   "mismatched replication "
-                                                   "level: %s contains both "
-                                                   "files and devices\n"),
-                                                   rep.zprl_type);
-                                       else
-                                               return (NULL);
-                                       dontreport = B_TRUE;
-                               }
-
-                               /*
-                                * According to stat(2), the value of 'st_size'
-                                * is undefined for block devices and character
-                                * devices.  But there is no effective way to
-                                * determine the real size in userland.
-                                *
-                                * Instead, we'll take advantage of an
-                                * implementation detail of spec_size().  If the
-                                * device is currently open, then we (should)
-                                * return a valid size.
-                                *
-                                * If we still don't get a valid size (indicated
-                                * by a size of 0 or MAXOFFSET_T), then ignore
-                                * this device altogether.
-                                */
-                               if ((fd = open(path, O_RDONLY)) >= 0) {
-                                       err = fstat64(fd, &statbuf);
-                                       (void) close(fd);
-                               } else {
-                                       err = stat64(path, &statbuf);
-                               }
-
-                               if (err != 0 ||
-                                   statbuf.st_size == 0 ||
-                                   statbuf.st_size == MAXOFFSET_T)
-                                       continue;
-
-                               size = statbuf.st_size;
-
-                               /*
-                                * Also make sure that devices and
-                                * slices have a consistent size.  If
-                                * they differ by a significant amount
-                                * (~16MB) then report an error.
-                                */
-                               if (!dontreport &&
-                                   (vdev_size != -1ULL &&
-                                   (labs(size - vdev_size) >
-                                   ZPOOL_FUZZ))) {
-                                       if (ret != NULL)
-                                               free(ret);
-                                       ret = NULL;
-                                       if (fatal)
-                                               vdev_error(gettext(
-                                                   "%s contains devices of "
-                                                   "different sizes\n"),
-                                                   rep.zprl_type);
-                                       else
-                                               return (NULL);
-                                       dontreport = B_TRUE;
-                               }
-
-                               type = childtype;
-                               vdev_size = size;
-                       }
-               }
-
-               /*
-                * At this point, we have the replication of the last toplevel
-                * vdev in 'rep'.  Compare it to 'lastrep' to see if its
-                * different.
-                */
-               if (lastrep.zprl_type != NULL) {
-                       if (strcmp(lastrep.zprl_type, rep.zprl_type) != 0) {
-                               if (ret != NULL)
-                                       free(ret);
-                               ret = NULL;
-                               if (fatal)
-                                       vdev_error(gettext(
-                                           "mismatched replication level: "
-                                           "both %s and %s vdevs are "
-                                           "present\n"),
-                                           lastrep.zprl_type, rep.zprl_type);
-                               else
-                                       return (NULL);
-                       } else if (lastrep.zprl_parity != rep.zprl_parity) {
-                               if (ret)
-                                       free(ret);
-                               ret = NULL;
-                               if (fatal)
-                                       vdev_error(gettext(
-                                           "mismatched replication level: "
-                                           "both %llu and %llu device parity "
-                                           "%s vdevs are present\n"),
-                                           lastrep.zprl_parity,
-                                           rep.zprl_parity,
-                                           rep.zprl_type);
-                               else
-                                       return (NULL);
-                       } else if (lastrep.zprl_children != rep.zprl_children) {
-                               if (ret)
-                                       free(ret);
-                               ret = NULL;
-                               if (fatal)
-                                       vdev_error(gettext(
-                                           "mismatched replication level: "
-                                           "both %llu-way and %llu-way %s "
-                                           "vdevs are present\n"),
-                                           lastrep.zprl_children,
-                                           rep.zprl_children,
-                                           rep.zprl_type);
-                               else
-                                       return (NULL);
-                       }
-               }
-               lastrep = rep;
-       }
-
-       if (ret != NULL)
-               *ret = rep;
-
-       return (ret);
-}
-
-/*
- * Check the replication level of the vdev spec against the current pool.  Calls
- * get_replication() to make sure the new spec is self-consistent.  If the pool
- * has a consistent replication level, then we ignore any errors.  Otherwise,
- * report any difference between the two.
- */
-static int
-check_replication(nvlist_t *config, nvlist_t *newroot)
-{
-       nvlist_t **child;
-       uint_t  children;
-       replication_level_t *current = NULL, *new;
-       int ret;
-
-       /*
-        * If we have a current pool configuration, check to see if it's
-        * self-consistent.  If not, simply return success.
-        */
-       if (config != NULL) {
-               nvlist_t *nvroot;
-
-               verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-                   &nvroot) == 0);
-               if ((current = get_replication(nvroot, B_FALSE)) == NULL)
-                       return (0);
-       }
-       /*
-        * for spares there may be no children, and therefore no
-        * replication level to check
-        */
-       if ((nvlist_lookup_nvlist_array(newroot, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0) || (children == 0)) {
-               free(current);
-               return (0);
-       }
-
-       /*
-        * If all we have is logs then there's no replication level to check.
-        */
-       if (num_logs(newroot) == children) {
-               free(current);
-               return (0);
-       }
-
-       /*
-        * Get the replication level of the new vdev spec, reporting any
-        * inconsistencies found.
-        */
-       if ((new = get_replication(newroot, B_TRUE)) == NULL) {
-               free(current);
-               return (-1);
-       }
-
-       /*
-        * Check to see if the new vdev spec matches the replication level of
-        * the current pool.
-        */
-       ret = 0;
-       if (current != NULL) {
-               if (strcmp(current->zprl_type, new->zprl_type) != 0) {
-                       vdev_error(gettext(
-                           "mismatched replication level: pool uses %s "
-                           "and new vdev is %s\n"),
-                           current->zprl_type, new->zprl_type);
-                       ret = -1;
-               } else if (current->zprl_parity != new->zprl_parity) {
-                       vdev_error(gettext(
-                           "mismatched replication level: pool uses %llu "
-                           "device parity and new vdev uses %llu\n"),
-                           current->zprl_parity, new->zprl_parity);
-                       ret = -1;
-               } else if (current->zprl_children != new->zprl_children) {
-                       vdev_error(gettext(
-                           "mismatched replication level: pool uses %llu-way "
-                           "%s and new vdev uses %llu-way %s\n"),
-                           current->zprl_children, current->zprl_type,
-                           new->zprl_children, new->zprl_type);
-                       ret = -1;
-               }
-       }
-
-       free(new);
-       if (current != NULL)
-               free(current);
-
-       return (ret);
-}
-
-static int
-zero_label(char *path)
-{
-       const int size = 4096;
-       char buf[size];
-       int err, fd;
-
-       if ((fd = open(path, O_WRONLY|O_EXCL)) < 0) {
-               (void) fprintf(stderr, gettext("cannot open '%s': %s\n"),
-                   path, strerror(errno));
-               return (-1);
-       }
-
-       memset(buf, 0, size);
-       err = write(fd, buf, size);
-       (void) fdatasync(fd);
-       (void) close(fd);
-
-       if (err == -1) {
-               (void) fprintf(stderr, gettext("cannot zero first %d bytes "
-                   "of '%s': %s\n"), size, path, strerror(errno));
-               return (-1);
-       }
-
-       if (err != size) {
-               (void) fprintf(stderr, gettext("could only zero %d/%d bytes "
-                   "of '%s'\n"), err, size, path);
-               return (-1);
-       }
-
-       return (0);
-}
-
-/*
- * Go through and find any whole disks in the vdev specification, labelling them
- * as appropriate.  When constructing the vdev spec, we were unable to open this
- * device in order to provide a devid.  Now that we have labelled the disk and
- * know that slice 0 is valid, we can construct the devid now.
- *
- * If the disk was already labeled with an EFI label, we will have gotten the
- * devid already (because we were able to open the whole disk).  Otherwise, we
- * need to get the devid after we label the disk.
- */
-static int
-make_disks(zpool_handle_t *zhp, nvlist_t *nv)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       char *type, *path;
-       char devpath[MAXPATHLEN];
-       char udevpath[MAXPATHLEN];
-       uint64_t wholedisk;
-       struct stat64 statbuf;
-       int is_exclusive = 0;
-       int fd;
-       int ret;
-
-       verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0) {
-
-               if (strcmp(type, VDEV_TYPE_DISK) != 0)
-                       return (0);
-
-               /*
-                * We have a disk device.  If this is a whole disk write
-                * out the efi partition table, otherwise write zero's to
-                * the first 4k of the partition.  This is to ensure that
-                * libblkid will not misidentify the partition due to a
-                * magic value left by the previous filesystem.
-                */
-               verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path));
-               verify(!nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
-                   &wholedisk));
-
-               if (!wholedisk) {
-                       (void) zero_label(path);
-                       return (0);
-               }
-
-               if (realpath(path, devpath) == NULL) {
-                       ret = errno;
-                       (void) fprintf(stderr,
-                           gettext("cannot resolve path '%s'\n"), path);
-                       return (ret);
-               }
-
-               /*
-                * Remove any previously existing symlink from a udev path to
-                * the device before labeling the disk.  This makes
-                * zpool_label_disk_wait() truly wait for the new link to show
-                * up instead of returning if it finds an old link still in
-                * place.  Otherwise there is a window between when udev
-                * deletes and recreates the link during which access attempts
-                * will fail with ENOENT.
-                */
-               strncpy(udevpath, path, MAXPATHLEN);
-               (void) zfs_append_partition(udevpath, MAXPATHLEN);
-
-               fd = open(devpath, O_RDWR|O_EXCL);
-               if (fd == -1) {
-                       if (errno == EBUSY)
-                               is_exclusive = 1;
-               } else {
-                       (void) close(fd);
-               }
-
-               /*
-                * If the partition exists, contains a valid spare label,
-                * and is opened exclusively there is no need to partition
-                * it.  Hot spares have already been partitioned and are
-                * held open exclusively by the kernel as a safety measure.
-                *
-                * If the provided path is for a /dev/disk/ device its
-                * symbolic link will be removed, partition table created,
-                * and then block until udev creates the new link.
-                */
-               if (!is_exclusive || !is_spare(NULL, udevpath)) {
-                       ret = strncmp(udevpath, UDISK_ROOT, strlen(UDISK_ROOT));
-                       if (ret == 0) {
-                               ret = lstat64(udevpath, &statbuf);
-                               if (ret == 0 && S_ISLNK(statbuf.st_mode))
-                                       (void) unlink(udevpath);
-                       }
-
-                       if (zpool_label_disk(g_zfs, zhp,
-                           strrchr(devpath, '/') + 1) == -1)
-                               return (-1);
-
-                       ret = zpool_label_disk_wait(udevpath, DISK_LABEL_WAIT);
-                       if (ret) {
-                               (void) fprintf(stderr, gettext("cannot "
-                                   "resolve path '%s': %d\n"), udevpath, ret);
-                               return (-1);
-                       }
-
-                       (void) zero_label(udevpath);
-               }
-
-               /*
-                * Update the path to refer to the partition.  The presence of
-                * the 'whole_disk' field indicates to the CLI that we should
-                * chop off the partition number when displaying the device in
-                * future output.
-                */
-               verify(nvlist_add_string(nv, ZPOOL_CONFIG_PATH, udevpath) == 0);
-
-               return (0);
-       }
-
-       for (c = 0; c < children; c++)
-               if ((ret = make_disks(zhp, child[c])) != 0)
-                       return (ret);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
-           &child, &children) == 0)
-               for (c = 0; c < children; c++)
-                       if ((ret = make_disks(zhp, child[c])) != 0)
-                               return (ret);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
-           &child, &children) == 0)
-               for (c = 0; c < children; c++)
-                       if ((ret = make_disks(zhp, child[c])) != 0)
-                               return (ret);
-
-       return (0);
-}
-
-/*
- * Go through and find any devices that are in use.  We rely on libdiskmgt for
- * the majority of this task.
- */
-static boolean_t
-is_device_in_use(nvlist_t *config, nvlist_t *nv, boolean_t force,
-    boolean_t replacing, boolean_t isspare)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       char *type, *path;
-       int ret = 0;
-       char buf[MAXPATHLEN];
-       uint64_t wholedisk = B_FALSE;
-       boolean_t anyinuse = B_FALSE;
-
-       verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0) {
-
-               verify(!nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path));
-               if (strcmp(type, VDEV_TYPE_DISK) == 0)
-                       verify(!nvlist_lookup_uint64(nv,
-                           ZPOOL_CONFIG_WHOLE_DISK, &wholedisk));
-
-               /*
-                * As a generic check, we look to see if this is a replace of a
-                * hot spare within the same pool.  If so, we allow it
-                * regardless of what libblkid or zpool_in_use() says.
-                */
-               if (replacing) {
-                       (void) strlcpy(buf, path, sizeof (buf));
-                       if (wholedisk) {
-                               ret = zfs_append_partition(buf,  sizeof (buf));
-                               if (ret == -1)
-                                       return (-1);
-                       }
-
-                       if (is_spare(config, buf))
-                               return (B_FALSE);
-               }
-
-               if (strcmp(type, VDEV_TYPE_DISK) == 0)
-                       ret = check_device(path, force, isspare, wholedisk);
-
-               else if (strcmp(type, VDEV_TYPE_FILE) == 0)
-                       ret = check_file(path, force, isspare);
-
-               return (ret != 0);
-       }
-
-       for (c = 0; c < children; c++)
-               if (is_device_in_use(config, child[c], force, replacing,
-                   B_FALSE))
-                       anyinuse = B_TRUE;
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
-           &child, &children) == 0)
-               for (c = 0; c < children; c++)
-                       if (is_device_in_use(config, child[c], force, replacing,
-                           B_TRUE))
-                               anyinuse = B_TRUE;
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
-           &child, &children) == 0)
-               for (c = 0; c < children; c++)
-                       if (is_device_in_use(config, child[c], force, replacing,
-                           B_FALSE))
-                               anyinuse = B_TRUE;
-
-       return (anyinuse);
-}
-
-static const char *
-is_grouping(const char *type, int *mindev, int *maxdev)
-{
-       if (strncmp(type, "raidz", 5) == 0) {
-               const char *p = type + 5;
-               char *end;
-               long nparity;
-
-               if (*p == '\0') {
-                       nparity = 1;
-               } else if (*p == '0') {
-                       return (NULL); /* no zero prefixes allowed */
-               } else {
-                       errno = 0;
-                       nparity = strtol(p, &end, 10);
-                       if (errno != 0 || nparity < 1 || nparity >= 255 ||
-                           *end != '\0')
-                               return (NULL);
-               }
-
-               if (mindev != NULL)
-                       *mindev = nparity + 1;
-               if (maxdev != NULL)
-                       *maxdev = 255;
-               return (VDEV_TYPE_RAIDZ);
-       }
-
-       if (maxdev != NULL)
-               *maxdev = INT_MAX;
-
-       if (strcmp(type, "mirror") == 0) {
-               if (mindev != NULL)
-                       *mindev = 2;
-               return (VDEV_TYPE_MIRROR);
-       }
-
-       if (strcmp(type, "spare") == 0) {
-               if (mindev != NULL)
-                       *mindev = 1;
-               return (VDEV_TYPE_SPARE);
-       }
-
-       if (strcmp(type, "log") == 0) {
-               if (mindev != NULL)
-                       *mindev = 1;
-               return (VDEV_TYPE_LOG);
-       }
-
-       if (strcmp(type, "cache") == 0) {
-               if (mindev != NULL)
-                       *mindev = 1;
-               return (VDEV_TYPE_L2CACHE);
-       }
-
-       return (NULL);
-}
-
-/*
- * Construct a syntactically valid vdev specification,
- * and ensure that all devices and files exist and can be opened.
- * Note: we don't bother freeing anything in the error paths
- * because the program is just going to exit anyway.
- */
-nvlist_t *
-construct_spec(nvlist_t *props, int argc, char **argv)
-{
-       nvlist_t *nvroot, *nv, **top, **spares, **l2cache;
-       int t, toplevels, mindev, maxdev, nspares, nlogs, nl2cache;
-       const char *type;
-       uint64_t is_log;
-       boolean_t seen_logs;
-
-       top = NULL;
-       toplevels = 0;
-       spares = NULL;
-       l2cache = NULL;
-       nspares = 0;
-       nlogs = 0;
-       nl2cache = 0;
-       is_log = B_FALSE;
-       seen_logs = B_FALSE;
-
-       while (argc > 0) {
-               nv = NULL;
-
-               /*
-                * If it's a mirror or raidz, the subsequent arguments are
-                * its leaves -- until we encounter the next mirror or raidz.
-                */
-               if ((type = is_grouping(argv[0], &mindev, &maxdev)) != NULL) {
-                       nvlist_t **child = NULL;
-                       int c, children = 0;
-
-                       if (strcmp(type, VDEV_TYPE_SPARE) == 0) {
-                               if (spares != NULL) {
-                                       (void) fprintf(stderr,
-                                           gettext("invalid vdev "
-                                           "specification: 'spare' can be "
-                                           "specified only once\n"));
-                                       return (NULL);
-                               }
-                               is_log = B_FALSE;
-                       }
-
-                       if (strcmp(type, VDEV_TYPE_LOG) == 0) {
-                               if (seen_logs) {
-                                       (void) fprintf(stderr,
-                                           gettext("invalid vdev "
-                                           "specification: 'log' can be "
-                                           "specified only once\n"));
-                                       return (NULL);
-                               }
-                               seen_logs = B_TRUE;
-                               is_log = B_TRUE;
-                               argc--;
-                               argv++;
-                               /*
-                                * A log is not a real grouping device.
-                                * We just set is_log and continue.
-                                */
-                               continue;
-                       }
-
-                       if (strcmp(type, VDEV_TYPE_L2CACHE) == 0) {
-                               if (l2cache != NULL) {
-                                       (void) fprintf(stderr,
-                                           gettext("invalid vdev "
-                                           "specification: 'cache' can be "
-                                           "specified only once\n"));
-                                       return (NULL);
-                               }
-                               is_log = B_FALSE;
-                       }
-
-                       if (is_log) {
-                               if (strcmp(type, VDEV_TYPE_MIRROR) != 0) {
-                                       (void) fprintf(stderr,
-                                           gettext("invalid vdev "
-                                           "specification: unsupported 'log' "
-                                           "device: %s\n"), type);
-                                       return (NULL);
-                               }
-                               nlogs++;
-                       }
-
-                       for (c = 1; c < argc; c++) {
-                               if (is_grouping(argv[c], NULL, NULL) != NULL)
-                                       break;
-                               children++;
-                               child = realloc(child,
-                                   children * sizeof (nvlist_t *));
-                               if (child == NULL)
-                                       zpool_no_memory();
-                               if ((nv = make_leaf_vdev(props, argv[c],
-                                   B_FALSE)) == NULL)
-                                       return (NULL);
-                               child[children - 1] = nv;
-                       }
-
-                       if (children < mindev) {
-                               (void) fprintf(stderr, gettext("invalid vdev "
-                                   "specification: %s requires at least %d "
-                                   "devices\n"), argv[0], mindev);
-                               return (NULL);
-                       }
-
-                       if (children > maxdev) {
-                               (void) fprintf(stderr, gettext("invalid vdev "
-                                   "specification: %s supports no more than "
-                                   "%d devices\n"), argv[0], maxdev);
-                               return (NULL);
-                       }
-
-                       argc -= c;
-                       argv += c;
-
-                       if (strcmp(type, VDEV_TYPE_SPARE) == 0) {
-                               spares = child;
-                               nspares = children;
-                               continue;
-                       } else if (strcmp(type, VDEV_TYPE_L2CACHE) == 0) {
-                               l2cache = child;
-                               nl2cache = children;
-                               continue;
-                       } else {
-                               verify(nvlist_alloc(&nv, NV_UNIQUE_NAME,
-                                   0) == 0);
-                               verify(nvlist_add_string(nv, ZPOOL_CONFIG_TYPE,
-                                   type) == 0);
-                               verify(nvlist_add_uint64(nv,
-                                   ZPOOL_CONFIG_IS_LOG, is_log) == 0);
-                               if (strcmp(type, VDEV_TYPE_RAIDZ) == 0) {
-                                       verify(nvlist_add_uint64(nv,
-                                           ZPOOL_CONFIG_NPARITY,
-                                           mindev - 1) == 0);
-                               }
-                               verify(nvlist_add_nvlist_array(nv,
-                                   ZPOOL_CONFIG_CHILDREN, child,
-                                   children) == 0);
-
-                               for (c = 0; c < children; c++)
-                                       nvlist_free(child[c]);
-                               free(child);
-                       }
-               } else {
-                       /*
-                        * We have a device.  Pass off to make_leaf_vdev() to
-                        * construct the appropriate nvlist describing the vdev.
-                        */
-                       if ((nv = make_leaf_vdev(props, argv[0],
-                           is_log)) == NULL)
-                               return (NULL);
-                       if (is_log)
-                               nlogs++;
-                       argc--;
-                       argv++;
-               }
-
-               toplevels++;
-               top = realloc(top, toplevels * sizeof (nvlist_t *));
-               if (top == NULL)
-                       zpool_no_memory();
-               top[toplevels - 1] = nv;
-       }
-
-       if (toplevels == 0 && nspares == 0 && nl2cache == 0) {
-               (void) fprintf(stderr, gettext("invalid vdev "
-                   "specification: at least one toplevel vdev must be "
-                   "specified\n"));
-               return (NULL);
-       }
-
-       if (seen_logs && nlogs == 0) {
-               (void) fprintf(stderr, gettext("invalid vdev specification: "
-                   "log requires at least 1 device\n"));
-               return (NULL);
-       }
-
-       /*
-        * Finally, create nvroot and add all top-level vdevs to it.
-        */
-       verify(nvlist_alloc(&nvroot, NV_UNIQUE_NAME, 0) == 0);
-       verify(nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE,
-           VDEV_TYPE_ROOT) == 0);
-       verify(nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
-           top, toplevels) == 0);
-       if (nspares != 0)
-               verify(nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
-                   spares, nspares) == 0);
-       if (nl2cache != 0)
-               verify(nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
-                   l2cache, nl2cache) == 0);
-
-       for (t = 0; t < toplevels; t++)
-               nvlist_free(top[t]);
-       for (t = 0; t < nspares; t++)
-               nvlist_free(spares[t]);
-       for (t = 0; t < nl2cache; t++)
-               nvlist_free(l2cache[t]);
-       if (spares)
-               free(spares);
-       if (l2cache)
-               free(l2cache);
-       free(top);
-
-       return (nvroot);
-}
-
-nvlist_t *
-split_mirror_vdev(zpool_handle_t *zhp, char *newname, nvlist_t *props,
-    splitflags_t flags, int argc, char **argv)
-{
-       nvlist_t *newroot = NULL, **child;
-       uint_t c, children;
-
-       if (argc > 0) {
-               if ((newroot = construct_spec(props, argc, argv)) == NULL) {
-                       (void) fprintf(stderr, gettext("Unable to build a "
-                           "pool from the specified devices\n"));
-                       return (NULL);
-               }
-
-               if (!flags.dryrun && make_disks(zhp, newroot) != 0) {
-                       nvlist_free(newroot);
-                       return (NULL);
-               }
-
-               /* avoid any tricks in the spec */
-               verify(nvlist_lookup_nvlist_array(newroot,
-                   ZPOOL_CONFIG_CHILDREN, &child, &children) == 0);
-               for (c = 0; c < children; c++) {
-                       char *path;
-                       const char *type;
-                       int min, max;
-
-                       verify(nvlist_lookup_string(child[c],
-                           ZPOOL_CONFIG_PATH, &path) == 0);
-                       if ((type = is_grouping(path, &min, &max)) != NULL) {
-                               (void) fprintf(stderr, gettext("Cannot use "
-                                   "'%s' as a device for splitting\n"), type);
-                               nvlist_free(newroot);
-                               return (NULL);
-                       }
-               }
-       }
-
-       if (zpool_vdev_split(zhp, newname, &newroot, props, flags) != 0) {
-               if (newroot != NULL)
-                       nvlist_free(newroot);
-               return (NULL);
-       }
-
-       return (newroot);
-}
-
-/*
- * Get and validate the contents of the given vdev specification.  This ensures
- * that the nvlist returned is well-formed, that all the devices exist, and that
- * they are not currently in use by any other known consumer.  The 'poolconfig'
- * parameter is the current configuration of the pool when adding devices
- * existing pool, and is used to perform additional checks, such as changing the
- * replication level of the pool.  It can be 'NULL' to indicate that this is a
- * new pool.  The 'force' flag controls whether devices should be forcefully
- * added, even if they appear in use.
- */
-nvlist_t *
-make_root_vdev(zpool_handle_t *zhp, nvlist_t *props, int force, int check_rep,
-    boolean_t replacing, boolean_t dryrun, int argc, char **argv)
-{
-       nvlist_t *newroot;
-       nvlist_t *poolconfig = NULL;
-       is_force = force;
-
-       /*
-        * Construct the vdev specification.  If this is successful, we know
-        * that we have a valid specification, and that all devices can be
-        * opened.
-        */
-       if ((newroot = construct_spec(props, argc, argv)) == NULL)
-               return (NULL);
-
-       if (zhp && ((poolconfig = zpool_get_config(zhp, NULL)) == NULL)) {
-               nvlist_free(newroot);
-               return (NULL);
-       }
-
-       /*
-        * Validate each device to make sure that its not shared with another
-        * subsystem.  We do this even if 'force' is set, because there are some
-        * uses (such as a dedicated dump device) that even '-f' cannot
-        * override.
-        */
-       if (is_device_in_use(poolconfig, newroot, force, replacing, B_FALSE)) {
-               nvlist_free(newroot);
-               return (NULL);
-       }
-
-       /*
-        * Check the replication level of the given vdevs and report any errors
-        * found.  We include the existing pool spec, if any, as we need to
-        * catch changes against the existing replication level.
-        */
-       if (check_rep && check_replication(poolconfig, newroot) != 0) {
-               nvlist_free(newroot);
-               return (NULL);
-       }
-
-       /*
-        * Run through the vdev specification and label any whole disks found.
-        */
-       if (!dryrun && make_disks(zhp, newroot) != 0) {
-               nvlist_free(newroot);
-               return (NULL);
-       }
-
-       return (newroot);
-}
diff --git a/zfs/cmd/zstreamdump/.gitignore b/zfs/cmd/zstreamdump/.gitignore
deleted file mode 100644 (file)
index ca44a52..0000000
+++ /dev/null
@@ -1 +0,0 @@
-zstreamdump
diff --git a/zfs/cmd/zstreamdump/Makefile.am b/zfs/cmd/zstreamdump/Makefile.am
deleted file mode 100644 (file)
index 654863a..0000000
+++ /dev/null
@@ -1,19 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-sbin_PROGRAMS = zstreamdump
-
-zstreamdump_SOURCES = \
-       zstreamdump.c
-
-zstreamdump_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
-
-zstreamdump_LDADD += $(ZLIB)
diff --git a/zfs/cmd/zstreamdump/Makefile.in b/zfs/cmd/zstreamdump/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zstreamdump/zstreamdump.c b/zfs/cmd/zstreamdump/zstreamdump.c
deleted file mode 100644 (file)
index 176dd66..0000000
+++ /dev/null
@@ -1,597 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- * Portions Copyright 2012 Martin Matuska <martin@matuska.org>
- */
-
-/*
- * Copyright (c) 2013 by Delphix. All rights reserved.
- */
-
-#include <ctype.h>
-#include <libnvpair.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-
-#include <sys/dmu.h>
-#include <sys/zfs_ioctl.h>
-#include <zfs_fletcher.h>
-
-/*
- * If dump mode is enabled, the number of bytes to print per line
- */
-#define        BYTES_PER_LINE  16
-/*
- * If dump mode is enabled, the number of bytes to group together, separated
- * by newlines or spaces
- */
-#define        DUMP_GROUPING   4
-
-uint64_t total_write_size = 0;
-uint64_t total_stream_len = 0;
-FILE *send_stream = 0;
-boolean_t do_byteswap = B_FALSE;
-boolean_t do_cksum = B_TRUE;
-
-static void
-usage(void)
-{
-       (void) fprintf(stderr, "usage: zstreamdump [-v] [-C] [-d] < file\n");
-       (void) fprintf(stderr, "\t -v -- verbose\n");
-       (void) fprintf(stderr, "\t -C -- suppress checksum verification\n");
-       (void) fprintf(stderr, "\t -d -- dump contents of blocks modified, "
-           "implies verbose\n");
-       exit(1);
-}
-
-static void *
-safe_malloc(size_t size)
-{
-       void *rv = malloc(size);
-       if (rv == NULL) {
-               (void) fprintf(stderr, "ERROR; failed to allocate %u bytes\n",
-                   (unsigned)size);
-               abort();
-       }
-       return (rv);
-}
-
-/*
- * ssread - send stream read.
- *
- * Read while computing incremental checksum
- */
-
-static size_t
-ssread(void *buf, size_t len, zio_cksum_t *cksum)
-{
-       size_t outlen;
-
-       if ((outlen = fread(buf, len, 1, send_stream)) == 0)
-               return (0);
-
-       if (do_cksum && cksum) {
-               if (do_byteswap)
-                       fletcher_4_incremental_byteswap(buf, len, cksum);
-               else
-                       fletcher_4_incremental_native(buf, len, cksum);
-       }
-       total_stream_len += len;
-       return (outlen);
-}
-
-/*
- * Print part of a block in ASCII characters
- */
-static void
-print_ascii_block(char *subbuf, int length)
-{
-       int i;
-
-       for (i = 0; i < length; i++) {
-               char char_print = isprint(subbuf[i]) ? subbuf[i] : '.';
-               if (i != 0 && i % DUMP_GROUPING == 0) {
-                       (void) printf(" ");
-               }
-               (void) printf("%c", char_print);
-       }
-       (void) printf("\n");
-}
-
-/*
- * print_block - Dump the contents of a modified block to STDOUT
- *
- * Assume that buf has capacity evenly divisible by BYTES_PER_LINE
- */
-static void
-print_block(char *buf, int length)
-{
-       int i;
-       /*
-        * Start printing ASCII characters at a constant offset, after
-        * the hex prints. Leave 3 characters per byte on a line (2 digit
-        * hex number plus 1 space) plus spaces between characters and
-        * groupings
-        */
-       int ascii_start = BYTES_PER_LINE * 3 +
-           BYTES_PER_LINE / DUMP_GROUPING + 2;
-
-       for (i = 0; i < length; i += BYTES_PER_LINE) {
-               int j;
-               int this_line_length = MIN(BYTES_PER_LINE, length - i);
-               int print_offset = 0;
-
-               for (j = 0; j < this_line_length; j++) {
-                       int buf_offset = i + j;
-
-                       /*
-                        * Separate every DUMP_GROUPING bytes by a space.
-                        */
-                       if (buf_offset % DUMP_GROUPING == 0) {
-                               print_offset += printf(" ");
-                       }
-
-                       /*
-                        * Print the two-digit hex value for this byte.
-                        */
-                       unsigned char hex_print = buf[buf_offset];
-                       print_offset += printf("%02x ", hex_print);
-               }
-
-               (void) printf("%*s", ascii_start - print_offset, " ");
-
-               print_ascii_block(buf + i, this_line_length);
-       }
-}
-
-int
-main(int argc, char *argv[])
-{
-       char *buf = safe_malloc(SPA_MAXBLOCKSIZE);
-       uint64_t drr_record_count[DRR_NUMTYPES] = { 0 };
-       uint64_t total_records = 0;
-       dmu_replay_record_t thedrr;
-       dmu_replay_record_t *drr = &thedrr;
-       struct drr_begin *drrb = &thedrr.drr_u.drr_begin;
-       struct drr_end *drre = &thedrr.drr_u.drr_end;
-       struct drr_object *drro = &thedrr.drr_u.drr_object;
-       struct drr_freeobjects *drrfo = &thedrr.drr_u.drr_freeobjects;
-       struct drr_write *drrw = &thedrr.drr_u.drr_write;
-       struct drr_write_byref *drrwbr = &thedrr.drr_u.drr_write_byref;
-       struct drr_free *drrf = &thedrr.drr_u.drr_free;
-       struct drr_spill *drrs = &thedrr.drr_u.drr_spill;
-       struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded;
-       char c;
-       boolean_t verbose = B_FALSE;
-       boolean_t first = B_TRUE;
-       /*
-        * dump flag controls whether the contents of any modified data blocks
-        * are printed to the console during processing of the stream. Warning:
-        * for large streams, this can obviously lead to massive prints.
-        */
-       boolean_t dump = B_FALSE;
-       int err;
-       zio_cksum_t zc = { { 0 } };
-       zio_cksum_t pcksum = { { 0 } };
-
-       while ((c = getopt(argc, argv, ":vCd")) != -1) {
-               switch (c) {
-               case 'C':
-                       do_cksum = B_FALSE;
-                       break;
-               case 'v':
-                       verbose = B_TRUE;
-                       break;
-               case 'd':
-                       dump = B_TRUE;
-                       verbose = B_TRUE;
-                       break;
-               case ':':
-                       (void) fprintf(stderr,
-                           "missing argument for '%c' option\n", optopt);
-                       usage();
-                       break;
-               case '?':
-                       (void) fprintf(stderr, "invalid option '%c'\n",
-                           optopt);
-                       usage();
-               }
-       }
-
-       if (isatty(STDIN_FILENO)) {
-               (void) fprintf(stderr,
-                   "Error: Backup stream can not be read "
-                   "from a terminal.\n"
-                   "You must redirect standard input.\n");
-               exit(1);
-       }
-
-       send_stream = stdin;
-       while (ssread(drr, sizeof (dmu_replay_record_t), &zc)) {
-
-               /*
-                * If this is the first DMU record being processed, check for
-                * the magic bytes and figure out the endian-ness based on them.
-                */
-               if (first) {
-                       if (drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC)) {
-                               do_byteswap = B_TRUE;
-                               if (do_cksum) {
-                                       ZIO_SET_CHECKSUM(&zc, 0, 0, 0, 0);
-                                       /*
-                                        * recalculate header checksum now
-                                        * that we know it needs to be
-                                        * byteswapped.
-                                        */
-                                       fletcher_4_incremental_byteswap(drr,
-                                           sizeof (dmu_replay_record_t), &zc);
-                               }
-                       } else if (drrb->drr_magic != DMU_BACKUP_MAGIC) {
-                               (void) fprintf(stderr, "Invalid stream "
-                                   "(bad magic number)\n");
-                               exit(1);
-                       }
-                       first = B_FALSE;
-               }
-               if (do_byteswap) {
-                       drr->drr_type = BSWAP_32(drr->drr_type);
-                       drr->drr_payloadlen =
-                           BSWAP_32(drr->drr_payloadlen);
-               }
-
-               /*
-                * At this point, the leading fields of the replay record
-                * (drr_type and drr_payloadlen) have been byte-swapped if
-                * necessary, but the rest of the data structure (the
-                * union of type-specific structures) is still in its
-                * original state.
-                */
-               if (drr->drr_type >= DRR_NUMTYPES) {
-                       (void) printf("INVALID record found: type 0x%x\n",
-                           drr->drr_type);
-                       (void) printf("Aborting.\n");
-                       exit(1);
-               }
-
-               drr_record_count[drr->drr_type]++;
-               total_records++;
-
-               switch (drr->drr_type) {
-               case DRR_BEGIN:
-                       if (do_byteswap) {
-                               drrb->drr_magic = BSWAP_64(drrb->drr_magic);
-                               drrb->drr_versioninfo =
-                                   BSWAP_64(drrb->drr_versioninfo);
-                               drrb->drr_creation_time =
-                                   BSWAP_64(drrb->drr_creation_time);
-                               drrb->drr_type = BSWAP_32(drrb->drr_type);
-                               drrb->drr_flags = BSWAP_32(drrb->drr_flags);
-                               drrb->drr_toguid = BSWAP_64(drrb->drr_toguid);
-                               drrb->drr_fromguid =
-                                   BSWAP_64(drrb->drr_fromguid);
-                       }
-
-                       (void) printf("BEGIN record\n");
-                       (void) printf("\thdrtype = %lld\n",
-                           DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo));
-                       (void) printf("\tfeatures = %llx\n",
-                           DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo));
-                       (void) printf("\tmagic = %llx\n",
-                           (u_longlong_t)drrb->drr_magic);
-                       (void) printf("\tcreation_time = %llx\n",
-                           (u_longlong_t)drrb->drr_creation_time);
-                       (void) printf("\ttype = %u\n", drrb->drr_type);
-                       (void) printf("\tflags = 0x%x\n", drrb->drr_flags);
-                       (void) printf("\ttoguid = %llx\n",
-                           (u_longlong_t)drrb->drr_toguid);
-                       (void) printf("\tfromguid = %llx\n",
-                           (u_longlong_t)drrb->drr_fromguid);
-                       (void) printf("\ttoname = %s\n", drrb->drr_toname);
-                       if (verbose)
-                               (void) printf("\n");
-
-                       if ((DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) ==
-                           DMU_COMPOUNDSTREAM) && drr->drr_payloadlen != 0) {
-                               nvlist_t *nv;
-                               int sz = drr->drr_payloadlen;
-
-                               if (sz > SPA_MAXBLOCKSIZE) {
-                                       free(buf);
-                                       buf = safe_malloc(sz);
-                               }
-                               (void) ssread(buf, sz, &zc);
-                               if (ferror(send_stream))
-                                       perror("fread");
-                               err = nvlist_unpack(buf, sz, &nv, 0);
-                               if (err)
-                                       perror(strerror(err));
-                               nvlist_print(stdout, nv);
-                               nvlist_free(nv);
-                       }
-                       break;
-
-               case DRR_END:
-                       if (do_byteswap) {
-                               drre->drr_checksum.zc_word[0] =
-                                   BSWAP_64(drre->drr_checksum.zc_word[0]);
-                               drre->drr_checksum.zc_word[1] =
-                                   BSWAP_64(drre->drr_checksum.zc_word[1]);
-                               drre->drr_checksum.zc_word[2] =
-                                   BSWAP_64(drre->drr_checksum.zc_word[2]);
-                               drre->drr_checksum.zc_word[3] =
-                                   BSWAP_64(drre->drr_checksum.zc_word[3]);
-                       }
-                       /*
-                        * We compare against the *previous* checksum
-                        * value, because the stored checksum is of
-                        * everything before the DRR_END record.
-                        */
-                       if (do_cksum && !ZIO_CHECKSUM_EQUAL(drre->drr_checksum,
-                           pcksum)) {
-                               (void) printf("Expected checksum differs from "
-                                   "checksum in stream.\n");
-                               (void) printf("Expected checksum = "
-                                   "%llx/%llx/%llx/%llx\n",
-                                   (long long unsigned int)pcksum.zc_word[0],
-                                   (long long unsigned int)pcksum.zc_word[1],
-                                   (long long unsigned int)pcksum.zc_word[2],
-                                   (long long unsigned int)pcksum.zc_word[3]);
-                       }
-                       (void) printf("END checksum = %llx/%llx/%llx/%llx\n",
-                           (long long unsigned int)
-                           drre->drr_checksum.zc_word[0],
-                           (long long unsigned int)
-                           drre->drr_checksum.zc_word[1],
-                           (long long unsigned int)
-                           drre->drr_checksum.zc_word[2],
-                           (long long unsigned int)
-                           drre->drr_checksum.zc_word[3]);
-
-                       ZIO_SET_CHECKSUM(&zc, 0, 0, 0, 0);
-                       break;
-
-               case DRR_OBJECT:
-                       if (do_byteswap) {
-                               drro->drr_object = BSWAP_64(drro->drr_object);
-                               drro->drr_type = BSWAP_32(drro->drr_type);
-                               drro->drr_bonustype =
-                                   BSWAP_32(drro->drr_bonustype);
-                               drro->drr_blksz = BSWAP_32(drro->drr_blksz);
-                               drro->drr_bonuslen =
-                                   BSWAP_32(drro->drr_bonuslen);
-                               drro->drr_toguid = BSWAP_64(drro->drr_toguid);
-                       }
-                       if (verbose) {
-                               (void) printf("OBJECT object = %llu type = %u "
-                                   "bonustype = %u blksz = %u bonuslen = %u\n",
-                                   (u_longlong_t)drro->drr_object,
-                                   drro->drr_type,
-                                   drro->drr_bonustype,
-                                   drro->drr_blksz,
-                                   drro->drr_bonuslen);
-                       }
-                       if (drro->drr_bonuslen > 0) {
-                               (void) ssread(buf, P2ROUNDUP(drro->drr_bonuslen,
-                                   8), &zc);
-                               if (dump) {
-                                       print_block(buf,
-                                           P2ROUNDUP(drro->drr_bonuslen, 8));
-                               }
-                       }
-                       break;
-
-               case DRR_FREEOBJECTS:
-                       if (do_byteswap) {
-                               drrfo->drr_firstobj =
-                                   BSWAP_64(drrfo->drr_firstobj);
-                               drrfo->drr_numobjs =
-                                   BSWAP_64(drrfo->drr_numobjs);
-                               drrfo->drr_toguid = BSWAP_64(drrfo->drr_toguid);
-                       }
-                       if (verbose) {
-                               (void) printf("FREEOBJECTS firstobj = %llu "
-                                   "numobjs = %llu\n",
-                                   (u_longlong_t)drrfo->drr_firstobj,
-                                   (u_longlong_t)drrfo->drr_numobjs);
-                       }
-                       break;
-
-               case DRR_WRITE:
-                       if (do_byteswap) {
-                               drrw->drr_object = BSWAP_64(drrw->drr_object);
-                               drrw->drr_type = BSWAP_32(drrw->drr_type);
-                               drrw->drr_offset = BSWAP_64(drrw->drr_offset);
-                               drrw->drr_length = BSWAP_64(drrw->drr_length);
-                               drrw->drr_toguid = BSWAP_64(drrw->drr_toguid);
-                               drrw->drr_key.ddk_prop =
-                                   BSWAP_64(drrw->drr_key.ddk_prop);
-                       }
-                       /*
-                        * If this is verbose and/or dump output,
-                        * print info on the modified block
-                        */
-                       if (verbose) {
-                               (void) printf("WRITE object = %llu type = %u "
-                                   "checksum type = %u\n"
-                                   "offset = %llu length = %llu "
-                                   "props = %llx\n",
-                                   (u_longlong_t)drrw->drr_object,
-                                   drrw->drr_type,
-                                   drrw->drr_checksumtype,
-                                   (u_longlong_t)drrw->drr_offset,
-                                   (u_longlong_t)drrw->drr_length,
-                                   (u_longlong_t)drrw->drr_key.ddk_prop);
-                       }
-                       /*
-                        * Read the contents of the block in from STDIN to buf
-                        */
-                       (void) ssread(buf, drrw->drr_length, &zc);
-                       /*
-                        * If in dump mode
-                        */
-                       if (dump) {
-                               print_block(buf, drrw->drr_length);
-                       }
-                       total_write_size += drrw->drr_length;
-                       break;
-
-               case DRR_WRITE_BYREF:
-                       if (do_byteswap) {
-                               drrwbr->drr_object =
-                                   BSWAP_64(drrwbr->drr_object);
-                               drrwbr->drr_offset =
-                                   BSWAP_64(drrwbr->drr_offset);
-                               drrwbr->drr_length =
-                                   BSWAP_64(drrwbr->drr_length);
-                               drrwbr->drr_toguid =
-                                   BSWAP_64(drrwbr->drr_toguid);
-                               drrwbr->drr_refguid =
-                                   BSWAP_64(drrwbr->drr_refguid);
-                               drrwbr->drr_refobject =
-                                   BSWAP_64(drrwbr->drr_refobject);
-                               drrwbr->drr_refoffset =
-                                   BSWAP_64(drrwbr->drr_refoffset);
-                               drrwbr->drr_key.ddk_prop =
-                                   BSWAP_64(drrwbr->drr_key.ddk_prop);
-                       }
-                       if (verbose) {
-                               (void) printf("WRITE_BYREF object = %llu "
-                                   "checksum type = %u props = %llx\n"
-                                   "offset = %llu length = %llu\n"
-                                   "toguid = %llx refguid = %llx\n"
-                                   "refobject = %llu refoffset = %llu\n",
-                                   (u_longlong_t)drrwbr->drr_object,
-                                   drrwbr->drr_checksumtype,
-                                   (u_longlong_t)drrwbr->drr_key.ddk_prop,
-                                   (u_longlong_t)drrwbr->drr_offset,
-                                   (u_longlong_t)drrwbr->drr_length,
-                                   (u_longlong_t)drrwbr->drr_toguid,
-                                   (u_longlong_t)drrwbr->drr_refguid,
-                                   (u_longlong_t)drrwbr->drr_refobject,
-                                   (u_longlong_t)drrwbr->drr_refoffset);
-                       }
-                       break;
-
-               case DRR_FREE:
-                       if (do_byteswap) {
-                               drrf->drr_object = BSWAP_64(drrf->drr_object);
-                               drrf->drr_offset = BSWAP_64(drrf->drr_offset);
-                               drrf->drr_length = BSWAP_64(drrf->drr_length);
-                       }
-                       if (verbose) {
-                               (void) printf("FREE object = %llu "
-                                   "offset = %llu length = %lld\n",
-                                   (u_longlong_t)drrf->drr_object,
-                                   (u_longlong_t)drrf->drr_offset,
-                                   (longlong_t)drrf->drr_length);
-                       }
-                       break;
-               case DRR_SPILL:
-                       if (do_byteswap) {
-                               drrs->drr_object = BSWAP_64(drrs->drr_object);
-                               drrs->drr_length = BSWAP_64(drrs->drr_length);
-                       }
-                       if (verbose) {
-                               (void) printf("SPILL block for object = %llu "
-                                   "length = %llu\n",
-                                   (long long unsigned int)drrs->drr_object,
-                                   (long long unsigned int)drrs->drr_length);
-                       }
-                       (void) ssread(buf, drrs->drr_length, &zc);
-                       if (dump) {
-                               print_block(buf, drrs->drr_length);
-                       }
-                       break;
-               case DRR_WRITE_EMBEDDED:
-                       if (do_byteswap) {
-                               drrwe->drr_object =
-                                   BSWAP_64(drrwe->drr_object);
-                               drrwe->drr_offset =
-                                   BSWAP_64(drrwe->drr_offset);
-                               drrwe->drr_length =
-                                   BSWAP_64(drrwe->drr_length);
-                               drrwe->drr_toguid =
-                                   BSWAP_64(drrwe->drr_toguid);
-                               drrwe->drr_lsize =
-                                   BSWAP_32(drrwe->drr_lsize);
-                               drrwe->drr_psize =
-                                   BSWAP_32(drrwe->drr_psize);
-                       }
-                       if (verbose) {
-                               (void) printf("WRITE_EMBEDDED object = %llu "
-                                   "offset = %llu length = %llu\n"
-                                   "toguid = %llx comp = %u etype = %u "
-                                   "lsize = %u psize = %u\n",
-                                   (u_longlong_t)drrwe->drr_object,
-                                   (u_longlong_t)drrwe->drr_offset,
-                                   (u_longlong_t)drrwe->drr_length,
-                                   (u_longlong_t)drrwe->drr_toguid,
-                                   drrwe->drr_compression,
-                                   drrwe->drr_etype,
-                                   drrwe->drr_lsize,
-                                   drrwe->drr_psize);
-                       }
-                       (void) ssread(buf,
-                           P2ROUNDUP(drrwe->drr_psize, 8), &zc);
-                       break;
-               case DRR_NUMTYPES:
-                       /* should never be reached */
-                       exit(1);
-               }
-               pcksum = zc;
-       }
-       free(buf);
-
-       /* Print final summary */
-
-       (void) printf("SUMMARY:\n");
-       (void) printf("\tTotal DRR_BEGIN records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_BEGIN]);
-       (void) printf("\tTotal DRR_END records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_END]);
-       (void) printf("\tTotal DRR_OBJECT records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_OBJECT]);
-       (void) printf("\tTotal DRR_FREEOBJECTS records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_FREEOBJECTS]);
-       (void) printf("\tTotal DRR_WRITE records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_WRITE]);
-       (void) printf("\tTotal DRR_WRITE_BYREF records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_WRITE_BYREF]);
-       (void) printf("\tTotal DRR_WRITE_EMBEDDED records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_WRITE_EMBEDDED]);
-       (void) printf("\tTotal DRR_FREE records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_FREE]);
-       (void) printf("\tTotal DRR_SPILL records = %lld\n",
-           (u_longlong_t)drr_record_count[DRR_SPILL]);
-       (void) printf("\tTotal records = %lld\n",
-           (u_longlong_t)total_records);
-       (void) printf("\tTotal write size = %lld (0x%llx)\n",
-           (u_longlong_t)total_write_size, (u_longlong_t)total_write_size);
-       (void) printf("\tTotal stream length = %lld (0x%llx)\n",
-           (u_longlong_t)total_stream_len, (u_longlong_t)total_stream_len);
-       return (0);
-}
diff --git a/zfs/cmd/ztest/.gitignore b/zfs/cmd/ztest/.gitignore
deleted file mode 100644 (file)
index d3d498d..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/ztest
diff --git a/zfs/cmd/ztest/Makefile.am b/zfs/cmd/ztest/Makefile.am
deleted file mode 100644 (file)
index ef4d99f..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-sbin_PROGRAMS = ztest
-
-ztest_SOURCES = \
-       ztest.c
-
-ztest_LDADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libzpool/libzpool.la \
-       $(top_builddir)/lib/libzfs/libzfs.la \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la
-
-ztest_LDADD += -lm -ldl
diff --git a/zfs/cmd/ztest/Makefile.in b/zfs/cmd/ztest/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/ztest/ztest.c b/zfs/cmd/ztest/ztest.c
deleted file mode 100644 (file)
index afe6faa..0000000
+++ /dev/null
@@ -1,6532 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2015 by Delphix. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
- * Copyright (c) 2013 Steven Hartland. All rights reserved.
- */
-
-/*
- * The objective of this program is to provide a DMU/ZAP/SPA stress test
- * that runs entirely in userland, is easy to use, and easy to extend.
- *
- * The overall design of the ztest program is as follows:
- *
- * (1) For each major functional area (e.g. adding vdevs to a pool,
- *     creating and destroying datasets, reading and writing objects, etc)
- *     we have a simple routine to test that functionality.  These
- *     individual routines do not have to do anything "stressful".
- *
- * (2) We turn these simple functionality tests into a stress test by
- *     running them all in parallel, with as many threads as desired,
- *     and spread across as many datasets, objects, and vdevs as desired.
- *
- * (3) While all this is happening, we inject faults into the pool to
- *     verify that self-healing data really works.
- *
- * (4) Every time we open a dataset, we change its checksum and compression
- *     functions.  Thus even individual objects vary from block to block
- *     in which checksum they use and whether they're compressed.
- *
- * (5) To verify that we never lose on-disk consistency after a crash,
- *     we run the entire test in a child of the main process.
- *     At random times, the child self-immolates with a SIGKILL.
- *     This is the software equivalent of pulling the power cord.
- *     The parent then runs the test again, using the existing
- *     storage pool, as many times as desired. If backwards compatibility
- *     testing is enabled ztest will sometimes run the "older" version
- *     of ztest after a SIGKILL.
- *
- * (6) To verify that we don't have future leaks or temporal incursions,
- *     many of the functional tests record the transaction group number
- *     as part of their data.  When reading old data, they verify that
- *     the transaction group number is less than the current, open txg.
- *     If you add a new test, please do this if applicable.
- *
- * (7) Threads are created with a reduced stack size, for sanity checking.
- *     Therefore, it's important not to allocate huge buffers on the stack.
- *
- * When run with no arguments, ztest runs for about five minutes and
- * produces no output if successful.  To get a little bit of information,
- * specify -V.  To get more information, specify -VV, and so on.
- *
- * To turn this into an overnight stress test, use -T to specify run time.
- *
- * You can ask more more vdevs [-v], datasets [-d], or threads [-t]
- * to increase the pool capacity, fanout, and overall stress level.
- *
- * Use the -k option to set the desired frequency of kills.
- *
- * When ztest invokes itself it passes all relevant information through a
- * temporary file which is mmap-ed in the child process. This allows shared
- * memory to survive the exec syscall. The ztest_shared_hdr_t struct is always
- * stored at offset 0 of this file and contains information on the size and
- * number of shared structures in the file. The information stored in this file
- * must remain backwards compatible with older versions of ztest so that
- * ztest can invoke them during backwards compatibility testing (-B).
- */
-
-#include <sys/zfs_context.h>
-#include <sys/spa.h>
-#include <sys/dmu.h>
-#include <sys/txg.h>
-#include <sys/dbuf.h>
-#include <sys/zap.h>
-#include <sys/dmu_objset.h>
-#include <sys/poll.h>
-#include <sys/stat.h>
-#include <sys/time.h>
-#include <sys/wait.h>
-#include <sys/mman.h>
-#include <sys/resource.h>
-#include <sys/zio.h>
-#include <sys/zil.h>
-#include <sys/zil_impl.h>
-#include <sys/vdev_impl.h>
-#include <sys/vdev_file.h>
-#include <sys/spa_impl.h>
-#include <sys/metaslab_impl.h>
-#include <sys/dsl_prop.h>
-#include <sys/dsl_dataset.h>
-#include <sys/dsl_destroy.h>
-#include <sys/dsl_scan.h>
-#include <sys/zio_checksum.h>
-#include <sys/refcount.h>
-#include <sys/zfeature.h>
-#include <sys/dsl_userhold.h>
-#include <stdio.h>
-#include <stdio_ext.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <signal.h>
-#include <umem.h>
-#include <ctype.h>
-#include <math.h>
-#include <sys/fs/zfs.h>
-#include <libnvpair.h>
-#ifdef __GNUC__
-#include <execinfo.h> /* for backtrace() */
-#endif
-
-static int ztest_fd_data = -1;
-static int ztest_fd_rand = -1;
-
-typedef struct ztest_shared_hdr {
-       uint64_t        zh_hdr_size;
-       uint64_t        zh_opts_size;
-       uint64_t        zh_size;
-       uint64_t        zh_stats_size;
-       uint64_t        zh_stats_count;
-       uint64_t        zh_ds_size;
-       uint64_t        zh_ds_count;
-} ztest_shared_hdr_t;
-
-static ztest_shared_hdr_t *ztest_shared_hdr;
-
-typedef struct ztest_shared_opts {
-       char zo_pool[MAXNAMELEN];
-       char zo_dir[MAXNAMELEN];
-       char zo_alt_ztest[MAXNAMELEN];
-       char zo_alt_libpath[MAXNAMELEN];
-       uint64_t zo_vdevs;
-       uint64_t zo_vdevtime;
-       size_t zo_vdev_size;
-       int zo_ashift;
-       int zo_mirrors;
-       int zo_raidz;
-       int zo_raidz_parity;
-       int zo_datasets;
-       int zo_threads;
-       uint64_t zo_passtime;
-       uint64_t zo_killrate;
-       int zo_verbose;
-       int zo_init;
-       uint64_t zo_time;
-       uint64_t zo_maxloops;
-       uint64_t zo_metaslab_gang_bang;
-} ztest_shared_opts_t;
-
-static const ztest_shared_opts_t ztest_opts_defaults = {
-       .zo_pool = { 'z', 't', 'e', 's', 't', '\0' },
-       .zo_dir = { '/', 't', 'm', 'p', '\0' },
-       .zo_alt_ztest = { '\0' },
-       .zo_alt_libpath = { '\0' },
-       .zo_vdevs = 5,
-       .zo_ashift = SPA_MINBLOCKSHIFT,
-       .zo_mirrors = 2,
-       .zo_raidz = 4,
-       .zo_raidz_parity = 1,
-       .zo_vdev_size = SPA_MINDEVSIZE,
-       .zo_datasets = 7,
-       .zo_threads = 23,
-       .zo_passtime = 60,              /* 60 seconds */
-       .zo_killrate = 70,              /* 70% kill rate */
-       .zo_verbose = 0,
-       .zo_init = 1,
-       .zo_time = 300,                 /* 5 minutes */
-       .zo_maxloops = 50,              /* max loops during spa_freeze() */
-       .zo_metaslab_gang_bang = 32 << 10
-};
-
-extern uint64_t metaslab_gang_bang;
-extern uint64_t metaslab_df_alloc_threshold;
-extern int metaslab_preload_limit;
-
-static ztest_shared_opts_t *ztest_shared_opts;
-static ztest_shared_opts_t ztest_opts;
-
-typedef struct ztest_shared_ds {
-       uint64_t        zd_seq;
-} ztest_shared_ds_t;
-
-static ztest_shared_ds_t *ztest_shared_ds;
-#define        ZTEST_GET_SHARED_DS(d) (&ztest_shared_ds[d])
-
-#define        BT_MAGIC        0x123456789abcdefULL
-#define        MAXFAULTS() \
-       (MAX(zs->zs_mirrors, 1) * (ztest_opts.zo_raidz_parity + 1) - 1)
-
-enum ztest_io_type {
-       ZTEST_IO_WRITE_TAG,
-       ZTEST_IO_WRITE_PATTERN,
-       ZTEST_IO_WRITE_ZEROES,
-       ZTEST_IO_TRUNCATE,
-       ZTEST_IO_SETATTR,
-       ZTEST_IO_REWRITE,
-       ZTEST_IO_TYPES
-};
-
-typedef struct ztest_block_tag {
-       uint64_t        bt_magic;
-       uint64_t        bt_objset;
-       uint64_t        bt_object;
-       uint64_t        bt_offset;
-       uint64_t        bt_gen;
-       uint64_t        bt_txg;
-       uint64_t        bt_crtxg;
-} ztest_block_tag_t;
-
-typedef struct bufwad {
-       uint64_t        bw_index;
-       uint64_t        bw_txg;
-       uint64_t        bw_data;
-} bufwad_t;
-
-/*
- * XXX -- fix zfs range locks to be generic so we can use them here.
- */
-typedef enum {
-       RL_READER,
-       RL_WRITER,
-       RL_APPEND
-} rl_type_t;
-
-typedef struct rll {
-       void            *rll_writer;
-       int             rll_readers;
-       kmutex_t        rll_lock;
-       kcondvar_t      rll_cv;
-} rll_t;
-
-typedef struct rl {
-       uint64_t        rl_object;
-       uint64_t        rl_offset;
-       uint64_t        rl_size;
-       rll_t           *rl_lock;
-} rl_t;
-
-#define        ZTEST_RANGE_LOCKS       64
-#define        ZTEST_OBJECT_LOCKS      64
-
-/*
- * Object descriptor.  Used as a template for object lookup/create/remove.
- */
-typedef struct ztest_od {
-       uint64_t        od_dir;
-       uint64_t        od_object;
-       dmu_object_type_t od_type;
-       dmu_object_type_t od_crtype;
-       uint64_t        od_blocksize;
-       uint64_t        od_crblocksize;
-       uint64_t        od_gen;
-       uint64_t        od_crgen;
-       char            od_name[MAXNAMELEN];
-} ztest_od_t;
-
-/*
- * Per-dataset state.
- */
-typedef struct ztest_ds {
-       ztest_shared_ds_t *zd_shared;
-       objset_t        *zd_os;
-       rwlock_t        zd_zilog_lock;
-       zilog_t         *zd_zilog;
-       ztest_od_t      *zd_od;         /* debugging aid */
-       char            zd_name[MAXNAMELEN];
-       kmutex_t        zd_dirobj_lock;
-       rll_t           zd_object_lock[ZTEST_OBJECT_LOCKS];
-       rll_t           zd_range_lock[ZTEST_RANGE_LOCKS];
-} ztest_ds_t;
-
-/*
- * Per-iteration state.
- */
-typedef void ztest_func_t(ztest_ds_t *zd, uint64_t id);
-
-typedef struct ztest_info {
-       ztest_func_t    *zi_func;       /* test function */
-       uint64_t        zi_iters;       /* iterations per execution */
-       uint64_t        *zi_interval;   /* execute every <interval> seconds */
-       const char      *zi_funcname;   /* name of test function */
-} ztest_info_t;
-
-typedef struct ztest_shared_callstate {
-       uint64_t        zc_count;       /* per-pass count */
-       uint64_t        zc_time;        /* per-pass time */
-       uint64_t        zc_next;        /* next time to call this function */
-} ztest_shared_callstate_t;
-
-static ztest_shared_callstate_t *ztest_shared_callstate;
-#define        ZTEST_GET_SHARED_CALLSTATE(c) (&ztest_shared_callstate[c])
-
-ztest_func_t ztest_dmu_read_write;
-ztest_func_t ztest_dmu_write_parallel;
-ztest_func_t ztest_dmu_object_alloc_free;
-ztest_func_t ztest_dmu_commit_callbacks;
-ztest_func_t ztest_zap;
-ztest_func_t ztest_zap_parallel;
-ztest_func_t ztest_zil_commit;
-ztest_func_t ztest_zil_remount;
-ztest_func_t ztest_dmu_read_write_zcopy;
-ztest_func_t ztest_dmu_objset_create_destroy;
-ztest_func_t ztest_dmu_prealloc;
-ztest_func_t ztest_fzap;
-ztest_func_t ztest_dmu_snapshot_create_destroy;
-ztest_func_t ztest_dsl_prop_get_set;
-ztest_func_t ztest_spa_prop_get_set;
-ztest_func_t ztest_spa_create_destroy;
-ztest_func_t ztest_fault_inject;
-ztest_func_t ztest_ddt_repair;
-ztest_func_t ztest_dmu_snapshot_hold;
-ztest_func_t ztest_spa_rename;
-ztest_func_t ztest_scrub;
-ztest_func_t ztest_dsl_dataset_promote_busy;
-ztest_func_t ztest_vdev_attach_detach;
-ztest_func_t ztest_vdev_LUN_growth;
-ztest_func_t ztest_vdev_add_remove;
-ztest_func_t ztest_vdev_aux_add_remove;
-ztest_func_t ztest_split_pool;
-ztest_func_t ztest_reguid;
-ztest_func_t ztest_spa_upgrade;
-
-uint64_t zopt_always = 0ULL * NANOSEC;         /* all the time */
-uint64_t zopt_incessant = 1ULL * NANOSEC / 10; /* every 1/10 second */
-uint64_t zopt_often = 1ULL * NANOSEC;          /* every second */
-uint64_t zopt_sometimes = 10ULL * NANOSEC;     /* every 10 seconds */
-uint64_t zopt_rarely = 60ULL * NANOSEC;                /* every 60 seconds */
-
-#define        ZTI_INIT(func, iters, interval) \
-       {   .zi_func = (func), \
-           .zi_iters = (iters), \
-           .zi_interval = (interval), \
-           .zi_funcname = # func }
-
-ztest_info_t ztest_info[] = {
-       ZTI_INIT(ztest_dmu_read_write, 1, &zopt_always),
-       ZTI_INIT(ztest_dmu_write_parallel, 10, &zopt_always),
-       ZTI_INIT(ztest_dmu_object_alloc_free, 1, &zopt_always),
-       ZTI_INIT(ztest_dmu_commit_callbacks, 1, &zopt_always),
-       ZTI_INIT(ztest_zap, 30, &zopt_always),
-       ZTI_INIT(ztest_zap_parallel, 100, &zopt_always),
-       ZTI_INIT(ztest_split_pool, 1, &zopt_always),
-       ZTI_INIT(ztest_zil_commit, 1, &zopt_incessant),
-       ZTI_INIT(ztest_zil_remount, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_dmu_read_write_zcopy, 1, &zopt_often),
-       ZTI_INIT(ztest_dmu_objset_create_destroy, 1, &zopt_often),
-       ZTI_INIT(ztest_dsl_prop_get_set, 1, &zopt_often),
-       ZTI_INIT(ztest_spa_prop_get_set, 1, &zopt_sometimes),
-#if 0
-       ZTI_INIT(ztest_dmu_prealloc, 1, &zopt_sometimes),
-#endif
-       ZTI_INIT(ztest_fzap, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_dmu_snapshot_create_destroy, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_spa_create_destroy, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_fault_inject, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_ddt_repair, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_dmu_snapshot_hold, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_reguid, 1, &zopt_rarely),
-       ZTI_INIT(ztest_spa_rename, 1, &zopt_rarely),
-       ZTI_INIT(ztest_scrub, 1, &zopt_rarely),
-       ZTI_INIT(ztest_spa_upgrade, 1, &zopt_rarely),
-       ZTI_INIT(ztest_dsl_dataset_promote_busy, 1, &zopt_rarely),
-       ZTI_INIT(ztest_vdev_attach_detach, 1, &zopt_sometimes),
-       ZTI_INIT(ztest_vdev_LUN_growth, 1, &zopt_rarely),
-       ZTI_INIT(ztest_vdev_add_remove, 1, &ztest_opts.zo_vdevtime),
-       ZTI_INIT(ztest_vdev_aux_add_remove, 1, &ztest_opts.zo_vdevtime),
-};
-
-#define        ZTEST_FUNCS     (sizeof (ztest_info) / sizeof (ztest_info_t))
-
-/*
- * The following struct is used to hold a list of uncalled commit callbacks.
- * The callbacks are ordered by txg number.
- */
-typedef struct ztest_cb_list {
-       kmutex_t        zcl_callbacks_lock;
-       list_t          zcl_callbacks;
-} ztest_cb_list_t;
-
-/*
- * Stuff we need to share writably between parent and child.
- */
-typedef struct ztest_shared {
-       boolean_t       zs_do_init;
-       hrtime_t        zs_proc_start;
-       hrtime_t        zs_proc_stop;
-       hrtime_t        zs_thread_start;
-       hrtime_t        zs_thread_stop;
-       hrtime_t        zs_thread_kill;
-       uint64_t        zs_enospc_count;
-       uint64_t        zs_vdev_next_leaf;
-       uint64_t        zs_vdev_aux;
-       uint64_t        zs_alloc;
-       uint64_t        zs_space;
-       uint64_t        zs_splits;
-       uint64_t        zs_mirrors;
-       uint64_t        zs_metaslab_sz;
-       uint64_t        zs_metaslab_df_alloc_threshold;
-       uint64_t        zs_guid;
-} ztest_shared_t;
-
-#define        ID_PARALLEL     -1ULL
-
-static char ztest_dev_template[] = "%s/%s.%llua";
-static char ztest_aux_template[] = "%s/%s.%s.%llu";
-ztest_shared_t *ztest_shared;
-
-static spa_t *ztest_spa = NULL;
-static ztest_ds_t *ztest_ds;
-
-static kmutex_t ztest_vdev_lock;
-
-/*
- * The ztest_name_lock protects the pool and dataset namespace used by
- * the individual tests. To modify the namespace, consumers must grab
- * this lock as writer. Grabbing the lock as reader will ensure that the
- * namespace does not change while the lock is held.
- */
-static rwlock_t ztest_name_lock;
-
-static boolean_t ztest_dump_core = B_TRUE;
-static boolean_t ztest_exiting;
-
-/* Global commit callback list */
-static ztest_cb_list_t zcl;
-/* Commit cb delay */
-static uint64_t zc_min_txg_delay = UINT64_MAX;
-static int zc_cb_counter = 0;
-
-/*
- * Minimum number of commit callbacks that need to be registered for us to check
- * whether the minimum txg delay is acceptable.
- */
-#define        ZTEST_COMMIT_CB_MIN_REG 100
-
-/*
- * If a number of txgs equal to this threshold have been created after a commit
- * callback has been registered but not called, then we assume there is an
- * implementation bug.
- */
-#define        ZTEST_COMMIT_CB_THRESH  (TXG_CONCURRENT_STATES + 1000)
-
-extern uint64_t metaslab_gang_bang;
-extern uint64_t metaslab_df_alloc_threshold;
-
-enum ztest_object {
-       ZTEST_META_DNODE = 0,
-       ZTEST_DIROBJ,
-       ZTEST_OBJECTS
-};
-
-static void usage(boolean_t) __NORETURN;
-
-/*
- * These libumem hooks provide a reasonable set of defaults for the allocator's
- * debugging facilities.
- */
-const char *
-_umem_debug_init(void)
-{
-       return ("default,verbose"); /* $UMEM_DEBUG setting */
-}
-
-const char *
-_umem_logging_init(void)
-{
-       return ("fail,contents"); /* $UMEM_LOGGING setting */
-}
-
-#define        BACKTRACE_SZ    100
-
-static void sig_handler(int signo)
-{
-       struct sigaction action;
-#ifdef __GNUC__ /* backtrace() is a GNU extension */
-       int nptrs;
-       void *buffer[BACKTRACE_SZ];
-
-       nptrs = backtrace(buffer, BACKTRACE_SZ);
-       backtrace_symbols_fd(buffer, nptrs, STDERR_FILENO);
-#endif
-
-       /*
-        * Restore default action and re-raise signal so SIGSEGV and
-        * SIGABRT can trigger a core dump.
-        */
-       action.sa_handler = SIG_DFL;
-       sigemptyset(&action.sa_mask);
-       action.sa_flags = 0;
-       (void) sigaction(signo, &action, NULL);
-       raise(signo);
-}
-
-#define        FATAL_MSG_SZ    1024
-
-char *fatal_msg;
-
-static void
-fatal(int do_perror, char *message, ...)
-{
-       va_list args;
-       int save_errno = errno;
-       char *buf;
-
-       (void) fflush(stdout);
-       buf = umem_alloc(FATAL_MSG_SZ, UMEM_NOFAIL);
-
-       va_start(args, message);
-       (void) sprintf(buf, "ztest: ");
-       /* LINTED */
-       (void) vsprintf(buf + strlen(buf), message, args);
-       va_end(args);
-       if (do_perror) {
-               (void) snprintf(buf + strlen(buf), FATAL_MSG_SZ - strlen(buf),
-                   ": %s", strerror(save_errno));
-       }
-       (void) fprintf(stderr, "%s\n", buf);
-       fatal_msg = buf;                        /* to ease debugging */
-       if (ztest_dump_core)
-               abort();
-       exit(3);
-}
-
-static int
-str2shift(const char *buf)
-{
-       const char *ends = "BKMGTPEZ";
-       int i;
-
-       if (buf[0] == '\0')
-               return (0);
-       for (i = 0; i < strlen(ends); i++) {
-               if (toupper(buf[0]) == ends[i])
-                       break;
-       }
-       if (i == strlen(ends)) {
-               (void) fprintf(stderr, "ztest: invalid bytes suffix: %s\n",
-                   buf);
-               usage(B_FALSE);
-       }
-       if (buf[1] == '\0' || (toupper(buf[1]) == 'B' && buf[2] == '\0')) {
-               return (10*i);
-       }
-       (void) fprintf(stderr, "ztest: invalid bytes suffix: %s\n", buf);
-       usage(B_FALSE);
-       /* NOTREACHED */
-}
-
-static uint64_t
-nicenumtoull(const char *buf)
-{
-       char *end;
-       uint64_t val;
-
-       val = strtoull(buf, &end, 0);
-       if (end == buf) {
-               (void) fprintf(stderr, "ztest: bad numeric value: %s\n", buf);
-               usage(B_FALSE);
-       } else if (end[0] == '.') {
-               double fval = strtod(buf, &end);
-               fval *= pow(2, str2shift(end));
-               if (fval > UINT64_MAX) {
-                       (void) fprintf(stderr, "ztest: value too large: %s\n",
-                           buf);
-                       usage(B_FALSE);
-               }
-               val = (uint64_t)fval;
-       } else {
-               int shift = str2shift(end);
-               if (shift >= 64 || (val << shift) >> shift != val) {
-                       (void) fprintf(stderr, "ztest: value too large: %s\n",
-                           buf);
-                       usage(B_FALSE);
-               }
-               val <<= shift;
-       }
-       return (val);
-}
-
-static void
-usage(boolean_t requested)
-{
-       const ztest_shared_opts_t *zo = &ztest_opts_defaults;
-
-       char nice_vdev_size[10];
-       char nice_gang_bang[10];
-       FILE *fp = requested ? stdout : stderr;
-
-       nicenum(zo->zo_vdev_size, nice_vdev_size);
-       nicenum(zo->zo_metaslab_gang_bang, nice_gang_bang);
-
-       (void) fprintf(fp, "Usage: %s\n"
-           "\t[-v vdevs (default: %llu)]\n"
-           "\t[-s size_of_each_vdev (default: %s)]\n"
-           "\t[-a alignment_shift (default: %d)] use 0 for random\n"
-           "\t[-m mirror_copies (default: %d)]\n"
-           "\t[-r raidz_disks (default: %d)]\n"
-           "\t[-R raidz_parity (default: %d)]\n"
-           "\t[-d datasets (default: %d)]\n"
-           "\t[-t threads (default: %d)]\n"
-           "\t[-g gang_block_threshold (default: %s)]\n"
-           "\t[-i init_count (default: %d)] initialize pool i times\n"
-           "\t[-k kill_percentage (default: %llu%%)]\n"
-           "\t[-p pool_name (default: %s)]\n"
-           "\t[-f dir (default: %s)] file directory for vdev files\n"
-           "\t[-V] verbose (use multiple times for ever more blather)\n"
-           "\t[-E] use existing pool instead of creating new one\n"
-           "\t[-T time (default: %llu sec)] total run time\n"
-           "\t[-F freezeloops (default: %llu)] max loops in spa_freeze()\n"
-           "\t[-P passtime (default: %llu sec)] time per pass\n"
-           "\t[-B alt_ztest (default: <none>)] alternate ztest path\n"
-           "\t[-h] (print help)\n"
-           "",
-           zo->zo_pool,
-           (u_longlong_t)zo->zo_vdevs,                 /* -v */
-           nice_vdev_size,                             /* -s */
-           zo->zo_ashift,                              /* -a */
-           zo->zo_mirrors,                             /* -m */
-           zo->zo_raidz,                               /* -r */
-           zo->zo_raidz_parity,                        /* -R */
-           zo->zo_datasets,                            /* -d */
-           zo->zo_threads,                             /* -t */
-           nice_gang_bang,                             /* -g */
-           zo->zo_init,                                /* -i */
-           (u_longlong_t)zo->zo_killrate,              /* -k */
-           zo->zo_pool,                                /* -p */
-           zo->zo_dir,                                 /* -f */
-           (u_longlong_t)zo->zo_time,                  /* -T */
-           (u_longlong_t)zo->zo_maxloops,              /* -F */
-           (u_longlong_t)zo->zo_passtime);
-       exit(requested ? 0 : 1);
-}
-
-static void
-process_options(int argc, char **argv)
-{
-       char *path;
-       ztest_shared_opts_t *zo = &ztest_opts;
-
-       int opt;
-       uint64_t value;
-       char altdir[MAXNAMELEN] = { 0 };
-
-       bcopy(&ztest_opts_defaults, zo, sizeof (*zo));
-
-       while ((opt = getopt(argc, argv,
-           "v:s:a:m:r:R:d:t:g:i:k:p:f:VET:P:hF:B:")) != EOF) {
-               value = 0;
-               switch (opt) {
-               case 'v':
-               case 's':
-               case 'a':
-               case 'm':
-               case 'r':
-               case 'R':
-               case 'd':
-               case 't':
-               case 'g':
-               case 'i':
-               case 'k':
-               case 'T':
-               case 'P':
-               case 'F':
-                       value = nicenumtoull(optarg);
-               }
-               switch (opt) {
-               case 'v':
-                       zo->zo_vdevs = value;
-                       break;
-               case 's':
-                       zo->zo_vdev_size = MAX(SPA_MINDEVSIZE, value);
-                       break;
-               case 'a':
-                       zo->zo_ashift = value;
-                       break;
-               case 'm':
-                       zo->zo_mirrors = value;
-                       break;
-               case 'r':
-                       zo->zo_raidz = MAX(1, value);
-                       break;
-               case 'R':
-                       zo->zo_raidz_parity = MIN(MAX(value, 1), 3);
-                       break;
-               case 'd':
-                       zo->zo_datasets = MAX(1, value);
-                       break;
-               case 't':
-                       zo->zo_threads = MAX(1, value);
-                       break;
-               case 'g':
-                       zo->zo_metaslab_gang_bang = MAX(SPA_MINBLOCKSIZE << 1,
-                           value);
-                       break;
-               case 'i':
-                       zo->zo_init = value;
-                       break;
-               case 'k':
-                       zo->zo_killrate = value;
-                       break;
-               case 'p':
-                       (void) strlcpy(zo->zo_pool, optarg,
-                           sizeof (zo->zo_pool));
-                       break;
-               case 'f':
-                       path = realpath(optarg, NULL);
-                       if (path == NULL) {
-                               (void) fprintf(stderr, "error: %s: %s\n",
-                                   optarg, strerror(errno));
-                               usage(B_FALSE);
-                       } else {
-                               (void) strlcpy(zo->zo_dir, path,
-                                   sizeof (zo->zo_dir));
-                       }
-                       break;
-               case 'V':
-                       zo->zo_verbose++;
-                       break;
-               case 'E':
-                       zo->zo_init = 0;
-                       break;
-               case 'T':
-                       zo->zo_time = value;
-                       break;
-               case 'P':
-                       zo->zo_passtime = MAX(1, value);
-                       break;
-               case 'F':
-                       zo->zo_maxloops = MAX(1, value);
-                       break;
-               case 'B':
-                       (void) strlcpy(altdir, optarg, sizeof (altdir));
-                       break;
-               case 'h':
-                       usage(B_TRUE);
-                       break;
-               case '?':
-               default:
-                       usage(B_FALSE);
-                       break;
-               }
-       }
-
-       zo->zo_raidz_parity = MIN(zo->zo_raidz_parity, zo->zo_raidz - 1);
-
-       zo->zo_vdevtime =
-           (zo->zo_vdevs > 0 ? zo->zo_time * NANOSEC / zo->zo_vdevs :
-           UINT64_MAX >> 2);
-
-       if (strlen(altdir) > 0) {
-               char *cmd;
-               char *realaltdir;
-               char *bin;
-               char *ztest;
-               char *isa;
-               int isalen;
-
-               cmd = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-               realaltdir = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-
-               VERIFY(NULL != realpath(getexecname(), cmd));
-               if (0 != access(altdir, F_OK)) {
-                       ztest_dump_core = B_FALSE;
-                       fatal(B_TRUE, "invalid alternate ztest path: %s",
-                           altdir);
-               }
-               VERIFY(NULL != realpath(altdir, realaltdir));
-
-               /*
-                * 'cmd' should be of the form "<anything>/usr/bin/<isa>/ztest".
-                * We want to extract <isa> to determine if we should use
-                * 32 or 64 bit binaries.
-                */
-               bin = strstr(cmd, "/usr/bin/");
-               ztest = strstr(bin, "/ztest");
-               isa = bin + 9;
-               isalen = ztest - isa;
-               (void) snprintf(zo->zo_alt_ztest, sizeof (zo->zo_alt_ztest),
-                   "%s/usr/bin/%.*s/ztest", realaltdir, isalen, isa);
-               (void) snprintf(zo->zo_alt_libpath, sizeof (zo->zo_alt_libpath),
-                   "%s/usr/lib/%.*s", realaltdir, isalen, isa);
-
-               if (0 != access(zo->zo_alt_ztest, X_OK)) {
-                       ztest_dump_core = B_FALSE;
-                       fatal(B_TRUE, "invalid alternate ztest: %s",
-                           zo->zo_alt_ztest);
-               } else if (0 != access(zo->zo_alt_libpath, X_OK)) {
-                       ztest_dump_core = B_FALSE;
-                       fatal(B_TRUE, "invalid alternate lib directory %s",
-                           zo->zo_alt_libpath);
-               }
-
-               umem_free(cmd, MAXPATHLEN);
-               umem_free(realaltdir, MAXPATHLEN);
-       }
-}
-
-static void
-ztest_kill(ztest_shared_t *zs)
-{
-       zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(ztest_spa));
-       zs->zs_space = metaslab_class_get_space(spa_normal_class(ztest_spa));
-
-       /*
-        * Before we kill off ztest, make sure that the config is updated.
-        * See comment above spa_config_sync().
-        */
-       mutex_enter(&spa_namespace_lock);
-       spa_config_sync(ztest_spa, B_FALSE, B_FALSE);
-       mutex_exit(&spa_namespace_lock);
-
-       (void) kill(getpid(), SIGKILL);
-}
-
-static uint64_t
-ztest_random(uint64_t range)
-{
-       uint64_t r;
-
-       ASSERT3S(ztest_fd_rand, >=, 0);
-
-       if (range == 0)
-               return (0);
-
-       if (read(ztest_fd_rand, &r, sizeof (r)) != sizeof (r))
-               fatal(1, "short read from /dev/urandom");
-
-       return (r % range);
-}
-
-/* ARGSUSED */
-static void
-ztest_record_enospc(const char *s)
-{
-       ztest_shared->zs_enospc_count++;
-}
-
-static uint64_t
-ztest_get_ashift(void)
-{
-       if (ztest_opts.zo_ashift == 0)
-               return (SPA_MINBLOCKSHIFT + ztest_random(5));
-       return (ztest_opts.zo_ashift);
-}
-
-static nvlist_t *
-make_vdev_file(char *path, char *aux, char *pool, size_t size, uint64_t ashift)
-{
-       char *pathbuf;
-       uint64_t vdev;
-       nvlist_t *file;
-
-       pathbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-
-       if (ashift == 0)
-               ashift = ztest_get_ashift();
-
-       if (path == NULL) {
-               path = pathbuf;
-
-               if (aux != NULL) {
-                       vdev = ztest_shared->zs_vdev_aux;
-                       (void) snprintf(path, MAXPATHLEN,
-                           ztest_aux_template, ztest_opts.zo_dir,
-                           pool == NULL ? ztest_opts.zo_pool : pool,
-                           aux, vdev);
-               } else {
-                       vdev = ztest_shared->zs_vdev_next_leaf++;
-                       (void) snprintf(path, MAXPATHLEN,
-                           ztest_dev_template, ztest_opts.zo_dir,
-                           pool == NULL ? ztest_opts.zo_pool : pool, vdev);
-               }
-       }
-
-       if (size != 0) {
-               int fd = open(path, O_RDWR | O_CREAT | O_TRUNC, 0666);
-               if (fd == -1)
-                       fatal(1, "can't open %s", path);
-               if (ftruncate(fd, size) != 0)
-                       fatal(1, "can't ftruncate %s", path);
-               (void) close(fd);
-       }
-
-       VERIFY(nvlist_alloc(&file, NV_UNIQUE_NAME, 0) == 0);
-       VERIFY(nvlist_add_string(file, ZPOOL_CONFIG_TYPE, VDEV_TYPE_FILE) == 0);
-       VERIFY(nvlist_add_string(file, ZPOOL_CONFIG_PATH, path) == 0);
-       VERIFY(nvlist_add_uint64(file, ZPOOL_CONFIG_ASHIFT, ashift) == 0);
-       umem_free(pathbuf, MAXPATHLEN);
-
-       return (file);
-}
-
-static nvlist_t *
-make_vdev_raidz(char *path, char *aux, char *pool, size_t size,
-    uint64_t ashift, int r)
-{
-       nvlist_t *raidz, **child;
-       int c;
-
-       if (r < 2)
-               return (make_vdev_file(path, aux, pool, size, ashift));
-       child = umem_alloc(r * sizeof (nvlist_t *), UMEM_NOFAIL);
-
-       for (c = 0; c < r; c++)
-               child[c] = make_vdev_file(path, aux, pool, size, ashift);
-
-       VERIFY(nvlist_alloc(&raidz, NV_UNIQUE_NAME, 0) == 0);
-       VERIFY(nvlist_add_string(raidz, ZPOOL_CONFIG_TYPE,
-           VDEV_TYPE_RAIDZ) == 0);
-       VERIFY(nvlist_add_uint64(raidz, ZPOOL_CONFIG_NPARITY,
-           ztest_opts.zo_raidz_parity) == 0);
-       VERIFY(nvlist_add_nvlist_array(raidz, ZPOOL_CONFIG_CHILDREN,
-           child, r) == 0);
-
-       for (c = 0; c < r; c++)
-               nvlist_free(child[c]);
-
-       umem_free(child, r * sizeof (nvlist_t *));
-
-       return (raidz);
-}
-
-static nvlist_t *
-make_vdev_mirror(char *path, char *aux, char *pool, size_t size,
-    uint64_t ashift, int r, int m)
-{
-       nvlist_t *mirror, **child;
-       int c;
-
-       if (m < 1)
-               return (make_vdev_raidz(path, aux, pool, size, ashift, r));
-
-       child = umem_alloc(m * sizeof (nvlist_t *), UMEM_NOFAIL);
-
-       for (c = 0; c < m; c++)
-               child[c] = make_vdev_raidz(path, aux, pool, size, ashift, r);
-
-       VERIFY(nvlist_alloc(&mirror, NV_UNIQUE_NAME, 0) == 0);
-       VERIFY(nvlist_add_string(mirror, ZPOOL_CONFIG_TYPE,
-           VDEV_TYPE_MIRROR) == 0);
-       VERIFY(nvlist_add_nvlist_array(mirror, ZPOOL_CONFIG_CHILDREN,
-           child, m) == 0);
-
-       for (c = 0; c < m; c++)
-               nvlist_free(child[c]);
-
-       umem_free(child, m * sizeof (nvlist_t *));
-
-       return (mirror);
-}
-
-static nvlist_t *
-make_vdev_root(char *path, char *aux, char *pool, size_t size, uint64_t ashift,
-    int log, int r, int m, int t)
-{
-       nvlist_t *root, **child;
-       int c;
-
-       ASSERT(t > 0);
-
-       child = umem_alloc(t * sizeof (nvlist_t *), UMEM_NOFAIL);
-
-       for (c = 0; c < t; c++) {
-               child[c] = make_vdev_mirror(path, aux, pool, size, ashift,
-                   r, m);
-               VERIFY(nvlist_add_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-                   log) == 0);
-       }
-
-       VERIFY(nvlist_alloc(&root, NV_UNIQUE_NAME, 0) == 0);
-       VERIFY(nvlist_add_string(root, ZPOOL_CONFIG_TYPE, VDEV_TYPE_ROOT) == 0);
-       VERIFY(nvlist_add_nvlist_array(root, aux ? aux : ZPOOL_CONFIG_CHILDREN,
-           child, t) == 0);
-
-       for (c = 0; c < t; c++)
-               nvlist_free(child[c]);
-
-       umem_free(child, t * sizeof (nvlist_t *));
-
-       return (root);
-}
-
-/*
- * Find a random spa version. Returns back a random spa version in the
- * range [initial_version, SPA_VERSION_FEATURES].
- */
-static uint64_t
-ztest_random_spa_version(uint64_t initial_version)
-{
-       uint64_t version = initial_version;
-
-       if (version <= SPA_VERSION_BEFORE_FEATURES) {
-               version = version +
-                   ztest_random(SPA_VERSION_BEFORE_FEATURES - version + 1);
-       }
-
-       if (version > SPA_VERSION_BEFORE_FEATURES)
-               version = SPA_VERSION_FEATURES;
-
-       ASSERT(SPA_VERSION_IS_SUPPORTED(version));
-       return (version);
-}
-
-static int
-ztest_random_blocksize(void)
-{
-       /*
-        * Choose a block size >= the ashift.
-        * If the SPA supports new MAXBLOCKSIZE, test up to 1MB blocks.
-        */
-       int maxbs = SPA_OLD_MAXBLOCKSHIFT;
-       if (spa_maxblocksize(ztest_spa) == SPA_MAXBLOCKSIZE)
-               maxbs = 20;
-       uint64_t block_shift =
-           ztest_random(maxbs - ztest_spa->spa_max_ashift + 1);
-       return (1 << (SPA_MINBLOCKSHIFT + block_shift));
-}
-
-static int
-ztest_random_ibshift(void)
-{
-       return (DN_MIN_INDBLKSHIFT +
-           ztest_random(DN_MAX_INDBLKSHIFT - DN_MIN_INDBLKSHIFT + 1));
-}
-
-static uint64_t
-ztest_random_vdev_top(spa_t *spa, boolean_t log_ok)
-{
-       uint64_t top;
-       vdev_t *rvd = spa->spa_root_vdev;
-       vdev_t *tvd;
-
-       ASSERT(spa_config_held(spa, SCL_ALL, RW_READER) != 0);
-
-       do {
-               top = ztest_random(rvd->vdev_children);
-               tvd = rvd->vdev_child[top];
-       } while (tvd->vdev_ishole || (tvd->vdev_islog && !log_ok) ||
-           tvd->vdev_mg == NULL || tvd->vdev_mg->mg_class == NULL);
-
-       return (top);
-}
-
-static uint64_t
-ztest_random_dsl_prop(zfs_prop_t prop)
-{
-       uint64_t value;
-
-       do {
-               value = zfs_prop_random_value(prop, ztest_random(-1ULL));
-       } while (prop == ZFS_PROP_CHECKSUM && value == ZIO_CHECKSUM_OFF);
-
-       return (value);
-}
-
-static int
-ztest_dsl_prop_set_uint64(char *osname, zfs_prop_t prop, uint64_t value,
-    boolean_t inherit)
-{
-       const char *propname = zfs_prop_to_name(prop);
-       const char *valname;
-       char *setpoint;
-       uint64_t curval;
-       int error;
-
-       error = dsl_prop_set_int(osname, propname,
-           (inherit ? ZPROP_SRC_NONE : ZPROP_SRC_LOCAL), value);
-
-       if (error == ENOSPC) {
-               ztest_record_enospc(FTAG);
-               return (error);
-       }
-       ASSERT0(error);
-
-       setpoint = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-       VERIFY0(dsl_prop_get_integer(osname, propname, &curval, setpoint));
-
-       if (ztest_opts.zo_verbose >= 6) {
-               int err;
-
-               err = zfs_prop_index_to_string(prop, curval, &valname);
-               if (err)
-                       (void) printf("%s %s = %llu at '%s'\n",
-                           osname, propname, (unsigned long long)curval,
-                               setpoint);
-               else
-                       (void) printf("%s %s = %s at '%s'\n",
-                           osname, propname, valname, setpoint);
-       }
-       umem_free(setpoint, MAXPATHLEN);
-
-       return (error);
-}
-
-static int
-ztest_spa_prop_set_uint64(zpool_prop_t prop, uint64_t value)
-{
-       spa_t *spa = ztest_spa;
-       nvlist_t *props = NULL;
-       int error;
-
-       VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
-       VERIFY(nvlist_add_uint64(props, zpool_prop_to_name(prop), value) == 0);
-
-       error = spa_prop_set(spa, props);
-
-       nvlist_free(props);
-
-       if (error == ENOSPC) {
-               ztest_record_enospc(FTAG);
-               return (error);
-       }
-       ASSERT0(error);
-
-       return (error);
-}
-
-static void
-ztest_rll_init(rll_t *rll)
-{
-       rll->rll_writer = NULL;
-       rll->rll_readers = 0;
-       mutex_init(&rll->rll_lock, NULL, MUTEX_DEFAULT, NULL);
-       cv_init(&rll->rll_cv, NULL, CV_DEFAULT, NULL);
-}
-
-static void
-ztest_rll_destroy(rll_t *rll)
-{
-       ASSERT(rll->rll_writer == NULL);
-       ASSERT(rll->rll_readers == 0);
-       mutex_destroy(&rll->rll_lock);
-       cv_destroy(&rll->rll_cv);
-}
-
-static void
-ztest_rll_lock(rll_t *rll, rl_type_t type)
-{
-       mutex_enter(&rll->rll_lock);
-
-       if (type == RL_READER) {
-               while (rll->rll_writer != NULL)
-                       (void) cv_wait(&rll->rll_cv, &rll->rll_lock);
-               rll->rll_readers++;
-       } else {
-               while (rll->rll_writer != NULL || rll->rll_readers)
-                       (void) cv_wait(&rll->rll_cv, &rll->rll_lock);
-               rll->rll_writer = curthread;
-       }
-
-       mutex_exit(&rll->rll_lock);
-}
-
-static void
-ztest_rll_unlock(rll_t *rll)
-{
-       mutex_enter(&rll->rll_lock);
-
-       if (rll->rll_writer) {
-               ASSERT(rll->rll_readers == 0);
-               rll->rll_writer = NULL;
-       } else {
-               ASSERT(rll->rll_readers != 0);
-               ASSERT(rll->rll_writer == NULL);
-               rll->rll_readers--;
-       }
-
-       if (rll->rll_writer == NULL && rll->rll_readers == 0)
-               cv_broadcast(&rll->rll_cv);
-
-       mutex_exit(&rll->rll_lock);
-}
-
-static void
-ztest_object_lock(ztest_ds_t *zd, uint64_t object, rl_type_t type)
-{
-       rll_t *rll = &zd->zd_object_lock[object & (ZTEST_OBJECT_LOCKS - 1)];
-
-       ztest_rll_lock(rll, type);
-}
-
-static void
-ztest_object_unlock(ztest_ds_t *zd, uint64_t object)
-{
-       rll_t *rll = &zd->zd_object_lock[object & (ZTEST_OBJECT_LOCKS - 1)];
-
-       ztest_rll_unlock(rll);
-}
-
-static rl_t *
-ztest_range_lock(ztest_ds_t *zd, uint64_t object, uint64_t offset,
-    uint64_t size, rl_type_t type)
-{
-       uint64_t hash = object ^ (offset % (ZTEST_RANGE_LOCKS + 1));
-       rll_t *rll = &zd->zd_range_lock[hash & (ZTEST_RANGE_LOCKS - 1)];
-       rl_t *rl;
-
-       rl = umem_alloc(sizeof (*rl), UMEM_NOFAIL);
-       rl->rl_object = object;
-       rl->rl_offset = offset;
-       rl->rl_size = size;
-       rl->rl_lock = rll;
-
-       ztest_rll_lock(rll, type);
-
-       return (rl);
-}
-
-static void
-ztest_range_unlock(rl_t *rl)
-{
-       rll_t *rll = rl->rl_lock;
-
-       ztest_rll_unlock(rll);
-
-       umem_free(rl, sizeof (*rl));
-}
-
-static void
-ztest_zd_init(ztest_ds_t *zd, ztest_shared_ds_t *szd, objset_t *os)
-{
-       zd->zd_os = os;
-       zd->zd_zilog = dmu_objset_zil(os);
-       zd->zd_shared = szd;
-       dmu_objset_name(os, zd->zd_name);
-       int l;
-
-       if (zd->zd_shared != NULL)
-               zd->zd_shared->zd_seq = 0;
-
-       VERIFY(rwlock_init(&zd->zd_zilog_lock, USYNC_THREAD, NULL) == 0);
-       mutex_init(&zd->zd_dirobj_lock, NULL, MUTEX_DEFAULT, NULL);
-
-       for (l = 0; l < ZTEST_OBJECT_LOCKS; l++)
-               ztest_rll_init(&zd->zd_object_lock[l]);
-
-       for (l = 0; l < ZTEST_RANGE_LOCKS; l++)
-               ztest_rll_init(&zd->zd_range_lock[l]);
-}
-
-static void
-ztest_zd_fini(ztest_ds_t *zd)
-{
-       int l;
-
-       mutex_destroy(&zd->zd_dirobj_lock);
-       (void) rwlock_destroy(&zd->zd_zilog_lock);
-
-       for (l = 0; l < ZTEST_OBJECT_LOCKS; l++)
-               ztest_rll_destroy(&zd->zd_object_lock[l]);
-
-       for (l = 0; l < ZTEST_RANGE_LOCKS; l++)
-               ztest_rll_destroy(&zd->zd_range_lock[l]);
-}
-
-#define        TXG_MIGHTWAIT   (ztest_random(10) == 0 ? TXG_NOWAIT : TXG_WAIT)
-
-static uint64_t
-ztest_tx_assign(dmu_tx_t *tx, uint64_t txg_how, const char *tag)
-{
-       uint64_t txg;
-       int error;
-
-       /*
-        * Attempt to assign tx to some transaction group.
-        */
-       error = dmu_tx_assign(tx, txg_how);
-       if (error) {
-               if (error == ERESTART) {
-                       ASSERT(txg_how == TXG_NOWAIT);
-                       dmu_tx_wait(tx);
-               } else {
-                       ASSERT3U(error, ==, ENOSPC);
-                       ztest_record_enospc(tag);
-               }
-               dmu_tx_abort(tx);
-               return (0);
-       }
-       txg = dmu_tx_get_txg(tx);
-       ASSERT(txg != 0);
-       return (txg);
-}
-
-static void
-ztest_pattern_set(void *buf, uint64_t size, uint64_t value)
-{
-       uint64_t *ip = buf;
-       uint64_t *ip_end = (uint64_t *)((uintptr_t)buf + (uintptr_t)size);
-
-       while (ip < ip_end)
-               *ip++ = value;
-}
-
-#ifndef NDEBUG
-static boolean_t
-ztest_pattern_match(void *buf, uint64_t size, uint64_t value)
-{
-       uint64_t *ip = buf;
-       uint64_t *ip_end = (uint64_t *)((uintptr_t)buf + (uintptr_t)size);
-       uint64_t diff = 0;
-
-       while (ip < ip_end)
-               diff |= (value - *ip++);
-
-       return (diff == 0);
-}
-#endif
-
-static void
-ztest_bt_generate(ztest_block_tag_t *bt, objset_t *os, uint64_t object,
-    uint64_t offset, uint64_t gen, uint64_t txg, uint64_t crtxg)
-{
-       bt->bt_magic = BT_MAGIC;
-       bt->bt_objset = dmu_objset_id(os);
-       bt->bt_object = object;
-       bt->bt_offset = offset;
-       bt->bt_gen = gen;
-       bt->bt_txg = txg;
-       bt->bt_crtxg = crtxg;
-}
-
-static void
-ztest_bt_verify(ztest_block_tag_t *bt, objset_t *os, uint64_t object,
-    uint64_t offset, uint64_t gen, uint64_t txg, uint64_t crtxg)
-{
-       ASSERT3U(bt->bt_magic, ==, BT_MAGIC);
-       ASSERT3U(bt->bt_objset, ==, dmu_objset_id(os));
-       ASSERT3U(bt->bt_object, ==, object);
-       ASSERT3U(bt->bt_offset, ==, offset);
-       ASSERT3U(bt->bt_gen, <=, gen);
-       ASSERT3U(bt->bt_txg, <=, txg);
-       ASSERT3U(bt->bt_crtxg, ==, crtxg);
-}
-
-static ztest_block_tag_t *
-ztest_bt_bonus(dmu_buf_t *db)
-{
-       dmu_object_info_t doi;
-       ztest_block_tag_t *bt;
-
-       dmu_object_info_from_db(db, &doi);
-       ASSERT3U(doi.doi_bonus_size, <=, db->db_size);
-       ASSERT3U(doi.doi_bonus_size, >=, sizeof (*bt));
-       bt = (void *)((char *)db->db_data + doi.doi_bonus_size - sizeof (*bt));
-
-       return (bt);
-}
-
-/*
- * ZIL logging ops
- */
-
-#define        lrz_type        lr_mode
-#define        lrz_blocksize   lr_uid
-#define        lrz_ibshift     lr_gid
-#define        lrz_bonustype   lr_rdev
-#define        lrz_bonuslen    lr_crtime[1]
-
-static void
-ztest_log_create(ztest_ds_t *zd, dmu_tx_t *tx, lr_create_t *lr)
-{
-       char *name = (void *)(lr + 1);          /* name follows lr */
-       size_t namesize = strlen(name) + 1;
-       itx_t *itx;
-
-       if (zil_replaying(zd->zd_zilog, tx))
-               return;
-
-       itx = zil_itx_create(TX_CREATE, sizeof (*lr) + namesize);
-       bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
-           sizeof (*lr) + namesize - sizeof (lr_t));
-
-       zil_itx_assign(zd->zd_zilog, itx, tx);
-}
-
-static void
-ztest_log_remove(ztest_ds_t *zd, dmu_tx_t *tx, lr_remove_t *lr, uint64_t object)
-{
-       char *name = (void *)(lr + 1);          /* name follows lr */
-       size_t namesize = strlen(name) + 1;
-       itx_t *itx;
-
-       if (zil_replaying(zd->zd_zilog, tx))
-               return;
-
-       itx = zil_itx_create(TX_REMOVE, sizeof (*lr) + namesize);
-       bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
-           sizeof (*lr) + namesize - sizeof (lr_t));
-
-       itx->itx_oid = object;
-       zil_itx_assign(zd->zd_zilog, itx, tx);
-}
-
-static void
-ztest_log_write(ztest_ds_t *zd, dmu_tx_t *tx, lr_write_t *lr)
-{
-       itx_t *itx;
-       itx_wr_state_t write_state = ztest_random(WR_NUM_STATES);
-
-       if (zil_replaying(zd->zd_zilog, tx))
-               return;
-
-       if (lr->lr_length > ZIL_MAX_LOG_DATA)
-               write_state = WR_INDIRECT;
-
-       itx = zil_itx_create(TX_WRITE,
-           sizeof (*lr) + (write_state == WR_COPIED ? lr->lr_length : 0));
-
-       if (write_state == WR_COPIED &&
-           dmu_read(zd->zd_os, lr->lr_foid, lr->lr_offset, lr->lr_length,
-           ((lr_write_t *)&itx->itx_lr) + 1, DMU_READ_NO_PREFETCH) != 0) {
-               zil_itx_destroy(itx);
-               itx = zil_itx_create(TX_WRITE, sizeof (*lr));
-               write_state = WR_NEED_COPY;
-       }
-       itx->itx_private = zd;
-       itx->itx_wr_state = write_state;
-       itx->itx_sync = (ztest_random(8) == 0);
-       itx->itx_sod += (write_state == WR_NEED_COPY ? lr->lr_length : 0);
-
-       bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
-           sizeof (*lr) - sizeof (lr_t));
-
-       zil_itx_assign(zd->zd_zilog, itx, tx);
-}
-
-static void
-ztest_log_truncate(ztest_ds_t *zd, dmu_tx_t *tx, lr_truncate_t *lr)
-{
-       itx_t *itx;
-
-       if (zil_replaying(zd->zd_zilog, tx))
-               return;
-
-       itx = zil_itx_create(TX_TRUNCATE, sizeof (*lr));
-       bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
-           sizeof (*lr) - sizeof (lr_t));
-
-       itx->itx_sync = B_FALSE;
-       zil_itx_assign(zd->zd_zilog, itx, tx);
-}
-
-static void
-ztest_log_setattr(ztest_ds_t *zd, dmu_tx_t *tx, lr_setattr_t *lr)
-{
-       itx_t *itx;
-
-       if (zil_replaying(zd->zd_zilog, tx))
-               return;
-
-       itx = zil_itx_create(TX_SETATTR, sizeof (*lr));
-       bcopy(&lr->lr_common + 1, &itx->itx_lr + 1,
-           sizeof (*lr) - sizeof (lr_t));
-
-       itx->itx_sync = B_FALSE;
-       zil_itx_assign(zd->zd_zilog, itx, tx);
-}
-
-/*
- * ZIL replay ops
- */
-static int
-ztest_replay_create(ztest_ds_t *zd, lr_create_t *lr, boolean_t byteswap)
-{
-       char *name = (void *)(lr + 1);          /* name follows lr */
-       objset_t *os = zd->zd_os;
-       ztest_block_tag_t *bbt;
-       dmu_buf_t *db;
-       dmu_tx_t *tx;
-       uint64_t txg;
-       int error = 0;
-
-       if (byteswap)
-               byteswap_uint64_array(lr, sizeof (*lr));
-
-       ASSERT(lr->lr_doid == ZTEST_DIROBJ);
-       ASSERT(name[0] != '\0');
-
-       tx = dmu_tx_create(os);
-
-       dmu_tx_hold_zap(tx, lr->lr_doid, B_TRUE, name);
-
-       if (lr->lrz_type == DMU_OT_ZAP_OTHER) {
-               dmu_tx_hold_zap(tx, DMU_NEW_OBJECT, B_TRUE, NULL);
-       } else {
-               dmu_tx_hold_bonus(tx, DMU_NEW_OBJECT);
-       }
-
-       txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
-       if (txg == 0)
-               return (ENOSPC);
-
-       ASSERT(dmu_objset_zil(os)->zl_replay == !!lr->lr_foid);
-
-       if (lr->lrz_type == DMU_OT_ZAP_OTHER) {
-               if (lr->lr_foid == 0) {
-                       lr->lr_foid = zap_create(os,
-                           lr->lrz_type, lr->lrz_bonustype,
-                           lr->lrz_bonuslen, tx);
-               } else {
-                       error = zap_create_claim(os, lr->lr_foid,
-                           lr->lrz_type, lr->lrz_bonustype,
-                           lr->lrz_bonuslen, tx);
-               }
-       } else {
-               if (lr->lr_foid == 0) {
-                       lr->lr_foid = dmu_object_alloc(os,
-                           lr->lrz_type, 0, lr->lrz_bonustype,
-                           lr->lrz_bonuslen, tx);
-               } else {
-                       error = dmu_object_claim(os, lr->lr_foid,
-                           lr->lrz_type, 0, lr->lrz_bonustype,
-                           lr->lrz_bonuslen, tx);
-               }
-       }
-
-       if (error) {
-               ASSERT3U(error, ==, EEXIST);
-               ASSERT(zd->zd_zilog->zl_replay);
-               dmu_tx_commit(tx);
-               return (error);
-       }
-
-       ASSERT(lr->lr_foid != 0);
-
-       if (lr->lrz_type != DMU_OT_ZAP_OTHER)
-               VERIFY3U(0, ==, dmu_object_set_blocksize(os, lr->lr_foid,
-                   lr->lrz_blocksize, lr->lrz_ibshift, tx));
-
-       VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db));
-       bbt = ztest_bt_bonus(db);
-       dmu_buf_will_dirty(db, tx);
-       ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_gen, txg, txg);
-       dmu_buf_rele(db, FTAG);
-
-       VERIFY3U(0, ==, zap_add(os, lr->lr_doid, name, sizeof (uint64_t), 1,
-           &lr->lr_foid, tx));
-
-       (void) ztest_log_create(zd, tx, lr);
-
-       dmu_tx_commit(tx);
-
-       return (0);
-}
-
-static int
-ztest_replay_remove(ztest_ds_t *zd, lr_remove_t *lr, boolean_t byteswap)
-{
-       char *name = (void *)(lr + 1);          /* name follows lr */
-       objset_t *os = zd->zd_os;
-       dmu_object_info_t doi;
-       dmu_tx_t *tx;
-       uint64_t object, txg;
-
-       if (byteswap)
-               byteswap_uint64_array(lr, sizeof (*lr));
-
-       ASSERT(lr->lr_doid == ZTEST_DIROBJ);
-       ASSERT(name[0] != '\0');
-
-       VERIFY3U(0, ==,
-           zap_lookup(os, lr->lr_doid, name, sizeof (object), 1, &object));
-       ASSERT(object != 0);
-
-       ztest_object_lock(zd, object, RL_WRITER);
-
-       VERIFY3U(0, ==, dmu_object_info(os, object, &doi));
-
-       tx = dmu_tx_create(os);
-
-       dmu_tx_hold_zap(tx, lr->lr_doid, B_FALSE, name);
-       dmu_tx_hold_free(tx, object, 0, DMU_OBJECT_END);
-
-       txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
-       if (txg == 0) {
-               ztest_object_unlock(zd, object);
-               return (ENOSPC);
-       }
-
-       if (doi.doi_type == DMU_OT_ZAP_OTHER) {
-               VERIFY3U(0, ==, zap_destroy(os, object, tx));
-       } else {
-               VERIFY3U(0, ==, dmu_object_free(os, object, tx));
-       }
-
-       VERIFY3U(0, ==, zap_remove(os, lr->lr_doid, name, tx));
-
-       (void) ztest_log_remove(zd, tx, lr, object);
-
-       dmu_tx_commit(tx);
-
-       ztest_object_unlock(zd, object);
-
-       return (0);
-}
-
-static int
-ztest_replay_write(ztest_ds_t *zd, lr_write_t *lr, boolean_t byteswap)
-{
-       objset_t *os = zd->zd_os;
-       void *data = lr + 1;                    /* data follows lr */
-       uint64_t offset, length;
-       ztest_block_tag_t *bt = data;
-       ztest_block_tag_t *bbt;
-       uint64_t gen, txg, lrtxg, crtxg;
-       dmu_object_info_t doi;
-       dmu_tx_t *tx;
-       dmu_buf_t *db;
-       arc_buf_t *abuf = NULL;
-       rl_t *rl;
-
-       if (byteswap)
-               byteswap_uint64_array(lr, sizeof (*lr));
-
-       offset = lr->lr_offset;
-       length = lr->lr_length;
-
-       /* If it's a dmu_sync() block, write the whole block */
-       if (lr->lr_common.lrc_reclen == sizeof (lr_write_t)) {
-               uint64_t blocksize = BP_GET_LSIZE(&lr->lr_blkptr);
-               if (length < blocksize) {
-                       offset -= offset % blocksize;
-                       length = blocksize;
-               }
-       }
-
-       if (bt->bt_magic == BSWAP_64(BT_MAGIC))
-               byteswap_uint64_array(bt, sizeof (*bt));
-
-       if (bt->bt_magic != BT_MAGIC)
-               bt = NULL;
-
-       ztest_object_lock(zd, lr->lr_foid, RL_READER);
-       rl = ztest_range_lock(zd, lr->lr_foid, offset, length, RL_WRITER);
-
-       VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db));
-
-       dmu_object_info_from_db(db, &doi);
-
-       bbt = ztest_bt_bonus(db);
-       ASSERT3U(bbt->bt_magic, ==, BT_MAGIC);
-       gen = bbt->bt_gen;
-       crtxg = bbt->bt_crtxg;
-       lrtxg = lr->lr_common.lrc_txg;
-
-       tx = dmu_tx_create(os);
-
-       dmu_tx_hold_write(tx, lr->lr_foid, offset, length);
-
-       if (ztest_random(8) == 0 && length == doi.doi_data_block_size &&
-           P2PHASE(offset, length) == 0)
-               abuf = dmu_request_arcbuf(db, length);
-
-       txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
-       if (txg == 0) {
-               if (abuf != NULL)
-                       dmu_return_arcbuf(abuf);
-               dmu_buf_rele(db, FTAG);
-               ztest_range_unlock(rl);
-               ztest_object_unlock(zd, lr->lr_foid);
-               return (ENOSPC);
-       }
-
-       if (bt != NULL) {
-               /*
-                * Usually, verify the old data before writing new data --
-                * but not always, because we also want to verify correct
-                * behavior when the data was not recently read into cache.
-                */
-               ASSERT(offset % doi.doi_data_block_size == 0);
-               if (ztest_random(4) != 0) {
-                       int prefetch = ztest_random(2) ?
-                           DMU_READ_PREFETCH : DMU_READ_NO_PREFETCH;
-                       ztest_block_tag_t rbt;
-
-                       VERIFY(dmu_read(os, lr->lr_foid, offset,
-                           sizeof (rbt), &rbt, prefetch) == 0);
-                       if (rbt.bt_magic == BT_MAGIC) {
-                               ztest_bt_verify(&rbt, os, lr->lr_foid,
-                                   offset, gen, txg, crtxg);
-                       }
-               }
-
-               /*
-                * Writes can appear to be newer than the bonus buffer because
-                * the ztest_get_data() callback does a dmu_read() of the
-                * open-context data, which may be different than the data
-                * as it was when the write was generated.
-                */
-               if (zd->zd_zilog->zl_replay) {
-                       ztest_bt_verify(bt, os, lr->lr_foid, offset,
-                           MAX(gen, bt->bt_gen), MAX(txg, lrtxg),
-                           bt->bt_crtxg);
-               }
-
-               /*
-                * Set the bt's gen/txg to the bonus buffer's gen/txg
-                * so that all of the usual ASSERTs will work.
-                */
-               ztest_bt_generate(bt, os, lr->lr_foid, offset, gen, txg, crtxg);
-       }
-
-       if (abuf == NULL) {
-               dmu_write(os, lr->lr_foid, offset, length, data, tx);
-       } else {
-               bcopy(data, abuf->b_data, length);
-               dmu_assign_arcbuf(db, offset, abuf, tx);
-       }
-
-       (void) ztest_log_write(zd, tx, lr);
-
-       dmu_buf_rele(db, FTAG);
-
-       dmu_tx_commit(tx);
-
-       ztest_range_unlock(rl);
-       ztest_object_unlock(zd, lr->lr_foid);
-
-       return (0);
-}
-
-static int
-ztest_replay_truncate(ztest_ds_t *zd, lr_truncate_t *lr, boolean_t byteswap)
-{
-       objset_t *os = zd->zd_os;
-       dmu_tx_t *tx;
-       uint64_t txg;
-       rl_t *rl;
-
-       if (byteswap)
-               byteswap_uint64_array(lr, sizeof (*lr));
-
-       ztest_object_lock(zd, lr->lr_foid, RL_READER);
-       rl = ztest_range_lock(zd, lr->lr_foid, lr->lr_offset, lr->lr_length,
-           RL_WRITER);
-
-       tx = dmu_tx_create(os);
-
-       dmu_tx_hold_free(tx, lr->lr_foid, lr->lr_offset, lr->lr_length);
-
-       txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
-       if (txg == 0) {
-               ztest_range_unlock(rl);
-               ztest_object_unlock(zd, lr->lr_foid);
-               return (ENOSPC);
-       }
-
-       VERIFY(dmu_free_range(os, lr->lr_foid, lr->lr_offset,
-           lr->lr_length, tx) == 0);
-
-       (void) ztest_log_truncate(zd, tx, lr);
-
-       dmu_tx_commit(tx);
-
-       ztest_range_unlock(rl);
-       ztest_object_unlock(zd, lr->lr_foid);
-
-       return (0);
-}
-
-static int
-ztest_replay_setattr(ztest_ds_t *zd, lr_setattr_t *lr, boolean_t byteswap)
-{
-       objset_t *os = zd->zd_os;
-       dmu_tx_t *tx;
-       dmu_buf_t *db;
-       ztest_block_tag_t *bbt;
-       uint64_t txg, lrtxg, crtxg;
-
-       if (byteswap)
-               byteswap_uint64_array(lr, sizeof (*lr));
-
-       ztest_object_lock(zd, lr->lr_foid, RL_WRITER);
-
-       VERIFY3U(0, ==, dmu_bonus_hold(os, lr->lr_foid, FTAG, &db));
-
-       tx = dmu_tx_create(os);
-       dmu_tx_hold_bonus(tx, lr->lr_foid);
-
-       txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
-       if (txg == 0) {
-               dmu_buf_rele(db, FTAG);
-               ztest_object_unlock(zd, lr->lr_foid);
-               return (ENOSPC);
-       }
-
-       bbt = ztest_bt_bonus(db);
-       ASSERT3U(bbt->bt_magic, ==, BT_MAGIC);
-       crtxg = bbt->bt_crtxg;
-       lrtxg = lr->lr_common.lrc_txg;
-
-       if (zd->zd_zilog->zl_replay) {
-               ASSERT(lr->lr_size != 0);
-               ASSERT(lr->lr_mode != 0);
-               ASSERT(lrtxg != 0);
-       } else {
-               /*
-                * Randomly change the size and increment the generation.
-                */
-               lr->lr_size = (ztest_random(db->db_size / sizeof (*bbt)) + 1) *
-                   sizeof (*bbt);
-               lr->lr_mode = bbt->bt_gen + 1;
-               ASSERT(lrtxg == 0);
-       }
-
-       /*
-        * Verify that the current bonus buffer is not newer than our txg.
-        */
-       ztest_bt_verify(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode,
-           MAX(txg, lrtxg), crtxg);
-
-       dmu_buf_will_dirty(db, tx);
-
-       ASSERT3U(lr->lr_size, >=, sizeof (*bbt));
-       ASSERT3U(lr->lr_size, <=, db->db_size);
-       VERIFY0(dmu_set_bonus(db, lr->lr_size, tx));
-       bbt = ztest_bt_bonus(db);
-
-       ztest_bt_generate(bbt, os, lr->lr_foid, -1ULL, lr->lr_mode, txg, crtxg);
-
-       dmu_buf_rele(db, FTAG);
-
-       (void) ztest_log_setattr(zd, tx, lr);
-
-       dmu_tx_commit(tx);
-
-       ztest_object_unlock(zd, lr->lr_foid);
-
-       return (0);
-}
-
-zil_replay_func_t ztest_replay_vector[TX_MAX_TYPE] = {
-       NULL,                           /* 0 no such transaction type */
-       (zil_replay_func_t)ztest_replay_create,         /* TX_CREATE */
-       NULL,                                           /* TX_MKDIR */
-       NULL,                                           /* TX_MKXATTR */
-       NULL,                                           /* TX_SYMLINK */
-       (zil_replay_func_t)ztest_replay_remove,         /* TX_REMOVE */
-       NULL,                                           /* TX_RMDIR */
-       NULL,                                           /* TX_LINK */
-       NULL,                                           /* TX_RENAME */
-       (zil_replay_func_t)ztest_replay_write,          /* TX_WRITE */
-       (zil_replay_func_t)ztest_replay_truncate,       /* TX_TRUNCATE */
-       (zil_replay_func_t)ztest_replay_setattr,        /* TX_SETATTR */
-       NULL,                                           /* TX_ACL */
-       NULL,                                           /* TX_CREATE_ACL */
-       NULL,                                           /* TX_CREATE_ATTR */
-       NULL,                                           /* TX_CREATE_ACL_ATTR */
-       NULL,                                           /* TX_MKDIR_ACL */
-       NULL,                                           /* TX_MKDIR_ATTR */
-       NULL,                                           /* TX_MKDIR_ACL_ATTR */
-       NULL,                                           /* TX_WRITE2 */
-};
-
-/*
- * ZIL get_data callbacks
- */
-
-static void
-ztest_get_done(zgd_t *zgd, int error)
-{
-       ztest_ds_t *zd = zgd->zgd_private;
-       uint64_t object = zgd->zgd_rl->rl_object;
-
-       if (zgd->zgd_db)
-               dmu_buf_rele(zgd->zgd_db, zgd);
-
-       ztest_range_unlock(zgd->zgd_rl);
-       ztest_object_unlock(zd, object);
-
-       if (error == 0 && zgd->zgd_bp)
-               zil_add_block(zgd->zgd_zilog, zgd->zgd_bp);
-
-       umem_free(zgd, sizeof (*zgd));
-}
-
-static int
-ztest_get_data(void *arg, lr_write_t *lr, char *buf, zio_t *zio)
-{
-       ztest_ds_t *zd = arg;
-       objset_t *os = zd->zd_os;
-       uint64_t object = lr->lr_foid;
-       uint64_t offset = lr->lr_offset;
-       uint64_t size = lr->lr_length;
-       blkptr_t *bp = &lr->lr_blkptr;
-       uint64_t txg = lr->lr_common.lrc_txg;
-       uint64_t crtxg;
-       dmu_object_info_t doi;
-       dmu_buf_t *db;
-       zgd_t *zgd;
-       int error;
-
-       ztest_object_lock(zd, object, RL_READER);
-       error = dmu_bonus_hold(os, object, FTAG, &db);
-       if (error) {
-               ztest_object_unlock(zd, object);
-               return (error);
-       }
-
-       crtxg = ztest_bt_bonus(db)->bt_crtxg;
-
-       if (crtxg == 0 || crtxg > txg) {
-               dmu_buf_rele(db, FTAG);
-               ztest_object_unlock(zd, object);
-               return (ENOENT);
-       }
-
-       dmu_object_info_from_db(db, &doi);
-       dmu_buf_rele(db, FTAG);
-       db = NULL;
-
-       zgd = umem_zalloc(sizeof (*zgd), UMEM_NOFAIL);
-       zgd->zgd_zilog = zd->zd_zilog;
-       zgd->zgd_private = zd;
-
-       if (buf != NULL) {      /* immediate write */
-               zgd->zgd_rl = ztest_range_lock(zd, object, offset, size,
-                   RL_READER);
-
-               error = dmu_read(os, object, offset, size, buf,
-                   DMU_READ_NO_PREFETCH);
-               ASSERT(error == 0);
-       } else {
-               size = doi.doi_data_block_size;
-               if (ISP2(size)) {
-                       offset = P2ALIGN(offset, size);
-               } else {
-                       ASSERT(offset < size);
-                       offset = 0;
-               }
-
-               zgd->zgd_rl = ztest_range_lock(zd, object, offset, size,
-                   RL_READER);
-
-               error = dmu_buf_hold(os, object, offset, zgd, &db,
-                   DMU_READ_NO_PREFETCH);
-
-               if (error == 0) {
-                       blkptr_t *obp = dmu_buf_get_blkptr(db);
-                       if (obp) {
-                               ASSERT(BP_IS_HOLE(bp));
-                               *bp = *obp;
-                       }
-
-                       zgd->zgd_db = db;
-                       zgd->zgd_bp = bp;
-
-                       ASSERT(db->db_offset == offset);
-                       ASSERT(db->db_size == size);
-
-                       error = dmu_sync(zio, lr->lr_common.lrc_txg,
-                           ztest_get_done, zgd);
-
-                       if (error == 0)
-                               return (0);
-               }
-       }
-
-       ztest_get_done(zgd, error);
-
-       return (error);
-}
-
-static void *
-ztest_lr_alloc(size_t lrsize, char *name)
-{
-       char *lr;
-       size_t namesize = name ? strlen(name) + 1 : 0;
-
-       lr = umem_zalloc(lrsize + namesize, UMEM_NOFAIL);
-
-       if (name)
-               bcopy(name, lr + lrsize, namesize);
-
-       return (lr);
-}
-
-void
-ztest_lr_free(void *lr, size_t lrsize, char *name)
-{
-       size_t namesize = name ? strlen(name) + 1 : 0;
-
-       umem_free(lr, lrsize + namesize);
-}
-
-/*
- * Lookup a bunch of objects.  Returns the number of objects not found.
- */
-static int
-ztest_lookup(ztest_ds_t *zd, ztest_od_t *od, int count)
-{
-       int missing = 0;
-       int error;
-       int i;
-
-       ASSERT(mutex_held(&zd->zd_dirobj_lock));
-
-       for (i = 0; i < count; i++, od++) {
-               od->od_object = 0;
-               error = zap_lookup(zd->zd_os, od->od_dir, od->od_name,
-                   sizeof (uint64_t), 1, &od->od_object);
-               if (error) {
-                       ASSERT(error == ENOENT);
-                       ASSERT(od->od_object == 0);
-                       missing++;
-               } else {
-                       dmu_buf_t *db;
-                       ztest_block_tag_t *bbt;
-                       dmu_object_info_t doi;
-
-                       ASSERT(od->od_object != 0);
-                       ASSERT(missing == 0);   /* there should be no gaps */
-
-                       ztest_object_lock(zd, od->od_object, RL_READER);
-                       VERIFY3U(0, ==, dmu_bonus_hold(zd->zd_os,
-                           od->od_object, FTAG, &db));
-                       dmu_object_info_from_db(db, &doi);
-                       bbt = ztest_bt_bonus(db);
-                       ASSERT3U(bbt->bt_magic, ==, BT_MAGIC);
-                       od->od_type = doi.doi_type;
-                       od->od_blocksize = doi.doi_data_block_size;
-                       od->od_gen = bbt->bt_gen;
-                       dmu_buf_rele(db, FTAG);
-                       ztest_object_unlock(zd, od->od_object);
-               }
-       }
-
-       return (missing);
-}
-
-static int
-ztest_create(ztest_ds_t *zd, ztest_od_t *od, int count)
-{
-       int missing = 0;
-       int i;
-
-       ASSERT(mutex_held(&zd->zd_dirobj_lock));
-
-       for (i = 0; i < count; i++, od++) {
-               if (missing) {
-                       od->od_object = 0;
-                       missing++;
-                       continue;
-               }
-
-               lr_create_t *lr = ztest_lr_alloc(sizeof (*lr), od->od_name);
-
-               lr->lr_doid = od->od_dir;
-               lr->lr_foid = 0;        /* 0 to allocate, > 0 to claim */
-               lr->lrz_type = od->od_crtype;
-               lr->lrz_blocksize = od->od_crblocksize;
-               lr->lrz_ibshift = ztest_random_ibshift();
-               lr->lrz_bonustype = DMU_OT_UINT64_OTHER;
-               lr->lrz_bonuslen = dmu_bonus_max();
-               lr->lr_gen = od->od_crgen;
-               lr->lr_crtime[0] = time(NULL);
-
-               if (ztest_replay_create(zd, lr, B_FALSE) != 0) {
-                       ASSERT(missing == 0);
-                       od->od_object = 0;
-                       missing++;
-               } else {
-                       od->od_object = lr->lr_foid;
-                       od->od_type = od->od_crtype;
-                       od->od_blocksize = od->od_crblocksize;
-                       od->od_gen = od->od_crgen;
-                       ASSERT(od->od_object != 0);
-               }
-
-               ztest_lr_free(lr, sizeof (*lr), od->od_name);
-       }
-
-       return (missing);
-}
-
-static int
-ztest_remove(ztest_ds_t *zd, ztest_od_t *od, int count)
-{
-       int missing = 0;
-       int error;
-       int i;
-
-       ASSERT(mutex_held(&zd->zd_dirobj_lock));
-
-       od += count - 1;
-
-       for (i = count - 1; i >= 0; i--, od--) {
-               if (missing) {
-                       missing++;
-                       continue;
-               }
-
-               /*
-                * No object was found.
-                */
-               if (od->od_object == 0)
-                       continue;
-
-               lr_remove_t *lr = ztest_lr_alloc(sizeof (*lr), od->od_name);
-
-               lr->lr_doid = od->od_dir;
-
-               if ((error = ztest_replay_remove(zd, lr, B_FALSE)) != 0) {
-                       ASSERT3U(error, ==, ENOSPC);
-                       missing++;
-               } else {
-                       od->od_object = 0;
-               }
-               ztest_lr_free(lr, sizeof (*lr), od->od_name);
-       }
-
-       return (missing);
-}
-
-static int
-ztest_write(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size,
-    void *data)
-{
-       lr_write_t *lr;
-       int error;
-
-       lr = ztest_lr_alloc(sizeof (*lr) + size, NULL);
-
-       lr->lr_foid = object;
-       lr->lr_offset = offset;
-       lr->lr_length = size;
-       lr->lr_blkoff = 0;
-       BP_ZERO(&lr->lr_blkptr);
-
-       bcopy(data, lr + 1, size);
-
-       error = ztest_replay_write(zd, lr, B_FALSE);
-
-       ztest_lr_free(lr, sizeof (*lr) + size, NULL);
-
-       return (error);
-}
-
-static int
-ztest_truncate(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size)
-{
-       lr_truncate_t *lr;
-       int error;
-
-       lr = ztest_lr_alloc(sizeof (*lr), NULL);
-
-       lr->lr_foid = object;
-       lr->lr_offset = offset;
-       lr->lr_length = size;
-
-       error = ztest_replay_truncate(zd, lr, B_FALSE);
-
-       ztest_lr_free(lr, sizeof (*lr), NULL);
-
-       return (error);
-}
-
-static int
-ztest_setattr(ztest_ds_t *zd, uint64_t object)
-{
-       lr_setattr_t *lr;
-       int error;
-
-       lr = ztest_lr_alloc(sizeof (*lr), NULL);
-
-       lr->lr_foid = object;
-       lr->lr_size = 0;
-       lr->lr_mode = 0;
-
-       error = ztest_replay_setattr(zd, lr, B_FALSE);
-
-       ztest_lr_free(lr, sizeof (*lr), NULL);
-
-       return (error);
-}
-
-static void
-ztest_prealloc(ztest_ds_t *zd, uint64_t object, uint64_t offset, uint64_t size)
-{
-       objset_t *os = zd->zd_os;
-       dmu_tx_t *tx;
-       uint64_t txg;
-       rl_t *rl;
-
-       txg_wait_synced(dmu_objset_pool(os), 0);
-
-       ztest_object_lock(zd, object, RL_READER);
-       rl = ztest_range_lock(zd, object, offset, size, RL_WRITER);
-
-       tx = dmu_tx_create(os);
-
-       dmu_tx_hold_write(tx, object, offset, size);
-
-       txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
-
-       if (txg != 0) {
-               dmu_prealloc(os, object, offset, size, tx);
-               dmu_tx_commit(tx);
-               txg_wait_synced(dmu_objset_pool(os), txg);
-       } else {
-               (void) dmu_free_long_range(os, object, offset, size);
-       }
-
-       ztest_range_unlock(rl);
-       ztest_object_unlock(zd, object);
-}
-
-static void
-ztest_io(ztest_ds_t *zd, uint64_t object, uint64_t offset)
-{
-       int err;
-       ztest_block_tag_t wbt;
-       dmu_object_info_t doi;
-       enum ztest_io_type io_type;
-       uint64_t blocksize;
-       void *data;
-
-       VERIFY(dmu_object_info(zd->zd_os, object, &doi) == 0);
-       blocksize = doi.doi_data_block_size;
-       data = umem_alloc(blocksize, UMEM_NOFAIL);
-
-       /*
-        * Pick an i/o type at random, biased toward writing block tags.
-        */
-       io_type = ztest_random(ZTEST_IO_TYPES);
-       if (ztest_random(2) == 0)
-               io_type = ZTEST_IO_WRITE_TAG;
-
-       (void) rw_rdlock(&zd->zd_zilog_lock);
-
-       switch (io_type) {
-
-       case ZTEST_IO_WRITE_TAG:
-               ztest_bt_generate(&wbt, zd->zd_os, object, offset, 0, 0, 0);
-               (void) ztest_write(zd, object, offset, sizeof (wbt), &wbt);
-               break;
-
-       case ZTEST_IO_WRITE_PATTERN:
-               (void) memset(data, 'a' + (object + offset) % 5, blocksize);
-               if (ztest_random(2) == 0) {
-                       /*
-                        * Induce fletcher2 collisions to ensure that
-                        * zio_ddt_collision() detects and resolves them
-                        * when using fletcher2-verify for deduplication.
-                        */
-                       ((uint64_t *)data)[0] ^= 1ULL << 63;
-                       ((uint64_t *)data)[4] ^= 1ULL << 63;
-               }
-               (void) ztest_write(zd, object, offset, blocksize, data);
-               break;
-
-       case ZTEST_IO_WRITE_ZEROES:
-               bzero(data, blocksize);
-               (void) ztest_write(zd, object, offset, blocksize, data);
-               break;
-
-       case ZTEST_IO_TRUNCATE:
-               (void) ztest_truncate(zd, object, offset, blocksize);
-               break;
-
-       case ZTEST_IO_SETATTR:
-               (void) ztest_setattr(zd, object);
-               break;
-       default:
-               break;
-
-       case ZTEST_IO_REWRITE:
-               (void) rw_rdlock(&ztest_name_lock);
-               err = ztest_dsl_prop_set_uint64(zd->zd_name,
-                   ZFS_PROP_CHECKSUM, spa_dedup_checksum(ztest_spa),
-                   B_FALSE);
-               VERIFY(err == 0 || err == ENOSPC);
-               err = ztest_dsl_prop_set_uint64(zd->zd_name,
-                   ZFS_PROP_COMPRESSION,
-                   ztest_random_dsl_prop(ZFS_PROP_COMPRESSION),
-                   B_FALSE);
-               VERIFY(err == 0 || err == ENOSPC);
-               (void) rw_unlock(&ztest_name_lock);
-
-               VERIFY0(dmu_read(zd->zd_os, object, offset, blocksize, data,
-                   DMU_READ_NO_PREFETCH));
-
-               (void) ztest_write(zd, object, offset, blocksize, data);
-               break;
-       }
-
-       (void) rw_unlock(&zd->zd_zilog_lock);
-
-       umem_free(data, blocksize);
-}
-
-/*
- * Initialize an object description template.
- */
-static void
-ztest_od_init(ztest_od_t *od, uint64_t id, char *tag, uint64_t index,
-    dmu_object_type_t type, uint64_t blocksize, uint64_t gen)
-{
-       od->od_dir = ZTEST_DIROBJ;
-       od->od_object = 0;
-
-       od->od_crtype = type;
-       od->od_crblocksize = blocksize ? blocksize : ztest_random_blocksize();
-       od->od_crgen = gen;
-
-       od->od_type = DMU_OT_NONE;
-       od->od_blocksize = 0;
-       od->od_gen = 0;
-
-       (void) snprintf(od->od_name, sizeof (od->od_name), "%s(%lld)[%llu]",
-           tag, (longlong_t)id, (u_longlong_t)index);
-}
-
-/*
- * Lookup or create the objects for a test using the od template.
- * If the objects do not all exist, or if 'remove' is specified,
- * remove any existing objects and create new ones.  Otherwise,
- * use the existing objects.
- */
-static int
-ztest_object_init(ztest_ds_t *zd, ztest_od_t *od, size_t size, boolean_t remove)
-{
-       int count = size / sizeof (*od);
-       int rv = 0;
-
-       mutex_enter(&zd->zd_dirobj_lock);
-       if ((ztest_lookup(zd, od, count) != 0 || remove) &&
-           (ztest_remove(zd, od, count) != 0 ||
-           ztest_create(zd, od, count) != 0))
-               rv = -1;
-       zd->zd_od = od;
-       mutex_exit(&zd->zd_dirobj_lock);
-
-       return (rv);
-}
-
-/* ARGSUSED */
-void
-ztest_zil_commit(ztest_ds_t *zd, uint64_t id)
-{
-       zilog_t *zilog = zd->zd_zilog;
-
-       (void) rw_rdlock(&zd->zd_zilog_lock);
-
-       zil_commit(zilog, ztest_random(ZTEST_OBJECTS));
-
-       /*
-        * Remember the committed values in zd, which is in parent/child
-        * shared memory.  If we die, the next iteration of ztest_run()
-        * will verify that the log really does contain this record.
-        */
-       mutex_enter(&zilog->zl_lock);
-       ASSERT(zd->zd_shared != NULL);
-       ASSERT3U(zd->zd_shared->zd_seq, <=, zilog->zl_commit_lr_seq);
-       zd->zd_shared->zd_seq = zilog->zl_commit_lr_seq;
-       mutex_exit(&zilog->zl_lock);
-
-       (void) rw_unlock(&zd->zd_zilog_lock);
-}
-
-/*
- * This function is designed to simulate the operations that occur during a
- * mount/unmount operation.  We hold the dataset across these operations in an
- * attempt to expose any implicit assumptions about ZIL management.
- */
-/* ARGSUSED */
-void
-ztest_zil_remount(ztest_ds_t *zd, uint64_t id)
-{
-       objset_t *os = zd->zd_os;
-
-       /*
-        * We grab the zd_dirobj_lock to ensure that no other thread is
-        * updating the zil (i.e. adding in-memory log records) and the
-        * zd_zilog_lock to block any I/O.
-        */
-       mutex_enter(&zd->zd_dirobj_lock);
-       (void) rw_wrlock(&zd->zd_zilog_lock);
-
-       /* zfs_sb_teardown() */
-       zil_close(zd->zd_zilog);
-
-       /* zfsvfs_setup() */
-       VERIFY(zil_open(os, ztest_get_data) == zd->zd_zilog);
-       zil_replay(os, zd, ztest_replay_vector);
-
-       (void) rw_unlock(&zd->zd_zilog_lock);
-       mutex_exit(&zd->zd_dirobj_lock);
-}
-
-/*
- * Verify that we can't destroy an active pool, create an existing pool,
- * or create a pool with a bad vdev spec.
- */
-/* ARGSUSED */
-void
-ztest_spa_create_destroy(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_shared_opts_t *zo = &ztest_opts;
-       spa_t *spa;
-       nvlist_t *nvroot;
-
-       /*
-        * Attempt to create using a bad file.
-        */
-       nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1);
-       VERIFY3U(ENOENT, ==,
-           spa_create("ztest_bad_file", nvroot, NULL, NULL));
-       nvlist_free(nvroot);
-
-       /*
-        * Attempt to create using a bad mirror.
-        */
-       nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 2, 1);
-       VERIFY3U(ENOENT, ==,
-           spa_create("ztest_bad_mirror", nvroot, NULL, NULL));
-       nvlist_free(nvroot);
-
-       /*
-        * Attempt to create an existing pool.  It shouldn't matter
-        * what's in the nvroot; we should fail with EEXIST.
-        */
-       (void) rw_rdlock(&ztest_name_lock);
-       nvroot = make_vdev_root("/dev/bogus", NULL, NULL, 0, 0, 0, 0, 0, 1);
-       VERIFY3U(EEXIST, ==, spa_create(zo->zo_pool, nvroot, NULL, NULL));
-       nvlist_free(nvroot);
-       VERIFY3U(0, ==, spa_open(zo->zo_pool, &spa, FTAG));
-       VERIFY3U(EBUSY, ==, spa_destroy(zo->zo_pool));
-       spa_close(spa, FTAG);
-
-       (void) rw_unlock(&ztest_name_lock);
-}
-
-/* ARGSUSED */
-void
-ztest_spa_upgrade(ztest_ds_t *zd, uint64_t id)
-{
-       spa_t *spa;
-       uint64_t initial_version = SPA_VERSION_INITIAL;
-       uint64_t version, newversion;
-       nvlist_t *nvroot, *props;
-       char *name;
-
-       mutex_enter(&ztest_vdev_lock);
-       name = kmem_asprintf("%s_upgrade", ztest_opts.zo_pool);
-
-       /*
-        * Clean up from previous runs.
-        */
-       (void) spa_destroy(name);
-
-       nvroot = make_vdev_root(NULL, NULL, name, ztest_opts.zo_vdev_size, 0,
-           0, ztest_opts.zo_raidz, ztest_opts.zo_mirrors, 1);
-
-       /*
-        * If we're configuring a RAIDZ device then make sure that the
-        * the initial version is capable of supporting that feature.
-        */
-       switch (ztest_opts.zo_raidz_parity) {
-       case 0:
-       case 1:
-               initial_version = SPA_VERSION_INITIAL;
-               break;
-       case 2:
-               initial_version = SPA_VERSION_RAIDZ2;
-               break;
-       case 3:
-               initial_version = SPA_VERSION_RAIDZ3;
-               break;
-       }
-
-       /*
-        * Create a pool with a spa version that can be upgraded. Pick
-        * a value between initial_version and SPA_VERSION_BEFORE_FEATURES.
-        */
-       do {
-               version = ztest_random_spa_version(initial_version);
-       } while (version > SPA_VERSION_BEFORE_FEATURES);
-
-       props = fnvlist_alloc();
-       fnvlist_add_uint64(props,
-           zpool_prop_to_name(ZPOOL_PROP_VERSION), version);
-       VERIFY3S(spa_create(name, nvroot, props, NULL), ==, 0);
-       fnvlist_free(nvroot);
-       fnvlist_free(props);
-
-       VERIFY3S(spa_open(name, &spa, FTAG), ==, 0);
-       VERIFY3U(spa_version(spa), ==, version);
-       newversion = ztest_random_spa_version(version + 1);
-
-       if (ztest_opts.zo_verbose >= 4) {
-               (void) printf("upgrading spa version from %llu to %llu\n",
-                   (u_longlong_t)version, (u_longlong_t)newversion);
-       }
-
-       spa_upgrade(spa, newversion);
-       VERIFY3U(spa_version(spa), >, version);
-       VERIFY3U(spa_version(spa), ==, fnvlist_lookup_uint64(spa->spa_config,
-           zpool_prop_to_name(ZPOOL_PROP_VERSION)));
-       spa_close(spa, FTAG);
-
-       strfree(name);
-       mutex_exit(&ztest_vdev_lock);
-}
-
-static vdev_t *
-vdev_lookup_by_path(vdev_t *vd, const char *path)
-{
-       vdev_t *mvd;
-       int c;
-
-       if (vd->vdev_path != NULL && strcmp(path, vd->vdev_path) == 0)
-               return (vd);
-
-       for (c = 0; c < vd->vdev_children; c++)
-               if ((mvd = vdev_lookup_by_path(vd->vdev_child[c], path)) !=
-                   NULL)
-                       return (mvd);
-
-       return (NULL);
-}
-
-/*
- * Find the first available hole which can be used as a top-level.
- */
-int
-find_vdev_hole(spa_t *spa)
-{
-       vdev_t *rvd = spa->spa_root_vdev;
-       int c;
-
-       ASSERT(spa_config_held(spa, SCL_VDEV, RW_READER) == SCL_VDEV);
-
-       for (c = 0; c < rvd->vdev_children; c++) {
-               vdev_t *cvd = rvd->vdev_child[c];
-
-               if (cvd->vdev_ishole)
-                       break;
-       }
-       return (c);
-}
-
-/*
- * Verify that vdev_add() works as expected.
- */
-/* ARGSUSED */
-void
-ztest_vdev_add_remove(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_shared_t *zs = ztest_shared;
-       spa_t *spa = ztest_spa;
-       uint64_t leaves;
-       uint64_t guid;
-       nvlist_t *nvroot;
-       int error;
-
-       mutex_enter(&ztest_vdev_lock);
-       leaves = MAX(zs->zs_mirrors + zs->zs_splits, 1) * ztest_opts.zo_raidz;
-
-       spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
-
-       ztest_shared->zs_vdev_next_leaf = find_vdev_hole(spa) * leaves;
-
-       /*
-        * If we have slogs then remove them 1/4 of the time.
-        */
-       if (spa_has_slogs(spa) && ztest_random(4) == 0) {
-               /*
-                * Grab the guid from the head of the log class rotor.
-                */
-               guid = spa_log_class(spa)->mc_rotor->mg_vd->vdev_guid;
-
-               spa_config_exit(spa, SCL_VDEV, FTAG);
-
-               /*
-                * We have to grab the zs_name_lock as writer to
-                * prevent a race between removing a slog (dmu_objset_find)
-                * and destroying a dataset. Removing the slog will
-                * grab a reference on the dataset which may cause
-                * dsl_destroy_head() to fail with EBUSY thus
-                * leaving the dataset in an inconsistent state.
-                */
-               rw_wrlock(&ztest_name_lock);
-               error = spa_vdev_remove(spa, guid, B_FALSE);
-               rw_unlock(&ztest_name_lock);
-
-               if (error && error != EEXIST)
-                       fatal(0, "spa_vdev_remove() = %d", error);
-       } else {
-               spa_config_exit(spa, SCL_VDEV, FTAG);
-
-               /*
-                * Make 1/4 of the devices be log devices.
-                */
-               nvroot = make_vdev_root(NULL, NULL, NULL,
-                   ztest_opts.zo_vdev_size, 0,
-                   ztest_random(4) == 0, ztest_opts.zo_raidz,
-                   zs->zs_mirrors, 1);
-
-               error = spa_vdev_add(spa, nvroot);
-               nvlist_free(nvroot);
-
-               if (error == ENOSPC)
-                       ztest_record_enospc("spa_vdev_add");
-               else if (error != 0)
-                       fatal(0, "spa_vdev_add() = %d", error);
-       }
-
-       mutex_exit(&ztest_vdev_lock);
-}
-
-/*
- * Verify that adding/removing aux devices (l2arc, hot spare) works as expected.
- */
-/* ARGSUSED */
-void
-ztest_vdev_aux_add_remove(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_shared_t *zs = ztest_shared;
-       spa_t *spa = ztest_spa;
-       vdev_t *rvd = spa->spa_root_vdev;
-       spa_aux_vdev_t *sav;
-       char *aux;
-       char *path;
-       uint64_t guid = 0;
-       int error;
-
-       path = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-
-       if (ztest_random(2) == 0) {
-               sav = &spa->spa_spares;
-               aux = ZPOOL_CONFIG_SPARES;
-       } else {
-               sav = &spa->spa_l2cache;
-               aux = ZPOOL_CONFIG_L2CACHE;
-       }
-
-       mutex_enter(&ztest_vdev_lock);
-
-       spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
-
-       if (sav->sav_count != 0 && ztest_random(4) == 0) {
-               /*
-                * Pick a random device to remove.
-                */
-               guid = sav->sav_vdevs[ztest_random(sav->sav_count)]->vdev_guid;
-       } else {
-               /*
-                * Find an unused device we can add.
-                */
-               zs->zs_vdev_aux = 0;
-               for (;;) {
-                       int c;
-                       (void) snprintf(path, MAXPATHLEN, ztest_aux_template,
-                           ztest_opts.zo_dir, ztest_opts.zo_pool, aux,
-                           zs->zs_vdev_aux);
-                       for (c = 0; c < sav->sav_count; c++)
-                               if (strcmp(sav->sav_vdevs[c]->vdev_path,
-                                   path) == 0)
-                                       break;
-                       if (c == sav->sav_count &&
-                           vdev_lookup_by_path(rvd, path) == NULL)
-                               break;
-                       zs->zs_vdev_aux++;
-               }
-       }
-
-       spa_config_exit(spa, SCL_VDEV, FTAG);
-
-       if (guid == 0) {
-               /*
-                * Add a new device.
-                */
-               nvlist_t *nvroot = make_vdev_root(NULL, aux, NULL,
-                   (ztest_opts.zo_vdev_size * 5) / 4, 0, 0, 0, 0, 1);
-               error = spa_vdev_add(spa, nvroot);
-               if (error != 0)
-                       fatal(0, "spa_vdev_add(%p) = %d", nvroot, error);
-               nvlist_free(nvroot);
-       } else {
-               /*
-                * Remove an existing device.  Sometimes, dirty its
-                * vdev state first to make sure we handle removal
-                * of devices that have pending state changes.
-                */
-               if (ztest_random(2) == 0)
-                       (void) vdev_online(spa, guid, 0, NULL);
-
-               error = spa_vdev_remove(spa, guid, B_FALSE);
-               if (error != 0 && error != EBUSY)
-                       fatal(0, "spa_vdev_remove(%llu) = %d", guid, error);
-       }
-
-       mutex_exit(&ztest_vdev_lock);
-
-       umem_free(path, MAXPATHLEN);
-}
-
-/*
- * split a pool if it has mirror tlvdevs
- */
-/* ARGSUSED */
-void
-ztest_split_pool(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_shared_t *zs = ztest_shared;
-       spa_t *spa = ztest_spa;
-       vdev_t *rvd = spa->spa_root_vdev;
-       nvlist_t *tree, **child, *config, *split, **schild;
-       uint_t c, children, schildren = 0, lastlogid = 0;
-       int error = 0;
-
-       mutex_enter(&ztest_vdev_lock);
-
-       /* ensure we have a useable config; mirrors of raidz aren't supported */
-       if (zs->zs_mirrors < 3 || ztest_opts.zo_raidz > 1) {
-               mutex_exit(&ztest_vdev_lock);
-               return;
-       }
-
-       /* clean up the old pool, if any */
-       (void) spa_destroy("splitp");
-
-       spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
-
-       /* generate a config from the existing config */
-       mutex_enter(&spa->spa_props_lock);
-       VERIFY(nvlist_lookup_nvlist(spa->spa_config, ZPOOL_CONFIG_VDEV_TREE,
-           &tree) == 0);
-       mutex_exit(&spa->spa_props_lock);
-
-       VERIFY(nvlist_lookup_nvlist_array(tree, ZPOOL_CONFIG_CHILDREN, &child,
-           &children) == 0);
-
-       schild = malloc(rvd->vdev_children * sizeof (nvlist_t *));
-       for (c = 0; c < children; c++) {
-               vdev_t *tvd = rvd->vdev_child[c];
-               nvlist_t **mchild;
-               uint_t mchildren;
-
-               if (tvd->vdev_islog || tvd->vdev_ops == &vdev_hole_ops) {
-                       VERIFY(nvlist_alloc(&schild[schildren], NV_UNIQUE_NAME,
-                           0) == 0);
-                       VERIFY(nvlist_add_string(schild[schildren],
-                           ZPOOL_CONFIG_TYPE, VDEV_TYPE_HOLE) == 0);
-                       VERIFY(nvlist_add_uint64(schild[schildren],
-                           ZPOOL_CONFIG_IS_HOLE, 1) == 0);
-                       if (lastlogid == 0)
-                               lastlogid = schildren;
-                       ++schildren;
-                       continue;
-               }
-               lastlogid = 0;
-               VERIFY(nvlist_lookup_nvlist_array(child[c],
-                   ZPOOL_CONFIG_CHILDREN, &mchild, &mchildren) == 0);
-               VERIFY(nvlist_dup(mchild[0], &schild[schildren++], 0) == 0);
-       }
-
-       /* OK, create a config that can be used to split */
-       VERIFY(nvlist_alloc(&split, NV_UNIQUE_NAME, 0) == 0);
-       VERIFY(nvlist_add_string(split, ZPOOL_CONFIG_TYPE,
-           VDEV_TYPE_ROOT) == 0);
-       VERIFY(nvlist_add_nvlist_array(split, ZPOOL_CONFIG_CHILDREN, schild,
-           lastlogid != 0 ? lastlogid : schildren) == 0);
-
-       VERIFY(nvlist_alloc(&config, NV_UNIQUE_NAME, 0) == 0);
-       VERIFY(nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, split) == 0);
-
-       for (c = 0; c < schildren; c++)
-               nvlist_free(schild[c]);
-       free(schild);
-       nvlist_free(split);
-
-       spa_config_exit(spa, SCL_VDEV, FTAG);
-
-       (void) rw_wrlock(&ztest_name_lock);
-       error = spa_vdev_split_mirror(spa, "splitp", config, NULL, B_FALSE);
-       (void) rw_unlock(&ztest_name_lock);
-
-       nvlist_free(config);
-
-       if (error == 0) {
-               (void) printf("successful split - results:\n");
-               mutex_enter(&spa_namespace_lock);
-               show_pool_stats(spa);
-               show_pool_stats(spa_lookup("splitp"));
-               mutex_exit(&spa_namespace_lock);
-               ++zs->zs_splits;
-               --zs->zs_mirrors;
-       }
-       mutex_exit(&ztest_vdev_lock);
-
-}
-
-/*
- * Verify that we can attach and detach devices.
- */
-/* ARGSUSED */
-void
-ztest_vdev_attach_detach(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_shared_t *zs = ztest_shared;
-       spa_t *spa = ztest_spa;
-       spa_aux_vdev_t *sav = &spa->spa_spares;
-       vdev_t *rvd = spa->spa_root_vdev;
-       vdev_t *oldvd, *newvd, *pvd;
-       nvlist_t *root;
-       uint64_t leaves;
-       uint64_t leaf, top;
-       uint64_t ashift = ztest_get_ashift();
-       uint64_t oldguid, pguid;
-       uint64_t oldsize, newsize;
-       char *oldpath, *newpath;
-       int replacing;
-       int oldvd_has_siblings = B_FALSE;
-       int newvd_is_spare = B_FALSE;
-       int oldvd_is_log;
-       int error, expected_error;
-
-       oldpath = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-       newpath = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-
-       mutex_enter(&ztest_vdev_lock);
-       leaves = MAX(zs->zs_mirrors, 1) * ztest_opts.zo_raidz;
-
-       spa_config_enter(spa, SCL_VDEV, FTAG, RW_READER);
-
-       /*
-        * Decide whether to do an attach or a replace.
-        */
-       replacing = ztest_random(2);
-
-       /*
-        * Pick a random top-level vdev.
-        */
-       top = ztest_random_vdev_top(spa, B_TRUE);
-
-       /*
-        * Pick a random leaf within it.
-        */
-       leaf = ztest_random(leaves);
-
-       /*
-        * Locate this vdev.
-        */
-       oldvd = rvd->vdev_child[top];
-       if (zs->zs_mirrors >= 1) {
-               ASSERT(oldvd->vdev_ops == &vdev_mirror_ops);
-               ASSERT(oldvd->vdev_children >= zs->zs_mirrors);
-               oldvd = oldvd->vdev_child[leaf / ztest_opts.zo_raidz];
-       }
-       if (ztest_opts.zo_raidz > 1) {
-               ASSERT(oldvd->vdev_ops == &vdev_raidz_ops);
-               ASSERT(oldvd->vdev_children == ztest_opts.zo_raidz);
-               oldvd = oldvd->vdev_child[leaf % ztest_opts.zo_raidz];
-       }
-
-       /*
-        * If we're already doing an attach or replace, oldvd may be a
-        * mirror vdev -- in which case, pick a random child.
-        */
-       while (oldvd->vdev_children != 0) {
-               oldvd_has_siblings = B_TRUE;
-               ASSERT(oldvd->vdev_children >= 2);
-               oldvd = oldvd->vdev_child[ztest_random(oldvd->vdev_children)];
-       }
-
-       oldguid = oldvd->vdev_guid;
-       oldsize = vdev_get_min_asize(oldvd);
-       oldvd_is_log = oldvd->vdev_top->vdev_islog;
-       (void) strcpy(oldpath, oldvd->vdev_path);
-       pvd = oldvd->vdev_parent;
-       pguid = pvd->vdev_guid;
-
-       /*
-        * If oldvd has siblings, then half of the time, detach it.
-        */
-       if (oldvd_has_siblings && ztest_random(2) == 0) {
-               spa_config_exit(spa, SCL_VDEV, FTAG);
-               error = spa_vdev_detach(spa, oldguid, pguid, B_FALSE);
-               if (error != 0 && error != ENODEV && error != EBUSY &&
-                   error != ENOTSUP)
-                       fatal(0, "detach (%s) returned %d", oldpath, error);
-               goto out;
-       }
-
-       /*
-        * For the new vdev, choose with equal probability between the two
-        * standard paths (ending in either 'a' or 'b') or a random hot spare.
-        */
-       if (sav->sav_count != 0 && ztest_random(3) == 0) {
-               newvd = sav->sav_vdevs[ztest_random(sav->sav_count)];
-               newvd_is_spare = B_TRUE;
-               (void) strcpy(newpath, newvd->vdev_path);
-       } else {
-               (void) snprintf(newpath, MAXPATHLEN, ztest_dev_template,
-                   ztest_opts.zo_dir, ztest_opts.zo_pool,
-                   top * leaves + leaf);
-               if (ztest_random(2) == 0)
-                       newpath[strlen(newpath) - 1] = 'b';
-               newvd = vdev_lookup_by_path(rvd, newpath);
-       }
-
-       if (newvd) {
-               newsize = vdev_get_min_asize(newvd);
-       } else {
-               /*
-                * Make newsize a little bigger or smaller than oldsize.
-                * If it's smaller, the attach should fail.
-                * If it's larger, and we're doing a replace,
-                * we should get dynamic LUN growth when we're done.
-                */
-               newsize = 10 * oldsize / (9 + ztest_random(3));
-       }
-
-       /*
-        * If pvd is not a mirror or root, the attach should fail with ENOTSUP,
-        * unless it's a replace; in that case any non-replacing parent is OK.
-        *
-        * If newvd is already part of the pool, it should fail with EBUSY.
-        *
-        * If newvd is too small, it should fail with EOVERFLOW.
-        */
-       if (pvd->vdev_ops != &vdev_mirror_ops &&
-           pvd->vdev_ops != &vdev_root_ops && (!replacing ||
-           pvd->vdev_ops == &vdev_replacing_ops ||
-           pvd->vdev_ops == &vdev_spare_ops))
-               expected_error = ENOTSUP;
-       else if (newvd_is_spare && (!replacing || oldvd_is_log))
-               expected_error = ENOTSUP;
-       else if (newvd == oldvd)
-               expected_error = replacing ? 0 : EBUSY;
-       else if (vdev_lookup_by_path(rvd, newpath) != NULL)
-               expected_error = EBUSY;
-       else if (newsize < oldsize)
-               expected_error = EOVERFLOW;
-       else if (ashift > oldvd->vdev_top->vdev_ashift)
-               expected_error = EDOM;
-       else
-               expected_error = 0;
-
-       spa_config_exit(spa, SCL_VDEV, FTAG);
-
-       /*
-        * Build the nvlist describing newpath.
-        */
-       root = make_vdev_root(newpath, NULL, NULL, newvd == NULL ? newsize : 0,
-           ashift, 0, 0, 0, 1);
-
-       error = spa_vdev_attach(spa, oldguid, root, replacing);
-
-       nvlist_free(root);
-
-       /*
-        * If our parent was the replacing vdev, but the replace completed,
-        * then instead of failing with ENOTSUP we may either succeed,
-        * fail with ENODEV, or fail with EOVERFLOW.
-        */
-       if (expected_error == ENOTSUP &&
-           (error == 0 || error == ENODEV || error == EOVERFLOW))
-               expected_error = error;
-
-       /*
-        * If someone grew the LUN, the replacement may be too small.
-        */
-       if (error == EOVERFLOW || error == EBUSY)
-               expected_error = error;
-
-       /* XXX workaround 6690467 */
-       if (error != expected_error && expected_error != EBUSY) {
-               fatal(0, "attach (%s %llu, %s %llu, %d) "
-                   "returned %d, expected %d",
-                   oldpath, oldsize, newpath,
-                   newsize, replacing, error, expected_error);
-       }
-out:
-       mutex_exit(&ztest_vdev_lock);
-
-       umem_free(oldpath, MAXPATHLEN);
-       umem_free(newpath, MAXPATHLEN);
-}
-
-/*
- * Callback function which expands the physical size of the vdev.
- */
-vdev_t *
-grow_vdev(vdev_t *vd, void *arg)
-{
-       ASSERTV(spa_t *spa = vd->vdev_spa);
-       size_t *newsize = arg;
-       size_t fsize;
-       int fd;
-
-       ASSERT(spa_config_held(spa, SCL_STATE, RW_READER) == SCL_STATE);
-       ASSERT(vd->vdev_ops->vdev_op_leaf);
-
-       if ((fd = open(vd->vdev_path, O_RDWR)) == -1)
-               return (vd);
-
-       fsize = lseek(fd, 0, SEEK_END);
-       VERIFY(ftruncate(fd, *newsize) == 0);
-
-       if (ztest_opts.zo_verbose >= 6) {
-               (void) printf("%s grew from %lu to %lu bytes\n",
-                   vd->vdev_path, (ulong_t)fsize, (ulong_t)*newsize);
-       }
-       (void) close(fd);
-       return (NULL);
-}
-
-/*
- * Callback function which expands a given vdev by calling vdev_online().
- */
-/* ARGSUSED */
-vdev_t *
-online_vdev(vdev_t *vd, void *arg)
-{
-       spa_t *spa = vd->vdev_spa;
-       vdev_t *tvd = vd->vdev_top;
-       uint64_t guid = vd->vdev_guid;
-       uint64_t generation = spa->spa_config_generation + 1;
-       vdev_state_t newstate = VDEV_STATE_UNKNOWN;
-       int error;
-
-       ASSERT(spa_config_held(spa, SCL_STATE, RW_READER) == SCL_STATE);
-       ASSERT(vd->vdev_ops->vdev_op_leaf);
-
-       /* Calling vdev_online will initialize the new metaslabs */
-       spa_config_exit(spa, SCL_STATE, spa);
-       error = vdev_online(spa, guid, ZFS_ONLINE_EXPAND, &newstate);
-       spa_config_enter(spa, SCL_STATE, spa, RW_READER);
-
-       /*
-        * If vdev_online returned an error or the underlying vdev_open
-        * failed then we abort the expand. The only way to know that
-        * vdev_open fails is by checking the returned newstate.
-        */
-       if (error || newstate != VDEV_STATE_HEALTHY) {
-               if (ztest_opts.zo_verbose >= 5) {
-                       (void) printf("Unable to expand vdev, state %llu, "
-                           "error %d\n", (u_longlong_t)newstate, error);
-               }
-               return (vd);
-       }
-       ASSERT3U(newstate, ==, VDEV_STATE_HEALTHY);
-
-       /*
-        * Since we dropped the lock we need to ensure that we're
-        * still talking to the original vdev. It's possible this
-        * vdev may have been detached/replaced while we were
-        * trying to online it.
-        */
-       if (generation != spa->spa_config_generation) {
-               if (ztest_opts.zo_verbose >= 5) {
-                       (void) printf("vdev configuration has changed, "
-                           "guid %llu, state %llu, expected gen %llu, "
-                           "got gen %llu\n",
-                           (u_longlong_t)guid,
-                           (u_longlong_t)tvd->vdev_state,
-                           (u_longlong_t)generation,
-                           (u_longlong_t)spa->spa_config_generation);
-               }
-               return (vd);
-       }
-       return (NULL);
-}
-
-/*
- * Traverse the vdev tree calling the supplied function.
- * We continue to walk the tree until we either have walked all
- * children or we receive a non-NULL return from the callback.
- * If a NULL callback is passed, then we just return back the first
- * leaf vdev we encounter.
- */
-vdev_t *
-vdev_walk_tree(vdev_t *vd, vdev_t *(*func)(vdev_t *, void *), void *arg)
-{
-       uint_t c;
-
-       if (vd->vdev_ops->vdev_op_leaf) {
-               if (func == NULL)
-                       return (vd);
-               else
-                       return (func(vd, arg));
-       }
-
-       for (c = 0; c < vd->vdev_children; c++) {
-               vdev_t *cvd = vd->vdev_child[c];
-               if ((cvd = vdev_walk_tree(cvd, func, arg)) != NULL)
-                       return (cvd);
-       }
-       return (NULL);
-}
-
-/*
- * Verify that dynamic LUN growth works as expected.
- */
-/* ARGSUSED */
-void
-ztest_vdev_LUN_growth(ztest_ds_t *zd, uint64_t id)
-{
-       spa_t *spa = ztest_spa;
-       vdev_t *vd, *tvd;
-       metaslab_class_t *mc;
-       metaslab_group_t *mg;
-       size_t psize, newsize;
-       uint64_t top;
-       uint64_t old_class_space, new_class_space, old_ms_count, new_ms_count;
-
-       mutex_enter(&ztest_vdev_lock);
-       spa_config_enter(spa, SCL_STATE, spa, RW_READER);
-
-       top = ztest_random_vdev_top(spa, B_TRUE);
-
-       tvd = spa->spa_root_vdev->vdev_child[top];
-       mg = tvd->vdev_mg;
-       mc = mg->mg_class;
-       old_ms_count = tvd->vdev_ms_count;
-       old_class_space = metaslab_class_get_space(mc);
-
-       /*
-        * Determine the size of the first leaf vdev associated with
-        * our top-level device.
-        */
-       vd = vdev_walk_tree(tvd, NULL, NULL);
-       ASSERT3P(vd, !=, NULL);
-       ASSERT(vd->vdev_ops->vdev_op_leaf);
-
-       psize = vd->vdev_psize;
-
-       /*
-        * We only try to expand the vdev if it's healthy, less than 4x its
-        * original size, and it has a valid psize.
-        */
-       if (tvd->vdev_state != VDEV_STATE_HEALTHY ||
-           psize == 0 || psize >= 4 * ztest_opts.zo_vdev_size) {
-               spa_config_exit(spa, SCL_STATE, spa);
-               mutex_exit(&ztest_vdev_lock);
-               return;
-       }
-       ASSERT(psize > 0);
-       newsize = psize + psize / 8;
-       ASSERT3U(newsize, >, psize);
-
-       if (ztest_opts.zo_verbose >= 6) {
-               (void) printf("Expanding LUN %s from %lu to %lu\n",
-                   vd->vdev_path, (ulong_t)psize, (ulong_t)newsize);
-       }
-
-       /*
-        * Growing the vdev is a two step process:
-        *      1). expand the physical size (i.e. relabel)
-        *      2). online the vdev to create the new metaslabs
-        */
-       if (vdev_walk_tree(tvd, grow_vdev, &newsize) != NULL ||
-           vdev_walk_tree(tvd, online_vdev, NULL) != NULL ||
-           tvd->vdev_state != VDEV_STATE_HEALTHY) {
-               if (ztest_opts.zo_verbose >= 5) {
-                       (void) printf("Could not expand LUN because "
-                           "the vdev configuration changed.\n");
-               }
-               spa_config_exit(spa, SCL_STATE, spa);
-               mutex_exit(&ztest_vdev_lock);
-               return;
-       }
-
-       spa_config_exit(spa, SCL_STATE, spa);
-
-       /*
-        * Expanding the LUN will update the config asynchronously,
-        * thus we must wait for the async thread to complete any
-        * pending tasks before proceeding.
-        */
-       for (;;) {
-               boolean_t done;
-               mutex_enter(&spa->spa_async_lock);
-               done = (spa->spa_async_thread == NULL && !spa->spa_async_tasks);
-               mutex_exit(&spa->spa_async_lock);
-               if (done)
-                       break;
-               txg_wait_synced(spa_get_dsl(spa), 0);
-               (void) poll(NULL, 0, 100);
-       }
-
-       spa_config_enter(spa, SCL_STATE, spa, RW_READER);
-
-       tvd = spa->spa_root_vdev->vdev_child[top];
-       new_ms_count = tvd->vdev_ms_count;
-       new_class_space = metaslab_class_get_space(mc);
-
-       if (tvd->vdev_mg != mg || mg->mg_class != mc) {
-               if (ztest_opts.zo_verbose >= 5) {
-                       (void) printf("Could not verify LUN expansion due to "
-                           "intervening vdev offline or remove.\n");
-               }
-               spa_config_exit(spa, SCL_STATE, spa);
-               mutex_exit(&ztest_vdev_lock);
-               return;
-       }
-
-       /*
-        * Make sure we were able to grow the vdev.
-        */
-       if (new_ms_count <= old_ms_count)
-               fatal(0, "LUN expansion failed: ms_count %llu <= %llu\n",
-                   old_ms_count, new_ms_count);
-
-       /*
-        * Make sure we were able to grow the pool.
-        */
-       if (new_class_space <= old_class_space)
-               fatal(0, "LUN expansion failed: class_space %llu <= %llu\n",
-                   old_class_space, new_class_space);
-
-       if (ztest_opts.zo_verbose >= 5) {
-               char oldnumbuf[6], newnumbuf[6];
-
-               nicenum(old_class_space, oldnumbuf);
-               nicenum(new_class_space, newnumbuf);
-               (void) printf("%s grew from %s to %s\n",
-                   spa->spa_name, oldnumbuf, newnumbuf);
-       }
-
-       spa_config_exit(spa, SCL_STATE, spa);
-       mutex_exit(&ztest_vdev_lock);
-}
-
-/*
- * Verify that dmu_objset_{create,destroy,open,close} work as expected.
- */
-/* ARGSUSED */
-static void
-ztest_objset_create_cb(objset_t *os, void *arg, cred_t *cr, dmu_tx_t *tx)
-{
-       /*
-        * Create the objects common to all ztest datasets.
-        */
-       VERIFY(zap_create_claim(os, ZTEST_DIROBJ,
-           DMU_OT_ZAP_OTHER, DMU_OT_NONE, 0, tx) == 0);
-}
-
-static int
-ztest_dataset_create(char *dsname)
-{
-       uint64_t zilset = ztest_random(100);
-       int err = dmu_objset_create(dsname, DMU_OST_OTHER, 0,
-           ztest_objset_create_cb, NULL);
-
-       if (err || zilset < 80)
-               return (err);
-
-       if (ztest_opts.zo_verbose >= 5)
-               (void) printf("Setting dataset %s to sync always\n", dsname);
-       return (ztest_dsl_prop_set_uint64(dsname, ZFS_PROP_SYNC,
-           ZFS_SYNC_ALWAYS, B_FALSE));
-}
-
-/* ARGSUSED */
-static int
-ztest_objset_destroy_cb(const char *name, void *arg)
-{
-       objset_t *os;
-       dmu_object_info_t doi;
-       int error;
-
-       /*
-        * Verify that the dataset contains a directory object.
-        */
-       VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_TRUE, FTAG, &os));
-       error = dmu_object_info(os, ZTEST_DIROBJ, &doi);
-       if (error != ENOENT) {
-               /* We could have crashed in the middle of destroying it */
-               ASSERT0(error);
-               ASSERT3U(doi.doi_type, ==, DMU_OT_ZAP_OTHER);
-               ASSERT3S(doi.doi_physical_blocks_512, >=, 0);
-       }
-       dmu_objset_disown(os, FTAG);
-
-       /*
-        * Destroy the dataset.
-        */
-       if (strchr(name, '@') != NULL) {
-               VERIFY0(dsl_destroy_snapshot(name, B_FALSE));
-       } else {
-               VERIFY0(dsl_destroy_head(name));
-       }
-       return (0);
-}
-
-static boolean_t
-ztest_snapshot_create(char *osname, uint64_t id)
-{
-       char snapname[MAXNAMELEN];
-       int error;
-
-       (void) snprintf(snapname, sizeof (snapname), "%llu", (u_longlong_t)id);
-
-       error = dmu_objset_snapshot_one(osname, snapname);
-       if (error == ENOSPC) {
-               ztest_record_enospc(FTAG);
-               return (B_FALSE);
-       }
-       if (error != 0 && error != EEXIST) {
-               fatal(0, "ztest_snapshot_create(%s@%s) = %d", osname,
-                   snapname, error);
-       }
-       return (B_TRUE);
-}
-
-static boolean_t
-ztest_snapshot_destroy(char *osname, uint64_t id)
-{
-       char snapname[MAXNAMELEN];
-       int error;
-
-       (void) snprintf(snapname, MAXNAMELEN, "%s@%llu", osname,
-           (u_longlong_t)id);
-
-       error = dsl_destroy_snapshot(snapname, B_FALSE);
-       if (error != 0 && error != ENOENT)
-               fatal(0, "ztest_snapshot_destroy(%s) = %d", snapname, error);
-       return (B_TRUE);
-}
-
-/* ARGSUSED */
-void
-ztest_dmu_objset_create_destroy(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_ds_t *zdtmp;
-       int iters;
-       int error;
-       objset_t *os, *os2;
-       char *name;
-       zilog_t *zilog;
-       int i;
-
-       zdtmp = umem_alloc(sizeof (ztest_ds_t), UMEM_NOFAIL);
-       name = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-
-       (void) rw_rdlock(&ztest_name_lock);
-
-       (void) snprintf(name, MAXNAMELEN, "%s/temp_%llu",
-           ztest_opts.zo_pool, (u_longlong_t)id);
-
-       /*
-        * If this dataset exists from a previous run, process its replay log
-        * half of the time.  If we don't replay it, then dsl_destroy_head()
-        * (invoked from ztest_objset_destroy_cb()) should just throw it away.
-        */
-       if (ztest_random(2) == 0 &&
-           dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os) == 0) {
-               ztest_zd_init(zdtmp, NULL, os);
-               zil_replay(os, zdtmp, ztest_replay_vector);
-               ztest_zd_fini(zdtmp);
-               dmu_objset_disown(os, FTAG);
-       }
-
-       /*
-        * There may be an old instance of the dataset we're about to
-        * create lying around from a previous run.  If so, destroy it
-        * and all of its snapshots.
-        */
-       (void) dmu_objset_find(name, ztest_objset_destroy_cb, NULL,
-           DS_FIND_CHILDREN | DS_FIND_SNAPSHOTS);
-
-       /*
-        * Verify that the destroyed dataset is no longer in the namespace.
-        */
-       VERIFY3U(ENOENT, ==, dmu_objset_own(name, DMU_OST_OTHER, B_TRUE,
-           FTAG, &os));
-
-       /*
-        * Verify that we can create a new dataset.
-        */
-       error = ztest_dataset_create(name);
-       if (error) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc(FTAG);
-                       goto out;
-               }
-               fatal(0, "dmu_objset_create(%s) = %d", name, error);
-       }
-
-       VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os));
-
-       ztest_zd_init(zdtmp, NULL, os);
-
-       /*
-        * Open the intent log for it.
-        */
-       zilog = zil_open(os, ztest_get_data);
-
-       /*
-        * Put some objects in there, do a little I/O to them,
-        * and randomly take a couple of snapshots along the way.
-        */
-       iters = ztest_random(5);
-       for (i = 0; i < iters; i++) {
-               ztest_dmu_object_alloc_free(zdtmp, id);
-               if (ztest_random(iters) == 0)
-                       (void) ztest_snapshot_create(name, i);
-       }
-
-       /*
-        * Verify that we cannot create an existing dataset.
-        */
-       VERIFY3U(EEXIST, ==,
-           dmu_objset_create(name, DMU_OST_OTHER, 0, NULL, NULL));
-
-       /*
-        * Verify that we can hold an objset that is also owned.
-        */
-       VERIFY3U(0, ==, dmu_objset_hold(name, FTAG, &os2));
-       dmu_objset_rele(os2, FTAG);
-
-       /*
-        * Verify that we cannot own an objset that is already owned.
-        */
-       VERIFY3U(EBUSY, ==,
-           dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, FTAG, &os2));
-
-       zil_close(zilog);
-       dmu_objset_disown(os, FTAG);
-       ztest_zd_fini(zdtmp);
-out:
-       (void) rw_unlock(&ztest_name_lock);
-
-       umem_free(name, MAXNAMELEN);
-       umem_free(zdtmp, sizeof (ztest_ds_t));
-}
-
-/*
- * Verify that dmu_snapshot_{create,destroy,open,close} work as expected.
- */
-void
-ztest_dmu_snapshot_create_destroy(ztest_ds_t *zd, uint64_t id)
-{
-       (void) rw_rdlock(&ztest_name_lock);
-       (void) ztest_snapshot_destroy(zd->zd_name, id);
-       (void) ztest_snapshot_create(zd->zd_name, id);
-       (void) rw_unlock(&ztest_name_lock);
-}
-
-/*
- * Cleanup non-standard snapshots and clones.
- */
-void
-ztest_dsl_dataset_cleanup(char *osname, uint64_t id)
-{
-       char *snap1name;
-       char *clone1name;
-       char *snap2name;
-       char *clone2name;
-       char *snap3name;
-       int error;
-
-       snap1name  = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       clone1name = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       snap2name  = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       clone2name = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       snap3name  = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-
-       (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu",
-           osname, (u_longlong_t)id);
-       (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu",
-           osname, (u_longlong_t)id);
-       (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu",
-           clone1name, (u_longlong_t)id);
-       (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu",
-           osname, (u_longlong_t)id);
-       (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu",
-           clone1name, (u_longlong_t)id);
-
-       error = dsl_destroy_head(clone2name);
-       if (error && error != ENOENT)
-               fatal(0, "dsl_destroy_head(%s) = %d", clone2name, error);
-       error = dsl_destroy_snapshot(snap3name, B_FALSE);
-       if (error && error != ENOENT)
-               fatal(0, "dsl_destroy_snapshot(%s) = %d", snap3name, error);
-       error = dsl_destroy_snapshot(snap2name, B_FALSE);
-       if (error && error != ENOENT)
-               fatal(0, "dsl_destroy_snapshot(%s) = %d", snap2name, error);
-       error = dsl_destroy_head(clone1name);
-       if (error && error != ENOENT)
-               fatal(0, "dsl_destroy_head(%s) = %d", clone1name, error);
-       error = dsl_destroy_snapshot(snap1name, B_FALSE);
-       if (error && error != ENOENT)
-               fatal(0, "dsl_destroy_snapshot(%s) = %d", snap1name, error);
-
-       umem_free(snap1name, MAXNAMELEN);
-       umem_free(clone1name, MAXNAMELEN);
-       umem_free(snap2name, MAXNAMELEN);
-       umem_free(clone2name, MAXNAMELEN);
-       umem_free(snap3name, MAXNAMELEN);
-}
-
-/*
- * Verify dsl_dataset_promote handles EBUSY
- */
-void
-ztest_dsl_dataset_promote_busy(ztest_ds_t *zd, uint64_t id)
-{
-       objset_t *os;
-       char *snap1name;
-       char *clone1name;
-       char *snap2name;
-       char *clone2name;
-       char *snap3name;
-       char *osname = zd->zd_name;
-       int error;
-
-       snap1name  = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       clone1name = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       snap2name  = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       clone2name = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       snap3name  = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-
-       (void) rw_rdlock(&ztest_name_lock);
-
-       ztest_dsl_dataset_cleanup(osname, id);
-
-       (void) snprintf(snap1name, MAXNAMELEN, "%s@s1_%llu",
-           osname, (u_longlong_t)id);
-       (void) snprintf(clone1name, MAXNAMELEN, "%s/c1_%llu",
-           osname, (u_longlong_t)id);
-       (void) snprintf(snap2name, MAXNAMELEN, "%s@s2_%llu",
-           clone1name, (u_longlong_t)id);
-       (void) snprintf(clone2name, MAXNAMELEN, "%s/c2_%llu",
-           osname, (u_longlong_t)id);
-       (void) snprintf(snap3name, MAXNAMELEN, "%s@s3_%llu",
-           clone1name, (u_longlong_t)id);
-
-       error = dmu_objset_snapshot_one(osname, strchr(snap1name, '@') + 1);
-       if (error && error != EEXIST) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc(FTAG);
-                       goto out;
-               }
-               fatal(0, "dmu_take_snapshot(%s) = %d", snap1name, error);
-       }
-
-       error = dmu_objset_clone(clone1name, snap1name);
-       if (error) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc(FTAG);
-                       goto out;
-               }
-               fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
-       }
-
-       error = dmu_objset_snapshot_one(clone1name, strchr(snap2name, '@') + 1);
-       if (error && error != EEXIST) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc(FTAG);
-                       goto out;
-               }
-               fatal(0, "dmu_open_snapshot(%s) = %d", snap2name, error);
-       }
-
-       error = dmu_objset_snapshot_one(clone1name, strchr(snap3name, '@') + 1);
-       if (error && error != EEXIST) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc(FTAG);
-                       goto out;
-               }
-               fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
-       }
-
-       error = dmu_objset_clone(clone2name, snap3name);
-       if (error) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc(FTAG);
-                       goto out;
-               }
-               fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
-       }
-
-       error = dmu_objset_own(snap2name, DMU_OST_ANY, B_TRUE, FTAG, &os);
-       if (error)
-               fatal(0, "dmu_objset_own(%s) = %d", snap2name, error);
-       error = dsl_dataset_promote(clone2name, NULL);
-       if (error == ENOSPC) {
-               dmu_objset_disown(os, FTAG);
-               ztest_record_enospc(FTAG);
-               goto out;
-       }
-       if (error != EBUSY)
-               fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
-                   error);
-       dmu_objset_disown(os, FTAG);
-
-out:
-       ztest_dsl_dataset_cleanup(osname, id);
-
-       (void) rw_unlock(&ztest_name_lock);
-
-       umem_free(snap1name, MAXNAMELEN);
-       umem_free(clone1name, MAXNAMELEN);
-       umem_free(snap2name, MAXNAMELEN);
-       umem_free(clone2name, MAXNAMELEN);
-       umem_free(snap3name, MAXNAMELEN);
-}
-
-#undef OD_ARRAY_SIZE
-#define        OD_ARRAY_SIZE   4
-
-/*
- * Verify that dmu_object_{alloc,free} work as expected.
- */
-void
-ztest_dmu_object_alloc_free(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_od_t *od;
-       int batchsize;
-       int size;
-       int b;
-
-       size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
-       od = umem_alloc(size, UMEM_NOFAIL);
-       batchsize = OD_ARRAY_SIZE;
-
-       for (b = 0; b < batchsize; b++)
-               ztest_od_init(od + b, id, FTAG, b, DMU_OT_UINT64_OTHER, 0, 0);
-
-       /*
-        * Destroy the previous batch of objects, create a new batch,
-        * and do some I/O on the new objects.
-        */
-       if (ztest_object_init(zd, od, size, B_TRUE) != 0)
-               return;
-
-       while (ztest_random(4 * batchsize) != 0)
-               ztest_io(zd, od[ztest_random(batchsize)].od_object,
-                   ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
-
-       umem_free(od, size);
-}
-
-#undef OD_ARRAY_SIZE
-#define        OD_ARRAY_SIZE   2
-
-/*
- * Verify that dmu_{read,write} work as expected.
- */
-void
-ztest_dmu_read_write(ztest_ds_t *zd, uint64_t id)
-{
-       int size;
-       ztest_od_t *od;
-
-       objset_t *os = zd->zd_os;
-       size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
-       od = umem_alloc(size, UMEM_NOFAIL);
-       dmu_tx_t *tx;
-       int i, freeit, error;
-       uint64_t n, s, txg;
-       bufwad_t *packbuf, *bigbuf, *pack, *bigH, *bigT;
-       uint64_t packobj, packoff, packsize, bigobj, bigoff, bigsize;
-       uint64_t chunksize = (1000 + ztest_random(1000)) * sizeof (uint64_t);
-       uint64_t regions = 997;
-       uint64_t stride = 123456789ULL;
-       uint64_t width = 40;
-       int free_percent = 5;
-
-       /*
-        * This test uses two objects, packobj and bigobj, that are always
-        * updated together (i.e. in the same tx) so that their contents are
-        * in sync and can be compared.  Their contents relate to each other
-        * in a simple way: packobj is a dense array of 'bufwad' structures,
-        * while bigobj is a sparse array of the same bufwads.  Specifically,
-        * for any index n, there are three bufwads that should be identical:
-        *
-        *      packobj, at offset n * sizeof (bufwad_t)
-        *      bigobj, at the head of the nth chunk
-        *      bigobj, at the tail of the nth chunk
-        *
-        * The chunk size is arbitrary. It doesn't have to be a power of two,
-        * and it doesn't have any relation to the object blocksize.
-        * The only requirement is that it can hold at least two bufwads.
-        *
-        * Normally, we write the bufwad to each of these locations.
-        * However, free_percent of the time we instead write zeroes to
-        * packobj and perform a dmu_free_range() on bigobj.  By comparing
-        * bigobj to packobj, we can verify that the DMU is correctly
-        * tracking which parts of an object are allocated and free,
-        * and that the contents of the allocated blocks are correct.
-        */
-
-       /*
-        * Read the directory info.  If it's the first time, set things up.
-        */
-       ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, chunksize);
-       ztest_od_init(od + 1, id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, chunksize);
-
-       if (ztest_object_init(zd, od, size, B_FALSE) != 0) {
-               umem_free(od, size);
-               return;
-       }
-
-       bigobj = od[0].od_object;
-       packobj = od[1].od_object;
-       chunksize = od[0].od_gen;
-       ASSERT(chunksize == od[1].od_gen);
-
-       /*
-        * Prefetch a random chunk of the big object.
-        * Our aim here is to get some async reads in flight
-        * for blocks that we may free below; the DMU should
-        * handle this race correctly.
-        */
-       n = ztest_random(regions) * stride + ztest_random(width);
-       s = 1 + ztest_random(2 * width - 1);
-       dmu_prefetch(os, bigobj, n * chunksize, s * chunksize);
-
-       /*
-        * Pick a random index and compute the offsets into packobj and bigobj.
-        */
-       n = ztest_random(regions) * stride + ztest_random(width);
-       s = 1 + ztest_random(width - 1);
-
-       packoff = n * sizeof (bufwad_t);
-       packsize = s * sizeof (bufwad_t);
-
-       bigoff = n * chunksize;
-       bigsize = s * chunksize;
-
-       packbuf = umem_alloc(packsize, UMEM_NOFAIL);
-       bigbuf = umem_alloc(bigsize, UMEM_NOFAIL);
-
-       /*
-        * free_percent of the time, free a range of bigobj rather than
-        * overwriting it.
-        */
-       freeit = (ztest_random(100) < free_percent);
-
-       /*
-        * Read the current contents of our objects.
-        */
-       error = dmu_read(os, packobj, packoff, packsize, packbuf,
-           DMU_READ_PREFETCH);
-       ASSERT0(error);
-       error = dmu_read(os, bigobj, bigoff, bigsize, bigbuf,
-           DMU_READ_PREFETCH);
-       ASSERT0(error);
-
-       /*
-        * Get a tx for the mods to both packobj and bigobj.
-        */
-       tx = dmu_tx_create(os);
-
-       dmu_tx_hold_write(tx, packobj, packoff, packsize);
-
-       if (freeit)
-               dmu_tx_hold_free(tx, bigobj, bigoff, bigsize);
-       else
-               dmu_tx_hold_write(tx, bigobj, bigoff, bigsize);
-
-       /* This accounts for setting the checksum/compression. */
-       dmu_tx_hold_bonus(tx, bigobj);
-
-       txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
-       if (txg == 0) {
-               umem_free(packbuf, packsize);
-               umem_free(bigbuf, bigsize);
-               umem_free(od, size);
-               return;
-       }
-
-       enum zio_checksum cksum;
-       do {
-               cksum = (enum zio_checksum)
-                   ztest_random_dsl_prop(ZFS_PROP_CHECKSUM);
-       } while (cksum >= ZIO_CHECKSUM_LEGACY_FUNCTIONS);
-       dmu_object_set_checksum(os, bigobj, cksum, tx);
-
-       enum zio_compress comp;
-       do {
-               comp = (enum zio_compress)
-                   ztest_random_dsl_prop(ZFS_PROP_COMPRESSION);
-       } while (comp >= ZIO_COMPRESS_LEGACY_FUNCTIONS);
-       dmu_object_set_compress(os, bigobj, comp, tx);
-
-       /*
-        * For each index from n to n + s, verify that the existing bufwad
-        * in packobj matches the bufwads at the head and tail of the
-        * corresponding chunk in bigobj.  Then update all three bufwads
-        * with the new values we want to write out.
-        */
-       for (i = 0; i < s; i++) {
-               /* LINTED */
-               pack = (bufwad_t *)((char *)packbuf + i * sizeof (bufwad_t));
-               /* LINTED */
-               bigH = (bufwad_t *)((char *)bigbuf + i * chunksize);
-               /* LINTED */
-               bigT = (bufwad_t *)((char *)bigH + chunksize) - 1;
-
-               ASSERT((uintptr_t)bigH - (uintptr_t)bigbuf < bigsize);
-               ASSERT((uintptr_t)bigT - (uintptr_t)bigbuf < bigsize);
-
-               if (pack->bw_txg > txg)
-                       fatal(0, "future leak: got %llx, open txg is %llx",
-                           pack->bw_txg, txg);
-
-               if (pack->bw_data != 0 && pack->bw_index != n + i)
-                       fatal(0, "wrong index: got %llx, wanted %llx+%llx",
-                           pack->bw_index, n, i);
-
-               if (bcmp(pack, bigH, sizeof (bufwad_t)) != 0)
-                       fatal(0, "pack/bigH mismatch in %p/%p", pack, bigH);
-
-               if (bcmp(pack, bigT, sizeof (bufwad_t)) != 0)
-                       fatal(0, "pack/bigT mismatch in %p/%p", pack, bigT);
-
-               if (freeit) {
-                       bzero(pack, sizeof (bufwad_t));
-               } else {
-                       pack->bw_index = n + i;
-                       pack->bw_txg = txg;
-                       pack->bw_data = 1 + ztest_random(-2ULL);
-               }
-               *bigH = *pack;
-               *bigT = *pack;
-       }
-
-       /*
-        * We've verified all the old bufwads, and made new ones.
-        * Now write them out.
-        */
-       dmu_write(os, packobj, packoff, packsize, packbuf, tx);
-
-       if (freeit) {
-               if (ztest_opts.zo_verbose >= 7) {
-                       (void) printf("freeing offset %llx size %llx"
-                           " txg %llx\n",
-                           (u_longlong_t)bigoff,
-                           (u_longlong_t)bigsize,
-                           (u_longlong_t)txg);
-               }
-               VERIFY(0 == dmu_free_range(os, bigobj, bigoff, bigsize, tx));
-       } else {
-               if (ztest_opts.zo_verbose >= 7) {
-                       (void) printf("writing offset %llx size %llx"
-                           " txg %llx\n",
-                           (u_longlong_t)bigoff,
-                           (u_longlong_t)bigsize,
-                           (u_longlong_t)txg);
-               }
-               dmu_write(os, bigobj, bigoff, bigsize, bigbuf, tx);
-       }
-
-       dmu_tx_commit(tx);
-
-       /*
-        * Sanity check the stuff we just wrote.
-        */
-       {
-               void *packcheck = umem_alloc(packsize, UMEM_NOFAIL);
-               void *bigcheck = umem_alloc(bigsize, UMEM_NOFAIL);
-
-               VERIFY(0 == dmu_read(os, packobj, packoff,
-                   packsize, packcheck, DMU_READ_PREFETCH));
-               VERIFY(0 == dmu_read(os, bigobj, bigoff,
-                   bigsize, bigcheck, DMU_READ_PREFETCH));
-
-               ASSERT(bcmp(packbuf, packcheck, packsize) == 0);
-               ASSERT(bcmp(bigbuf, bigcheck, bigsize) == 0);
-
-               umem_free(packcheck, packsize);
-               umem_free(bigcheck, bigsize);
-       }
-
-       umem_free(packbuf, packsize);
-       umem_free(bigbuf, bigsize);
-       umem_free(od, size);
-}
-
-void
-compare_and_update_pbbufs(uint64_t s, bufwad_t *packbuf, bufwad_t *bigbuf,
-    uint64_t bigsize, uint64_t n, uint64_t chunksize, uint64_t txg)
-{
-       uint64_t i;
-       bufwad_t *pack;
-       bufwad_t *bigH;
-       bufwad_t *bigT;
-
-       /*
-        * For each index from n to n + s, verify that the existing bufwad
-        * in packobj matches the bufwads at the head and tail of the
-        * corresponding chunk in bigobj.  Then update all three bufwads
-        * with the new values we want to write out.
-        */
-       for (i = 0; i < s; i++) {
-               /* LINTED */
-               pack = (bufwad_t *)((char *)packbuf + i * sizeof (bufwad_t));
-               /* LINTED */
-               bigH = (bufwad_t *)((char *)bigbuf + i * chunksize);
-               /* LINTED */
-               bigT = (bufwad_t *)((char *)bigH + chunksize) - 1;
-
-               ASSERT((uintptr_t)bigH - (uintptr_t)bigbuf < bigsize);
-               ASSERT((uintptr_t)bigT - (uintptr_t)bigbuf < bigsize);
-
-               if (pack->bw_txg > txg)
-                       fatal(0, "future leak: got %llx, open txg is %llx",
-                           pack->bw_txg, txg);
-
-               if (pack->bw_data != 0 && pack->bw_index != n + i)
-                       fatal(0, "wrong index: got %llx, wanted %llx+%llx",
-                           pack->bw_index, n, i);
-
-               if (bcmp(pack, bigH, sizeof (bufwad_t)) != 0)
-                       fatal(0, "pack/bigH mismatch in %p/%p", pack, bigH);
-
-               if (bcmp(pack, bigT, sizeof (bufwad_t)) != 0)
-                       fatal(0, "pack/bigT mismatch in %p/%p", pack, bigT);
-
-               pack->bw_index = n + i;
-               pack->bw_txg = txg;
-               pack->bw_data = 1 + ztest_random(-2ULL);
-
-               *bigH = *pack;
-               *bigT = *pack;
-       }
-}
-
-#undef OD_ARRAY_SIZE
-#define        OD_ARRAY_SIZE   2
-
-void
-ztest_dmu_read_write_zcopy(ztest_ds_t *zd, uint64_t id)
-{
-       objset_t *os = zd->zd_os;
-       ztest_od_t *od;
-       dmu_tx_t *tx;
-       uint64_t i;
-       int error;
-       int size;
-       uint64_t n, s, txg;
-       bufwad_t *packbuf, *bigbuf;
-       uint64_t packobj, packoff, packsize, bigobj, bigoff, bigsize;
-       uint64_t blocksize = ztest_random_blocksize();
-       uint64_t chunksize = blocksize;
-       uint64_t regions = 997;
-       uint64_t stride = 123456789ULL;
-       uint64_t width = 9;
-       dmu_buf_t *bonus_db;
-       arc_buf_t **bigbuf_arcbufs;
-       dmu_object_info_t doi;
-
-       size = sizeof (ztest_od_t) * OD_ARRAY_SIZE;
-       od = umem_alloc(size, UMEM_NOFAIL);
-
-       /*
-        * This test uses two objects, packobj and bigobj, that are always
-        * updated together (i.e. in the same tx) so that their contents are
-        * in sync and can be compared.  Their contents relate to each other
-        * in a simple way: packobj is a dense array of 'bufwad' structures,
-        * while bigobj is a sparse array of the same bufwads.  Specifically,
-        * for any index n, there are three bufwads that should be identical:
-        *
-        *      packobj, at offset n * sizeof (bufwad_t)
-        *      bigobj, at the head of the nth chunk
-        *      bigobj, at the tail of the nth chunk
-        *
-        * The chunk size is set equal to bigobj block size so that
-        * dmu_assign_arcbuf() can be tested for object updates.
-        */
-
-       /*
-        * Read the directory info.  If it's the first time, set things up.
-        */
-       ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0);
-       ztest_od_init(od + 1, id, FTAG, 1, DMU_OT_UINT64_OTHER, 0, chunksize);
-
-
-       if (ztest_object_init(zd, od, size, B_FALSE) != 0) {
-               umem_free(od, size);
-               return;
-       }
-
-       bigobj = od[0].od_object;
-       packobj = od[1].od_object;
-       blocksize = od[0].od_blocksize;
-       chunksize = blocksize;
-       ASSERT(chunksize == od[1].od_gen);
-
-       VERIFY(dmu_object_info(os, bigobj, &doi) == 0);
-       VERIFY(ISP2(doi.doi_data_block_size));
-       VERIFY(chunksize == doi.doi_data_block_size);
-       VERIFY(chunksize >= 2 * sizeof (bufwad_t));
-
-       /*
-        * Pick a random index and compute the offsets into packobj and bigobj.
-        */
-       n = ztest_random(regions) * stride + ztest_random(width);
-       s = 1 + ztest_random(width - 1);
-
-       packoff = n * sizeof (bufwad_t);
-       packsize = s * sizeof (bufwad_t);
-
-       bigoff = n * chunksize;
-       bigsize = s * chunksize;
-
-       packbuf = umem_zalloc(packsize, UMEM_NOFAIL);
-       bigbuf = umem_zalloc(bigsize, UMEM_NOFAIL);
-
-       VERIFY3U(0, ==, dmu_bonus_hold(os, bigobj, FTAG, &bonus_db));
-
-       bigbuf_arcbufs = umem_zalloc(2 * s * sizeof (arc_buf_t *), UMEM_NOFAIL);
-
-       /*
-        * Iteration 0 test zcopy for DB_UNCACHED dbufs.
-        * Iteration 1 test zcopy to already referenced dbufs.
-        * Iteration 2 test zcopy to dirty dbuf in the same txg.
-        * Iteration 3 test zcopy to dbuf dirty in previous txg.
-        * Iteration 4 test zcopy when dbuf is no longer dirty.
-        * Iteration 5 test zcopy when it can't be done.
-        * Iteration 6 one more zcopy write.
-        */
-       for (i = 0; i < 7; i++) {
-               uint64_t j;
-               uint64_t off;
-
-               /*
-                * In iteration 5 (i == 5) use arcbufs
-                * that don't match bigobj blksz to test
-                * dmu_assign_arcbuf() when it can't directly
-                * assign an arcbuf to a dbuf.
-                */
-               for (j = 0; j < s; j++) {
-                       if (i != 5 || chunksize < (SPA_MINBLOCKSIZE * 2)) {
-                               bigbuf_arcbufs[j] =
-                                   dmu_request_arcbuf(bonus_db, chunksize);
-                       } else {
-                               bigbuf_arcbufs[2 * j] =
-                                   dmu_request_arcbuf(bonus_db, chunksize / 2);
-                               bigbuf_arcbufs[2 * j + 1] =
-                                   dmu_request_arcbuf(bonus_db, chunksize / 2);
-                       }
-               }
-
-               /*
-                * Get a tx for the mods to both packobj and bigobj.
-                */
-               tx = dmu_tx_create(os);
-
-               dmu_tx_hold_write(tx, packobj, packoff, packsize);
-               dmu_tx_hold_write(tx, bigobj, bigoff, bigsize);
-
-               txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
-               if (txg == 0) {
-                       umem_free(packbuf, packsize);
-                       umem_free(bigbuf, bigsize);
-                       for (j = 0; j < s; j++) {
-                               if (i != 5 ||
-                                   chunksize < (SPA_MINBLOCKSIZE * 2)) {
-                                       dmu_return_arcbuf(bigbuf_arcbufs[j]);
-                               } else {
-                                       dmu_return_arcbuf(
-                                           bigbuf_arcbufs[2 * j]);
-                                       dmu_return_arcbuf(
-                                           bigbuf_arcbufs[2 * j + 1]);
-                               }
-                       }
-                       umem_free(bigbuf_arcbufs, 2 * s * sizeof (arc_buf_t *));
-                       umem_free(od, size);
-                       dmu_buf_rele(bonus_db, FTAG);
-                       return;
-               }
-
-               /*
-                * 50% of the time don't read objects in the 1st iteration to
-                * test dmu_assign_arcbuf() for the case when there're no
-                * existing dbufs for the specified offsets.
-                */
-               if (i != 0 || ztest_random(2) != 0) {
-                       error = dmu_read(os, packobj, packoff,
-                           packsize, packbuf, DMU_READ_PREFETCH);
-                       ASSERT0(error);
-                       error = dmu_read(os, bigobj, bigoff, bigsize,
-                           bigbuf, DMU_READ_PREFETCH);
-                       ASSERT0(error);
-               }
-               compare_and_update_pbbufs(s, packbuf, bigbuf, bigsize,
-                   n, chunksize, txg);
-
-               /*
-                * We've verified all the old bufwads, and made new ones.
-                * Now write them out.
-                */
-               dmu_write(os, packobj, packoff, packsize, packbuf, tx);
-               if (ztest_opts.zo_verbose >= 7) {
-                       (void) printf("writing offset %llx size %llx"
-                           " txg %llx\n",
-                           (u_longlong_t)bigoff,
-                           (u_longlong_t)bigsize,
-                           (u_longlong_t)txg);
-               }
-               for (off = bigoff, j = 0; j < s; j++, off += chunksize) {
-                       dmu_buf_t *dbt;
-                       if (i != 5 || chunksize < (SPA_MINBLOCKSIZE * 2)) {
-                               bcopy((caddr_t)bigbuf + (off - bigoff),
-                                   bigbuf_arcbufs[j]->b_data, chunksize);
-                       } else {
-                               bcopy((caddr_t)bigbuf + (off - bigoff),
-                                   bigbuf_arcbufs[2 * j]->b_data,
-                                   chunksize / 2);
-                               bcopy((caddr_t)bigbuf + (off - bigoff) +
-                                   chunksize / 2,
-                                   bigbuf_arcbufs[2 * j + 1]->b_data,
-                                   chunksize / 2);
-                       }
-
-                       if (i == 1) {
-                               VERIFY(dmu_buf_hold(os, bigobj, off,
-                                   FTAG, &dbt, DMU_READ_NO_PREFETCH) == 0);
-                       }
-                       if (i != 5 || chunksize < (SPA_MINBLOCKSIZE * 2)) {
-                               dmu_assign_arcbuf(bonus_db, off,
-                                   bigbuf_arcbufs[j], tx);
-                       } else {
-                               dmu_assign_arcbuf(bonus_db, off,
-                                   bigbuf_arcbufs[2 * j], tx);
-                               dmu_assign_arcbuf(bonus_db,
-                                   off + chunksize / 2,
-                                   bigbuf_arcbufs[2 * j + 1], tx);
-                       }
-                       if (i == 1) {
-                               dmu_buf_rele(dbt, FTAG);
-                       }
-               }
-               dmu_tx_commit(tx);
-
-               /*
-                * Sanity check the stuff we just wrote.
-                */
-               {
-                       void *packcheck = umem_alloc(packsize, UMEM_NOFAIL);
-                       void *bigcheck = umem_alloc(bigsize, UMEM_NOFAIL);
-
-                       VERIFY(0 == dmu_read(os, packobj, packoff,
-                           packsize, packcheck, DMU_READ_PREFETCH));
-                       VERIFY(0 == dmu_read(os, bigobj, bigoff,
-                           bigsize, bigcheck, DMU_READ_PREFETCH));
-
-                       ASSERT(bcmp(packbuf, packcheck, packsize) == 0);
-                       ASSERT(bcmp(bigbuf, bigcheck, bigsize) == 0);
-
-                       umem_free(packcheck, packsize);
-                       umem_free(bigcheck, bigsize);
-               }
-               if (i == 2) {
-                       txg_wait_open(dmu_objset_pool(os), 0);
-               } else if (i == 3) {
-                       txg_wait_synced(dmu_objset_pool(os), 0);
-               }
-       }
-
-       dmu_buf_rele(bonus_db, FTAG);
-       umem_free(packbuf, packsize);
-       umem_free(bigbuf, bigsize);
-       umem_free(bigbuf_arcbufs, 2 * s * sizeof (arc_buf_t *));
-       umem_free(od, size);
-}
-
-/* ARGSUSED */
-void
-ztest_dmu_write_parallel(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_od_t *od;
-
-       od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
-       uint64_t offset = (1ULL << (ztest_random(20) + 43)) +
-           (ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
-
-       /*
-        * Have multiple threads write to large offsets in an object
-        * to verify that parallel writes to an object -- even to the
-        * same blocks within the object -- doesn't cause any trouble.
-        */
-       ztest_od_init(od, ID_PARALLEL, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0);
-
-       if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0)
-               return;
-
-       while (ztest_random(10) != 0)
-               ztest_io(zd, od->od_object, offset);
-
-       umem_free(od, sizeof (ztest_od_t));
-}
-
-void
-ztest_dmu_prealloc(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_od_t *od;
-       uint64_t offset = (1ULL << (ztest_random(4) + SPA_MAXBLOCKSHIFT)) +
-           (ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
-       uint64_t count = ztest_random(20) + 1;
-       uint64_t blocksize = ztest_random_blocksize();
-       void *data;
-
-       od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
-
-       ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0);
-
-       if (ztest_object_init(zd, od, sizeof (ztest_od_t),
-           !ztest_random(2)) != 0) {
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       if (ztest_truncate(zd, od->od_object, offset, count * blocksize) != 0) {
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       ztest_prealloc(zd, od->od_object, offset, count * blocksize);
-
-       data = umem_zalloc(blocksize, UMEM_NOFAIL);
-
-       while (ztest_random(count) != 0) {
-               uint64_t randoff = offset + (ztest_random(count) * blocksize);
-               if (ztest_write(zd, od->od_object, randoff, blocksize,
-                   data) != 0)
-                       break;
-               while (ztest_random(4) != 0)
-                       ztest_io(zd, od->od_object, randoff);
-       }
-
-       umem_free(data, blocksize);
-       umem_free(od, sizeof (ztest_od_t));
-}
-
-/*
- * Verify that zap_{create,destroy,add,remove,update} work as expected.
- */
-#define        ZTEST_ZAP_MIN_INTS      1
-#define        ZTEST_ZAP_MAX_INTS      4
-#define        ZTEST_ZAP_MAX_PROPS     1000
-
-void
-ztest_zap(ztest_ds_t *zd, uint64_t id)
-{
-       objset_t *os = zd->zd_os;
-       ztest_od_t *od;
-       uint64_t object;
-       uint64_t txg, last_txg;
-       uint64_t value[ZTEST_ZAP_MAX_INTS];
-       uint64_t zl_ints, zl_intsize, prop;
-       int i, ints;
-       dmu_tx_t *tx;
-       char propname[100], txgname[100];
-       int error;
-       char *hc[2] = { "s.acl.h", ".s.open.h.hyLZlg" };
-
-       od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
-       ztest_od_init(od, id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0);
-
-       if (ztest_object_init(zd, od, sizeof (ztest_od_t),
-                       !ztest_random(2)) != 0)
-               goto out;
-
-       object = od->od_object;
-
-       /*
-        * Generate a known hash collision, and verify that
-        * we can lookup and remove both entries.
-        */
-       tx = dmu_tx_create(os);
-       dmu_tx_hold_zap(tx, object, B_TRUE, NULL);
-       txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
-       if (txg == 0)
-               goto out;
-       for (i = 0; i < 2; i++) {
-               value[i] = i;
-               VERIFY3U(0, ==, zap_add(os, object, hc[i], sizeof (uint64_t),
-                   1, &value[i], tx));
-       }
-       for (i = 0; i < 2; i++) {
-               VERIFY3U(EEXIST, ==, zap_add(os, object, hc[i],
-                   sizeof (uint64_t), 1, &value[i], tx));
-               VERIFY3U(0, ==,
-                   zap_length(os, object, hc[i], &zl_intsize, &zl_ints));
-               ASSERT3U(zl_intsize, ==, sizeof (uint64_t));
-               ASSERT3U(zl_ints, ==, 1);
-       }
-       for (i = 0; i < 2; i++) {
-               VERIFY3U(0, ==, zap_remove(os, object, hc[i], tx));
-       }
-       dmu_tx_commit(tx);
-
-       /*
-        * Generate a buch of random entries.
-        */
-       ints = MAX(ZTEST_ZAP_MIN_INTS, object % ZTEST_ZAP_MAX_INTS);
-
-       prop = ztest_random(ZTEST_ZAP_MAX_PROPS);
-       (void) sprintf(propname, "prop_%llu", (u_longlong_t)prop);
-       (void) sprintf(txgname, "txg_%llu", (u_longlong_t)prop);
-       bzero(value, sizeof (value));
-       last_txg = 0;
-
-       /*
-        * If these zap entries already exist, validate their contents.
-        */
-       error = zap_length(os, object, txgname, &zl_intsize, &zl_ints);
-       if (error == 0) {
-               ASSERT3U(zl_intsize, ==, sizeof (uint64_t));
-               ASSERT3U(zl_ints, ==, 1);
-
-               VERIFY(zap_lookup(os, object, txgname, zl_intsize,
-                   zl_ints, &last_txg) == 0);
-
-               VERIFY(zap_length(os, object, propname, &zl_intsize,
-                   &zl_ints) == 0);
-
-               ASSERT3U(zl_intsize, ==, sizeof (uint64_t));
-               ASSERT3U(zl_ints, ==, ints);
-
-               VERIFY(zap_lookup(os, object, propname, zl_intsize,
-                   zl_ints, value) == 0);
-
-               for (i = 0; i < ints; i++) {
-                       ASSERT3U(value[i], ==, last_txg + object + i);
-               }
-       } else {
-               ASSERT3U(error, ==, ENOENT);
-       }
-
-       /*
-        * Atomically update two entries in our zap object.
-        * The first is named txg_%llu, and contains the txg
-        * in which the property was last updated.  The second
-        * is named prop_%llu, and the nth element of its value
-        * should be txg + object + n.
-        */
-       tx = dmu_tx_create(os);
-       dmu_tx_hold_zap(tx, object, B_TRUE, NULL);
-       txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
-       if (txg == 0)
-               goto out;
-
-       if (last_txg > txg)
-               fatal(0, "zap future leak: old %llu new %llu", last_txg, txg);
-
-       for (i = 0; i < ints; i++)
-               value[i] = txg + object + i;
-
-       VERIFY3U(0, ==, zap_update(os, object, txgname, sizeof (uint64_t),
-           1, &txg, tx));
-       VERIFY3U(0, ==, zap_update(os, object, propname, sizeof (uint64_t),
-           ints, value, tx));
-
-       dmu_tx_commit(tx);
-
-       /*
-        * Remove a random pair of entries.
-        */
-       prop = ztest_random(ZTEST_ZAP_MAX_PROPS);
-       (void) sprintf(propname, "prop_%llu", (u_longlong_t)prop);
-       (void) sprintf(txgname, "txg_%llu", (u_longlong_t)prop);
-
-       error = zap_length(os, object, txgname, &zl_intsize, &zl_ints);
-
-       if (error == ENOENT)
-               goto out;
-
-       ASSERT0(error);
-
-       tx = dmu_tx_create(os);
-       dmu_tx_hold_zap(tx, object, B_TRUE, NULL);
-       txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
-       if (txg == 0)
-               goto out;
-       VERIFY3U(0, ==, zap_remove(os, object, txgname, tx));
-       VERIFY3U(0, ==, zap_remove(os, object, propname, tx));
-       dmu_tx_commit(tx);
-out:
-       umem_free(od, sizeof (ztest_od_t));
-}
-
-/*
- * Testcase to test the upgrading of a microzap to fatzap.
- */
-void
-ztest_fzap(ztest_ds_t *zd, uint64_t id)
-{
-       objset_t *os = zd->zd_os;
-       ztest_od_t *od;
-       uint64_t object, txg;
-       int i;
-
-       od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
-       ztest_od_init(od, id, FTAG, 0, DMU_OT_ZAP_OTHER, 0, 0);
-
-       if (ztest_object_init(zd, od, sizeof (ztest_od_t),
-                               !ztest_random(2)) != 0)
-               goto out;
-       object = od->od_object;
-
-       /*
-        * Add entries to this ZAP and make sure it spills over
-        * and gets upgraded to a fatzap. Also, since we are adding
-        * 2050 entries we should see ptrtbl growth and leaf-block split.
-        */
-       for (i = 0; i < 2050; i++) {
-               char name[MAXNAMELEN];
-               uint64_t value = i;
-               dmu_tx_t *tx;
-               int error;
-
-               (void) snprintf(name, sizeof (name), "fzap-%llu-%llu",
-                   (u_longlong_t)id, (u_longlong_t)value);
-
-               tx = dmu_tx_create(os);
-               dmu_tx_hold_zap(tx, object, B_TRUE, name);
-               txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
-               if (txg == 0)
-                       goto out;
-               error = zap_add(os, object, name, sizeof (uint64_t), 1,
-                   &value, tx);
-               ASSERT(error == 0 || error == EEXIST);
-               dmu_tx_commit(tx);
-       }
-out:
-       umem_free(od, sizeof (ztest_od_t));
-}
-
-/* ARGSUSED */
-void
-ztest_zap_parallel(ztest_ds_t *zd, uint64_t id)
-{
-       objset_t *os = zd->zd_os;
-       ztest_od_t *od;
-       uint64_t txg, object, count, wsize, wc, zl_wsize, zl_wc;
-       dmu_tx_t *tx;
-       int i, namelen, error;
-       int micro = ztest_random(2);
-       char name[20], string_value[20];
-       void *data;
-
-       od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
-       ztest_od_init(od, ID_PARALLEL, FTAG, micro, DMU_OT_ZAP_OTHER, 0, 0);
-
-       if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0) {
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       object = od->od_object;
-
-       /*
-        * Generate a random name of the form 'xxx.....' where each
-        * x is a random printable character and the dots are dots.
-        * There are 94 such characters, and the name length goes from
-        * 6 to 20, so there are 94^3 * 15 = 12,458,760 possible names.
-        */
-       namelen = ztest_random(sizeof (name) - 5) + 5 + 1;
-
-       for (i = 0; i < 3; i++)
-               name[i] = '!' + ztest_random('~' - '!' + 1);
-       for (; i < namelen - 1; i++)
-               name[i] = '.';
-       name[i] = '\0';
-
-       if ((namelen & 1) || micro) {
-               wsize = sizeof (txg);
-               wc = 1;
-               data = &txg;
-       } else {
-               wsize = 1;
-               wc = namelen;
-               data = string_value;
-       }
-
-       count = -1ULL;
-       VERIFY0(zap_count(os, object, &count));
-       ASSERT(count != -1ULL);
-
-       /*
-        * Select an operation: length, lookup, add, update, remove.
-        */
-       i = ztest_random(5);
-
-       if (i >= 2) {
-               tx = dmu_tx_create(os);
-               dmu_tx_hold_zap(tx, object, B_TRUE, NULL);
-               txg = ztest_tx_assign(tx, TXG_MIGHTWAIT, FTAG);
-               if (txg == 0)
-                       return;
-               bcopy(name, string_value, namelen);
-       } else {
-               tx = NULL;
-               txg = 0;
-               bzero(string_value, namelen);
-       }
-
-       switch (i) {
-
-       case 0:
-               error = zap_length(os, object, name, &zl_wsize, &zl_wc);
-               if (error == 0) {
-                       ASSERT3U(wsize, ==, zl_wsize);
-                       ASSERT3U(wc, ==, zl_wc);
-               } else {
-                       ASSERT3U(error, ==, ENOENT);
-               }
-               break;
-
-       case 1:
-               error = zap_lookup(os, object, name, wsize, wc, data);
-               if (error == 0) {
-                       if (data == string_value &&
-                           bcmp(name, data, namelen) != 0)
-                               fatal(0, "name '%s' != val '%s' len %d",
-                                   name, data, namelen);
-               } else {
-                       ASSERT3U(error, ==, ENOENT);
-               }
-               break;
-
-       case 2:
-               error = zap_add(os, object, name, wsize, wc, data, tx);
-               ASSERT(error == 0 || error == EEXIST);
-               break;
-
-       case 3:
-               VERIFY(zap_update(os, object, name, wsize, wc, data, tx) == 0);
-               break;
-
-       case 4:
-               error = zap_remove(os, object, name, tx);
-               ASSERT(error == 0 || error == ENOENT);
-               break;
-       }
-
-       if (tx != NULL)
-               dmu_tx_commit(tx);
-
-       umem_free(od, sizeof (ztest_od_t));
-}
-
-/*
- * Commit callback data.
- */
-typedef struct ztest_cb_data {
-       list_node_t             zcd_node;
-       uint64_t                zcd_txg;
-       int                     zcd_expected_err;
-       boolean_t               zcd_added;
-       boolean_t               zcd_called;
-       spa_t                   *zcd_spa;
-} ztest_cb_data_t;
-
-/* This is the actual commit callback function */
-static void
-ztest_commit_callback(void *arg, int error)
-{
-       ztest_cb_data_t *data = arg;
-       uint64_t synced_txg;
-
-       VERIFY(data != NULL);
-       VERIFY3S(data->zcd_expected_err, ==, error);
-       VERIFY(!data->zcd_called);
-
-       synced_txg = spa_last_synced_txg(data->zcd_spa);
-       if (data->zcd_txg > synced_txg)
-               fatal(0, "commit callback of txg %" PRIu64 " called prematurely"
-                   ", last synced txg = %" PRIu64 "\n", data->zcd_txg,
-                   synced_txg);
-
-       data->zcd_called = B_TRUE;
-
-       if (error == ECANCELED) {
-               ASSERT0(data->zcd_txg);
-               ASSERT(!data->zcd_added);
-
-               /*
-                * The private callback data should be destroyed here, but
-                * since we are going to check the zcd_called field after
-                * dmu_tx_abort(), we will destroy it there.
-                */
-               return;
-       }
-
-       ASSERT(data->zcd_added);
-       ASSERT3U(data->zcd_txg, !=, 0);
-
-       (void) mutex_enter(&zcl.zcl_callbacks_lock);
-
-       /* See if this cb was called more quickly */
-       if ((synced_txg - data->zcd_txg) < zc_min_txg_delay)
-               zc_min_txg_delay = synced_txg - data->zcd_txg;
-
-       /* Remove our callback from the list */
-       list_remove(&zcl.zcl_callbacks, data);
-
-       (void) mutex_exit(&zcl.zcl_callbacks_lock);
-
-       umem_free(data, sizeof (ztest_cb_data_t));
-}
-
-/* Allocate and initialize callback data structure */
-static ztest_cb_data_t *
-ztest_create_cb_data(objset_t *os, uint64_t txg)
-{
-       ztest_cb_data_t *cb_data;
-
-       cb_data = umem_zalloc(sizeof (ztest_cb_data_t), UMEM_NOFAIL);
-
-       cb_data->zcd_txg = txg;
-       cb_data->zcd_spa = dmu_objset_spa(os);
-       list_link_init(&cb_data->zcd_node);
-
-       return (cb_data);
-}
-
-/*
- * Commit callback test.
- */
-void
-ztest_dmu_commit_callbacks(ztest_ds_t *zd, uint64_t id)
-{
-       objset_t *os = zd->zd_os;
-       ztest_od_t *od;
-       dmu_tx_t *tx;
-       ztest_cb_data_t *cb_data[3], *tmp_cb;
-       uint64_t old_txg, txg;
-       int i, error = 0;
-
-       od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
-       ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0);
-
-       if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0) {
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       tx = dmu_tx_create(os);
-
-       cb_data[0] = ztest_create_cb_data(os, 0);
-       dmu_tx_callback_register(tx, ztest_commit_callback, cb_data[0]);
-
-       dmu_tx_hold_write(tx, od->od_object, 0, sizeof (uint64_t));
-
-       /* Every once in a while, abort the transaction on purpose */
-       if (ztest_random(100) == 0)
-               error = -1;
-
-       if (!error)
-               error = dmu_tx_assign(tx, TXG_NOWAIT);
-
-       txg = error ? 0 : dmu_tx_get_txg(tx);
-
-       cb_data[0]->zcd_txg = txg;
-       cb_data[1] = ztest_create_cb_data(os, txg);
-       dmu_tx_callback_register(tx, ztest_commit_callback, cb_data[1]);
-
-       if (error) {
-               /*
-                * It's not a strict requirement to call the registered
-                * callbacks from inside dmu_tx_abort(), but that's what
-                * it's supposed to happen in the current implementation
-                * so we will check for that.
-                */
-               for (i = 0; i < 2; i++) {
-                       cb_data[i]->zcd_expected_err = ECANCELED;
-                       VERIFY(!cb_data[i]->zcd_called);
-               }
-
-               dmu_tx_abort(tx);
-
-               for (i = 0; i < 2; i++) {
-                       VERIFY(cb_data[i]->zcd_called);
-                       umem_free(cb_data[i], sizeof (ztest_cb_data_t));
-               }
-
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       cb_data[2] = ztest_create_cb_data(os, txg);
-       dmu_tx_callback_register(tx, ztest_commit_callback, cb_data[2]);
-
-       /*
-        * Read existing data to make sure there isn't a future leak.
-        */
-       VERIFY(0 == dmu_read(os, od->od_object, 0, sizeof (uint64_t),
-           &old_txg, DMU_READ_PREFETCH));
-
-       if (old_txg > txg)
-               fatal(0, "future leak: got %" PRIu64 ", open txg is %" PRIu64,
-                   old_txg, txg);
-
-       dmu_write(os, od->od_object, 0, sizeof (uint64_t), &txg, tx);
-
-       (void) mutex_enter(&zcl.zcl_callbacks_lock);
-
-       /*
-        * Since commit callbacks don't have any ordering requirement and since
-        * it is theoretically possible for a commit callback to be called
-        * after an arbitrary amount of time has elapsed since its txg has been
-        * synced, it is difficult to reliably determine whether a commit
-        * callback hasn't been called due to high load or due to a flawed
-        * implementation.
-        *
-        * In practice, we will assume that if after a certain number of txgs a
-        * commit callback hasn't been called, then most likely there's an
-        * implementation bug..
-        */
-       tmp_cb = list_head(&zcl.zcl_callbacks);
-       if (tmp_cb != NULL &&
-           tmp_cb->zcd_txg + ZTEST_COMMIT_CB_THRESH < txg) {
-               fatal(0, "Commit callback threshold exceeded, oldest txg: %"
-                   PRIu64 ", open txg: %" PRIu64 "\n", tmp_cb->zcd_txg, txg);
-       }
-
-       /*
-        * Let's find the place to insert our callbacks.
-        *
-        * Even though the list is ordered by txg, it is possible for the
-        * insertion point to not be the end because our txg may already be
-        * quiescing at this point and other callbacks in the open txg
-        * (from other objsets) may have sneaked in.
-        */
-       tmp_cb = list_tail(&zcl.zcl_callbacks);
-       while (tmp_cb != NULL && tmp_cb->zcd_txg > txg)
-               tmp_cb = list_prev(&zcl.zcl_callbacks, tmp_cb);
-
-       /* Add the 3 callbacks to the list */
-       for (i = 0; i < 3; i++) {
-               if (tmp_cb == NULL)
-                       list_insert_head(&zcl.zcl_callbacks, cb_data[i]);
-               else
-                       list_insert_after(&zcl.zcl_callbacks, tmp_cb,
-                           cb_data[i]);
-
-               cb_data[i]->zcd_added = B_TRUE;
-               VERIFY(!cb_data[i]->zcd_called);
-
-               tmp_cb = cb_data[i];
-       }
-
-       zc_cb_counter += 3;
-
-       (void) mutex_exit(&zcl.zcl_callbacks_lock);
-
-       dmu_tx_commit(tx);
-
-       umem_free(od, sizeof (ztest_od_t));
-}
-
-/* ARGSUSED */
-void
-ztest_dsl_prop_get_set(ztest_ds_t *zd, uint64_t id)
-{
-       zfs_prop_t proplist[] = {
-               ZFS_PROP_CHECKSUM,
-               ZFS_PROP_COMPRESSION,
-               ZFS_PROP_COPIES,
-               ZFS_PROP_DEDUP
-       };
-       int p;
-
-       (void) rw_rdlock(&ztest_name_lock);
-
-       for (p = 0; p < sizeof (proplist) / sizeof (proplist[0]); p++)
-               (void) ztest_dsl_prop_set_uint64(zd->zd_name, proplist[p],
-                   ztest_random_dsl_prop(proplist[p]), (int)ztest_random(2));
-
-       VERIFY0(ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_RECORDSIZE,
-           ztest_random_blocksize(), (int)ztest_random(2)));
-
-       (void) rw_unlock(&ztest_name_lock);
-}
-
-/* ARGSUSED */
-void
-ztest_spa_prop_get_set(ztest_ds_t *zd, uint64_t id)
-{
-       nvlist_t *props = NULL;
-
-       (void) rw_rdlock(&ztest_name_lock);
-
-       (void) ztest_spa_prop_set_uint64(ZPOOL_PROP_DEDUPDITTO,
-           ZIO_DEDUPDITTO_MIN + ztest_random(ZIO_DEDUPDITTO_MIN));
-
-       VERIFY0(spa_prop_get(ztest_spa, &props));
-
-       if (ztest_opts.zo_verbose >= 6)
-               dump_nvlist(props, 4);
-
-       nvlist_free(props);
-
-       (void) rw_unlock(&ztest_name_lock);
-}
-
-static int
-user_release_one(const char *snapname, const char *holdname)
-{
-       nvlist_t *snaps, *holds;
-       int error;
-
-       snaps = fnvlist_alloc();
-       holds = fnvlist_alloc();
-       fnvlist_add_boolean(holds, holdname);
-       fnvlist_add_nvlist(snaps, snapname, holds);
-       fnvlist_free(holds);
-       error = dsl_dataset_user_release(snaps, NULL);
-       fnvlist_free(snaps);
-       return (error);
-}
-
-/*
- * Test snapshot hold/release and deferred destroy.
- */
-void
-ztest_dmu_snapshot_hold(ztest_ds_t *zd, uint64_t id)
-{
-       int error;
-       objset_t *os = zd->zd_os;
-       objset_t *origin;
-       char snapname[100];
-       char fullname[100];
-       char clonename[100];
-       char tag[100];
-       char osname[MAXNAMELEN];
-       nvlist_t *holds;
-
-       (void) rw_rdlock(&ztest_name_lock);
-
-       dmu_objset_name(os, osname);
-
-       (void) snprintf(snapname, sizeof (snapname), "sh1_%llu",
-           (u_longlong_t)id);
-       (void) snprintf(fullname, sizeof (fullname), "%s@%s", osname, snapname);
-       (void) snprintf(clonename, sizeof (clonename),
-           "%s/ch1_%llu", osname, (u_longlong_t)id);
-       (void) snprintf(tag, sizeof (tag), "tag_%llu", (u_longlong_t)id);
-
-       /*
-        * Clean up from any previous run.
-        */
-       error = dsl_destroy_head(clonename);
-       if (error != ENOENT)
-               ASSERT0(error);
-       error = user_release_one(fullname, tag);
-       if (error != ESRCH && error != ENOENT)
-               ASSERT0(error);
-       error = dsl_destroy_snapshot(fullname, B_FALSE);
-       if (error != ENOENT)
-               ASSERT0(error);
-
-       /*
-        * Create snapshot, clone it, mark snap for deferred destroy,
-        * destroy clone, verify snap was also destroyed.
-        */
-       error = dmu_objset_snapshot_one(osname, snapname);
-       if (error) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc("dmu_objset_snapshot");
-                       goto out;
-               }
-               fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error);
-       }
-
-       error = dmu_objset_clone(clonename, fullname);
-       if (error) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc("dmu_objset_clone");
-                       goto out;
-               }
-               fatal(0, "dmu_objset_clone(%s) = %d", clonename, error);
-       }
-
-       error = dsl_destroy_snapshot(fullname, B_TRUE);
-       if (error) {
-               fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
-                   fullname, error);
-       }
-
-       error = dsl_destroy_head(clonename);
-       if (error)
-               fatal(0, "dsl_destroy_head(%s) = %d", clonename, error);
-
-       error = dmu_objset_hold(fullname, FTAG, &origin);
-       if (error != ENOENT)
-               fatal(0, "dmu_objset_hold(%s) = %d", fullname, error);
-
-       /*
-        * Create snapshot, add temporary hold, verify that we can't
-        * destroy a held snapshot, mark for deferred destroy,
-        * release hold, verify snapshot was destroyed.
-        */
-       error = dmu_objset_snapshot_one(osname, snapname);
-       if (error) {
-               if (error == ENOSPC) {
-                       ztest_record_enospc("dmu_objset_snapshot");
-                       goto out;
-               }
-               fatal(0, "dmu_objset_snapshot(%s) = %d", fullname, error);
-       }
-
-       holds = fnvlist_alloc();
-       fnvlist_add_string(holds, fullname, tag);
-       error = dsl_dataset_user_hold(holds, 0, NULL);
-       fnvlist_free(holds);
-
-       if (error == ENOSPC) {
-               ztest_record_enospc("dsl_dataset_user_hold");
-               goto out;
-       } else if (error) {
-               fatal(0, "dsl_dataset_user_hold(%s, %s) = %u",
-                   fullname, tag, error);
-       }
-
-       error = dsl_destroy_snapshot(fullname, B_FALSE);
-       if (error != EBUSY) {
-               fatal(0, "dsl_destroy_snapshot(%s, B_FALSE) = %d",
-                   fullname, error);
-       }
-
-       error = dsl_destroy_snapshot(fullname, B_TRUE);
-       if (error) {
-               fatal(0, "dsl_destroy_snapshot(%s, B_TRUE) = %d",
-                   fullname, error);
-       }
-
-       error = user_release_one(fullname, tag);
-       if (error)
-               fatal(0, "user_release_one(%s, %s) = %d", fullname, tag, error);
-
-       VERIFY3U(dmu_objset_hold(fullname, FTAG, &origin), ==, ENOENT);
-
-out:
-       (void) rw_unlock(&ztest_name_lock);
-}
-
-/*
- * Inject random faults into the on-disk data.
- */
-/* ARGSUSED */
-void
-ztest_fault_inject(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_shared_t *zs = ztest_shared;
-       spa_t *spa = ztest_spa;
-       int fd;
-       uint64_t offset;
-       uint64_t leaves;
-       uint64_t bad = 0x1990c0ffeedecadeull;
-       uint64_t top, leaf;
-       char *path0;
-       char *pathrand;
-       size_t fsize;
-       int bshift = SPA_OLD_MAXBLOCKSHIFT + 2; /* don't scrog all labels */
-       int iters = 1000;
-       int maxfaults;
-       int mirror_save;
-       vdev_t *vd0 = NULL;
-       uint64_t guid0 = 0;
-       boolean_t islog = B_FALSE;
-
-       path0 = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-       pathrand = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-
-       mutex_enter(&ztest_vdev_lock);
-       maxfaults = MAXFAULTS();
-       leaves = MAX(zs->zs_mirrors, 1) * ztest_opts.zo_raidz;
-       mirror_save = zs->zs_mirrors;
-       mutex_exit(&ztest_vdev_lock);
-
-       ASSERT(leaves >= 1);
-
-       /*
-        * Grab the name lock as reader. There are some operations
-        * which don't like to have their vdevs changed while
-        * they are in progress (i.e. spa_change_guid). Those
-        * operations will have grabbed the name lock as writer.
-        */
-       (void) rw_rdlock(&ztest_name_lock);
-
-       /*
-        * We need SCL_STATE here because we're going to look at vd0->vdev_tsd.
-        */
-       spa_config_enter(spa, SCL_STATE, FTAG, RW_READER);
-
-       if (ztest_random(2) == 0) {
-               /*
-                * Inject errors on a normal data device or slog device.
-                */
-               top = ztest_random_vdev_top(spa, B_TRUE);
-               leaf = ztest_random(leaves) + zs->zs_splits;
-
-               /*
-                * Generate paths to the first leaf in this top-level vdev,
-                * and to the random leaf we selected.  We'll induce transient
-                * write failures and random online/offline activity on leaf 0,
-                * and we'll write random garbage to the randomly chosen leaf.
-                */
-               (void) snprintf(path0, MAXPATHLEN, ztest_dev_template,
-                   ztest_opts.zo_dir, ztest_opts.zo_pool,
-                   top * leaves + zs->zs_splits);
-               (void) snprintf(pathrand, MAXPATHLEN, ztest_dev_template,
-                   ztest_opts.zo_dir, ztest_opts.zo_pool,
-                   top * leaves + leaf);
-
-               vd0 = vdev_lookup_by_path(spa->spa_root_vdev, path0);
-               if (vd0 != NULL && vd0->vdev_top->vdev_islog)
-                       islog = B_TRUE;
-
-               /*
-                * If the top-level vdev needs to be resilvered
-                * then we only allow faults on the device that is
-                * resilvering.
-                */
-               if (vd0 != NULL && maxfaults != 1 &&
-                   (!vdev_resilver_needed(vd0->vdev_top, NULL, NULL) ||
-                   vd0->vdev_resilver_txg != 0)) {
-                       /*
-                        * Make vd0 explicitly claim to be unreadable,
-                        * or unwriteable, or reach behind its back
-                        * and close the underlying fd.  We can do this if
-                        * maxfaults == 0 because we'll fail and reexecute,
-                        * and we can do it if maxfaults >= 2 because we'll
-                        * have enough redundancy.  If maxfaults == 1, the
-                        * combination of this with injection of random data
-                        * corruption below exceeds the pool's fault tolerance.
-                        */
-                       vdev_file_t *vf = vd0->vdev_tsd;
-
-                       if (vf != NULL && ztest_random(3) == 0) {
-                               (void) close(vf->vf_vnode->v_fd);
-                               vf->vf_vnode->v_fd = -1;
-                       } else if (ztest_random(2) == 0) {
-                               vd0->vdev_cant_read = B_TRUE;
-                       } else {
-                               vd0->vdev_cant_write = B_TRUE;
-                       }
-                       guid0 = vd0->vdev_guid;
-               }
-       } else {
-               /*
-                * Inject errors on an l2cache device.
-                */
-               spa_aux_vdev_t *sav = &spa->spa_l2cache;
-
-               if (sav->sav_count == 0) {
-                       spa_config_exit(spa, SCL_STATE, FTAG);
-                       (void) rw_unlock(&ztest_name_lock);
-                       goto out;
-               }
-               vd0 = sav->sav_vdevs[ztest_random(sav->sav_count)];
-               guid0 = vd0->vdev_guid;
-               (void) strcpy(path0, vd0->vdev_path);
-               (void) strcpy(pathrand, vd0->vdev_path);
-
-               leaf = 0;
-               leaves = 1;
-               maxfaults = INT_MAX;    /* no limit on cache devices */
-       }
-
-       spa_config_exit(spa, SCL_STATE, FTAG);
-       (void) rw_unlock(&ztest_name_lock);
-
-       /*
-        * If we can tolerate two or more faults, or we're dealing
-        * with a slog, randomly online/offline vd0.
-        */
-       if ((maxfaults >= 2 || islog) && guid0 != 0) {
-               if (ztest_random(10) < 6) {
-                       int flags = (ztest_random(2) == 0 ?
-                           ZFS_OFFLINE_TEMPORARY : 0);
-
-                       /*
-                        * We have to grab the zs_name_lock as writer to
-                        * prevent a race between offlining a slog and
-                        * destroying a dataset. Offlining the slog will
-                        * grab a reference on the dataset which may cause
-                        * dsl_destroy_head() to fail with EBUSY thus
-                        * leaving the dataset in an inconsistent state.
-                        */
-                       if (islog)
-                               (void) rw_wrlock(&ztest_name_lock);
-
-                       VERIFY(vdev_offline(spa, guid0, flags) != EBUSY);
-
-                       if (islog)
-                               (void) rw_unlock(&ztest_name_lock);
-               } else {
-                       /*
-                        * Ideally we would like to be able to randomly
-                        * call vdev_[on|off]line without holding locks
-                        * to force unpredictable failures but the side
-                        * effects of vdev_[on|off]line prevent us from
-                        * doing so. We grab the ztest_vdev_lock here to
-                        * prevent a race between injection testing and
-                        * aux_vdev removal.
-                        */
-                       mutex_enter(&ztest_vdev_lock);
-                       (void) vdev_online(spa, guid0, 0, NULL);
-                       mutex_exit(&ztest_vdev_lock);
-               }
-       }
-
-       if (maxfaults == 0)
-               goto out;
-
-       /*
-        * We have at least single-fault tolerance, so inject data corruption.
-        */
-       fd = open(pathrand, O_RDWR);
-
-       if (fd == -1)   /* we hit a gap in the device namespace */
-               goto out;
-
-       fsize = lseek(fd, 0, SEEK_END);
-
-       while (--iters != 0) {
-               offset = ztest_random(fsize / (leaves << bshift)) *
-                   (leaves << bshift) + (leaf << bshift) +
-                   (ztest_random(1ULL << (bshift - 1)) & -8ULL);
-
-               if (offset >= fsize)
-                       continue;
-
-               mutex_enter(&ztest_vdev_lock);
-               if (mirror_save != zs->zs_mirrors) {
-                       mutex_exit(&ztest_vdev_lock);
-                       (void) close(fd);
-                       goto out;
-               }
-
-               if (pwrite(fd, &bad, sizeof (bad), offset) != sizeof (bad))
-                       fatal(1, "can't inject bad word at 0x%llx in %s",
-                           offset, pathrand);
-
-               mutex_exit(&ztest_vdev_lock);
-
-               if (ztest_opts.zo_verbose >= 7)
-                       (void) printf("injected bad word into %s,"
-                           " offset 0x%llx\n", pathrand, (u_longlong_t)offset);
-       }
-
-       (void) close(fd);
-out:
-       umem_free(path0, MAXPATHLEN);
-       umem_free(pathrand, MAXPATHLEN);
-}
-
-/*
- * Verify that DDT repair works as expected.
- */
-void
-ztest_ddt_repair(ztest_ds_t *zd, uint64_t id)
-{
-       ztest_shared_t *zs = ztest_shared;
-       spa_t *spa = ztest_spa;
-       objset_t *os = zd->zd_os;
-       ztest_od_t *od;
-       uint64_t object, blocksize, txg, pattern, psize;
-       enum zio_checksum checksum = spa_dedup_checksum(spa);
-       dmu_buf_t *db;
-       dmu_tx_t *tx;
-       void *buf;
-       blkptr_t blk;
-       int copies = 2 * ZIO_DEDUPDITTO_MIN;
-       int i;
-
-       blocksize = ztest_random_blocksize();
-       blocksize = MIN(blocksize, 2048);       /* because we write so many */
-
-       od = umem_alloc(sizeof (ztest_od_t), UMEM_NOFAIL);
-       ztest_od_init(od, id, FTAG, 0, DMU_OT_UINT64_OTHER, blocksize, 0);
-
-       if (ztest_object_init(zd, od, sizeof (ztest_od_t), B_FALSE) != 0) {
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       /*
-        * Take the name lock as writer to prevent anyone else from changing
-        * the pool and dataset properies we need to maintain during this test.
-        */
-       (void) rw_wrlock(&ztest_name_lock);
-
-       if (ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_DEDUP, checksum,
-           B_FALSE) != 0 ||
-           ztest_dsl_prop_set_uint64(zd->zd_name, ZFS_PROP_COPIES, 1,
-           B_FALSE) != 0) {
-               (void) rw_unlock(&ztest_name_lock);
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       object = od[0].od_object;
-       blocksize = od[0].od_blocksize;
-       pattern = zs->zs_guid ^ dmu_objset_fsid_guid(os);
-
-       ASSERT(object != 0);
-
-       tx = dmu_tx_create(os);
-       dmu_tx_hold_write(tx, object, 0, copies * blocksize);
-       txg = ztest_tx_assign(tx, TXG_WAIT, FTAG);
-       if (txg == 0) {
-               (void) rw_unlock(&ztest_name_lock);
-               umem_free(od, sizeof (ztest_od_t));
-               return;
-       }
-
-       /*
-        * Write all the copies of our block.
-        */
-       for (i = 0; i < copies; i++) {
-               uint64_t offset = i * blocksize;
-               int error = dmu_buf_hold(os, object, offset, FTAG, &db,
-                   DMU_READ_NO_PREFETCH);
-               if (error != 0) {
-                       fatal(B_FALSE, "dmu_buf_hold(%p, %llu, %llu) = %u",
-                           os, (long long)object, (long long) offset, error);
-               }
-               ASSERT(db->db_offset == offset);
-               ASSERT(db->db_size == blocksize);
-               ASSERT(ztest_pattern_match(db->db_data, db->db_size, pattern) ||
-                   ztest_pattern_match(db->db_data, db->db_size, 0ULL));
-               dmu_buf_will_fill(db, tx);
-               ztest_pattern_set(db->db_data, db->db_size, pattern);
-               dmu_buf_rele(db, FTAG);
-       }
-
-       dmu_tx_commit(tx);
-       txg_wait_synced(spa_get_dsl(spa), txg);
-
-       /*
-        * Find out what block we got.
-        */
-       VERIFY0(dmu_buf_hold(os, object, 0, FTAG, &db,
-           DMU_READ_NO_PREFETCH));
-       blk = *((dmu_buf_impl_t *)db)->db_blkptr;
-       dmu_buf_rele(db, FTAG);
-
-       /*
-        * Damage the block.  Dedup-ditto will save us when we read it later.
-        */
-       psize = BP_GET_PSIZE(&blk);
-       buf = zio_buf_alloc(psize);
-       ztest_pattern_set(buf, psize, ~pattern);
-
-       (void) zio_wait(zio_rewrite(NULL, spa, 0, &blk,
-           buf, psize, NULL, NULL, ZIO_PRIORITY_SYNC_WRITE,
-           ZIO_FLAG_CANFAIL | ZIO_FLAG_INDUCE_DAMAGE, NULL));
-
-       zio_buf_free(buf, psize);
-
-       (void) rw_unlock(&ztest_name_lock);
-       umem_free(od, sizeof (ztest_od_t));
-}
-
-/*
- * Scrub the pool.
- */
-/* ARGSUSED */
-void
-ztest_scrub(ztest_ds_t *zd, uint64_t id)
-{
-       spa_t *spa = ztest_spa;
-
-       (void) spa_scan(spa, POOL_SCAN_SCRUB);
-       (void) poll(NULL, 0, 100); /* wait a moment, then force a restart */
-       (void) spa_scan(spa, POOL_SCAN_SCRUB);
-}
-
-/*
- * Change the guid for the pool.
- */
-/* ARGSUSED */
-void
-ztest_reguid(ztest_ds_t *zd, uint64_t id)
-{
-       spa_t *spa = ztest_spa;
-       uint64_t orig, load;
-       int error;
-
-       orig = spa_guid(spa);
-       load = spa_load_guid(spa);
-
-       (void) rw_wrlock(&ztest_name_lock);
-       error = spa_change_guid(spa);
-       (void) rw_unlock(&ztest_name_lock);
-
-       if (error != 0)
-               return;
-
-       if (ztest_opts.zo_verbose >= 4) {
-               (void) printf("Changed guid old %llu -> %llu\n",
-                   (u_longlong_t)orig, (u_longlong_t)spa_guid(spa));
-       }
-
-       VERIFY3U(orig, !=, spa_guid(spa));
-       VERIFY3U(load, ==, spa_load_guid(spa));
-}
-
-/*
- * Rename the pool to a different name and then rename it back.
- */
-/* ARGSUSED */
-void
-ztest_spa_rename(ztest_ds_t *zd, uint64_t id)
-{
-       char *oldname, *newname;
-       spa_t *spa;
-
-       (void) rw_wrlock(&ztest_name_lock);
-
-       oldname = ztest_opts.zo_pool;
-       newname = umem_alloc(strlen(oldname) + 5, UMEM_NOFAIL);
-       (void) strcpy(newname, oldname);
-       (void) strcat(newname, "_tmp");
-
-       /*
-        * Do the rename
-        */
-       VERIFY3U(0, ==, spa_rename(oldname, newname));
-
-       /*
-        * Try to open it under the old name, which shouldn't exist
-        */
-       VERIFY3U(ENOENT, ==, spa_open(oldname, &spa, FTAG));
-
-       /*
-        * Open it under the new name and make sure it's still the same spa_t.
-        */
-       VERIFY3U(0, ==, spa_open(newname, &spa, FTAG));
-
-       ASSERT(spa == ztest_spa);
-       spa_close(spa, FTAG);
-
-       /*
-        * Rename it back to the original
-        */
-       VERIFY3U(0, ==, spa_rename(newname, oldname));
-
-       /*
-        * Make sure it can still be opened
-        */
-       VERIFY3U(0, ==, spa_open(oldname, &spa, FTAG));
-
-       ASSERT(spa == ztest_spa);
-       spa_close(spa, FTAG);
-
-       umem_free(newname, strlen(newname) + 1);
-
-       (void) rw_unlock(&ztest_name_lock);
-}
-
-/*
- * Verify pool integrity by running zdb.
- */
-static void
-ztest_run_zdb(char *pool)
-{
-       int status;
-       char *bin;
-       char *zdb;
-       char *zbuf;
-       FILE *fp;
-
-       bin = umem_alloc(MAXPATHLEN + MAXNAMELEN + 20, UMEM_NOFAIL);
-       zdb = umem_alloc(MAXPATHLEN + MAXNAMELEN + 20, UMEM_NOFAIL);
-       zbuf = umem_alloc(1024, UMEM_NOFAIL);
-
-       VERIFY(realpath(getexecname(), bin) != NULL);
-       if (strncmp(bin, "/usr/sbin/ztest", 15) == 0) {
-               strcpy(bin, "/usr/sbin/zdb"); /* Installed */
-       } else if (strncmp(bin, "/sbin/ztest", 11) == 0) {
-               strcpy(bin, "/sbin/zdb"); /* Installed */
-       } else {
-               strstr(bin, "/ztest/")[0] = '\0'; /* In-tree */
-               strcat(bin, "/zdb/zdb");
-       }
-
-       (void) sprintf(zdb,
-           "%s -bcc%s%s -d -U %s %s",
-           bin,
-           ztest_opts.zo_verbose >= 3 ? "s" : "",
-           ztest_opts.zo_verbose >= 4 ? "v" : "",
-           spa_config_path,
-           pool);
-
-       if (ztest_opts.zo_verbose >= 5)
-               (void) printf("Executing %s\n", strstr(zdb, "zdb "));
-
-       fp = popen(zdb, "r");
-
-       while (fgets(zbuf, 1024, fp) != NULL)
-               if (ztest_opts.zo_verbose >= 3)
-                       (void) printf("%s", zbuf);
-
-       status = pclose(fp);
-
-       if (status == 0)
-               goto out;
-
-       ztest_dump_core = 0;
-       if (WIFEXITED(status))
-               fatal(0, "'%s' exit code %d", zdb, WEXITSTATUS(status));
-       else
-               fatal(0, "'%s' died with signal %d", zdb, WTERMSIG(status));
-out:
-       umem_free(bin, MAXPATHLEN + MAXNAMELEN + 20);
-       umem_free(zdb, MAXPATHLEN + MAXNAMELEN + 20);
-       umem_free(zbuf, 1024);
-}
-
-static void
-ztest_walk_pool_directory(char *header)
-{
-       spa_t *spa = NULL;
-
-       if (ztest_opts.zo_verbose >= 6)
-               (void) printf("%s\n", header);
-
-       mutex_enter(&spa_namespace_lock);
-       while ((spa = spa_next(spa)) != NULL)
-               if (ztest_opts.zo_verbose >= 6)
-                       (void) printf("\t%s\n", spa_name(spa));
-       mutex_exit(&spa_namespace_lock);
-}
-
-static void
-ztest_spa_import_export(char *oldname, char *newname)
-{
-       nvlist_t *config, *newconfig;
-       uint64_t pool_guid;
-       spa_t *spa;
-       int error;
-
-       if (ztest_opts.zo_verbose >= 4) {
-               (void) printf("import/export: old = %s, new = %s\n",
-                   oldname, newname);
-       }
-
-       /*
-        * Clean up from previous runs.
-        */
-       (void) spa_destroy(newname);
-
-       /*
-        * Get the pool's configuration and guid.
-        */
-       VERIFY3U(0, ==, spa_open(oldname, &spa, FTAG));
-
-       /*
-        * Kick off a scrub to tickle scrub/export races.
-        */
-       if (ztest_random(2) == 0)
-               (void) spa_scan(spa, POOL_SCAN_SCRUB);
-
-       pool_guid = spa_guid(spa);
-       spa_close(spa, FTAG);
-
-       ztest_walk_pool_directory("pools before export");
-
-       /*
-        * Export it.
-        */
-       VERIFY3U(0, ==, spa_export(oldname, &config, B_FALSE, B_FALSE));
-
-       ztest_walk_pool_directory("pools after export");
-
-       /*
-        * Try to import it.
-        */
-       newconfig = spa_tryimport(config);
-       ASSERT(newconfig != NULL);
-       nvlist_free(newconfig);
-
-       /*
-        * Import it under the new name.
-        */
-       error = spa_import(newname, config, NULL, 0);
-       if (error != 0) {
-               dump_nvlist(config, 0);
-               fatal(B_FALSE, "couldn't import pool %s as %s: error %u",
-                   oldname, newname, error);
-       }
-
-       ztest_walk_pool_directory("pools after import");
-
-       /*
-        * Try to import it again -- should fail with EEXIST.
-        */
-       VERIFY3U(EEXIST, ==, spa_import(newname, config, NULL, 0));
-
-       /*
-        * Try to import it under a different name -- should fail with EEXIST.
-        */
-       VERIFY3U(EEXIST, ==, spa_import(oldname, config, NULL, 0));
-
-       /*
-        * Verify that the pool is no longer visible under the old name.
-        */
-       VERIFY3U(ENOENT, ==, spa_open(oldname, &spa, FTAG));
-
-       /*
-        * Verify that we can open and close the pool using the new name.
-        */
-       VERIFY3U(0, ==, spa_open(newname, &spa, FTAG));
-       ASSERT(pool_guid == spa_guid(spa));
-       spa_close(spa, FTAG);
-
-       nvlist_free(config);
-}
-
-static void
-ztest_resume(spa_t *spa)
-{
-       if (spa_suspended(spa) && ztest_opts.zo_verbose >= 6)
-               (void) printf("resuming from suspended state\n");
-       spa_vdev_state_enter(spa, SCL_NONE);
-       vdev_clear(spa, NULL);
-       (void) spa_vdev_state_exit(spa, NULL, 0);
-       (void) zio_resume(spa);
-}
-
-static void *
-ztest_resume_thread(void *arg)
-{
-       spa_t *spa = arg;
-
-       while (!ztest_exiting) {
-               if (spa_suspended(spa))
-                       ztest_resume(spa);
-               (void) poll(NULL, 0, 100);
-       }
-
-       thread_exit();
-
-       return (NULL);
-}
-
-#define        GRACE   300
-
-#if 0
-static void
-ztest_deadman_alarm(int sig)
-{
-       fatal(0, "failed to complete within %d seconds of deadline", GRACE);
-}
-#endif
-
-static void
-ztest_execute(int test, ztest_info_t *zi, uint64_t id)
-{
-       ztest_ds_t *zd = &ztest_ds[id % ztest_opts.zo_datasets];
-       ztest_shared_callstate_t *zc = ZTEST_GET_SHARED_CALLSTATE(test);
-       hrtime_t functime = gethrtime();
-       int i;
-
-       for (i = 0; i < zi->zi_iters; i++)
-               zi->zi_func(zd, id);
-
-       functime = gethrtime() - functime;
-
-       atomic_add_64(&zc->zc_count, 1);
-       atomic_add_64(&zc->zc_time, functime);
-
-       if (ztest_opts.zo_verbose >= 4)
-               (void) printf("%6.2f sec in %s\n",
-                   (double)functime / NANOSEC, zi->zi_funcname);
-}
-
-static void *
-ztest_thread(void *arg)
-{
-       int rand;
-       uint64_t id = (uintptr_t)arg;
-       ztest_shared_t *zs = ztest_shared;
-       uint64_t call_next;
-       hrtime_t now;
-       ztest_info_t *zi;
-       ztest_shared_callstate_t *zc;
-
-       while ((now = gethrtime()) < zs->zs_thread_stop) {
-               /*
-                * See if it's time to force a crash.
-                */
-               if (now > zs->zs_thread_kill)
-                       ztest_kill(zs);
-
-               /*
-                * If we're getting ENOSPC with some regularity, stop.
-                */
-               if (zs->zs_enospc_count > 10)
-                       break;
-
-               /*
-                * Pick a random function to execute.
-                */
-               rand = ztest_random(ZTEST_FUNCS);
-               zi = &ztest_info[rand];
-               zc = ZTEST_GET_SHARED_CALLSTATE(rand);
-               call_next = zc->zc_next;
-
-               if (now >= call_next &&
-                   atomic_cas_64(&zc->zc_next, call_next, call_next +
-                   ztest_random(2 * zi->zi_interval[0] + 1)) == call_next) {
-                       ztest_execute(rand, zi, id);
-               }
-       }
-
-       thread_exit();
-
-       return (NULL);
-}
-
-static void
-ztest_dataset_name(char *dsname, char *pool, int d)
-{
-       (void) snprintf(dsname, MAXNAMELEN, "%s/ds_%d", pool, d);
-}
-
-static void
-ztest_dataset_destroy(int d)
-{
-       char name[MAXNAMELEN];
-       int t;
-
-       ztest_dataset_name(name, ztest_opts.zo_pool, d);
-
-       if (ztest_opts.zo_verbose >= 3)
-               (void) printf("Destroying %s to free up space\n", name);
-
-       /*
-        * Cleanup any non-standard clones and snapshots.  In general,
-        * ztest thread t operates on dataset (t % zopt_datasets),
-        * so there may be more than one thing to clean up.
-        */
-       for (t = d; t < ztest_opts.zo_threads;
-           t += ztest_opts.zo_datasets)
-               ztest_dsl_dataset_cleanup(name, t);
-
-       (void) dmu_objset_find(name, ztest_objset_destroy_cb, NULL,
-           DS_FIND_SNAPSHOTS | DS_FIND_CHILDREN);
-}
-
-static void
-ztest_dataset_dirobj_verify(ztest_ds_t *zd)
-{
-       uint64_t usedobjs, dirobjs, scratch;
-
-       /*
-        * ZTEST_DIROBJ is the object directory for the entire dataset.
-        * Therefore, the number of objects in use should equal the
-        * number of ZTEST_DIROBJ entries, +1 for ZTEST_DIROBJ itself.
-        * If not, we have an object leak.
-        *
-        * Note that we can only check this in ztest_dataset_open(),
-        * when the open-context and syncing-context values agree.
-        * That's because zap_count() returns the open-context value,
-        * while dmu_objset_space() returns the rootbp fill count.
-        */
-       VERIFY3U(0, ==, zap_count(zd->zd_os, ZTEST_DIROBJ, &dirobjs));
-       dmu_objset_space(zd->zd_os, &scratch, &scratch, &usedobjs, &scratch);
-       ASSERT3U(dirobjs + 1, ==, usedobjs);
-}
-
-static int
-ztest_dataset_open(int d)
-{
-       ztest_ds_t *zd = &ztest_ds[d];
-       uint64_t committed_seq = ZTEST_GET_SHARED_DS(d)->zd_seq;
-       objset_t *os;
-       zilog_t *zilog;
-       char name[MAXNAMELEN];
-       int error;
-
-       ztest_dataset_name(name, ztest_opts.zo_pool, d);
-
-       (void) rw_rdlock(&ztest_name_lock);
-
-       error = ztest_dataset_create(name);
-       if (error == ENOSPC) {
-               (void) rw_unlock(&ztest_name_lock);
-               ztest_record_enospc(FTAG);
-               return (error);
-       }
-       ASSERT(error == 0 || error == EEXIST);
-
-       VERIFY0(dmu_objset_own(name, DMU_OST_OTHER, B_FALSE, zd, &os));
-       (void) rw_unlock(&ztest_name_lock);
-
-       ztest_zd_init(zd, ZTEST_GET_SHARED_DS(d), os);
-
-       zilog = zd->zd_zilog;
-
-       if (zilog->zl_header->zh_claim_lr_seq != 0 &&
-           zilog->zl_header->zh_claim_lr_seq < committed_seq)
-               fatal(0, "missing log records: claimed %llu < committed %llu",
-                   zilog->zl_header->zh_claim_lr_seq, committed_seq);
-
-       ztest_dataset_dirobj_verify(zd);
-
-       zil_replay(os, zd, ztest_replay_vector);
-
-       ztest_dataset_dirobj_verify(zd);
-
-       if (ztest_opts.zo_verbose >= 6)
-               (void) printf("%s replay %llu blocks, %llu records, seq %llu\n",
-                   zd->zd_name,
-                   (u_longlong_t)zilog->zl_parse_blk_count,
-                   (u_longlong_t)zilog->zl_parse_lr_count,
-                   (u_longlong_t)zilog->zl_replaying_seq);
-
-       zilog = zil_open(os, ztest_get_data);
-
-       if (zilog->zl_replaying_seq != 0 &&
-           zilog->zl_replaying_seq < committed_seq)
-               fatal(0, "missing log records: replayed %llu < committed %llu",
-                   zilog->zl_replaying_seq, committed_seq);
-
-       return (0);
-}
-
-static void
-ztest_dataset_close(int d)
-{
-       ztest_ds_t *zd = &ztest_ds[d];
-
-       zil_close(zd->zd_zilog);
-       dmu_objset_disown(zd->zd_os, zd);
-
-       ztest_zd_fini(zd);
-}
-
-/*
- * Kick off threads to run tests on all datasets in parallel.
- */
-static void
-ztest_run(ztest_shared_t *zs)
-{
-       kt_did_t *tid;
-       spa_t *spa;
-       objset_t *os;
-       kthread_t *resume_thread;
-       uint64_t object;
-       int error;
-       int t, d;
-
-       ztest_exiting = B_FALSE;
-
-       /*
-        * Initialize parent/child shared state.
-        */
-       mutex_init(&ztest_vdev_lock, NULL, MUTEX_DEFAULT, NULL);
-       VERIFY(rwlock_init(&ztest_name_lock, USYNC_THREAD, NULL) == 0);
-
-       zs->zs_thread_start = gethrtime();
-       zs->zs_thread_stop =
-           zs->zs_thread_start + ztest_opts.zo_passtime * NANOSEC;
-       zs->zs_thread_stop = MIN(zs->zs_thread_stop, zs->zs_proc_stop);
-       zs->zs_thread_kill = zs->zs_thread_stop;
-       if (ztest_random(100) < ztest_opts.zo_killrate) {
-               zs->zs_thread_kill -=
-                   ztest_random(ztest_opts.zo_passtime * NANOSEC);
-       }
-
-       mutex_init(&zcl.zcl_callbacks_lock, NULL, MUTEX_DEFAULT, NULL);
-
-       list_create(&zcl.zcl_callbacks, sizeof (ztest_cb_data_t),
-           offsetof(ztest_cb_data_t, zcd_node));
-
-       /*
-        * Open our pool.
-        */
-       kernel_init(FREAD | FWRITE);
-       VERIFY0(spa_open(ztest_opts.zo_pool, &spa, FTAG));
-       spa->spa_debug = B_TRUE;
-       metaslab_preload_limit = ztest_random(20) + 1;
-       ztest_spa = spa;
-
-       VERIFY0(dmu_objset_own(ztest_opts.zo_pool,
-           DMU_OST_ANY, B_TRUE, FTAG, &os));
-       zs->zs_guid = dmu_objset_fsid_guid(os);
-       dmu_objset_disown(os, FTAG);
-
-       spa->spa_dedup_ditto = 2 * ZIO_DEDUPDITTO_MIN;
-
-       /*
-        * We don't expect the pool to suspend unless maxfaults == 0,
-        * in which case ztest_fault_inject() temporarily takes away
-        * the only valid replica.
-        */
-       if (MAXFAULTS() == 0)
-               spa->spa_failmode = ZIO_FAILURE_MODE_WAIT;
-       else
-               spa->spa_failmode = ZIO_FAILURE_MODE_PANIC;
-
-       /*
-        * Create a thread to periodically resume suspended I/O.
-        */
-       VERIFY3P((resume_thread = zk_thread_create(NULL, 0,
-           (thread_func_t)ztest_resume_thread, spa, TS_RUN, NULL, 0, 0,
-           PTHREAD_CREATE_JOINABLE)), !=, NULL);
-
-#if 0
-       /*
-        * Set a deadman alarm to abort() if we hang.
-        */
-       signal(SIGALRM, ztest_deadman_alarm);
-       alarm((zs->zs_thread_stop - zs->zs_thread_start) / NANOSEC + GRACE);
-#endif
-
-       /*
-        * Verify that we can safely inquire about about any object,
-        * whether it's allocated or not.  To make it interesting,
-        * we probe a 5-wide window around each power of two.
-        * This hits all edge cases, including zero and the max.
-        */
-       for (t = 0; t < 64; t++) {
-               for (d = -5; d <= 5; d++) {
-                       error = dmu_object_info(spa->spa_meta_objset,
-                           (1ULL << t) + d, NULL);
-                       ASSERT(error == 0 || error == ENOENT ||
-                           error == EINVAL);
-               }
-       }
-
-       /*
-        * If we got any ENOSPC errors on the previous run, destroy something.
-        */
-       if (zs->zs_enospc_count != 0) {
-               int d = ztest_random(ztest_opts.zo_datasets);
-               ztest_dataset_destroy(d);
-       }
-       zs->zs_enospc_count = 0;
-
-       tid = umem_zalloc(ztest_opts.zo_threads * sizeof (kt_did_t),
-           UMEM_NOFAIL);
-
-       if (ztest_opts.zo_verbose >= 4)
-               (void) printf("starting main threads...\n");
-
-       /*
-        * Kick off all the tests that run in parallel.
-        */
-       for (t = 0; t < ztest_opts.zo_threads; t++) {
-               kthread_t *thread;
-
-               if (t < ztest_opts.zo_datasets &&
-                   ztest_dataset_open(t) != 0)
-                       return;
-
-               VERIFY3P(thread = zk_thread_create(NULL, 0,
-                   (thread_func_t)ztest_thread,
-                   (void *)(uintptr_t)t, TS_RUN, NULL, 0, 0,
-                   PTHREAD_CREATE_JOINABLE), !=, NULL);
-               tid[t] = thread->t_tid;
-       }
-
-       /*
-        * Wait for all of the tests to complete.  We go in reverse order
-        * so we don't close datasets while threads are still using them.
-        */
-       for (t = ztest_opts.zo_threads - 1; t >= 0; t--) {
-               thread_join(tid[t]);
-               if (t < ztest_opts.zo_datasets)
-                       ztest_dataset_close(t);
-       }
-
-       txg_wait_synced(spa_get_dsl(spa), 0);
-
-       zs->zs_alloc = metaslab_class_get_alloc(spa_normal_class(spa));
-       zs->zs_space = metaslab_class_get_space(spa_normal_class(spa));
-
-       umem_free(tid, ztest_opts.zo_threads * sizeof (kt_did_t));
-
-       /* Kill the resume thread */
-       ztest_exiting = B_TRUE;
-       thread_join(resume_thread->t_tid);
-       ztest_resume(spa);
-
-       /*
-        * Right before closing the pool, kick off a bunch of async I/O;
-        * spa_close() should wait for it to complete.
-        */
-       for (object = 1; object < 50; object++)
-               dmu_prefetch(spa->spa_meta_objset, object, 0, 1ULL << 20);
-
-       /* Verify that at least one commit cb was called in a timely fashion */
-       if (zc_cb_counter >= ZTEST_COMMIT_CB_MIN_REG)
-               VERIFY0(zc_min_txg_delay);
-
-       spa_close(spa, FTAG);
-
-       /*
-        * Verify that we can loop over all pools.
-        */
-       mutex_enter(&spa_namespace_lock);
-       for (spa = spa_next(NULL); spa != NULL; spa = spa_next(spa))
-               if (ztest_opts.zo_verbose > 3)
-                       (void) printf("spa_next: found %s\n", spa_name(spa));
-       mutex_exit(&spa_namespace_lock);
-
-       /*
-        * Verify that we can export the pool and reimport it under a
-        * different name.
-        */
-       if (ztest_random(2) == 0) {
-               char name[MAXNAMELEN];
-               (void) snprintf(name, MAXNAMELEN, "%s_import",
-                   ztest_opts.zo_pool);
-               ztest_spa_import_export(ztest_opts.zo_pool, name);
-               ztest_spa_import_export(name, ztest_opts.zo_pool);
-       }
-
-       kernel_fini();
-
-       list_destroy(&zcl.zcl_callbacks);
-       mutex_destroy(&zcl.zcl_callbacks_lock);
-       (void) rwlock_destroy(&ztest_name_lock);
-       mutex_destroy(&ztest_vdev_lock);
-}
-
-static void
-ztest_freeze(void)
-{
-       ztest_ds_t *zd = &ztest_ds[0];
-       spa_t *spa;
-       int numloops = 0;
-
-       if (ztest_opts.zo_verbose >= 3)
-               (void) printf("testing spa_freeze()...\n");
-
-       kernel_init(FREAD | FWRITE);
-       VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
-       VERIFY3U(0, ==, ztest_dataset_open(0));
-       spa->spa_debug = B_TRUE;
-       ztest_spa = spa;
-
-       /*
-        * Force the first log block to be transactionally allocated.
-        * We have to do this before we freeze the pool -- otherwise
-        * the log chain won't be anchored.
-        */
-       while (BP_IS_HOLE(&zd->zd_zilog->zl_header->zh_log)) {
-               ztest_dmu_object_alloc_free(zd, 0);
-               zil_commit(zd->zd_zilog, 0);
-       }
-
-       txg_wait_synced(spa_get_dsl(spa), 0);
-
-       /*
-        * Freeze the pool.  This stops spa_sync() from doing anything,
-        * so that the only way to record changes from now on is the ZIL.
-        */
-       spa_freeze(spa);
-
-       /*
-        * Because it is hard to predict how much space a write will actually
-        * require beforehand, we leave ourselves some fudge space to write over
-        * capacity.
-        */
-       uint64_t capacity = metaslab_class_get_space(spa_normal_class(spa)) / 2;
-
-       /*
-        * Run tests that generate log records but don't alter the pool config
-        * or depend on DSL sync tasks (snapshots, objset create/destroy, etc).
-        * We do a txg_wait_synced() after each iteration to force the txg
-        * to increase well beyond the last synced value in the uberblock.
-        * The ZIL should be OK with that.
-        *
-        * Run a random number of times less than zo_maxloops and ensure we do
-        * not run out of space on the pool.
-        */
-       while (ztest_random(10) != 0 &&
-           numloops++ < ztest_opts.zo_maxloops &&
-           metaslab_class_get_alloc(spa_normal_class(spa)) < capacity) {
-               ztest_od_t od;
-               ztest_od_init(&od, 0, FTAG, 0, DMU_OT_UINT64_OTHER, 0, 0);
-               VERIFY0(ztest_object_init(zd, &od, sizeof (od), B_FALSE));
-               ztest_io(zd, od.od_object,
-                   ztest_random(ZTEST_RANGE_LOCKS) << SPA_MAXBLOCKSHIFT);
-               txg_wait_synced(spa_get_dsl(spa), 0);
-       }
-
-       /*
-        * Commit all of the changes we just generated.
-        */
-       zil_commit(zd->zd_zilog, 0);
-       txg_wait_synced(spa_get_dsl(spa), 0);
-
-       /*
-        * Close our dataset and close the pool.
-        */
-       ztest_dataset_close(0);
-       spa_close(spa, FTAG);
-       kernel_fini();
-
-       /*
-        * Open and close the pool and dataset to induce log replay.
-        */
-       kernel_init(FREAD | FWRITE);
-       VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
-       ASSERT(spa_freeze_txg(spa) == UINT64_MAX);
-       VERIFY3U(0, ==, ztest_dataset_open(0));
-       ztest_dataset_close(0);
-
-       spa->spa_debug = B_TRUE;
-       ztest_spa = spa;
-       txg_wait_synced(spa_get_dsl(spa), 0);
-       ztest_reguid(NULL, 0);
-
-       spa_close(spa, FTAG);
-       kernel_fini();
-}
-
-void
-print_time(hrtime_t t, char *timebuf)
-{
-       hrtime_t s = t / NANOSEC;
-       hrtime_t m = s / 60;
-       hrtime_t h = m / 60;
-       hrtime_t d = h / 24;
-
-       s -= m * 60;
-       m -= h * 60;
-       h -= d * 24;
-
-       timebuf[0] = '\0';
-
-       if (d)
-               (void) sprintf(timebuf,
-                   "%llud%02lluh%02llum%02llus", d, h, m, s);
-       else if (h)
-               (void) sprintf(timebuf, "%lluh%02llum%02llus", h, m, s);
-       else if (m)
-               (void) sprintf(timebuf, "%llum%02llus", m, s);
-       else
-               (void) sprintf(timebuf, "%llus", s);
-}
-
-static nvlist_t *
-make_random_props(void)
-{
-       nvlist_t *props;
-
-       VERIFY(nvlist_alloc(&props, NV_UNIQUE_NAME, 0) == 0);
-       if (ztest_random(2) == 0)
-               return (props);
-       VERIFY(nvlist_add_uint64(props, "autoreplace", 1) == 0);
-
-       return (props);
-}
-
-/*
- * Create a storage pool with the given name and initial vdev size.
- * Then test spa_freeze() functionality.
- */
-static void
-ztest_init(ztest_shared_t *zs)
-{
-       spa_t *spa;
-       nvlist_t *nvroot, *props;
-       int i;
-
-       mutex_init(&ztest_vdev_lock, NULL, MUTEX_DEFAULT, NULL);
-       VERIFY(rwlock_init(&ztest_name_lock, USYNC_THREAD, NULL) == 0);
-
-       kernel_init(FREAD | FWRITE);
-
-       /*
-        * Create the storage pool.
-        */
-       (void) spa_destroy(ztest_opts.zo_pool);
-       ztest_shared->zs_vdev_next_leaf = 0;
-       zs->zs_splits = 0;
-       zs->zs_mirrors = ztest_opts.zo_mirrors;
-       nvroot = make_vdev_root(NULL, NULL, NULL, ztest_opts.zo_vdev_size, 0,
-           0, ztest_opts.zo_raidz, zs->zs_mirrors, 1);
-       props = make_random_props();
-       for (i = 0; i < SPA_FEATURES; i++) {
-               char *buf;
-               VERIFY3S(-1, !=, asprintf(&buf, "feature@%s",
-                   spa_feature_table[i].fi_uname));
-               VERIFY3U(0, ==, nvlist_add_uint64(props, buf, 0));
-               free(buf);
-       }
-       VERIFY3U(0, ==, spa_create(ztest_opts.zo_pool, nvroot, props, NULL));
-       nvlist_free(nvroot);
-       nvlist_free(props);
-
-       VERIFY3U(0, ==, spa_open(ztest_opts.zo_pool, &spa, FTAG));
-       zs->zs_metaslab_sz =
-           1ULL << spa->spa_root_vdev->vdev_child[0]->vdev_ms_shift;
-       spa_close(spa, FTAG);
-
-       kernel_fini();
-
-       ztest_run_zdb(ztest_opts.zo_pool);
-
-       ztest_freeze();
-
-       ztest_run_zdb(ztest_opts.zo_pool);
-
-       (void) rwlock_destroy(&ztest_name_lock);
-       mutex_destroy(&ztest_vdev_lock);
-}
-
-static void
-setup_data_fd(void)
-{
-       static char ztest_name_data[] = "/tmp/ztest.data.XXXXXX";
-
-       ztest_fd_data = mkstemp(ztest_name_data);
-       ASSERT3S(ztest_fd_data, >=, 0);
-       (void) unlink(ztest_name_data);
-}
-
-static int
-shared_data_size(ztest_shared_hdr_t *hdr)
-{
-       int size;
-
-       size = hdr->zh_hdr_size;
-       size += hdr->zh_opts_size;
-       size += hdr->zh_size;
-       size += hdr->zh_stats_size * hdr->zh_stats_count;
-       size += hdr->zh_ds_size * hdr->zh_ds_count;
-
-       return (size);
-}
-
-static void
-setup_hdr(void)
-{
-       int size;
-       ztest_shared_hdr_t *hdr;
-
-       hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
-           PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0);
-       VERIFY3P(hdr, !=, MAP_FAILED);
-
-       VERIFY3U(0, ==, ftruncate(ztest_fd_data, sizeof (ztest_shared_hdr_t)));
-
-       hdr->zh_hdr_size = sizeof (ztest_shared_hdr_t);
-       hdr->zh_opts_size = sizeof (ztest_shared_opts_t);
-       hdr->zh_size = sizeof (ztest_shared_t);
-       hdr->zh_stats_size = sizeof (ztest_shared_callstate_t);
-       hdr->zh_stats_count = ZTEST_FUNCS;
-       hdr->zh_ds_size = sizeof (ztest_shared_ds_t);
-       hdr->zh_ds_count = ztest_opts.zo_datasets;
-
-       size = shared_data_size(hdr);
-       VERIFY3U(0, ==, ftruncate(ztest_fd_data, size));
-
-       (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
-}
-
-static void
-setup_data(void)
-{
-       int size, offset;
-       ztest_shared_hdr_t *hdr;
-       uint8_t *buf;
-
-       hdr = (void *)mmap(0, P2ROUNDUP(sizeof (*hdr), getpagesize()),
-           PROT_READ, MAP_SHARED, ztest_fd_data, 0);
-       VERIFY3P(hdr, !=, MAP_FAILED);
-
-       size = shared_data_size(hdr);
-
-       (void) munmap((caddr_t)hdr, P2ROUNDUP(sizeof (*hdr), getpagesize()));
-       hdr = ztest_shared_hdr = (void *)mmap(0, P2ROUNDUP(size, getpagesize()),
-           PROT_READ | PROT_WRITE, MAP_SHARED, ztest_fd_data, 0);
-       VERIFY3P(hdr, !=, MAP_FAILED);
-       buf = (uint8_t *)hdr;
-
-       offset = hdr->zh_hdr_size;
-       ztest_shared_opts = (void *)&buf[offset];
-       offset += hdr->zh_opts_size;
-       ztest_shared = (void *)&buf[offset];
-       offset += hdr->zh_size;
-       ztest_shared_callstate = (void *)&buf[offset];
-       offset += hdr->zh_stats_size * hdr->zh_stats_count;
-       ztest_shared_ds = (void *)&buf[offset];
-}
-
-static boolean_t
-exec_child(char *cmd, char *libpath, boolean_t ignorekill, int *statusp)
-{
-       pid_t pid;
-       int status;
-       char *cmdbuf = NULL;
-
-       pid = fork();
-
-       if (cmd == NULL) {
-               cmdbuf = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-               (void) strlcpy(cmdbuf, getexecname(), MAXPATHLEN);
-               cmd = cmdbuf;
-       }
-
-       if (pid == -1)
-               fatal(1, "fork failed");
-
-       if (pid == 0) { /* child */
-               char *emptyargv[2] = { cmd, NULL };
-               char fd_data_str[12];
-
-               struct rlimit rl = { 1024, 1024 };
-               (void) setrlimit(RLIMIT_NOFILE, &rl);
-
-               (void) close(ztest_fd_rand);
-               VERIFY(11 >= snprintf(fd_data_str, 12, "%d", ztest_fd_data));
-               VERIFY(0 == setenv("ZTEST_FD_DATA", fd_data_str, 1));
-
-               (void) enable_extended_FILE_stdio(-1, -1);
-               if (libpath != NULL)
-                       VERIFY(0 == setenv("LD_LIBRARY_PATH", libpath, 1));
-               (void) execv(cmd, emptyargv);
-               ztest_dump_core = B_FALSE;
-               fatal(B_TRUE, "exec failed: %s", cmd);
-       }
-
-       if (cmdbuf != NULL) {
-               umem_free(cmdbuf, MAXPATHLEN);
-               cmd = NULL;
-       }
-
-       while (waitpid(pid, &status, 0) != pid)
-               continue;
-       if (statusp != NULL)
-               *statusp = status;
-
-       if (WIFEXITED(status)) {
-               if (WEXITSTATUS(status) != 0) {
-                       (void) fprintf(stderr, "child exited with code %d\n",
-                           WEXITSTATUS(status));
-                       exit(2);
-               }
-               return (B_FALSE);
-       } else if (WIFSIGNALED(status)) {
-               if (!ignorekill || WTERMSIG(status) != SIGKILL) {
-                       (void) fprintf(stderr, "child died with signal %d\n",
-                           WTERMSIG(status));
-                       exit(3);
-               }
-               return (B_TRUE);
-       } else {
-               (void) fprintf(stderr, "something strange happened to child\n");
-               exit(4);
-               /* NOTREACHED */
-       }
-}
-
-static void
-ztest_run_init(void)
-{
-       int i;
-
-       ztest_shared_t *zs = ztest_shared;
-
-       ASSERT(ztest_opts.zo_init != 0);
-
-       /*
-        * Blow away any existing copy of zpool.cache
-        */
-       (void) remove(spa_config_path);
-
-       /*
-        * Create and initialize our storage pool.
-        */
-       for (i = 1; i <= ztest_opts.zo_init; i++) {
-               bzero(zs, sizeof (ztest_shared_t));
-               if (ztest_opts.zo_verbose >= 3 &&
-                   ztest_opts.zo_init != 1) {
-                       (void) printf("ztest_init(), pass %d\n", i);
-               }
-               ztest_init(zs);
-       }
-}
-
-int
-main(int argc, char **argv)
-{
-       int kills = 0;
-       int iters = 0;
-       int older = 0;
-       int newer = 0;
-       ztest_shared_t *zs;
-       ztest_info_t *zi;
-       ztest_shared_callstate_t *zc;
-       char timebuf[100];
-       char numbuf[6];
-       spa_t *spa;
-       char *cmd;
-       boolean_t hasalt;
-       int f;
-       char *fd_data_str = getenv("ZTEST_FD_DATA");
-       struct sigaction action;
-
-       (void) setvbuf(stdout, NULL, _IOLBF, 0);
-
-       dprintf_setup(&argc, argv);
-
-       action.sa_handler = sig_handler;
-       sigemptyset(&action.sa_mask);
-       action.sa_flags = 0;
-
-       if (sigaction(SIGSEGV, &action, NULL) < 0) {
-               (void) fprintf(stderr, "ztest: cannot catch SIGSEGV: %s.\n",
-                   strerror(errno));
-               exit(EXIT_FAILURE);
-       }
-
-       if (sigaction(SIGABRT, &action, NULL) < 0) {
-               (void) fprintf(stderr, "ztest: cannot catch SIGABRT: %s.\n",
-                   strerror(errno));
-               exit(EXIT_FAILURE);
-       }
-
-       ztest_fd_rand = open("/dev/urandom", O_RDONLY);
-       ASSERT3S(ztest_fd_rand, >=, 0);
-
-       if (!fd_data_str) {
-               process_options(argc, argv);
-
-               setup_data_fd();
-               setup_hdr();
-               setup_data();
-               bcopy(&ztest_opts, ztest_shared_opts,
-                   sizeof (*ztest_shared_opts));
-       } else {
-               ztest_fd_data = atoi(fd_data_str);
-               setup_data();
-               bcopy(ztest_shared_opts, &ztest_opts, sizeof (ztest_opts));
-       }
-       ASSERT3U(ztest_opts.zo_datasets, ==, ztest_shared_hdr->zh_ds_count);
-
-       /* Override location of zpool.cache */
-       VERIFY(asprintf((char **)&spa_config_path, "%s/zpool.cache",
-           ztest_opts.zo_dir) != -1);
-
-       ztest_ds = umem_alloc(ztest_opts.zo_datasets * sizeof (ztest_ds_t),
-           UMEM_NOFAIL);
-       zs = ztest_shared;
-
-       if (fd_data_str) {
-               metaslab_gang_bang = ztest_opts.zo_metaslab_gang_bang;
-               metaslab_df_alloc_threshold =
-                   zs->zs_metaslab_df_alloc_threshold;
-
-               if (zs->zs_do_init)
-                       ztest_run_init();
-               else
-                       ztest_run(zs);
-               exit(0);
-       }
-
-       hasalt = (strlen(ztest_opts.zo_alt_ztest) != 0);
-
-       if (ztest_opts.zo_verbose >= 1) {
-               (void) printf("%llu vdevs, %d datasets, %d threads,"
-                   " %llu seconds...\n",
-                   (u_longlong_t)ztest_opts.zo_vdevs,
-                   ztest_opts.zo_datasets,
-                   ztest_opts.zo_threads,
-                   (u_longlong_t)ztest_opts.zo_time);
-       }
-
-       cmd = umem_alloc(MAXNAMELEN, UMEM_NOFAIL);
-       (void) strlcpy(cmd, getexecname(), MAXNAMELEN);
-
-       zs->zs_do_init = B_TRUE;
-       if (strlen(ztest_opts.zo_alt_ztest) != 0) {
-               if (ztest_opts.zo_verbose >= 1) {
-                       (void) printf("Executing older ztest for "
-                           "initialization: %s\n", ztest_opts.zo_alt_ztest);
-               }
-               VERIFY(!exec_child(ztest_opts.zo_alt_ztest,
-                   ztest_opts.zo_alt_libpath, B_FALSE, NULL));
-       } else {
-               VERIFY(!exec_child(NULL, NULL, B_FALSE, NULL));
-       }
-       zs->zs_do_init = B_FALSE;
-
-       zs->zs_proc_start = gethrtime();
-       zs->zs_proc_stop = zs->zs_proc_start + ztest_opts.zo_time * NANOSEC;
-
-       for (f = 0; f < ZTEST_FUNCS; f++) {
-               zi = &ztest_info[f];
-               zc = ZTEST_GET_SHARED_CALLSTATE(f);
-               if (zs->zs_proc_start + zi->zi_interval[0] > zs->zs_proc_stop)
-                       zc->zc_next = UINT64_MAX;
-               else
-                       zc->zc_next = zs->zs_proc_start +
-                           ztest_random(2 * zi->zi_interval[0] + 1);
-       }
-
-       /*
-        * Run the tests in a loop.  These tests include fault injection
-        * to verify that self-healing data works, and forced crashes
-        * to verify that we never lose on-disk consistency.
-        */
-       while (gethrtime() < zs->zs_proc_stop) {
-               int status;
-               boolean_t killed;
-
-               /*
-                * Initialize the workload counters for each function.
-                */
-               for (f = 0; f < ZTEST_FUNCS; f++) {
-                       zc = ZTEST_GET_SHARED_CALLSTATE(f);
-                       zc->zc_count = 0;
-                       zc->zc_time = 0;
-               }
-
-               /* Set the allocation switch size */
-               zs->zs_metaslab_df_alloc_threshold =
-                   ztest_random(zs->zs_metaslab_sz / 4) + 1;
-
-               if (!hasalt || ztest_random(2) == 0) {
-                       if (hasalt && ztest_opts.zo_verbose >= 1) {
-                               (void) printf("Executing newer ztest: %s\n",
-                                   cmd);
-                       }
-                       newer++;
-                       killed = exec_child(cmd, NULL, B_TRUE, &status);
-               } else {
-                       if (hasalt && ztest_opts.zo_verbose >= 1) {
-                               (void) printf("Executing older ztest: %s\n",
-                                   ztest_opts.zo_alt_ztest);
-                       }
-                       older++;
-                       killed = exec_child(ztest_opts.zo_alt_ztest,
-                           ztest_opts.zo_alt_libpath, B_TRUE, &status);
-               }
-
-               if (killed)
-                       kills++;
-               iters++;
-
-               if (ztest_opts.zo_verbose >= 1) {
-                       hrtime_t now = gethrtime();
-
-                       now = MIN(now, zs->zs_proc_stop);
-                       print_time(zs->zs_proc_stop - now, timebuf);
-                       nicenum(zs->zs_space, numbuf);
-
-                       (void) printf("Pass %3d, %8s, %3llu ENOSPC, "
-                           "%4.1f%% of %5s used, %3.0f%% done, %8s to go\n",
-                           iters,
-                           WIFEXITED(status) ? "Complete" : "SIGKILL",
-                           (u_longlong_t)zs->zs_enospc_count,
-                           100.0 * zs->zs_alloc / zs->zs_space,
-                           numbuf,
-                           100.0 * (now - zs->zs_proc_start) /
-                           (ztest_opts.zo_time * NANOSEC), timebuf);
-               }
-
-               if (ztest_opts.zo_verbose >= 2) {
-                       (void) printf("\nWorkload summary:\n\n");
-                       (void) printf("%7s %9s   %s\n",
-                           "Calls", "Time", "Function");
-                       (void) printf("%7s %9s   %s\n",
-                           "-----", "----", "--------");
-                       for (f = 0; f < ZTEST_FUNCS; f++) {
-                               zi = &ztest_info[f];
-                               zc = ZTEST_GET_SHARED_CALLSTATE(f);
-                               print_time(zc->zc_time, timebuf);
-                               (void) printf("%7llu %9s   %s\n",
-                                   (u_longlong_t)zc->zc_count, timebuf,
-                                   zi->zi_funcname);
-                       }
-                       (void) printf("\n");
-               }
-
-               /*
-                * It's possible that we killed a child during a rename test,
-                * in which case we'll have a 'ztest_tmp' pool lying around
-                * instead of 'ztest'.  Do a blind rename in case this happened.
-                */
-               kernel_init(FREAD);
-               if (spa_open(ztest_opts.zo_pool, &spa, FTAG) == 0) {
-                       spa_close(spa, FTAG);
-               } else {
-                       char tmpname[MAXNAMELEN];
-                       kernel_fini();
-                       kernel_init(FREAD | FWRITE);
-                       (void) snprintf(tmpname, sizeof (tmpname), "%s_tmp",
-                           ztest_opts.zo_pool);
-                       (void) spa_rename(tmpname, ztest_opts.zo_pool);
-               }
-               kernel_fini();
-
-               ztest_run_zdb(ztest_opts.zo_pool);
-       }
-
-       if (ztest_opts.zo_verbose >= 1) {
-               if (hasalt) {
-                       (void) printf("%d runs of older ztest: %s\n", older,
-                           ztest_opts.zo_alt_ztest);
-                       (void) printf("%d runs of newer ztest: %s\n", newer,
-                           cmd);
-               }
-               (void) printf("%d killed, %d completed, %.0f%% kill rate\n",
-                   kills, iters - kills, (100.0 * kills) / MAX(1, iters));
-       }
-
-       umem_free(cmd, MAXNAMELEN);
-
-       return (0);
-}
diff --git a/zfs/cmd/zvol_id/.gitignore b/zfs/cmd/zvol_id/.gitignore
deleted file mode 100644 (file)
index 8b757a2..0000000
+++ /dev/null
@@ -1 +0,0 @@
-zvol_id
diff --git a/zfs/cmd/zvol_id/Makefile.am b/zfs/cmd/zvol_id/Makefile.am
deleted file mode 100644 (file)
index d131c63..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-# Disable GCC stack protection for zvol_id.  This is a kludge and should be
-# removed once https://github.com/zfsonlinux/zfs/issues/569 is resolved.
-AM_CFLAGS += -fno-stack-protector
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-udev_PROGRAMS = zvol_id
-
-zvol_id_SOURCES = \
-       zvol_id_main.c
diff --git a/zfs/cmd/zvol_id/Makefile.in b/zfs/cmd/zvol_id/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/cmd/zvol_id/zvol_id_main.c b/zfs/cmd/zvol_id/zvol_id_main.c
deleted file mode 100644 (file)
index 8f0504a..0000000
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2011, Fajar A. Nugraha.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <ctype.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <linux/ioctl.h>
-#include <sys/stat.h>
-#include <sys/ioctl.h>
-#include <sys/zfs_znode.h>
-#include <sys/fs/zfs.h>
-
-static int
-ioctl_get_msg(char *var, int fd)
-{
-       int error = 0;
-       char msg[ZFS_MAXNAMELEN];
-
-       error = ioctl(fd, BLKZNAME, msg);
-       if (error < 0) {
-               return (error);
-       }
-
-       snprintf(var, ZFS_MAXNAMELEN, "%s", msg);
-       return (error);
-}
-
-int
-main(int argc, char **argv)
-{
-       int fd, error = 0;
-       char zvol_name[ZFS_MAXNAMELEN], zvol_name_part[ZFS_MAXNAMELEN];
-       char *dev_name;
-       struct stat64 statbuf;
-       int dev_minor, dev_part;
-       int i;
-
-       if (argc < 2) {
-               printf("Usage: %s /dev/zvol_device_node\n", argv[0]);
-               return (EINVAL);
-       }
-
-       dev_name = argv[1];
-       error = stat64(dev_name, &statbuf);
-       if (error != 0) {
-               printf("Unable to access device file: %s\n", dev_name);
-               return (errno);
-       }
-
-       dev_minor = minor(statbuf.st_rdev);
-       dev_part = dev_minor % ZVOL_MINORS;
-
-       fd = open(dev_name, O_RDONLY);
-       if (fd < 0) {
-               printf("Unable to open device file: %s\n", dev_name);
-               return (errno);
-       }
-
-       error = ioctl_get_msg(zvol_name, fd);
-       if (error < 0) {
-               printf("ioctl_get_msg failed:%s\n", strerror(errno));
-               return (errno);
-       }
-       if (dev_part > 0)
-               snprintf(zvol_name_part, ZFS_MAXNAMELEN, "%s-part%d", zvol_name,
-                   dev_part);
-       else
-               snprintf(zvol_name_part, ZFS_MAXNAMELEN, "%s", zvol_name);
-
-       for (i = 0; i < strlen(zvol_name_part); i++) {
-               if (isblank(zvol_name_part[i]))
-                       zvol_name_part[i] = '+';
-       }
-
-       printf("%s\n", zvol_name_part);
-       close(fd);
-       return (error);
-}
diff --git a/zfs/config/.gitignore b/zfs/config/.gitignore
deleted file mode 100644 (file)
index cd811a0..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-/compile
-/config.guess
-/config.sub
-/depcomp
-/install-sh
-/ltmain.sh
-/missing
-/libtool.m4
-/lt*.m4
diff --git a/zfs/config/compile b/zfs/config/compile
new file mode 100755 (executable)
index 0000000..a85b723
--- /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-2014 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:
diff --git a/zfs/config/config.guess b/zfs/config/config.guess
new file mode 100755 (executable)
index 0000000..1659250
--- /dev/null
@@ -0,0 +1,1441 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
+
+timestamp='2015-08-20'
+
+# 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.
+#
+# 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 Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
+#
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
+#
+# You can get the latest version of this script from:
+# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+#
+# Please send patches to <config-patches@gnu.org>.
+
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.guess ($timestamp)
+
+Originally written by Per Bothner.
+Copyright 1992-2015 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
+# compiler to aid in system detection is discouraged as it requires
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+set_cc_for_build='
+trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
+trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
+: ${TMPDIR=/tmp} ;
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+       for c in cc gcc c89 c99 ; do
+         if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+            CC_FOR_BUILD="$c"; break ;
+         fi ;
+       done ;
+       if test x"$CC_FOR_BUILD" = x ; then
+         CC_FOR_BUILD=no_compiler_found ;
+       fi
+       ;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+       PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+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 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
+       # compatibility and a consistent mechanism for selecting the
+       # object file format.
+       #
+       # Note: NetBSD doesn't particularly care about the vendor
+       # portion of the name.  We always set it to "unknown".
+       sysctl="sysctl -n hw.machine_arch"
+       UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+           /sbin/$sysctl 2>/dev/null || \
+           /usr/sbin/$sysctl 2>/dev/null || \
+           echo unknown)`
+       case "${UNAME_MACHINE_ARCH}" in
+           armeb) machine=armeb-unknown ;;
+           arm*) machine=arm-unknown ;;
+           sh3el) machine=shl-unknown ;;
+           sh3eb) machine=sh-unknown ;;
+           sh5el) machine=sh5le-unknown ;;
+           earmv*)
+               arch=`echo ${UNAME_MACHINE_ARCH} | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+               endian=`echo ${UNAME_MACHINE_ARCH} | sed -ne 's,^.*\(eb\)$,\1,p'`
+               machine=${arch}${endian}-unknown
+               ;;
+           *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+       esac
+       # The Operating System including object format, if it has switched
+       # to ELF recently, or will in the future.
+       case "${UNAME_MACHINE_ARCH}" in
+           arm*|earm*|i386|m68k|ns32k|sh3*|sparc|vax)
+               eval $set_cc_for_build
+               if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
+                       | grep -q __ELF__
+               then
+                   # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+                   # Return netbsd for either.  FIX?
+                   os=netbsd
+               else
+                   os=netbsdelf
+               fi
+               ;;
+           *)
+               os=netbsd
+               ;;
+       esac
+       # Determine ABI tags.
+       case "${UNAME_MACHINE_ARCH}" in
+           earm*)
+               expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+               abi=`echo ${UNAME_MACHINE_ARCH} | sed -e "$expr"`
+               ;;
+       esac
+       # The OS release
+       # Debian GNU/NetBSD machines have a different userland, and
+       # thus, need a distinct triplet. However, they do not need
+       # kernel version information, so it can be replaced with a
+       # suitable tag, in the style of linux-gnu.
+       case "${UNAME_VERSION}" in
+           Debian*)
+               release='-gnu'
+               ;;
+           *)
+               release=`echo ${UNAME_RELEASE} | sed -e 's/[-_].*//' | cut -d. -f1,2`
+               ;;
+       esac
+       # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+       # contains redundant information, the shorter form:
+       # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+       echo "${machine}-${os}${release}${abi}"
+       exit ;;
+    *:Bitrig:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE}
+       exit ;;
+    *:OpenBSD:*:*)
+       UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+       echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+       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 ;;
+    *:Sortix:*:*)
+       echo ${UNAME_MACHINE}-unknown-sortix
+       exit ;;
+    alpha:OSF1:*:*)
+       case $UNAME_RELEASE in
+       *4.0)
+               UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+               ;;
+       *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
+       # types through head -n 1, so we only detect the type of CPU 0.
+       ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+       case "$ALPHA_CPU_TYPE" in
+           "EV4 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "EV4.5 (21064)")
+               UNAME_MACHINE="alpha" ;;
+           "LCA4 (21066/21068)")
+               UNAME_MACHINE="alpha" ;;
+           "EV5 (21164)")
+               UNAME_MACHINE="alphaev5" ;;
+           "EV5.6 (21164A)")
+               UNAME_MACHINE="alphaev56" ;;
+           "EV5.6 (21164PC)")
+               UNAME_MACHINE="alphapca56" ;;
+           "EV5.7 (21164PC)")
+               UNAME_MACHINE="alphapca57" ;;
+           "EV6 (21264)")
+               UNAME_MACHINE="alphaev6" ;;
+           "EV6.7 (21264A)")
+               UNAME_MACHINE="alphaev67" ;;
+           "EV6.8CB (21264C)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8AL (21264B)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.8CX (21264D)")
+               UNAME_MACHINE="alphaev68" ;;
+           "EV6.9A (21264/EV69A)")
+               UNAME_MACHINE="alphaev69" ;;
+           "EV7 (21364)")
+               UNAME_MACHINE="alphaev7" ;;
+           "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/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+       # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+       exitcode=$?
+       trap '' 0
+       exit $exitcode ;;
+    Alpha\ *:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # Should we change UNAME_MACHINE based on the output of uname instead
+       # of the specific Alpha model?
+       echo alpha-pc-interix
+       exit ;;
+    21064:Windows_NT:50:3)
+       echo alpha-dec-winnt3.5
+       exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+       echo m68k-unknown-sysv4
+       exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-amigaos
+       exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+       echo ${UNAME_MACHINE}-unknown-morphos
+       exit ;;
+    *:OS/390:*:*)
+       echo i370-ibm-openedition
+       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 ;;
+    arm*:riscos:*:*|arm*:RISCOS:*:*)
+       echo arm-unknown-riscos
+       exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+       echo hppa1.1-hitachi-hiuxmpp
+       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
+               echo pyramid-pyramid-sysv3
+       else
+               echo pyramid-pyramid-bsd
+       fi
+       exit ;;
+    NILE*:*:*:dcosx)
+       echo pyramid-pyramid-svr4
+       exit ;;
+    DRS?6000:unix:4.0:6*)
+       echo sparc-icl-nx6
+       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 ;;
+       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 ;;
+    sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
+       echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       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 ;;
+    sun4*:SunOS:*:*)
+       case "`/usr/bin/arch -k`" in
+           Series*|S4*)
+               UNAME_RELEASE=`uname -v`
+               ;;
+       esac
+       # Japanese Language versions have a version number like `4.1.3-JL'.
+       echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+       exit ;;
+    sun3*:SunOS:*:*)
+       echo m68k-sun-sunos${UNAME_RELEASE}
+       exit ;;
+    sun*:*:4.2BSD:*)
+       UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+       test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+       case "`/bin/arch`" in
+           sun3)
+               echo m68k-sun-sunos${UNAME_RELEASE}
+               ;;
+           sun4)
+               echo sparc-sun-sunos${UNAME_RELEASE}
+               ;;
+       esac
+       exit ;;
+    aushp:SunOS:*:*)
+       echo sparc-auspex-sunos${UNAME_RELEASE}
+       exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # 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 ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+       echo m68k-atari-mint${UNAME_RELEASE}
+       exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+       echo m68k-milan-mint${UNAME_RELEASE}
+       exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+       echo m68k-hades-mint${UNAME_RELEASE}
+       exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+       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 ;;
+    RISC*:Mach:*:*)
+       echo mips-dec-mach_bsd4.3
+       exit ;;
+    RISC*:ULTRIX:*:*)
+       echo mips-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    VAX*:ULTRIX*:*:*)
+       echo vax-dec-ultrix${UNAME_RELEASE}
+       exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+       echo clipper-intergraph-clix${UNAME_RELEASE}
+       exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+       int main (int argc, char *argv[]) {
+#else
+       int main (argc, argv) int argc; char *argv[]; {
+#endif
+       #if defined (host_mips) && defined (MIPSEB)
+       #if defined (SYSTYPE_SYSV)
+         printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_SVR4)
+         printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+       #endif
+       #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+         printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+       #endif
+       #endif
+         exit (-1);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c &&
+         dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+         SYSTEM_NAME=`$dummy $dummyarg` &&
+           { echo "$SYSTEM_NAME"; exit; }
+       echo mips-mips-riscos${UNAME_RELEASE}
+       exit ;;
+    Motorola:PowerMAX_OS:*:*)
+       echo powerpc-motorola-powermax
+       exit ;;
+    Motorola:*:4.3:PL8-*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+       echo powerpc-harris-powermax
+       exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+       echo powerpc-harris-powerunix
+       exit ;;
+    m88k:CX/UX:7*:*)
+       echo m88k-harris-cxux7
+       exit ;;
+    m88k:*:4*:R4*)
+       echo m88k-motorola-sysv4
+       exit ;;
+    m88k:*:3*:R3*)
+       echo m88k-motorola-sysv3
+       exit ;;
+    AViiON:dgux:*:*)
+       # 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 ] || \
+              [ ${TARGET_BINARY_INTERFACE}x = x ]
+           then
+               echo m88k-dg-dgux${UNAME_RELEASE}
+           else
+               echo m88k-dg-dguxbcs${UNAME_RELEASE}
+           fi
+       else
+           echo i586-dg-dgux${UNAME_RELEASE}
+       fi
+       exit ;;
+    M88*:DolphinOS:*:*)        # DolphinOS (SVR3)
+       echo m88k-dolphin-sysv3
+       exit ;;
+    M88*:*:R3*:*)
+       # Delta 88k system running SVR3
+       echo m88k-motorola-sysv3
+       exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+       echo m88k-tektronix-sysv3
+       exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+       echo m68k-tektronix-bsd
+       exit ;;
+    *:IRIX*:*:*)
+       echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+       exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+       echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+       exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+       echo i386-ibm-aix
+       exit ;;
+    ia64:AIX:*:*)
+       if [ -x /usr/bin/oslevel ] ; then
+               IBM_REV=`/usr/bin/oslevel`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:2:3)
+       if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+               eval $set_cc_for_build
+               sed 's/^                //' << EOF >$dummy.c
+               #include <sys/systemcfg.h>
+
+               main()
+                       {
+                       if (!__power_pc())
+                               exit(1);
+                       puts("powerpc-ibm-aix3.2.5");
+                       exit(0);
+                       }
+EOF
+               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:*:[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
+       else
+               IBM_ARCH=powerpc
+       fi
+       if [ -x /usr/bin/lslpp ] ; then
+               IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc |
+                          awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
+       else
+               IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+       fi
+       echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+       exit ;;
+    *:AIX:*:*)
+       echo rs6000-ibm-aix
+       exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+       echo romp-ibm-bsd4.4
+       exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+       echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+       exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+       echo rs6000-bull-bosx
+       exit ;;
+    DPX/2?00:B.O.S.:*:*)
+       echo m68k-bull-sysv3
+       exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+       echo m68k-hp-bsd
+       exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+       echo m68k-hp-bsd4.4
+       exit ;;
+    9000/[34678]??:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       case "${UNAME_MACHINE}" in
+           9000/31? )            HP_ARCH=m68000 ;;
+           9000/[34]?? )         HP_ARCH=m68k ;;
+           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" ;;
+                         '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                       esac ;;
+                   esac
+               fi
+               if [ "${HP_ARCH}" = "" ]; then
+                   eval $set_cc_for_build
+                   sed 's/^            //' << EOF >$dummy.c
+
+               #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);
+
+                   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
+               fi ;;
+       esac
+       if [ ${HP_ARCH} = "hppa2.0w" ]
+       then
+           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
+               HP_ARCH="hppa64"
+           fi
+       fi
+       echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+       exit ;;
+    ia64:HP-UX:*:*)
+       HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+       echo ia64-hp-hpux${HPUX_REV}
+       exit ;;
+    3050*:HI-UX:*:*)
+       eval $set_cc_for_build
+       sed 's/^        //' << EOF >$dummy.c
+       #include <unistd.h>
+       int
+       main ()
+       {
+         long cpu = sysconf (_SC_CPU_VERSION);
+         /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+            true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+            results, however.  */
+         if (CPU_IS_PA_RISC (cpu))
+           {
+             switch (cpu)
+               {
+                 case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+                 case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+                 default: puts ("hppa-hitachi-hiuxwe2"); break;
+               }
+           }
+         else if (CPU_IS_HP_MC68K (cpu))
+           puts ("m68k-hitachi-hiuxwe2");
+         else puts ("unknown-hitachi-hiuxwe2");
+         exit (0);
+       }
+EOF
+       $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+               { echo "$SYSTEM_NAME"; exit; }
+       echo unknown-hitachi-hiuxwe2
+       exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+       echo hppa1.1-hp-bsd
+       exit ;;
+    9000/8??:4.3bsd:*:*)
+       echo hppa1.0-hp-bsd
+       exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+       echo hppa1.0-hp-mpeix
+       exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+       echo hppa1.1-hp-osf
+       exit ;;
+    hp8??:OSF1:*:*)
+       echo hppa1.0-hp-osf
+       exit ;;
+    i*86:OSF1:*:*)
+       if [ -x /usr/sbin/sysversion ] ; then
+           echo ${UNAME_MACHINE}-unknown-osf1mk
+       else
+           echo ${UNAME_MACHINE}-unknown-osf1
+       fi
+       exit ;;
+    parisc*:Lites*:*:*)
+       echo hppa1.1-hp-lites
+       exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+       echo c1-convex-bsd
+       exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+       if getsysinfo -f scalar_acc
+       then echo c32-convex-bsd
+       else echo c2-convex-bsd
+       fi
+       exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+       echo c34-convex-bsd
+       exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+       echo c38-convex-bsd
+       exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+       echo c4-convex-bsd
+       exit ;;
+    CRAY*Y-MP:*:*:*)
+       echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       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 ;;
+    CRAY*TS:*:*:*)
+       echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*T3E:*:*:*)
+       echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    CRAY*SV1:*:*:*)
+       echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+       exit ;;
+    *:UNICOS/mp:*:*)
+       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 ;;
+    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 ;;
+    sparc*:BSD/OS:*:*)
+       echo sparc-unknown-bsdi${UNAME_RELEASE}
+       exit ;;
+    *:BSD/OS:*:*)
+       echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+       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 ;;
+    *:MINGW64*:*)
+       echo ${UNAME_MACHINE}-pc-mingw64
+       exit ;;
+    *:MINGW*:*)
+       echo ${UNAME_MACHINE}-pc-mingw32
+       exit ;;
+    *:MSYS*:*)
+       echo ${UNAME_MACHINE}-pc-msys
+       exit ;;
+    i*:windows32*:*)
+       # uname -m includes "-pc" on this system.
+       echo ${UNAME_MACHINE}-mingw32
+       exit ;;
+    i*:PW*:*)
+       echo ${UNAME_MACHINE}-pc-pw32
+       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 ;;
+    8664:Windows_NT:*)
+       echo x86_64-pc-mks
+       exit ;;
+    i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
+       # How do we know it's Interix rather than the generic POSIX subsystem?
+       # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
+       # UNAME_MACHINE based on the output of uname instead of i386?
+       echo i586-pc-interix
+       exit ;;
+    i*:UWIN*:*)
+       echo ${UNAME_MACHINE}-pc-uwin
+       exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+       echo x86_64-unknown-cygwin
+       exit ;;
+    p*:CYGWIN*:*)
+       echo powerpcle-unknown-cygwin
+       exit ;;
+    prep*:SunOS:5.*:*)
+       echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+       exit ;;
+    *:GNU:*:*)
+       # the GNU system
+       echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+       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 ;;
+    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:*:*)
+       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 ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    crisv32:Linux:*:*)
+       echo ${UNAME_MACHINE}-axis-linux-${LIBC}
+       exit ;;
+    e2k:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-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-${LIBC}
+       exit ;;
+    m32r*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    m68*: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 ${UNAME_MACHINE}
+       #undef ${UNAME_MACHINE}el
+       #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+       CPU=${UNAME_MACHINE}el
+       #else
+       #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+       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-${LIBC}"; exit; }
+       ;;
+    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-${LIBC} ;;
+         PA8*) echo hppa2.0-unknown-linux-${LIBC} ;;
+         *)    echo hppa-unknown-linux-${LIBC} ;;
+       esac
+       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-${LIBC}
+       exit ;;
+    sh64*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sh*:Linux:*:*)
+       echo ${UNAME_MACHINE}-unknown-linux-${LIBC}
+       exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+       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 ${UNAME_MACHINE}-pc-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 ;;
+    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,
+       # I just have to hope.  -- rms.
+       # Use sysv4.2uw... so that sysv4* matches it.
+       echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+       exit ;;
+    i*86:OS/2:*:*)
+       # If we were able to find `uname', then EMX Unix compatibility
+       # is probably installed.
+       echo ${UNAME_MACHINE}-pc-os2-emx
+       exit ;;
+    i*86:XTS-300:*:STOP)
+       echo ${UNAME_MACHINE}-unknown-stop
+       exit ;;
+    i*86:atheos:*:*)
+       echo ${UNAME_MACHINE}-unknown-atheos
+       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 ;;
+    i*86:*DOS:*:*)
+       echo ${UNAME_MACHINE}-pc-msdosdjgpp
+       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
+               echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+       else
+               echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+       fi
+       exit ;;
+    i*86:*:5:[678]*)
+       # UnixWare 7.x, OpenUNIX and OpenServer 6.
+       case `/bin/uname -X | grep "^Machine"` in
+           *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 ;;
+    i*86:*:3.2:*)
+       if test -f /usr/options/cb.name; then
+               UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+               echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+       elif /bin/uname -X 2>/dev/null >/dev/null ; then
+               UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+               (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+               (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+                       && UNAME_MACHINE=i586
+               (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+                       && UNAME_MACHINE=i686
+               echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+       else
+               echo ${UNAME_MACHINE}-pc-sysv32
+       fi
+       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 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 ;;
+    paragon:*:*:*)
+       echo i860-intel-osf1
+       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 ;;
+    mini*:CTIX:SYS*5:*)
+       # "miniframe"
+       echo m68010-convergent-sysv
+       exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+       echo m68k-convergent-sysv
+       exit ;;
+    M680?0:D-NIX:5.3:*)
+       echo m68k-diab-dnix
+       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; }
+       /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
+         && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+       /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+         && { echo i486-ncr-sysv4; exit; } ;;
+    NCR*:*:4.2:* | MPRAS*:*:4.2:*)
+       OS_REL='.3'
+       test -r /etc/.relid \
+           && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
+       /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 ;;
+    mc68030:UNIX_System_V:4.*:*)
+       echo m68k-atari-sysv4
+       exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+       echo sparc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    rs6000:LynxOS:2.*:*)
+       echo rs6000-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
+       echo powerpc-unknown-lynxos${UNAME_RELEASE}
+       exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+       echo mips-dde-sysv${UNAME_RELEASE}
+       exit ;;
+    RM*:ReliantUNIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    RM*:SINIX-*:*:*)
+       echo mips-sni-sysv4
+       exit ;;
+    *:SINIX-*:*:*)
+       if uname -p 2>/dev/null >/dev/null ; then
+               UNAME_MACHINE=`(uname -p) 2>/dev/null`
+               echo ${UNAME_MACHINE}-sni-sysv4
+       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 ;;
+    *:UNIX_System_V:4*:FTX*)
+       # From Gerald Hewes <hewes@openmarket.com>.
+       # How about differentiating between stratus architectures? -djm
+       echo hppa1.1-stratus-sysv4
+       exit ;;
+    *:*:*:FTX*)
+       # From seanf@swdc.stratus.com.
+       echo i860-stratus-sysv4
+       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 ;;
+    mc68*:A/UX:*:*)
+       echo m68k-apple-aux${UNAME_RELEASE}
+       exit ;;
+    news*:NEWS-OS:6*:*)
+       echo mips-sony-newsos6
+       exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+       if [ -d /usr/nec ]; then
+               echo mips-nec-sysv${UNAME_RELEASE}
+       else
+               echo mips-unknown-sysv${UNAME_RELEASE}
+       fi
+       exit ;;
+    BeBox:BeOS:*:*)    # BeOS running on hardware made by Be, PPC only.
+       echo powerpc-be-beos
+       exit ;;
+    BeMac:BeOS:*:*)    # BeOS running on Mac or Mac clone, PPC only.
+       echo powerpc-apple-beos
+       exit ;;
+    BePC:BeOS:*:*)     # BeOS running on Intel PC compatible.
+       echo i586-pc-beos
+       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 ;;
+    SX-5:SUPER-UX:*:*)
+       echo sx5-nec-superux${UNAME_RELEASE}
+       exit ;;
+    SX-6:SUPER-UX:*:*)
+       echo sx6-nec-superux${UNAME_RELEASE}
+       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 ;;
+    *:Rhapsody:*:*)
+       echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+       exit ;;
+    *:Darwin:*:*)
+       UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+       eval $set_cc_for_build
+       if test "$UNAME_PROCESSOR" = unknown ; then
+           UNAME_PROCESSOR=powerpc
+       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 ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+       UNAME_PROCESSOR=`uname -p`
+       if test "$UNAME_PROCESSOR" = "x86"; then
+               UNAME_PROCESSOR=i386
+               UNAME_MACHINE=pc
+       fi
+       echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+       exit ;;
+    *:QNX:*:4*)
+       echo i386-pc-qnx
+       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 ;;
+    *:NonStop-UX:*:*)
+       echo mips-compaq-nonstopux
+       exit ;;
+    BS2000:POSIX*:*:*)
+       echo bs2000-siemens-sysv
+       exit ;;
+    DS/*:UNIX_System_V:*:*)
+       echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+       exit ;;
+    *:Plan9:*:*)
+       # "uname -m" is not consistent, so use $cputype instead. 386
+       # is converted to i386 for consistency with other x86
+       # operating systems.
+       if test "$cputype" = "386"; then
+           UNAME_MACHINE=i386
+       else
+           UNAME_MACHINE="$cputype"
+       fi
+       echo ${UNAME_MACHINE}-unknown-plan9
+       exit ;;
+    *:TOPS-10:*:*)
+       echo pdp10-unknown-tops10
+       exit ;;
+    *:TENEX:*:*)
+       echo pdp10-unknown-tenex
+       exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+       echo pdp10-dec-tops20
+       exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+       echo pdp10-xkl-tops20
+       exit ;;
+    *:TOPS-20:*:*)
+       echo pdp10-unknown-tops20
+       exit ;;
+    *:ITS:*:*)
+       echo pdp10-unknown-its
+       exit ;;
+    SEI:*:*:SEIUX)
+       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
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+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
+
+  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
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/zfs/config/config.sub b/zfs/config/config.sub
new file mode 100755 (executable)
index 0000000..1acc966
--- /dev/null
@@ -0,0 +1,1813 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright 1992-2015 Free Software Foundation, Inc.
+
+timestamp='2015-08-20'
+
+# 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.
+#
+# 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 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>.
+#
+# 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.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#      CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#      CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright 1992-2015 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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )        # Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# Here we must recognize all the valid KERNEL-OS combinations.
+maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
+case $maybe_os in
+  nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
+  linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
+  knetbsd*-gnu* | netbsd*-gnu* | netbsd*-eabi* | \
+  kopensolaris*-gnu* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  android-linux)
+    os=-linux-android
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+       -sun*os*)
+               # Prevent following clause from handling this invalid input.
+               ;;
+       -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+       -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+       -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+       -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+       -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+       -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
+       -apple | -axis | -knuth | -cray | -microblaze*)
+               os=
+               basic_machine=$1
+               ;;
+       -bluegene*)
+               os=-cnk
+               ;;
+       -sim | -cisco | -oki | -wec | -winbond)
+               os=
+               basic_machine=$1
+               ;;
+       -scout)
+               ;;
+       -wrs)
+               os=-vxworks
+               basic_machine=$1
+               ;;
+       -chorusos*)
+               os=-chorusos
+               basic_machine=$1
+               ;;
+       -chorusrdb)
+               os=-chorusrdb
+               basic_machine=$1
+               ;;
+       -hiux*)
+               os=-hiuxwe2
+               ;;
+       -sco6)
+               os=-sco5v6
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5)
+               os=-sco3.2v5
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco4)
+               os=-sco3.2v4
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2.[4-9]*)
+               os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco3.2v[4-9]*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco5v6*)
+               # Don't forget version if it is 3.2v4 or newer.
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -sco*)
+               os=-sco3.2v2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -udk*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -isc)
+               os=-isc2.2
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -clix*)
+               basic_machine=clipper-intergraph
+               ;;
+       -isc*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+               ;;
+       -lynx*178)
+               os=-lynxos178
+               ;;
+       -lynx*5)
+               os=-lynxos5
+               ;;
+       -lynx*)
+               os=-lynxos
+               ;;
+       -ptx*)
+               basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+               ;;
+       -windowsnt*)
+               os=`echo $os | sed -e 's/windowsnt/winnt/'`
+               ;;
+       -psos*)
+               os=-psos
+               ;;
+       -mint | -mint[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+       # Recognize the basic CPU types without company name.
+       # Some are omitted here because they have special meanings below.
+       1750a | 580 \
+       | a29k \
+       | aarch64 | aarch64_be \
+       | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+       | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+       | am33_2.0 \
+       | arc | arceb \
+       | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \
+       | avr | avr32 \
+       | ba \
+       | be32 | be64 \
+       | bfin \
+       | c4x | c8051 | clipper \
+       | d10v | d30v | dlx | dsp16xx \
+       | e2k | epiphany \
+       | fido | fr30 | frv | ft32 \
+       | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+       | hexagon \
+       | i370 | i860 | i960 | ia64 \
+       | ip2k | iq2000 \
+       | k1om \
+       | le32 | le64 \
+       | lm32 \
+       | m32c | m32r | m32rle | m68000 | m68k | m88k \
+       | maxq | mb | microblaze | microblazeel | mcore | mep | metag \
+       | mips | mipsbe | mipseb | mipsel | mipsle \
+       | mips16 \
+       | mips64 | mips64el \
+       | mips64octeon | mips64octeonel \
+       | mips64orion | mips64orionel \
+       | mips64r5900 | mips64r5900el \
+       | mips64vr | mips64vrel \
+       | mips64vr4100 | mips64vr4100el \
+       | mips64vr4300 | mips64vr4300el \
+       | mips64vr5000 | mips64vr5000el \
+       | mips64vr5900 | mips64vr5900el \
+       | mipsisa32 | mipsisa32el \
+       | mipsisa32r2 | mipsisa32r2el \
+       | mipsisa32r6 | mipsisa32r6el \
+       | mipsisa64 | mipsisa64el \
+       | mipsisa64r2 | mipsisa64r2el \
+       | mipsisa64r6 | mipsisa64r6el \
+       | mipsisa64sb1 | mipsisa64sb1el \
+       | mipsisa64sr71k | mipsisa64sr71kel \
+       | mipsr5900 | mipsr5900el \
+       | mipstx39 | mipstx39el \
+       | mn10200 | mn10300 \
+       | moxie \
+       | mt \
+       | msp430 \
+       | nds32 | nds32le | nds32be \
+       | nios | nios2 | nios2eb | nios2el \
+       | ns16k | ns32k \
+       | open8 | or1k | or1knd | or32 \
+       | pdp10 | pdp11 | pj | pjl \
+       | powerpc | powerpc64 | powerpc64le | powerpcle \
+       | pyramid \
+       | riscv32 | riscv64 \
+       | rl78 | rx \
+       | score \
+       | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[234]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
+       | sh64 | sh64le \
+       | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
+       | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
+       | spu \
+       | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
+       | ubicom32 \
+       | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
+       | visium \
+       | we32k \
+       | x86 | xc16x | xstormy16 | xtensa \
+       | z8k | z80)
+               basic_machine=$basic_machine-unknown
+               ;;
+       c54x)
+               basic_machine=tic54x-unknown
+               ;;
+       c55x)
+               basic_machine=tic55x-unknown
+               ;;
+       c6x)
+               basic_machine=tic6x-unknown
+               ;;
+       leon|leon[3-9])
+               basic_machine=sparc-$basic_machine
+               ;;
+       m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip)
+               basic_machine=$basic_machine-unknown
+               os=-none
+               ;;
+       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
+       # (2) the word "unknown" tends to confuse beginning users.
+       i*86 | x86_64)
+         basic_machine=$basic_machine-pc
+         ;;
+       # Object if more than one company name word.
+       *-*-*)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+       # Recognize the basic CPU types with company name.
+       580-* \
+       | a29k-* \
+       | aarch64-* | aarch64_be-* \
+       | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+       | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+       | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \
+       | arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+       | avr-* | avr32-* \
+       | ba-* \
+       | be32-* | be64-* \
+       | bfin-* | bs2000-* \
+       | c[123]* | c30-* | [cjt]90-* | c4x-* \
+       | c8051-* | clipper-* | craynv-* | cydra-* \
+       | d10v-* | d30v-* | dlx-* \
+       | e2k-* | elxsi-* \
+       | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
+       | h8300-* | h8500-* \
+       | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+       | hexagon-* \
+       | i*86-* | i860-* | i960-* | ia64-* \
+       | ip2k-* | iq2000-* \
+       | k1om-* \
+       | le32-* | le64-* \
+       | lm32-* \
+       | m32c-* | m32r-* | m32rle-* \
+       | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+       | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \
+       | microblaze-* | microblazeel-* \
+       | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+       | mips16-* \
+       | mips64-* | mips64el-* \
+       | mips64octeon-* | mips64octeonel-* \
+       | mips64orion-* | mips64orionel-* \
+       | mips64r5900-* | mips64r5900el-* \
+       | mips64vr-* | mips64vrel-* \
+       | mips64vr4100-* | mips64vr4100el-* \
+       | mips64vr4300-* | mips64vr4300el-* \
+       | mips64vr5000-* | mips64vr5000el-* \
+       | mips64vr5900-* | mips64vr5900el-* \
+       | mipsisa32-* | mipsisa32el-* \
+       | mipsisa32r2-* | mipsisa32r2el-* \
+       | mipsisa32r6-* | mipsisa32r6el-* \
+       | mipsisa64-* | mipsisa64el-* \
+       | mipsisa64r2-* | mipsisa64r2el-* \
+       | mipsisa64r6-* | mipsisa64r6el-* \
+       | mipsisa64sb1-* | mipsisa64sb1el-* \
+       | mipsisa64sr71k-* | mipsisa64sr71kel-* \
+       | mipsr5900-* | mipsr5900el-* \
+       | mipstx39-* | mipstx39el-* \
+       | mmix-* \
+       | mt-* \
+       | msp430-* \
+       | nds32-* | nds32le-* | nds32be-* \
+       | nios-* | nios2-* | nios2eb-* | nios2el-* \
+       | none-* | np1-* | ns16k-* | ns32k-* \
+       | open8-* \
+       | or1k*-* \
+       | orion-* \
+       | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
+       | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
+       | pyramid-* \
+       | riscv32-* | riscv64-* \
+       | rl78-* | romp-* | rs6000-* | rx-* \
+       | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
+       | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
+       | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
+       | sparclite-* \
+       | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx*-* \
+       | tahoe-* \
+       | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
+       | tile*-* \
+       | tron-* \
+       | ubicom32-* \
+       | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
+       | vax-* \
+       | visium-* \
+       | we32k-* \
+       | x86-* | x86_64-* | xc16x-* | xps100-* \
+       | xstormy16-* | xtensa*-* \
+       | ymp-* \
+       | z8k-* | z80-*)
+               ;;
+       # Recognize the basic CPU types without company name, with glob match.
+       xtensa*)
+               basic_machine=$basic_machine-unknown
+               ;;
+       # Recognize the various machine names and aliases which stand
+       # for a CPU type and a company and sometimes even an OS.
+       386bsd)
+               basic_machine=i386-unknown
+               os=-bsd
+               ;;
+       3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+               basic_machine=m68000-att
+               ;;
+       3b*)
+               basic_machine=we32k-att
+               ;;
+       a29khif)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       abacus)
+               basic_machine=abacus-unknown
+               ;;
+       adobe68k)
+               basic_machine=m68010-adobe
+               os=-scout
+               ;;
+       alliant | fx80)
+               basic_machine=fx80-alliant
+               ;;
+       altos | altos3068)
+               basic_machine=m68k-altos
+               ;;
+       am29k)
+               basic_machine=a29k-none
+               os=-bsd
+               ;;
+       amd64)
+               basic_machine=x86_64-pc
+               ;;
+       amd64-*)
+               basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       amdahl)
+               basic_machine=580-amdahl
+               os=-sysv
+               ;;
+       amiga | amiga-*)
+               basic_machine=m68k-unknown
+               ;;
+       amigaos | amigados)
+               basic_machine=m68k-unknown
+               os=-amigaos
+               ;;
+       amigaunix | amix)
+               basic_machine=m68k-unknown
+               os=-sysv4
+               ;;
+       apollo68)
+               basic_machine=m68k-apollo
+               os=-sysv
+               ;;
+       apollo68bsd)
+               basic_machine=m68k-apollo
+               os=-bsd
+               ;;
+       aros)
+               basic_machine=i386-pc
+               os=-aros
+               ;;
+        asmjs)
+               basic_machine=asmjs-unknown
+               ;;
+       aux)
+               basic_machine=m68k-apple
+               os=-aux
+               ;;
+       balance)
+               basic_machine=ns32k-sequent
+               os=-dynix
+               ;;
+       blackfin)
+               basic_machine=bfin-unknown
+               os=-linux
+               ;;
+       blackfin-*)
+               basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       bluegene*)
+               basic_machine=powerpc-ibm
+               os=-cnk
+               ;;
+       c54x-*)
+               basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c55x-*)
+               basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c6x-*)
+               basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       c90)
+               basic_machine=c90-cray
+               os=-unicos
+               ;;
+       cegcc)
+               basic_machine=arm-unknown
+               os=-cegcc
+               ;;
+       convex-c1)
+               basic_machine=c1-convex
+               os=-bsd
+               ;;
+       convex-c2)
+               basic_machine=c2-convex
+               os=-bsd
+               ;;
+       convex-c32)
+               basic_machine=c32-convex
+               os=-bsd
+               ;;
+       convex-c34)
+               basic_machine=c34-convex
+               os=-bsd
+               ;;
+       convex-c38)
+               basic_machine=c38-convex
+               os=-bsd
+               ;;
+       cray | j90)
+               basic_machine=j90-cray
+               os=-unicos
+               ;;
+       craynv)
+               basic_machine=craynv-cray
+               os=-unicosmp
+               ;;
+       cr16 | cr16-*)
+               basic_machine=cr16-unknown
+               os=-elf
+               ;;
+       crds | unos)
+               basic_machine=m68k-crds
+               ;;
+       crisv32 | crisv32-* | etraxfs*)
+               basic_machine=crisv32-axis
+               ;;
+       cris | cris-* | etrax*)
+               basic_machine=cris-axis
+               ;;
+       crx)
+               basic_machine=crx-unknown
+               os=-elf
+               ;;
+       da30 | da30-*)
+               basic_machine=m68k-da30
+               ;;
+       decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+               basic_machine=mips-dec
+               ;;
+       decsystem10* | dec10*)
+               basic_machine=pdp10-dec
+               os=-tops10
+               ;;
+       decsystem20* | dec20*)
+               basic_machine=pdp10-dec
+               os=-tops20
+               ;;
+       delta | 3300 | motorola-3300 | motorola-delta \
+             | 3300-motorola | delta-motorola)
+               basic_machine=m68k-motorola
+               ;;
+       delta88)
+               basic_machine=m88k-motorola
+               os=-sysv3
+               ;;
+       dicos)
+               basic_machine=i686-pc
+               os=-dicos
+               ;;
+       djgpp)
+               basic_machine=i586-pc
+               os=-msdosdjgpp
+               ;;
+       dpx20 | dpx20-*)
+               basic_machine=rs6000-bull
+               os=-bosx
+               ;;
+       dpx2* | dpx2*-bull)
+               basic_machine=m68k-bull
+               os=-sysv3
+               ;;
+       ebmon29k)
+               basic_machine=a29k-amd
+               os=-ebmon
+               ;;
+       elxsi)
+               basic_machine=elxsi-elxsi
+               os=-bsd
+               ;;
+       encore | umax | mmax)
+               basic_machine=ns32k-encore
+               ;;
+       es1800 | OSE68k | ose68k | ose | OSE)
+               basic_machine=m68k-ericsson
+               os=-ose
+               ;;
+       fx2800)
+               basic_machine=i860-alliant
+               ;;
+       genix)
+               basic_machine=ns32k-ns
+               ;;
+       gmicro)
+               basic_machine=tron-gmicro
+               os=-sysv
+               ;;
+       go32)
+               basic_machine=i386-pc
+               os=-go32
+               ;;
+       h3050r* | hiux*)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       h8300hms)
+               basic_machine=h8300-hitachi
+               os=-hms
+               ;;
+       h8300xray)
+               basic_machine=h8300-hitachi
+               os=-xray
+               ;;
+       h8500hms)
+               basic_machine=h8500-hitachi
+               os=-hms
+               ;;
+       harris)
+               basic_machine=m88k-harris
+               os=-sysv3
+               ;;
+       hp300-*)
+               basic_machine=m68k-hp
+               ;;
+       hp300bsd)
+               basic_machine=m68k-hp
+               os=-bsd
+               ;;
+       hp300hpux)
+               basic_machine=m68k-hp
+               os=-hpux
+               ;;
+       hp3k9[0-9][0-9] | hp9[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k2[0-9][0-9] | hp9k31[0-9])
+               basic_machine=m68000-hp
+               ;;
+       hp9k3[2-9][0-9])
+               basic_machine=m68k-hp
+               ;;
+       hp9k6[0-9][0-9] | hp6[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hp9k7[0-79][0-9] | hp7[0-79][0-9])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k78[0-9] | hp78[0-9])
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+               # FIXME: really hppa2.0-hp
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][13679] | hp8[0-9][13679])
+               basic_machine=hppa1.1-hp
+               ;;
+       hp9k8[0-9][0-9] | hp8[0-9][0-9])
+               basic_machine=hppa1.0-hp
+               ;;
+       hppa-next)
+               os=-nextstep3
+               ;;
+       hppaosf)
+               basic_machine=hppa1.1-hp
+               os=-osf
+               ;;
+       hppro)
+               basic_machine=hppa1.1-hp
+               os=-proelf
+               ;;
+       i370-ibm* | ibm*)
+               basic_machine=i370-ibm
+               ;;
+       i*86v32)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv32
+               ;;
+       i*86v4*)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv4
+               ;;
+       i*86v)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-sysv
+               ;;
+       i*86sol2)
+               basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+               os=-solaris2
+               ;;
+       i386mach)
+               basic_machine=i386-mach
+               os=-mach
+               ;;
+       i386-vsta | vsta)
+               basic_machine=i386-unknown
+               os=-vsta
+               ;;
+       iris | iris4d)
+               basic_machine=mips-sgi
+               case $os in
+                   -irix*)
+                       ;;
+                   *)
+                       os=-irix4
+                       ;;
+               esac
+               ;;
+       isi68 | isi)
+               basic_machine=m68k-isi
+               os=-sysv
+               ;;
+       leon-*|leon[3-9]-*)
+               basic_machine=sparc-`echo $basic_machine | sed 's/-.*//'`
+               ;;
+       m68knommu)
+               basic_machine=m68k-unknown
+               os=-linux
+               ;;
+       m68knommu-*)
+               basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       m88k-omron*)
+               basic_machine=m88k-omron
+               ;;
+       magnum | m3230)
+               basic_machine=mips-mips
+               os=-sysv
+               ;;
+       merlin)
+               basic_machine=ns32k-utek
+               os=-sysv
+               ;;
+       microblaze*)
+               basic_machine=microblaze-xilinx
+               ;;
+       mingw64)
+               basic_machine=x86_64-pc
+               os=-mingw64
+               ;;
+       mingw32)
+               basic_machine=i686-pc
+               os=-mingw32
+               ;;
+       mingw32ce)
+               basic_machine=arm-unknown
+               os=-mingw32ce
+               ;;
+       miniframe)
+               basic_machine=m68000-convergent
+               ;;
+       *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+               basic_machine=m68k-atari
+               os=-mint
+               ;;
+       mips3*-*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+               ;;
+       mips3*)
+               basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+               ;;
+       monitor)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       morphos)
+               basic_machine=powerpc-unknown
+               os=-morphos
+               ;;
+       moxiebox)
+               basic_machine=moxie-unknown
+               os=-moxiebox
+               ;;
+       msdos)
+               basic_machine=i386-pc
+               os=-msdos
+               ;;
+       ms1-*)
+               basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+               ;;
+       msys)
+               basic_machine=i686-pc
+               os=-msys
+               ;;
+       mvs)
+               basic_machine=i370-ibm
+               os=-mvs
+               ;;
+       nacl)
+               basic_machine=le32-unknown
+               os=-nacl
+               ;;
+       ncr3000)
+               basic_machine=i486-ncr
+               os=-sysv4
+               ;;
+       netbsd386)
+               basic_machine=i386-unknown
+               os=-netbsd
+               ;;
+       netwinder)
+               basic_machine=armv4l-rebel
+               os=-linux
+               ;;
+       news | news700 | news800 | news900)
+               basic_machine=m68k-sony
+               os=-newsos
+               ;;
+       news1000)
+               basic_machine=m68030-sony
+               os=-newsos
+               ;;
+       news-3600 | risc-news)
+               basic_machine=mips-sony
+               os=-newsos
+               ;;
+       necv70)
+               basic_machine=v70-nec
+               os=-sysv
+               ;;
+       next | m*-next )
+               basic_machine=m68k-next
+               case $os in
+                   -nextstep* )
+                       ;;
+                   -ns2*)
+                     os=-nextstep2
+                       ;;
+                   *)
+                     os=-nextstep3
+                       ;;
+               esac
+               ;;
+       nh3000)
+               basic_machine=m68k-harris
+               os=-cxux
+               ;;
+       nh[45]000)
+               basic_machine=m88k-harris
+               os=-cxux
+               ;;
+       nindy960)
+               basic_machine=i960-intel
+               os=-nindy
+               ;;
+       mon960)
+               basic_machine=i960-intel
+               os=-mon960
+               ;;
+       nonstopux)
+               basic_machine=mips-compaq
+               os=-nonstopux
+               ;;
+       np1)
+               basic_machine=np1-gould
+               ;;
+       neo-tandem)
+               basic_machine=neo-tandem
+               ;;
+       nse-tandem)
+               basic_machine=nse-tandem
+               ;;
+       nsr-tandem)
+               basic_machine=nsr-tandem
+               ;;
+       op50n-* | op60c-*)
+               basic_machine=hppa1.1-oki
+               os=-proelf
+               ;;
+       openrisc | openrisc-*)
+               basic_machine=or32-unknown
+               ;;
+       os400)
+               basic_machine=powerpc-ibm
+               os=-os400
+               ;;
+       OSE68000 | ose68000)
+               basic_machine=m68000-ericsson
+               os=-ose
+               ;;
+       os68k)
+               basic_machine=m68k-none
+               os=-os68k
+               ;;
+       pa-hitachi)
+               basic_machine=hppa1.1-hitachi
+               os=-hiuxwe2
+               ;;
+       paragon)
+               basic_machine=i860-intel
+               os=-osf
+               ;;
+       parisc)
+               basic_machine=hppa-unknown
+               os=-linux
+               ;;
+       parisc-*)
+               basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
+               os=-linux
+               ;;
+       pbd)
+               basic_machine=sparc-tti
+               ;;
+       pbb)
+               basic_machine=m68k-tti
+               ;;
+       pc532 | pc532-*)
+               basic_machine=ns32k-pc532
+               ;;
+       pc98)
+               basic_machine=i386-pc
+               ;;
+       pc98-*)
+               basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium | p5 | k5 | k6 | nexgen | viac3)
+               basic_machine=i586-pc
+               ;;
+       pentiumpro | p6 | 6x86 | athlon | athlon_*)
+               basic_machine=i686-pc
+               ;;
+       pentiumii | pentium2 | pentiumiii | pentium3)
+               basic_machine=i686-pc
+               ;;
+       pentium4)
+               basic_machine=i786-pc
+               ;;
+       pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+               basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumpro-* | p6-* | 6x86-* | athlon-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+               basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pentium4-*)
+               basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       pn)
+               basic_machine=pn-gould
+               ;;
+       power)  basic_machine=power-ibm
+               ;;
+       ppc | ppcbe)    basic_machine=powerpc-unknown
+               ;;
+       ppc-* | ppcbe-*)
+               basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppcle | powerpclittle | ppc-le | powerpc-little)
+               basic_machine=powerpcle-unknown
+               ;;
+       ppcle-* | powerpclittle-*)
+               basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64)  basic_machine=powerpc64-unknown
+               ;;
+       ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+               basic_machine=powerpc64le-unknown
+               ;;
+       ppc64le-* | powerpc64little-*)
+               basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       ps2)
+               basic_machine=i386-ibm
+               ;;
+       pw32)
+               basic_machine=i586-unknown
+               os=-pw32
+               ;;
+       rdos | rdos64)
+               basic_machine=x86_64-pc
+               os=-rdos
+               ;;
+       rdos32)
+               basic_machine=i386-pc
+               os=-rdos
+               ;;
+       rom68k)
+               basic_machine=m68k-rom68k
+               os=-coff
+               ;;
+       rm[46]00)
+               basic_machine=mips-siemens
+               ;;
+       rtpc | rtpc-*)
+               basic_machine=romp-ibm
+               ;;
+       s390 | s390-*)
+               basic_machine=s390-ibm
+               ;;
+       s390x | s390x-*)
+               basic_machine=s390x-ibm
+               ;;
+       sa29200)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       sb1)
+               basic_machine=mipsisa64sb1-unknown
+               ;;
+       sb1el)
+               basic_machine=mipsisa64sb1el-unknown
+               ;;
+       sde)
+               basic_machine=mipsisa32-sde
+               os=-elf
+               ;;
+       sei)
+               basic_machine=mips-sei
+               os=-seiux
+               ;;
+       sequent)
+               basic_machine=i386-sequent
+               ;;
+       sh)
+               basic_machine=sh-hitachi
+               os=-hms
+               ;;
+       sh5el)
+               basic_machine=sh5le-unknown
+               ;;
+       sh64)
+               basic_machine=sh64-unknown
+               ;;
+       sparclite-wrs | simso-wrs)
+               basic_machine=sparclite-wrs
+               os=-vxworks
+               ;;
+       sps7)
+               basic_machine=m68k-bull
+               os=-sysv2
+               ;;
+       spur)
+               basic_machine=spur-unknown
+               ;;
+       st2000)
+               basic_machine=m68k-tandem
+               ;;
+       stratus)
+               basic_machine=i860-stratus
+               os=-sysv4
+               ;;
+       strongarm-* | thumb-*)
+               basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'`
+               ;;
+       sun2)
+               basic_machine=m68000-sun
+               ;;
+       sun2os3)
+               basic_machine=m68000-sun
+               os=-sunos3
+               ;;
+       sun2os4)
+               basic_machine=m68000-sun
+               os=-sunos4
+               ;;
+       sun3os3)
+               basic_machine=m68k-sun
+               os=-sunos3
+               ;;
+       sun3os4)
+               basic_machine=m68k-sun
+               os=-sunos4
+               ;;
+       sun4os3)
+               basic_machine=sparc-sun
+               os=-sunos3
+               ;;
+       sun4os4)
+               basic_machine=sparc-sun
+               os=-sunos4
+               ;;
+       sun4sol2)
+               basic_machine=sparc-sun
+               os=-solaris2
+               ;;
+       sun3 | sun3-*)
+               basic_machine=m68k-sun
+               ;;
+       sun4)
+               basic_machine=sparc-sun
+               ;;
+       sun386 | sun386i | roadrunner)
+               basic_machine=i386-sun
+               ;;
+       sv1)
+               basic_machine=sv1-cray
+               os=-unicos
+               ;;
+       symmetry)
+               basic_machine=i386-sequent
+               os=-dynix
+               ;;
+       t3e)
+               basic_machine=alphaev5-cray
+               os=-unicos
+               ;;
+       t90)
+               basic_machine=t90-cray
+               os=-unicos
+               ;;
+       tile*)
+               basic_machine=$basic_machine-unknown
+               os=-linux-gnu
+               ;;
+       tx39)
+               basic_machine=mipstx39-unknown
+               ;;
+       tx39el)
+               basic_machine=mipstx39el-unknown
+               ;;
+       toad1)
+               basic_machine=pdp10-xkl
+               os=-tops20
+               ;;
+       tower | tower-32)
+               basic_machine=m68k-ncr
+               ;;
+       tpf)
+               basic_machine=s390x-ibm
+               os=-tpf
+               ;;
+       udi29k)
+               basic_machine=a29k-amd
+               os=-udi
+               ;;
+       ultra3)
+               basic_machine=a29k-nyu
+               os=-sym1
+               ;;
+       v810 | necv810)
+               basic_machine=v810-nec
+               os=-none
+               ;;
+       vaxv)
+               basic_machine=vax-dec
+               os=-sysv
+               ;;
+       vms)
+               basic_machine=vax-dec
+               os=-vms
+               ;;
+       vpp*|vx|vx-*)
+               basic_machine=f301-fujitsu
+               ;;
+       vxworks960)
+               basic_machine=i960-wrs
+               os=-vxworks
+               ;;
+       vxworks68)
+               basic_machine=m68k-wrs
+               os=-vxworks
+               ;;
+       vxworks29k)
+               basic_machine=a29k-wrs
+               os=-vxworks
+               ;;
+       w65*)
+               basic_machine=w65-wdc
+               os=-none
+               ;;
+       w89k-*)
+               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
+               ;;
+       z8k-*-coff)
+               basic_machine=z8k-unknown
+               os=-sim
+               ;;
+       z80-*-coff)
+               basic_machine=z80-unknown
+               os=-sim
+               ;;
+       none)
+               basic_machine=none-none
+               os=-none
+               ;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+       w89k)
+               basic_machine=hppa1.1-winbond
+               ;;
+       op50n)
+               basic_machine=hppa1.1-oki
+               ;;
+       op60c)
+               basic_machine=hppa1.1-oki
+               ;;
+       romp)
+               basic_machine=romp-ibm
+               ;;
+       mmix)
+               basic_machine=mmix-knuth
+               ;;
+       rs6000)
+               basic_machine=rs6000-ibm
+               ;;
+       vax)
+               basic_machine=vax-dec
+               ;;
+       pdp10)
+               # there are many clones, so DEC is not a safe bet
+               basic_machine=pdp10-unknown
+               ;;
+       pdp11)
+               basic_machine=pdp11-dec
+               ;;
+       we32k)
+               basic_machine=we32k-att
+               ;;
+       sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele)
+               basic_machine=sh-unknown
+               ;;
+       sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+               basic_machine=sparc-sun
+               ;;
+       cydra)
+               basic_machine=cydra-cydrome
+               ;;
+       orion)
+               basic_machine=orion-highlevel
+               ;;
+       orion105)
+               basic_machine=clipper-highlevel
+               ;;
+       mac | mpw | mac-mpw)
+               basic_machine=m68k-apple
+               ;;
+       pmac | pmac-mpw)
+               basic_machine=powerpc-apple
+               ;;
+       *-unknown)
+               # Make sure to match an already-canonicalized machine name.
+               ;;
+       *)
+               echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+       *-digital*)
+               basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+               ;;
+       *-commodore*)
+               basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+               ;;
+       *)
+               ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+       # First match some system type aliases
+       # that might get confused with valid system types.
+       # -solaris* is a basic system type, with this one exception.
+       -auroraux)
+               os=-auroraux
+               ;;
+       -solaris1 | -solaris1.*)
+               os=`echo $os | sed -e 's|solaris1|sunos4|'`
+               ;;
+       -solaris)
+               os=-solaris2
+               ;;
+       -svr4*)
+               os=-sysv4
+               ;;
+       -unixware*)
+               os=-sysv4.2uw
+               ;;
+       -gnu/linux*)
+               os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+               ;;
+       # First accept the basic system types.
+       # The portable systems comes first.
+       # Each alternative MUST END IN A *, to match a version number.
+       # -sysv* is not here because it comes later, after sysvr4.
+       -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+             | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\
+             | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \
+             | -sym* | -kopensolaris* | -plan9* \
+             | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+             | -aos* | -aros* | -cloudabi* | -sortix* \
+             | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+             | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+             | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+             | -bitrig* | -openbsd* | -solidbsd* \
+             | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+             | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+             | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+             | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+             | -chorusos* | -chorusrdb* | -cegcc* \
+             | -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* | -dragonfly* \
+             | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*)
+       # Remember, each alternative MUST END IN *, to match a version number.
+               ;;
+       -qnx*)
+               case $basic_machine in
+                   x86-* | i*86-*)
+                       ;;
+                   *)
+                       os=-nto$os
+                       ;;
+               esac
+               ;;
+       -nto-qnx*)
+               ;;
+       -nto*)
+               os=`echo $os | sed -e 's|nto|nto-qnx|'`
+               ;;
+       -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+             | -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|'`
+               ;;
+       -sunos5*)
+               os=`echo $os | sed -e 's|sunos5|solaris2|'`
+               ;;
+       -sunos6*)
+               os=`echo $os | sed -e 's|sunos6|solaris3|'`
+               ;;
+       -opened*)
+               os=-openedition
+               ;;
+       -os400*)
+               os=-os400
+               ;;
+       -wince*)
+               os=-wince
+               ;;
+       -osfrose*)
+               os=-osfrose
+               ;;
+       -osf*)
+               os=-osf
+               ;;
+       -utek*)
+               os=-bsd
+               ;;
+       -dynix*)
+               os=-bsd
+               ;;
+       -acis*)
+               os=-aos
+               ;;
+       -atheos*)
+               os=-atheos
+               ;;
+       -syllable*)
+               os=-syllable
+               ;;
+       -386bsd)
+               os=-bsd
+               ;;
+       -ctix* | -uts*)
+               os=-sysv
+               ;;
+       -nova*)
+               os=-rtmk-nova
+               ;;
+       -ns2 )
+               os=-nextstep2
+               ;;
+       -nsk*)
+               os=-nsk
+               ;;
+       # Preserve the version number of sinix5.
+       -sinix5.*)
+               os=`echo $os | sed -e 's|sinix|sysv|'`
+               ;;
+       -sinix*)
+               os=-sysv4
+               ;;
+       -tpf*)
+               os=-tpf
+               ;;
+       -triton*)
+               os=-sysv3
+               ;;
+       -oss*)
+               os=-sysv3
+               ;;
+       -svr4)
+               os=-sysv4
+               ;;
+       -svr3)
+               os=-sysv3
+               ;;
+       -sysvr4)
+               os=-sysv4
+               ;;
+       # This must come after -sysvr4.
+       -sysv*)
+               ;;
+       -ose*)
+               os=-ose
+               ;;
+       -es1800*)
+               os=-ose
+               ;;
+       -xenix)
+               os=-xenix
+               ;;
+       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+               os=-mint
+               ;;
+       -aros*)
+               os=-aros
+               ;;
+       -zvmoe)
+               os=-zvmoe
+               ;;
+       -dicos*)
+               os=-dicos
+               ;;
+       -nacl*)
+               ;;
+       -none)
+               ;;
+       *)
+               # Get rid of the `-' at the beginning of $os.
+               os=`echo $os | sed 's/[^-]*-//'`
+               echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+               exit 1
+               ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+       score-*)
+               os=-elf
+               ;;
+       spu-*)
+               os=-elf
+               ;;
+       *-acorn)
+               os=-riscix1.2
+               ;;
+       arm*-rebel)
+               os=-linux
+               ;;
+       arm*-semi)
+               os=-aout
+               ;;
+       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
+               ;;
+       pdp11-*)
+               os=-none
+               ;;
+       *-dec | vax-*)
+               os=-ultrix4.2
+               ;;
+       m68*-apollo)
+               os=-domain
+               ;;
+       i386-sun)
+               os=-sunos4.0.2
+               ;;
+       m68000-sun)
+               os=-sunos3
+               ;;
+       m68*-cisco)
+               os=-aout
+               ;;
+       mep-*)
+               os=-elf
+               ;;
+       mips*-cisco)
+               os=-elf
+               ;;
+       mips*-*)
+               os=-elf
+               ;;
+       or32-*)
+               os=-coff
+               ;;
+       *-tti)  # must be before sparc entry or we get the wrong os.
+               os=-sysv3
+               ;;
+       sparc-* | *-sun)
+               os=-sunos4.1.1
+               ;;
+       *-be)
+               os=-beos
+               ;;
+       *-haiku)
+               os=-haiku
+               ;;
+       *-ibm)
+               os=-aix
+               ;;
+       *-knuth)
+               os=-mmixware
+               ;;
+       *-wec)
+               os=-proelf
+               ;;
+       *-winbond)
+               os=-proelf
+               ;;
+       *-oki)
+               os=-proelf
+               ;;
+       *-hp)
+               os=-hpux
+               ;;
+       *-hitachi)
+               os=-hiux
+               ;;
+       i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+               os=-sysv
+               ;;
+       *-cbm)
+               os=-amigaos
+               ;;
+       *-dg)
+               os=-dgux
+               ;;
+       *-dolphin)
+               os=-sysv3
+               ;;
+       m68k-ccur)
+               os=-rtu
+               ;;
+       m88k-omron*)
+               os=-luna
+               ;;
+       *-next )
+               os=-nextstep
+               ;;
+       *-sequent)
+               os=-ptx
+               ;;
+       *-crds)
+               os=-unos
+               ;;
+       *-ns)
+               os=-genix
+               ;;
+       i370-*)
+               os=-mvs
+               ;;
+       *-next)
+               os=-nextstep3
+               ;;
+       *-gould)
+               os=-sysv
+               ;;
+       *-highlevel)
+               os=-bsd
+               ;;
+       *-encore)
+               os=-bsd
+               ;;
+       *-sgi)
+               os=-irix
+               ;;
+       *-siemens)
+               os=-sysv4
+               ;;
+       *-masscomp)
+               os=-rtu
+               ;;
+       f30[01]-fujitsu | f700-fujitsu)
+               os=-uxpv
+               ;;
+       *-rom68k)
+               os=-coff
+               ;;
+       *-*bug)
+               os=-coff
+               ;;
+       *-apple)
+               os=-macos
+               ;;
+       *-atari*)
+               os=-mint
+               ;;
+       *)
+               os=-none
+               ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+       *-unknown)
+               case $os in
+                       -riscix*)
+                               vendor=acorn
+                               ;;
+                       -sunos*)
+                               vendor=sun
+                               ;;
+                       -cnk*|-aix*)
+                               vendor=ibm
+                               ;;
+                       -beos*)
+                               vendor=be
+                               ;;
+                       -hpux*)
+                               vendor=hp
+                               ;;
+                       -mpeix*)
+                               vendor=hp
+                               ;;
+                       -hiux*)
+                               vendor=hitachi
+                               ;;
+                       -unos*)
+                               vendor=crds
+                               ;;
+                       -dgux*)
+                               vendor=dg
+                               ;;
+                       -luna*)
+                               vendor=omron
+                               ;;
+                       -genix*)
+                               vendor=ns
+                               ;;
+                       -mvs* | -opened*)
+                               vendor=ibm
+                               ;;
+                       -os400*)
+                               vendor=ibm
+                               ;;
+                       -ptx*)
+                               vendor=sequent
+                               ;;
+                       -tpf*)
+                               vendor=ibm
+                               ;;
+                       -vxsim* | -vxworks* | -windiss*)
+                               vendor=wrs
+                               ;;
+                       -aux*)
+                               vendor=apple
+                               ;;
+                       -hms*)
+                               vendor=hitachi
+                               ;;
+                       -mpw* | -macos*)
+                               vendor=apple
+                               ;;
+                       -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+                               vendor=atari
+                               ;;
+                       -vos*)
+                               vendor=stratus
+                               ;;
+               esac
+               basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+               ;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/zfs/config/depcomp b/zfs/config/depcomp
new file mode 100755 (executable)
index 0000000..fc98710
--- /dev/null
@@ -0,0 +1,791 @@
+#! /bin/sh
+# depcomp - compile a program generating dependencies as side-effects
+
+scriptversion=2013-05-30.07; # UTC
+
+# Copyright (C) 1999-2014 Free Software Foundation, Inc.
+
+# This program is free software; you can 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.
+
+# Originally written by Alexandre Oliva <oliva@dcc.unicamp.br>.
+
+case $1 in
+  '')
+    echo "$0: No command.  Try '$0 --help' for more information." 1>&2
+    exit 1;
+    ;;
+  -h | --h*)
+    cat <<\EOF
+Usage: depcomp [--help] [--version] PROGRAM [ARGS]
+
+Run PROGRAMS ARGS to compile a file, generating dependencies
+as side-effects.
+
+Environment variables:
+  depmode     Dependency tracking mode.
+  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 outputting dependencies.
+  libtool     Whether libtool is used (yes/no).
+
+Report bugs to <bug-automake@gnu.org>.
+EOF
+    exit $?
+    ;;
+  -v | --v*)
+    echo "depcomp $scriptversion"
+    exit $?
+    ;;
+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
+fi
+
+# Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po.
+depfile=${depfile-`echo "$object" |
+  sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`}
+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
+# here, because this file can only contain one case statement.
+if test "$depmode" = hp; then
+  # HP compiler uses -M and no extra arg.
+  gccflag=-M
+  depmode=gcc
+fi
+
+if test "$depmode" = dashXmstdout; then
+  # 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
+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
+gcc3)
+## gcc 3 implements dependency tracking that does exactly what
+## we want.  Yay!  Note: for some reason libtool 1.4 doesn't like
+## it if -MD -MP comes after the -MF stuff.  Hmm.
+## Unfortunately, FreeBSD c89 acceptance of flags depends upon
+## the command line argument order; so add the flags where they
+## appear in depend2.am.  Note that the slowdown incurred here
+## affects only configure: in makefiles, %FASTDEP% shortcuts this.
+  for arg
+  do
+    case $arg in
+    -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;;
+    *)  set fnord "$@" "$arg" ;;
+    esac
+    shift # fnord
+    shift # $arg
+  done
+  "$@"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  mv "$tmpdepfile" "$depfile"
+  ;;
+
+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).  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
+    gccflag=-MD,
+  fi
+  "$@" -Wp,"$gccflag$tmpdepfile"
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  # 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.
+## 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.
+## 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.  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.
+  tr ' ' "$nl" < "$tmpdepfile" \
+    | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \
+    | sed -e 's/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp)
+  # 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
+  ;;
+
+sgi)
+  if test "$libtool" = yes; then
+    "$@" "-Wp,-MDupdate,$tmpdepfile"
+  else
+    "$@" -MDupdate "$tmpdepfile"
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+
+  if test -f "$tmpdepfile"; then  # yes, the sourcefile depend on other files
+    echo "$object : \\" > "$depfile"
+    # Clip off the initial element (the dependent).  Don't try to be
+    # clever and replace this with sed code, as IRIX sed won't handle
+    # lines with more than a fixed number of characters (4096 in
+    # IRIX 6.2 sed, 8192 in IRIX 6.5).  We also remove comment lines;
+    # the IRIX cc adds comments like '#:fec' to the end of the
+    # dependency line.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \
+      | tr "$nl" ' ' >> "$depfile"
+    echo >> "$depfile"
+    # The second pass generates a dummy entry for each header file.
+    tr ' ' "$nl" < "$tmpdepfile" \
+      | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \
+      >> "$depfile"
+  else
+    make_dummy_depfile
+  fi
+  rm -f "$tmpdepfile"
+  ;;
+
+xlc)
+  # This case exists only to let depend.m4 do its work.  It works by
+  # looking at the text of this script.  This case will never be run,
+  # 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
+  # start of each line; $object doesn't have directory information.
+  # Version 6 uses the directory in both cases.
+  set_dir_from "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$base.u
+    tmpdepfile3=$dir.libs/$base.u
+    "$@" -Wc,-M
+  else
+    tmpdepfile1=$dir$base.u
+    tmpdepfile2=$dir$base.u
+    tmpdepfile3=$dir$base.u
+    "$@" -M
+  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
+  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"
+  ;;
+
+## 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 '\' :
+  #    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
+
+  if test $stat -ne 0; then
+    rm -f "$tmpdepfile"
+    exit $stat
+  fi
+  rm -f "$depfile"
+  # Each line is of the form `foo.o: dependent.h',
+  # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'.
+  # Do two passes, one to just change these to
+  # `$object: dependent.h' and one to simply `dependent.h:'.
+  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"
+  rm -f "$tmpdepfile"
+  ;;
+
+hp2)
+  # The "hp" stanza above does not work with aCC (C++) and HP's ia64
+  # compilers, which have integrated preprocessors.  The correct option
+  # to use with these is +Maked; it writes dependencies to a file named
+  # '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.
+  set_dir_from  "$object"
+  set_base_from "$object"
+  if test "$libtool" = yes; then
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir.libs/$base.d
+    "$@" -Wc,+Maked
+  else
+    tmpdepfile1=$dir$base.d
+    tmpdepfile2=$dir$base.d
+    "$@" +Maked
+  fi
+  stat=$?
+  if test $stat -ne 0; then
+     rm -f "$tmpdepfile1" "$tmpdepfile2"
+     exit $stat
+  fi
+
+  for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2"
+  do
+    test -f "$tmpdepfile" && break
+  done
+  if test -f "$tmpdepfile"; then
+    sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile"
+    # Add 'dependent.h:' lines.
+    sed -ne '2,${
+               s/^ *//
+               s/ \\*$//
+               s/$/:/
+               p
+             }' "$tmpdepfile" >> "$depfile"
+  else
+    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.
+  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
+  # dependency tracking mechanisms from slower ones.
+
+dashmstdout)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout, regardless of -o.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    esac
+  done
+
+  test -z "$dashmflag" && dashmflag=-M
+  # 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.
+  "$@" $dashmflag |
+    sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile"
+  rm -f "$depfile"
+  cat < "$tmpdepfile" > "$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"
+  ;;
+
+dashXmstdout)
+  # This case only exists to satisfy depend.m4.  It is never actually
+  # run, as this mode is specially recognized in the preamble.
+  exit 1
+  ;;
+
+makedepend)
+  "$@" || exit $?
+  # Remove any Libtool call
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+  # X makedepend
+  shift
+  cleared=no eat=no
+  for arg
+  do
+    case $cleared in
+    no)
+      set ""; shift
+      cleared=yes ;;
+    esac
+    if test $eat = yes; then
+      eat=no
+      continue
+    fi
+    case "$arg" in
+    -D*|-I*)
+      set fnord "$@" "$arg"; shift ;;
+    # Strip any option that makedepend may not understand.  Remove
+    # the object too, otherwise makedepend will parse it as a source file.
+    -arch)
+      eat=yes ;;
+    -*|$object)
+      ;;
+    *)
+      set fnord "$@" "$arg"; shift ;;
+    esac
+  done
+  obj_suffix=`echo "$object" | sed 's/^.*\././'`
+  touch "$tmpdepfile"
+  ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@"
+  rm -f "$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
+  ;;
+
+cpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  # Remove '-o $object'.
+  IFS=" "
+  for arg
+  do
+    case $arg in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    *)
+      set fnord "$@" "$arg"
+      shift # fnord
+      shift # $arg
+      ;;
+    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"
+  rm -f "$depfile"
+  echo "$object : \\" > "$depfile"
+  cat < "$tmpdepfile" >> "$depfile"
+  sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvisualcpp)
+  # Important note: in order to support this mode, a compiler *must*
+  # always write the preprocessed file to stdout.
+  "$@" || exit $?
+
+  # Remove the call to Libtool.
+  if test "$libtool" = yes; then
+    while test "X$1" != 'X--mode=compile'; do
+      shift
+    done
+    shift
+  fi
+
+  IFS=" "
+  for arg
+  do
+    case "$arg" in
+    -o)
+      shift
+      ;;
+    $object)
+      shift
+      ;;
+    "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI")
+        set fnord "$@"
+        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::'"$tab"'\1 \\:p' >> "$depfile"
+  echo "$tab" >> "$depfile"
+  sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile"
+  rm -f "$tmpdepfile"
+  ;;
+
+msvcmsys)
+  # 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
+  ;;
+
+none)
+  exec "$@"
+  ;;
+
+*)
+  echo "Unknown depmode $depmode" 1>&2
+  exit 1
+  ;;
+esac
+
+exit 0
+
+# 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/zfs/config/dkms.m4 b/zfs/config/dkms.m4
new file mode 100644 (file)
index 0000000..cfa1152
--- /dev/null
@@ -0,0 +1,14 @@
+dnl #
+dnl # Prevent manual building in DKMS source tree.
+dnl #
+AC_DEFUN([ZFS_AC_DKMS_INHIBIT], [
+       AC_MSG_CHECKING([for dkms.conf file])
+        AS_IF([test -e dkms.conf], [
+               AC_MSG_ERROR([
+       *** ZFS should not be manually built in the DKMS source tree.
+       *** Remove all ZFS packages before compiling the ZoL sources.
+       *** Running "make install" breaks ZFS packages.])
+        ], [
+               AC_MSG_RESULT([not found])
+        ])
+])
diff --git a/zfs/config/install-sh b/zfs/config/install-sh
new file mode 100755 (executable)
index 0000000..0b0fdcb
--- /dev/null
@@ -0,0 +1,501 @@
+#!/bin/sh
+# install - install a program, script, or datafile
+
+scriptversion=2013-12-25.23; # UTC
+
+# This originates from X11R5 (mit/util/scripts/install.sh), which was
+# later released in X11R6 (xc/config/util/install.sh) with the
+# following copyright and license.
+#
+# Copyright (C) 1994 X Consortium
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to
+# deal in the Software without restriction, including without limitation the
+# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
+# sell copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
+# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
+# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
+# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+#
+# Except as contained in this notice, the name of the X Consortium shall not
+# be used in advertising or otherwise to promote the sale, use or other deal-
+# ings in this Software without prior written authorization from the X Consor-
+# tium.
+#
+#
+# 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
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+
+tab='  '
+nl='
+'
+IFS=" $tab$nl"
+
+# Set DOITPROG to "echo" to test this script.
+
+doit=${DOITPROG-}
+doit_exec=${doit:-exec}
+
+# Put in absolute file names if you don't have them in your path;
+# or use environment vars.
+
+chgrpprog=${CHGRPPROG-chgrp}
+chmodprog=${CHMODPROG-chmod}
+chownprog=${CHOWNPROG-chown}
+cmpprog=${CMPPROG-cmp}
+cpprog=${CPPROG-cp}
+mkdirprog=${MKDIRPROG-mkdir}
+mvprog=${MVPROG-mv}
+rmprog=${RMPROG-rm}
+stripprog=${STRIPPROG-strip}
+
+posix_mkdir=
+
+# Desired mode of installed file.
+mode=0755
+
+chgrpcmd=
+chmodcmd=$chmodprog
+chowncmd=
+mvcmd=$mvprog
+rmcmd="$rmprog -f"
+stripcmd=
+
+src=
+dst=
+dir_arg=
+dst_arg=
+
+copy_on_change=false
+is_target_a_directory=possibly
+
+usage="\
+Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
+   or: $0 [OPTION]... SRCFILES... DIRECTORY
+   or: $0 [OPTION]... -t DIRECTORY SRCFILES...
+   or: $0 [OPTION]... -d DIRECTORIES...
+
+In the 1st form, copy SRCFILE to DSTFILE.
+In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
+In the 4th, create DIRECTORIES.
+
+Options:
+     --help     display this help and exit.
+     --version  display version info and exit.
+
+  -c            (ignored)
+  -C            install only if different (preserve the last data modification time)
+  -d            create directories instead of installing files.
+  -g GROUP      $chgrpprog installed files to GROUP.
+  -m MODE       $chmodprog installed files to MODE.
+  -o USER       $chownprog installed files to USER.
+  -s            $stripprog installed files.
+  -t DIRECTORY  install into DIRECTORY.
+  -T            report an error if DSTFILE is a directory.
+
+Environment variables override the default commands:
+  CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
+  RMPROG STRIPPROG
+"
+
+while test $# -ne 0; do
+  case $1 in
+    -c) ;;
+
+    -C) copy_on_change=true;;
+
+    -d) dir_arg=true;;
+
+    -g) chgrpcmd="$chgrpprog $2"
+        shift;;
+
+    --help) echo "$usage"; exit $?;;
+
+    -m) mode=$2
+        case $mode in
+          *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+            echo "$0: invalid mode: $mode" >&2
+            exit 1;;
+        esac
+        shift;;
+
+    -o) chowncmd="$chownprog $2"
+        shift;;
+
+    -s) stripcmd=$stripprog;;
+
+    -t)
+        is_target_a_directory=always
+        dst_arg=$2
+        # Protect names problematic for 'test' and other utilities.
+        case $dst_arg in
+          -* | [=\(\)!]) dst_arg=./$dst_arg;;
+        esac
+        shift;;
+
+    -T) is_target_a_directory=never;;
+
+    --version) echo "$0 $scriptversion"; exit $?;;
+
+    --) shift
+        break;;
+
+    -*) echo "$0: invalid option: $1" >&2
+        exit 1;;
+
+    *)  break;;
+  esac
+  shift
+done
+
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+  if test -n "$dst_arg"; then
+    echo "$0: target directory not allowed when installing a directory." >&2
+    exit 1
+  fi
+fi
+
+if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
+  # When -d is used, all remaining arguments are directories to create.
+  # When -t is used, the destination is already specified.
+  # Otherwise, the last argument is the destination.  Remove it from $@.
+  for arg
+  do
+    if test -n "$dst_arg"; then
+      # $@ is not empty: it contains at least $arg.
+      set fnord "$@" "$dst_arg"
+      shift # fnord
+    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
+
+if test $# -eq 0; then
+  if test -z "$dir_arg"; then
+    echo "$0: no input file specified." >&2
+    exit 1
+  fi
+  # 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
+  if test $# -gt 1 || test "$is_target_a_directory" = always; then
+    if test ! -d "$dst_arg"; then
+      echo "$0: $dst_arg: Is not a directory." >&2
+      exit 1
+    fi
+  fi
+fi
+
+if test -z "$dir_arg"; then
+  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.
+  case $mode in
+    # Optimize common cases.
+    *644) cp_umask=133;;
+    *755) cp_umask=22;;
+
+    *[0-7])
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw='% 200'
+      fi
+      cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
+    *)
+      if test -z "$stripcmd"; then
+        u_plus_rw=
+      else
+        u_plus_rw=,u+rw
+      fi
+      cp_umask=$mode$u_plus_rw;;
+  esac
+fi
+
+for src
+do
+  # Protect names problematic for 'test' and other utilities.
+  case $src in
+    -* | [=\(\)!]) src=./$src;;
+  esac
+
+  if test -n "$dir_arg"; then
+    dst=$src
+    dstdir=$dst
+    test -d "$dstdir"
+    dstdir_status=$?
+  else
+
+    # Waiting for this to be detected by the "$cpprog $src $dsttmp" command
+    # might cause directories to be created, which would be especially bad
+    # if $src (and thus $dsttmp) contains '*'.
+    if test ! -f "$src" && test ! -d "$src"; then
+      echo "$0: $src does not exist." >&2
+      exit 1
+    fi
+
+    if test -z "$dst_arg"; then
+      echo "$0: no destination specified." >&2
+      exit 1
+    fi
+    dst=$dst_arg
+
+    # If destination is a directory, append the input filename; won't work
+    # if double slashes aren't ignored.
+    if test -d "$dst"; then
+      if test "$is_target_a_directory" = never; then
+        echo "$0: $dst_arg: Is a directory" >&2
+        exit 1
+      fi
+      dstdir=$dst
+      dst=$dstdir/`basename "$src"`
+      dstdir_status=0
+    else
+      dstdir=`dirname "$dst"`
+      test -d "$dstdir"
+      dstdir_status=$?
+    fi
+  fi
+
+  obsolete_mkdir_used=false
+
+  if test $dstdir_status != 0; then
+    case $posix_mkdir in
+      '')
+        # Create intermediate dirs using mode 755 as modified by the umask.
+        # This is like FreeBSD 'install' as of 1997-10-28.
+        umask=`umask`
+        case $stripcmd.$umask in
+          # Optimize common cases.
+          *[2367][2367]) mkdir_umask=$umask;;
+          .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
+
+          *[0-7])
+            mkdir_umask=`expr $umask + 22 \
+              - $umask % 100 % 40 + $umask % 20 \
+              - $umask % 10 % 4 + $umask % 2
+            `;;
+          *) mkdir_umask=$umask,go-w;;
+        esac
+
+        # With -d, create the new directory with the user-specified mode.
+        # Otherwise, rely on $mkdir_umask.
+        if test -n "$dir_arg"; then
+          mkdir_mode=-m$mode
+        else
+          mkdir_mode=
+        fi
+
+        posix_mkdir=false
+        case $umask in
+          *[123567][0-7][0-7])
+            # POSIX mkdir -p sets u+wx bits regardless of umask, which
+            # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
+            ;;
+          *)
+            tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+            trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
+
+            if (umask $mkdir_umask &&
+                exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
+            then
+              if test -z "$dir_arg" || {
+                   # Check for POSIX incompatibilities with -m.
+                   # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+                   # other-writable bit of parent directory when it shouldn't.
+                   # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+                   ls_ld_tmpdir=`ls -ld "$tmpdir"`
+                   case $ls_ld_tmpdir in
+                     d????-?r-*) different_mode=700;;
+                     d????-?--*) different_mode=755;;
+                     *) false;;
+                   esac &&
+                   $mkdirprog -m$different_mode -p -- "$tmpdir" && {
+                     ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
+                     test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+                   }
+                 }
+              then posix_mkdir=:
+              fi
+              rmdir "$tmpdir/d" "$tmpdir"
+            else
+              # Remove any dirs left behind by ancient mkdir implementations.
+              rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
+            fi
+            trap '' 0;;
+        esac;;
+    esac
+
+    if
+      $posix_mkdir && (
+        umask $mkdir_umask &&
+        $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+      )
+    then :
+    else
+
+      # The umask is ridiculous, or mkdir does not conform to POSIX,
+      # or it failed possibly due to a race condition.  Create the
+      # directory the slow way, step by step, checking for races as we go.
+
+      case $dstdir in
+        /*) prefix='/';;
+        [-=\(\)!]*) prefix='./';;
+        *)  prefix='';;
+      esac
+
+      oIFS=$IFS
+      IFS=/
+      set -f
+      set fnord $dstdir
+      shift
+      set +f
+      IFS=$oIFS
+
+      prefixes=
+
+      for d
+      do
+        test X"$d" = X && continue
+
+        prefix=$prefix$d
+        if test -d "$prefix"; then
+          prefixes=
+        else
+          if $posix_mkdir; then
+            (umask=$mkdir_umask &&
+             $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+            # Don't fail if two instances are running concurrently.
+            test -d "$prefix" || exit 1
+          else
+            case $prefix in
+              *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+              *) qprefix=$prefix;;
+            esac
+            prefixes="$prefixes '$qprefix'"
+          fi
+        fi
+        prefix=$prefix/
+      done
+
+      if test -n "$prefixes"; then
+        # Don't fail if two instances are running concurrently.
+        (umask $mkdir_umask &&
+         eval "\$doit_exec \$mkdirprog $prefixes") ||
+          test -d "$dstdir" || exit 1
+        obsolete_mkdir_used=true
+      fi
+    fi
+  fi
+
+  if test -n "$dir_arg"; then
+    { test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
+    { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
+      test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
+  else
+
+    # Make a couple of temp file names in the proper directory.
+    dsttmp=$dstdir/_inst.$$_
+    rmtmp=$dstdir/_rm.$$_
+
+    # Trap to clean up those temp files at exit.
+    trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
+
+    # Copy the file name to the temp name.
+    (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+
+    # and set any options; do chmod last to preserve setuid bits.
+    #
+    # If any of these fail, we abort the whole thing.  If we want to
+    # ignore errors from any of these, just make sure not to ignore
+    # errors from the above "$doit $cpprog $src $dsttmp" command.
+    #
+    { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
+    { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
+    { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
+    { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
+
+    # If -C, don't bother to copy if it wouldn't change the file.
+    if $copy_on_change &&
+       old=`LC_ALL=C ls -dlL "$dst"     2>/dev/null` &&
+       new=`LC_ALL=C ls -dlL "$dsttmp"  2>/dev/null` &&
+       set -f &&
+       set X $old && old=:$2:$4:$5:$6 &&
+       set X $new && new=:$2:$4:$5:$6 &&
+       set +f &&
+       test "$old" = "$new" &&
+       $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
+    then
+      rm -f "$dsttmp"
+    else
+      # Rename the file to the real destination.
+      $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
+
+      # The rename failed, perhaps because mv can't rename something else
+      # to itself, or perhaps because mv is so ancient that it does not
+      # support -f.
+      {
+        # Now remove or move aside any old file at destination location.
+        # We try this two ways since rm can't unlink itself on some
+        # systems and the destination file might be busy for other
+        # reasons.  In this case, the final cleanup might fail but the new
+        # file should still install successfully.
+        {
+          test ! -f "$dst" ||
+          $doit $rmcmd -f "$dst" 2>/dev/null ||
+          { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+            { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
+          } ||
+          { echo "$0: cannot unlink or rename $dst" >&2
+            (exit 1); exit 1
+          }
+        } &&
+
+        # Now rename the file to the real destination.
+        $doit $mvcmd "$dsttmp" "$dst"
+      }
+    fi || exit 1
+
+    trap '' 0
+  fi
+done
+
+# 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:
index 0a65f39ef21b4d66efd0066f19bc956358c4a56b..c655a9a1ddd0670a9ba29fa579f3c8638416e037 100644 (file)
@@ -448,16 +448,18 @@ dnl # detected at configure time and cause a build failure.  Otherwise
 dnl # modules may be successfully built that behave incorrectly.
 dnl #
 AC_DEFUN([ZFS_AC_KERNEL_CONFIG], [
-       AC_RUN_IFELSE([
-               AC_LANG_PROGRAM([
-                       #include "$LINUX/include/linux/license.h"
+       AS_IF([test "x$cross_compiling" != xyes], [
+               AC_RUN_IFELSE([
+                       AC_LANG_PROGRAM([
+                               #include "$LINUX/include/linux/license.h"
+                       ], [
+                               return !license_is_gpl_compatible("$ZFS_META_LICENSE");
+                       ])
+               ], [
+                       AC_DEFINE([ZFS_IS_GPL_COMPATIBLE], [1],
+                           [Define to 1 if GPL-only symbols can be used])
                ], [
-                       return !license_is_gpl_compatible("$ZFS_META_LICENSE");
                ])
-       ], [
-               AC_DEFINE([ZFS_IS_GPL_COMPATIBLE], [1],
-                   [Define to 1 if GPL-only symbols can be used])
-       ], [
        ])
 
        ZFS_AC_KERNEL_CONFIG_DEBUG_LOCK_ALLOC
diff --git a/zfs/config/libtool.m4 b/zfs/config/libtool.m4
new file mode 100644 (file)
index 0000000..d7c043f
--- /dev/null
@@ -0,0 +1,7997 @@
+# 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, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+# 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.
+
+m4_define([_LT_COPYING], [dnl
+#   Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
+#                 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+])
+
+# serial 57 LT_INIT
+
+
+# LT_PREREQ(VERSION)
+# ------------------
+# Complain and exit if this libtool version is less that VERSION.
+m4_defun([LT_PREREQ],
+[m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1,
+       [m4_default([$3],
+                  [m4_fatal([Libtool version $1 or higher is required],
+                            63)])],
+       [$2])])
+
+
+# _LT_CHECK_BUILDDIR
+# ------------------
+# Complain if the absolute build directory name contains unusual characters
+m4_defun([_LT_CHECK_BUILDDIR],
+[case `pwd` in
+  *\ * | *\    *)
+    AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;;
+esac
+])
+
+
+# LT_INIT([OPTIONS])
+# ------------------
+AC_DEFUN([LT_INIT],
+[AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT
+AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
+AC_BEFORE([$0], [LT_LANG])dnl
+AC_BEFORE([$0], [LT_OUTPUT])dnl
+AC_BEFORE([$0], [LTDL_INIT])dnl
+m4_require([_LT_CHECK_BUILDDIR])dnl
+
+dnl Autoconf doesn't catch unexpanded LT_ macros by default:
+m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl
+m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl
+dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4
+dnl unless we require an AC_DEFUNed macro:
+AC_REQUIRE([LTOPTIONS_VERSION])dnl
+AC_REQUIRE([LTSUGAR_VERSION])dnl
+AC_REQUIRE([LTVERSION_VERSION])dnl
+AC_REQUIRE([LTOBSOLETE_VERSION])dnl
+m4_require([_LT_PROG_LTMAIN])dnl
+
+_LT_SHELL_INIT([SHELL=${CONFIG_SHELL-/bin/sh}])
+
+dnl Parse OPTIONS
+_LT_SET_OPTIONS([$0], [$1])
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+AC_SUBST(LIBTOOL)dnl
+
+_LT_SETUP
+
+# Only expand once:
+m4_define([LT_INIT])
+])# LT_INIT
+
+# Old names:
+AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT])
+AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PROG_LIBTOOL], [])
+dnl AC_DEFUN([AM_PROG_LIBTOOL], [])
+
+
+# _LT_CC_BASENAME(CC)
+# -------------------
+# Calculate cc_basename.  Skip known compiler wrappers and cross-prefix.
+m4_defun([_LT_CC_BASENAME],
+[for cc_temp in $1""; do
+  case $cc_temp in
+    compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;;
+    distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+])
+
+
+# _LT_FILEUTILS_DEFAULTS
+# ----------------------
+# It is okay to use these file commands and assume they have been set
+# sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'.
+m4_defun([_LT_FILEUTILS_DEFAULTS],
+[: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+])# _LT_FILEUTILS_DEFAULTS
+
+
+# _LT_SETUP
+# ---------
+m4_defun([_LT_SETUP],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+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
+dnl
+_LT_DECL([], [build_alias], [0], [The build system])dnl
+_LT_DECL([], [build], [0])dnl
+_LT_DECL([], [build_os], [0])dnl
+dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+dnl
+AC_REQUIRE([AC_PROG_LN_S])dnl
+test -z "$LN_S" && LN_S="ln -s"
+_LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl
+dnl
+AC_REQUIRE([LT_CMD_MAX_LEN])dnl
+_LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl
+_LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
+dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
+m4_require([_LT_CMD_RELOAD])dnl
+m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
+m4_require([_LT_CMD_OLD_ARCHIVE])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
+
+_LT_CONFIG_LIBTOOL_INIT([
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+])
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+_LT_CHECK_OBJDIR
+
+m4_require([_LT_TAG_COMPILER])dnl
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+_LT_CC_BASENAME([$compiler])
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    _LT_PATH_MAGIC
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+LT_SUPPORTED_TAG([CC])
+_LT_LANG_C_CONFIG
+_LT_LANG_DEFAULT_CONFIG
+_LT_CONFIG_COMMANDS
+])# _LT_SETUP
+
+
+# _LT_PREPARE_SED_QUOTE_VARS
+# --------------------------
+# Define a few sed substitution that help us do robust quoting.
+m4_defun([_LT_PREPARE_SED_QUOTE_VARS],
+[# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\([["`$\\]]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\([["`\\]]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+])
+
+# _LT_PROG_LTMAIN
+# ---------------
+# Note that this code is called both from `configure', and `config.status'
+# now that we use AC_CONFIG_COMMANDS to generate libtool.  Notably,
+# `config.status' has no value for ac_aux_dir unless we are using Automake,
+# so we pass a copy along to make sure it has a sensible value anyway.
+m4_defun([_LT_PROG_LTMAIN],
+[m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl
+_LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir'])
+ltmain="$ac_aux_dir/ltmain.sh"
+])# _LT_PROG_LTMAIN
+
+
+## ------------------------------------- ##
+## Accumulate code for creating libtool. ##
+## ------------------------------------- ##
+
+# So that we can recreate a full libtool script including additional
+# tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS
+# in macros and then make a single call at the end using the `libtool'
+# label.
+
+
+# _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS])
+# ----------------------------------------
+# Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL_INIT],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_INIT],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_INIT])
+
+
+# _LT_CONFIG_LIBTOOL([COMMANDS])
+# ------------------------------
+# Register COMMANDS to be passed to AC_CONFIG_COMMANDS later.
+m4_define([_LT_CONFIG_LIBTOOL],
+[m4_ifval([$1],
+          [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS],
+                     [$1
+])])])
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS])
+
+
+# _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS])
+# -----------------------------------------------------
+m4_defun([_LT_CONFIG_SAVE_COMMANDS],
+[_LT_CONFIG_LIBTOOL([$1])
+_LT_CONFIG_LIBTOOL_INIT([$2])
+])
+
+
+# _LT_FORMAT_COMMENT([COMMENT])
+# -----------------------------
+# Add leading comment marks to the start of each line, and a trailing
+# full-stop to the whole comment if one is not present already.
+m4_define([_LT_FORMAT_COMMENT],
+[m4_ifval([$1], [
+m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])],
+              [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.])
+)])
+
+
+
+## ------------------------ ##
+## FIXME: Eliminate VARNAME ##
+## ------------------------ ##
+
+
+# _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?])
+# -------------------------------------------------------------------
+# CONFIGNAME is the name given to the value in the libtool script.
+# VARNAME is the (base) name used in the configure script.
+# VALUE may be 0, 1 or 2 for a computed quote escaped value based on
+# VARNAME.  Any other value will be used directly.
+m4_define([_LT_DECL],
+[lt_if_append_uniq([lt_decl_varnames], [$2], [, ],
+    [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name],
+       [m4_ifval([$1], [$1], [$2])])
+    lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3])
+    m4_ifval([$4],
+       [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])])
+    lt_dict_add_subkey([lt_decl_dict], [$2],
+       [tagged?], [m4_ifval([$5], [yes], [no])])])
+])
+
+
+# _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION])
+# --------------------------------------------------------
+m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])])
+
+
+# lt_decl_tag_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_tag_varnames],
+[_lt_decl_filter([tagged?], [yes], $@)])
+
+
+# _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..])
+# ---------------------------------------------------------
+m4_define([_lt_decl_filter],
+[m4_case([$#],
+  [0], [m4_fatal([$0: too few arguments: $#])],
+  [1], [m4_fatal([$0: too few arguments: $#: $1])],
+  [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)],
+  [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)],
+  [lt_dict_filter([lt_decl_dict], $@)])[]dnl
+])
+
+
+# lt_decl_quote_varnames([SEPARATOR], [VARNAME1...])
+# --------------------------------------------------
+m4_define([lt_decl_quote_varnames],
+[_lt_decl_filter([value], [1], $@)])
+
+
+# lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_dquote_varnames],
+[_lt_decl_filter([value], [2], $@)])
+
+
+# lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...])
+# ---------------------------------------------------
+m4_define([lt_decl_varnames_tagged],
+[m4_assert([$# <= 2])dnl
+_$0(m4_quote(m4_default([$1], [[, ]])),
+    m4_ifval([$2], [[$2]], [m4_dquote(lt_decl_tag_varnames)]),
+    m4_split(m4_normalize(m4_quote(_LT_TAGS)), [ ]))])
+m4_define([_lt_decl_varnames_tagged],
+[m4_ifval([$3], [lt_combine([$1], [$2], [_], $3)])])
+
+
+# lt_decl_all_varnames([SEPARATOR], [VARNAME1...])
+# ------------------------------------------------
+m4_define([lt_decl_all_varnames],
+[_$0(m4_quote(m4_default([$1], [[, ]])),
+     m4_if([$2], [],
+          m4_quote(lt_decl_varnames),
+       m4_quote(m4_shift($@))))[]dnl
+])
+m4_define([_lt_decl_all_varnames],
+[lt_join($@, lt_decl_varnames_tagged([$1],
+                       lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl
+])
+
+
+# _LT_CONFIG_STATUS_DECLARE([VARNAME])
+# ------------------------------------
+# Quote a variable value, and forward it to `config.status' so that its
+# declaration there will have the same value as in `configure'.  VARNAME
+# must have a single quote delimited value for this to work.
+m4_define([_LT_CONFIG_STATUS_DECLARE],
+[$1='`$ECHO "$][$1" | $SED "$delay_single_quote_subst"`'])
+
+
+# _LT_CONFIG_STATUS_DECLARATIONS
+# ------------------------------
+# We delimit libtool config variables with single quotes, so when
+# we write them to config.status, we have to be sure to quote all
+# embedded single quotes properly.  In configure, this macro expands
+# each variable declared with _LT_DECL (and _LT_TAGDECL) into:
+#
+#    <var>='`$ECHO "$<var>" | $SED "$delay_single_quote_subst"`'
+m4_defun([_LT_CONFIG_STATUS_DECLARATIONS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames),
+    [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAGS
+# ----------------
+# Output comment and list of tags supported by the script
+m4_defun([_LT_LIBTOOL_TAGS],
+[_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl
+available_tags="_LT_TAGS"dnl
+])
+
+
+# _LT_LIBTOOL_DECLARE(VARNAME, [TAG])
+# -----------------------------------
+# Extract the dictionary values for VARNAME (optionally with TAG) and
+# expand to a commented shell variable setting:
+#
+#    # Some comment about what VAR is for.
+#    visible_name=$lt_internal_name
+m4_define([_LT_LIBTOOL_DECLARE],
+[_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1],
+                                          [description])))[]dnl
+m4_pushdef([_libtool_name],
+    m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl
+m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])),
+    [0], [_libtool_name=[$]$1],
+    [1], [_libtool_name=$lt_[]$1],
+    [2], [_libtool_name=$lt_[]$1],
+    [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl
+m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl
+])
+
+
+# _LT_LIBTOOL_CONFIG_VARS
+# -----------------------
+# Produce commented declarations of non-tagged libtool config variables
+# suitable for insertion in the LIBTOOL CONFIG section of the `libtool'
+# script.  Tagged libtool config variables (even for the LIBTOOL CONFIG
+# section) are produced by _LT_LIBTOOL_TAG_VARS.
+m4_defun([_LT_LIBTOOL_CONFIG_VARS],
+[m4_foreach([_lt_var],
+    m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])])
+
+
+# _LT_LIBTOOL_TAG_VARS(TAG)
+# -------------------------
+m4_define([_LT_LIBTOOL_TAG_VARS],
+[m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames),
+    [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])])
+
+
+# _LT_TAGVAR(VARNAME, [TAGNAME])
+# ------------------------------
+m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])])
+
+
+# _LT_CONFIG_COMMANDS
+# -------------------
+# Send accumulated output to $CONFIG_STATUS.  Thanks to the lists of
+# variables for single and double quote escaping we saved from calls
+# to _LT_DECL, we can put quote escaped variables declarations
+# into `config.status', and then the shell code to quote escape them in
+# for loops in `config.status'.  Finally, any additional code accumulated
+# from calls to _LT_CONFIG_LIBTOOL_INIT is expanded.
+m4_defun([_LT_CONFIG_COMMANDS],
+[AC_PROVIDE_IFELSE([LT_OUTPUT],
+       dnl If the libtool generation code has been placed in $CONFIG_LT,
+       dnl instead of duplicating it all over again into config.status,
+       dnl then we will have config.status run $CONFIG_LT later, so it
+       dnl needs to know what name is stored there:
+        [AC_CONFIG_COMMANDS([libtool],
+            [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])],
+    dnl If the libtool generation code is destined for config.status,
+    dnl expand the accumulated commands and init code now:
+    [AC_CONFIG_COMMANDS([libtool],
+        [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])])
+])#_LT_CONFIG_COMMANDS
+
+
+# Initialize.
+m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT],
+[
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+_LT_CONFIG_STATUS_DECLARATIONS
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$[]1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_quote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in lt_decl_all_varnames([[ \
+]], lt_decl_dquote_varnames); do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[[\\\\\\\`\\"\\\$]]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+_LT_OUTPUT_LIBTOOL_INIT
+])
+
+# _LT_GENERATED_FILE_INIT(FILE, [COMMENT])
+# ------------------------------------
+# Generate a child script FILE with all initialization necessary to
+# reuse the environment learned by the parent script, and make the
+# file executable.  If COMMENT is supplied, it is inserted after the
+# `#!' sequence but before initialization text begins.  After this
+# macro, additional text can be appended to FILE to form the body of
+# the child script.  The macro ends with non-zero status if the
+# file could not be fully written (such as if the disk is full).
+m4_ifdef([AS_INIT_GENERATED],
+[m4_defun([_LT_GENERATED_FILE_INIT],[AS_INIT_GENERATED($@)])],
+[m4_defun([_LT_GENERATED_FILE_INIT],
+[m4_require([AS_PREPARE])]dnl
+[m4_pushdef([AS_MESSAGE_LOG_FD])]dnl
+[lt_write_fail=0
+cat >$1 <<_ASEOF || lt_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+$2
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$1 <<\_ASEOF || lt_write_fail=1
+AS_SHELL_SANITIZE
+_AS_PREPARE
+exec AS_MESSAGE_FD>&1
+_ASEOF
+test $lt_write_fail = 0 && chmod +x $1[]dnl
+m4_popdef([AS_MESSAGE_LOG_FD])])])# _LT_GENERATED_FILE_INIT
+
+# LT_OUTPUT
+# ---------
+# This macro allows early generation of the libtool script (before
+# AC_OUTPUT is called), incase it is used in configure for compilation
+# tests.
+AC_DEFUN([LT_OUTPUT],
+[: ${CONFIG_LT=./config.lt}
+AC_MSG_NOTICE([creating $CONFIG_LT])
+_LT_GENERATED_FILE_INIT(["$CONFIG_LT"],
+[# Run this file to recreate a libtool stub with the current configuration.])
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+lt_cl_silent=false
+exec AS_MESSAGE_LOG_FD>>config.log
+{
+  echo
+  AS_BOX([Running $as_me.])
+} >&AS_MESSAGE_LOG_FD
+
+lt_cl_help="\
+\`$as_me' creates a local libtool stub from the current configuration,
+for use in further configure time tests before the real libtool is
+generated.
+
+Usage: $[0] [[OPTIONS]]
+
+  -h, --help      print this help, then exit
+  -V, --version   print version number, then exit
+  -q, --quiet     do not print progress messages
+  -d, --debug     don't remove temporary files
+
+Report bugs to <bug-libtool@gnu.org>."
+
+lt_cl_version="\
+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) 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."
+
+while test $[#] != 0
+do
+  case $[1] in
+    --version | --v* | -V )
+      echo "$lt_cl_version"; exit 0 ;;
+    --help | --h* | -h )
+      echo "$lt_cl_help"; exit 0 ;;
+    --debug | --d* | -d )
+      debug=: ;;
+    --quiet | --q* | --silent | --s* | -q )
+      lt_cl_silent=: ;;
+
+    -*) AC_MSG_ERROR([unrecognized option: $[1]
+Try \`$[0] --help' for more information.]) ;;
+
+    *) AC_MSG_ERROR([unrecognized argument: $[1]
+Try \`$[0] --help' for more information.]) ;;
+  esac
+  shift
+done
+
+if $lt_cl_silent; then
+  exec AS_MESSAGE_FD>/dev/null
+fi
+_LTEOF
+
+cat >>"$CONFIG_LT" <<_LTEOF
+_LT_OUTPUT_LIBTOOL_COMMANDS_INIT
+_LTEOF
+
+cat >>"$CONFIG_LT" <<\_LTEOF
+AC_MSG_NOTICE([creating $ofile])
+_LT_OUTPUT_LIBTOOL_COMMANDS
+AS_EXIT(0)
+_LTEOF
+chmod +x "$CONFIG_LT"
+
+# configure is writing to config.log, but config.lt does its own redirection,
+# appending to config.log, which fails on DOS, as config.log is still kept
+# open by configure.  Here we exec the FD to /dev/null, effectively closing
+# config.log, so it can be properly (re)opened and appended to by config.lt.
+lt_cl_success=:
+test "$silent" = yes &&
+  lt_config_lt_args="$lt_config_lt_args --quiet"
+exec AS_MESSAGE_LOG_FD>/dev/null
+$SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false
+exec AS_MESSAGE_LOG_FD>>config.log
+$lt_cl_success || AS_EXIT(1)
+])# LT_OUTPUT
+
+
+# _LT_CONFIG(TAG)
+# ---------------
+# If TAG is the built-in tag, create an initial libtool script with a
+# default configuration from the untagged config vars.  Otherwise add code
+# to config.status for appending the configuration named by TAG from the
+# matching tagged config vars.
+m4_defun([_LT_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_CONFIG_SAVE_COMMANDS([
+  m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl
+  m4_if(_LT_TAG, [C], [
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# NOTE: Changes made to this file will be lost: look at ltmain.sh.
+#
+_LT_COPYING
+_LT_LIBTOOL_TAGS
+
+# ### BEGIN LIBTOOL CONFIG
+_LT_LIBTOOL_CONFIG_VARS
+_LT_LIBTOOL_TAG_VARS
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+  _LT_PROG_LTMAIN
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  _LT_PROG_REPLACE_SHELLFNS
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+],
+[cat <<_LT_EOF >> "$ofile"
+
+dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded
+dnl in a comment (ie after a #).
+# ### BEGIN LIBTOOL TAG CONFIG: $1
+_LT_LIBTOOL_TAG_VARS(_LT_TAG)
+# ### END LIBTOOL TAG CONFIG: $1
+_LT_EOF
+])dnl /m4_if
+],
+[m4_if([$1], [], [
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'], [])
+])dnl /_LT_CONFIG_SAVE_COMMANDS
+])# _LT_CONFIG
+
+
+# LT_SUPPORTED_TAG(TAG)
+# ---------------------
+# Trace this macro to discover what tags are supported by the libtool
+# --tag option, using:
+#    autoconf --trace 'LT_SUPPORTED_TAG:$1'
+AC_DEFUN([LT_SUPPORTED_TAG], [])
+
+
+# C support is built-in for now
+m4_define([_LT_LANG_C_enabled], [])
+m4_define([_LT_TAGS], [])
+
+
+# LT_LANG(LANG)
+# -------------
+# Enable libtool support for the given language if not already enabled.
+AC_DEFUN([LT_LANG],
+[AC_BEFORE([$0], [LT_OUTPUT])dnl
+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)],
+  [Windows Resource],  [_LT_LANG(RC)],
+  [m4_ifdef([_LT_LANG_]$1[_CONFIG],
+    [_LT_LANG($1)],
+    [m4_fatal([$0: unsupported language: "$1"])])])dnl
+])# LT_LANG
+
+
+# _LT_LANG(LANGNAME)
+# ------------------
+m4_defun([_LT_LANG],
+[m4_ifdef([_LT_LANG_]$1[_enabled], [],
+  [LT_SUPPORTED_TAG([$1])dnl
+  m4_append([_LT_TAGS], [$1 ])dnl
+  m4_define([_LT_LANG_]$1[_enabled], [])dnl
+  _LT_LANG_$1_CONFIG($1)])dnl
+])# _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],
+[AC_PROVIDE_IFELSE([AC_PROG_CXX],
+  [LT_LANG(CXX)],
+  [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_F77],
+  [LT_LANG(F77)],
+  [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])])
+
+AC_PROVIDE_IFELSE([AC_PROG_FC],
+  [LT_LANG(FC)],
+  [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])])
+
+dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal
+dnl pulling things in needlessly.
+AC_PROVIDE_IFELSE([AC_PROG_GCJ],
+  [LT_LANG(GCJ)],
+  [AC_PROVIDE_IFELSE([A][M_PROG_GCJ],
+    [LT_LANG(GCJ)],
+    [AC_PROVIDE_IFELSE([LT_PROG_GCJ],
+      [LT_LANG(GCJ)],
+      [m4_ifdef([AC_PROG_GCJ],
+       [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])])
+       m4_ifdef([A][M_PROG_GCJ],
+       [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(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)])])
+])# _LT_LANG_DEFAULT_CONFIG
+
+# Obsolete macros:
+AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)])
+AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)])
+AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)])
+AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)])
+AU_DEFUN([AC_LIBTOOL_RC], [LT_LANG(Windows Resource)])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_CXX], [])
+dnl AC_DEFUN([AC_LIBTOOL_F77], [])
+dnl AC_DEFUN([AC_LIBTOOL_FC], [])
+dnl AC_DEFUN([AC_LIBTOOL_GCJ], [])
+dnl AC_DEFUN([AC_LIBTOOL_RC], [])
+
+
+# _LT_TAG_COMPILER
+# ----------------
+m4_defun([_LT_TAG_COMPILER],
+[AC_REQUIRE([AC_PROG_CC])dnl
+
+_LT_DECL([LTCC], [CC], [1], [A C compiler])dnl
+_LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl
+_LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl
+_LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+])# _LT_TAG_COMPILER
+
+
+# _LT_COMPILER_BOILERPLATE
+# ------------------------
+# Check for compiler boilerplate output or warnings with
+# the simple compiler test code.
+m4_defun([_LT_COMPILER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+])# _LT_COMPILER_BOILERPLATE
+
+
+# _LT_LINKER_BOILERPLATE
+# ----------------------
+# Check for linker boilerplate output or warnings with
+# the simple link test code.
+m4_defun([_LT_LINKER_BOILERPLATE],
+[m4_require([_LT_DECL_SED])dnl
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+])# _LT_LINKER_BOILERPLATE
+
+# _LT_REQUIRED_DARWIN_CHECKS
+# -------------------------
+m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
+  case $host_os in
+    rhapsody* | darwin*)
+    AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:])
+    AC_CHECK_TOOL([NMEDIT], [nmedit], [:])
+    AC_CHECK_TOOL([LIPO], [lipo], [:])
+    AC_CHECK_TOOL([OTOOL], [otool], [:])
+    AC_CHECK_TOOL([OTOOL64], [otool64], [:])
+    _LT_DECL([], [DSYMUTIL], [1],
+      [Tool to manipulate archived DWARF debug symbol files on Mac OS X])
+    _LT_DECL([], [NMEDIT], [1],
+      [Tool to change global to local symbols on Mac OS X])
+    _LT_DECL([], [LIPO], [1],
+      [Tool to manipulate fat objects and archives on Mac OS X])
+    _LT_DECL([], [OTOOL], [1],
+      [ldd/readelf like tool for Mach-O binaries on Mac OS X])
+    _LT_DECL([], [OTOOL64], [1],
+      [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4])
+
+    AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod],
+      [lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # 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
+       fi
+       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
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+       [lt_cv_ld_exported_symbols_list=yes],
+       [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
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&AS_MESSAGE_LOG_FD
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&AS_MESSAGE_LOG_FD
+      echo "$AR cru libconftest.a conftest.o" >&AS_MESSAGE_LOG_FD
+      $AR cru libconftest.a conftest.o 2>&AS_MESSAGE_LOG_FD
+      echo "$RANLIB libconftest.a" >&AS_MESSAGE_LOG_FD
+      $RANLIB libconftest.a 2>&AS_MESSAGE_LOG_FD
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_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 -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
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+    ])
+    case $host_os in
+    rhapsody* | darwin1.[[012]])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[[91]]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[[012]]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+])
+
+
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
+# Checks for linker and compiler features on darwin
+m4_defun([_LT_DARWIN_LINKER_FEATURES],
+[
+  m4_require([_LT_REQUIRED_DARWIN_CHECKS])
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_automatic, $1)=yes
+  _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
+  _LT_TAGVAR(link_all_deplibs, $1)=yes
+  _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+    m4_if([$1], [CXX],
+[   if test "$lt_cv_apple_cc_single_mod" != "yes"; then
+      _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}"
+      _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}"
+    fi
+],[])
+  else
+  _LT_TAGVAR(ld_shlibs, $1)=no
+  fi
+])
+
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
+# Links a minimal program and checks the executable
+# for the system default hardcoded library path. In most cases,
+# this is /usr/lib:/lib, but when the MPI compilers are used
+# the location of the communication and MPI libs are included too.
+# If we don't find anything, use the default library path according
+# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
+m4_defun([_LT_SYS_MODULE_PATH_AIX],
+[m4_require([_LT_DECL_SED])dnl
+if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+  [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+  lt_aix_libpath_sed='[
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }]'
+  _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi],[])
+  if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+    _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+  fi
+  ])
+  aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
+])# _LT_SYS_MODULE_PATH_AIX
+
+
+# _LT_SHELL_INIT(ARG)
+# -------------------
+m4_define([_LT_SHELL_INIT],
+[m4_divert_text([M4SH-INIT], [$1
+])])# _LT_SHELL_INIT
+
+
+
+# _LT_PROG_ECHO_BACKSLASH
+# -----------------------
+# Find how we can fake an echo command that does not interpret backslash.
+# In particular, with Autoconf 2.60 or later we add some code to the start
+# of the generated configure script which will find a shell with a builtin
+# printf (which we can use as an echo command).
+m4_defun([_LT_PROG_ECHO_BACKSLASH],
+[ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+AC_MSG_CHECKING([how to print strings])
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$[]1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*" 
+}
+
+case "$ECHO" in
+  printf*) AC_MSG_RESULT([printf]) ;;
+  print*) AC_MSG_RESULT([print -r]) ;;
+  *) AC_MSG_RESULT([cat]) ;;
+esac
+
+m4_ifdef([_AS_DETECT_SUGGESTED],
+[_AS_DETECT_SUGGESTED([
+  test -n "${ZSH_VERSION+set}${BASH_VERSION+set}" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+    ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test "X`printf %s $ECHO`" = "X$ECHO" \
+      || test "X`print -r -- $ECHO`" = "X$ECHO" )])])
+
+_LT_DECL([], [SHELL], [1], [Shell to use when invoking shell scripts])
+_LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
+])# _LT_PROG_ECHO_BACKSLASH
+
+
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[  --with-sysroot[=DIR] Search for dependent libraries within DIR
+                        (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted.  We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   AC_MSG_RESULT([${with_sysroot}])
+   AC_MSG_ERROR([The sysroot must be an absolute path.])
+   ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
+# _LT_ENABLE_LOCK
+# ---------------
+m4_defun([_LT_ENABLE_LOCK],
+[AC_ARG_ENABLE([libtool-lock],
+  [AS_HELP_STRING([--disable-libtool-lock],
+    [avoid locking (might break parallel builds)])])
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # 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.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '[#]line '$LINENO' "configure"' > conftest.$ac_ext
+  if AC_TRY_EVAL(ac_compile); then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+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
+  if AC_TRY_EVAL(ac_compile); then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         powerpcle-*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
+    [AC_LANG_PUSH(C)
+     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],[[]])],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])
+     AC_LANG_POP])
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*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*)
+        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"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+])# _LT_ENABLE_LOCK
+
+
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+  [lt_cv_ar_at_file=no
+   AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+     [echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+      AC_TRY_EVAL([lt_ar_try])
+      if test "$ac_status" -eq 0; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       AC_TRY_EVAL([lt_ar_try])
+       if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+     ])
+  ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+  [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
+# _LT_CMD_OLD_ARCHIVE
+# -------------------
+m4_defun([_LT_CMD_OLD_ARCHIVE],
+[_LT_PROG_AR
+
+AC_CHECK_TOOL(STRIP, strip, :)
+test -z "$STRIP" && STRIP=:
+_LT_DECL([], [STRIP], [1], [A symbol stripping program])
+
+AC_CHECK_TOOL(RANLIB, ranlib, :)
+test -z "$RANLIB" && RANLIB=:
+_LT_DECL([], [RANLIB], [1],
+    [Commands used to install an old-style archive])
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+_LT_DECL([], [old_postinstall_cmds], [2])
+_LT_DECL([], [old_postuninstall_cmds], [2])
+_LT_TAGDECL([], [old_archive_cmds], [2],
+    [Commands used to build an old-style archive])
+_LT_DECL([], [lock_old_archive_extraction], [0],
+    [Whether to use a lock for old archive extraction])
+])# _LT_CMD_OLD_ARCHIVE
+
+
+# _LT_COMPILER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#              [OUTPUT-FILE], [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------------------
+# Check whether the given compiler option works
+AC_DEFUN([_LT_COMPILER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   m4_if([$4], , [ac_outfile=conftest.$ac_objext], [ac_outfile=$4])
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$3"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       $2=yes
+     fi
+   fi
+   $RM conftest*
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$5], , :, [$5])
+else
+    m4_if([$6], , :, [$6])
+fi
+])# _LT_COMPILER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_COMPILER_OPTION], [_LT_COMPILER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_COMPILER_OPTION], [])
+
+
+# _LT_LINKER_OPTION(MESSAGE, VARIABLE-NAME, FLAGS,
+#                  [ACTION-SUCCESS], [ACTION-FAILURE])
+# ----------------------------------------------------
+# Check whether the given linker option works
+AC_DEFUN([_LT_LINKER_OPTION],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_SED])dnl
+AC_CACHE_CHECK([$1], [$2],
+  [$2=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $3"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&AS_MESSAGE_LOG_FD
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         $2=yes
+       fi
+     else
+       $2=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+])
+
+if test x"[$]$2" = xyes; then
+    m4_if([$4], , :, [$4])
+else
+    m4_if([$5], , :, [$5])
+fi
+])# _LT_LINKER_OPTION
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_LINKER_OPTION], [_LT_LINKER_OPTION])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_LINKER_OPTION], [])
+
+
+# LT_CMD_MAX_LEN
+#---------------
+AC_DEFUN([LT_CMD_MAX_LEN],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+# find the maximum length of command line arguments
+AC_MSG_CHECKING([the maximum length of command line arguments])
+AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
+  i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    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
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[[        ]]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # 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"`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+])
+if test -n $lt_cv_sys_max_cmd_len ; then
+  AC_MSG_RESULT($lt_cv_sys_max_cmd_len)
+else
+  AC_MSG_RESULT(none)
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+_LT_DECL([], [max_cmd_len], [0],
+    [What is the maximum length of a command?])
+])# LT_CMD_MAX_LEN
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_SYS_MAX_CMD_LEN], [LT_CMD_MAX_LEN])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_SYS_MAX_CMD_LEN], [])
+
+
+# _LT_HEADER_DLFCN
+# ----------------
+m4_defun([_LT_HEADER_DLFCN],
+[AC_CHECK_HEADERS([dlfcn.h], [], [], [AC_INCLUDES_DEFAULT])dnl
+])# _LT_HEADER_DLFCN
+
+
+# _LT_TRY_DLOPEN_SELF (ACTION-IF-TRUE, ACTION-IF-TRUE-W-USCORE,
+#                      ACTION-IF-FALSE, ACTION-IF-CROSS-COMPILING)
+# ----------------------------------------------------------------
+m4_defun([_LT_TRY_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "$cross_compiling" = yes; then :
+  [$4]
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+[#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}]
+_LT_EOF
+  if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&AS_MESSAGE_LOG_FD 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) $1 ;;
+      x$lt_dlneed_uscore) $2 ;;
+      x$lt_dlunknown|x*) $3 ;;
+    esac
+  else :
+    # compilation failed
+    $3
+  fi
+fi
+rm -fr conftest*
+])# _LT_TRY_DLOPEN_SELF
+
+
+# LT_SYS_DLOPEN_SELF
+# ------------------
+AC_DEFUN([LT_SYS_DLOPEN_SELF],
+[m4_require([_LT_HEADER_DLFCN])dnl
+if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],[
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ])
+    ;;
+
+  *)
+    AC_CHECK_FUNC([shl_load],
+         [lt_cv_dlopen="shl_load"],
+      [AC_CHECK_LIB([dld], [shl_load],
+           [lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"],
+       [AC_CHECK_FUNC([dlopen],
+             [lt_cv_dlopen="dlopen"],
+         [AC_CHECK_LIB([dl], [dlopen],
+               [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"],
+           [AC_CHECK_LIB([svld], [dlopen],
+                 [lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"],
+             [AC_CHECK_LIB([dld], [dld_link],
+                   [lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"])
+             ])
+           ])
+         ])
+       ])
+      ])
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    AC_CACHE_CHECK([whether a program can dlopen itself],
+         lt_cv_dlopen_self, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self=yes, lt_cv_dlopen_self=yes,
+           lt_cv_dlopen_self=no, lt_cv_dlopen_self=cross)
+    ])
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      AC_CACHE_CHECK([whether a statically linked program can dlopen itself],
+         lt_cv_dlopen_self_static, [dnl
+         _LT_TRY_DLOPEN_SELF(
+           lt_cv_dlopen_self_static=yes, lt_cv_dlopen_self_static=yes,
+           lt_cv_dlopen_self_static=no,  lt_cv_dlopen_self_static=cross)
+      ])
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+_LT_DECL([dlopen_support], [enable_dlopen], [0],
+        [Whether dlopen is supported])
+_LT_DECL([dlopen_self], [enable_dlopen_self], [0],
+        [Whether dlopen of programs is supported])
+_LT_DECL([dlopen_self_static], [enable_dlopen_self_static], [0],
+        [Whether dlopen of statically linked programs is supported])
+])# LT_SYS_DLOPEN_SELF
+
+# Old name:
+AU_ALIAS([AC_LIBTOOL_DLOPEN_SELF], [LT_SYS_DLOPEN_SELF])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN_SELF], [])
+
+
+# _LT_COMPILER_C_O([TAGNAME])
+# ---------------------------
+# Check to see if options -c and -o are simultaneously supported by compiler.
+# This macro does not hard code the compiler like AC_PROG_CC_C_O.
+m4_defun([_LT_COMPILER_C_O],
+[m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_CACHE_CHECK([if $compiler supports -c -o file.$ac_objext],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [[^ ]]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&AS_MESSAGE_LOG_FD)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&AS_MESSAGE_LOG_FD
+   echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       _LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+     fi
+   fi
+   chmod u+w . 2>&AS_MESSAGE_LOG_FD
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+])
+_LT_TAGDECL([compiler_c_o], [lt_cv_prog_compiler_c_o], [1],
+       [Does compiler simultaneously support -c and -o options?])
+])# _LT_COMPILER_C_O
+
+
+# _LT_COMPILER_FILE_LOCKS([TAGNAME])
+# ----------------------------------
+# Check to see if we can do hard links to lock some files if needed
+m4_defun([_LT_COMPILER_FILE_LOCKS],
+[m4_require([_LT_ENABLE_LOCK])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+_LT_COMPILER_C_O([$1])
+
+hard_links="nottested"
+if test "$_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  AC_MSG_CHECKING([if we can lock with hard links])
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  AC_MSG_RESULT([$hard_links])
+  if test "$hard_links" = no; then
+    AC_MSG_WARN([`$CC' does not support `-c -o', so `make -j' may be unsafe])
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+_LT_DECL([], [need_locks], [1], [Must we lock files when doing compilation?])
+])# _LT_COMPILER_FILE_LOCKS
+
+
+# _LT_CHECK_OBJDIR
+# ----------------
+m4_defun([_LT_CHECK_OBJDIR],
+[AC_CACHE_CHECK([for objdir], [lt_cv_objdir],
+[rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null])
+objdir=$lt_cv_objdir
+_LT_DECL([], [objdir], [0],
+         [The name of the directory that contains temporary libtool files])dnl
+m4_pattern_allow([LT_OBJDIR])dnl
+AC_DEFINE_UNQUOTED(LT_OBJDIR, "$lt_cv_objdir/",
+  [Define to the sub-directory in which libtool stores uninstalled libraries.])
+])# _LT_CHECK_OBJDIR
+
+
+# _LT_LINKER_HARDCODE_LIBPATH([TAGNAME])
+# --------------------------------------
+# Check hardcoding attributes.
+m4_defun([_LT_LINKER_HARDCODE_LIBPATH],
+[AC_MSG_CHECKING([how to hardcode library paths into programs])
+_LT_TAGVAR(hardcode_action, $1)=
+if test -n "$_LT_TAGVAR(hardcode_libdir_flag_spec, $1)" ||
+   test -n "$_LT_TAGVAR(runpath_var, $1)" ||
+   test "X$_LT_TAGVAR(hardcode_automatic, $1)" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$_LT_TAGVAR(hardcode_direct, $1)" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, $1)" != no &&
+     test "$_LT_TAGVAR(hardcode_minus_L, $1)" != no; then
+    # Linking always hardcodes the temporary library directory.
+    _LT_TAGVAR(hardcode_action, $1)=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    _LT_TAGVAR(hardcode_action, $1)=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  _LT_TAGVAR(hardcode_action, $1)=unsupported
+fi
+AC_MSG_RESULT([$_LT_TAGVAR(hardcode_action, $1)])
+
+if test "$_LT_TAGVAR(hardcode_action, $1)" = relink ||
+   test "$_LT_TAGVAR(inherit_rpath, $1)" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+_LT_TAGDECL([], [hardcode_action], [0],
+    [How to hardcode a shared library path into an executable])
+])# _LT_LINKER_HARDCODE_LIBPATH
+
+
+# _LT_CMD_STRIPLIB
+# ----------------
+m4_defun([_LT_CMD_STRIPLIB],
+[m4_require([_LT_DECL_EGREP])
+striplib=
+old_striplib=
+AC_MSG_CHECKING([whether stripping libraries is possible])
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  AC_MSG_RESULT([yes])
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      AC_MSG_RESULT([yes])
+    else
+      AC_MSG_RESULT([no])
+    fi
+    ;;
+  *)
+    AC_MSG_RESULT([no])
+    ;;
+  esac
+fi
+_LT_DECL([], [old_striplib], [1], [Commands to strip libraries])
+_LT_DECL([], [striplib], [1])
+])# _LT_CMD_STRIPLIB
+
+
+# _LT_SYS_DYNAMIC_LINKER([TAG])
+# -----------------------------
+# PORTME Fill in your ld.so characteristics
+m4_defun([_LT_SYS_DYNAMIC_LINKER],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_OBJDUMP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+AC_MSG_CHECKING([dynamic linker characteristics])
+m4_if([$1],
+       [], [
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([[A-Za-z]]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[[lt_foo]]++; }
+  if (lt_freq[[lt_foo]] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([[A-Za-z]]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi])
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  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
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[[4-9]]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[[01]] | aix4.[[01]].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([[^/]]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[[45]]*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+m4_if([$1], [],[
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"])
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+m4_if([$1], [],[
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"])
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  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
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[[23]].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[[01]]* | freebsdelf3.[[01]]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[[2-9]]* | freebsdelf3.[[2-9]]* | \
+  freebsd4.[[0-5]] | freebsdelf4.[[0-5]] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  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"
+  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=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[[3-9]]*)
+  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'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux # correct to gnu/linux during the next big refactor
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  AC_CACHE_VAL([lt_cv_shlibpath_overrides_runpath],
+    [lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$_LT_TAGVAR(lt_prog_compiler_wl, $1)\"; \
+        LDFLAGS=\"\$LDFLAGS $_LT_TAGVAR(hardcode_libdir_flag_spec, $1)\""
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])],
+      [AS_IF([ ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null],
+        [lt_cv_shlibpath_overrides_runpath=yes])])
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+    ])
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \[$]2)); skip = 1; } { if (!skip) print \[$]0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[  ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsdelf*-gnu)
+  version_type=linux
+  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
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  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
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  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
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[[89]] | openbsd2.[[89]].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  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=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  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
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    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
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/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}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  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
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+AC_MSG_RESULT([$dynamic_linker])
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+_LT_DECL([], [variables_saved_for_relink], [1],
+    [Variables whose values should be saved in libtool wrapper scripts and
+    restored at link time])
+_LT_DECL([], [need_lib_prefix], [0],
+    [Do we need the "lib" prefix for modules?])
+_LT_DECL([], [need_version], [0], [Do we need a version for libraries?])
+_LT_DECL([], [version_type], [0], [Library versioning type])
+_LT_DECL([], [runpath_var], [0],  [Shared library runtime path variable])
+_LT_DECL([], [shlibpath_var], [0],[Shared library path variable])
+_LT_DECL([], [shlibpath_overrides_runpath], [0],
+    [Is shlibpath searched before the hard-coded library search path?])
+_LT_DECL([], [libname_spec], [1], [Format of library name prefix])
+_LT_DECL([], [library_names_spec], [1],
+    [[List of archive names.  First name is the real one, the rest are links.
+    The last name is the one that the linker finds with -lNAME]])
+_LT_DECL([], [soname_spec], [1],
+    [[The coded name of the library, if different from the real name]])
+_LT_DECL([], [install_override_mode], [1],
+    [Permission mode override for installation of shared libraries])
+_LT_DECL([], [postinstall_cmds], [2],
+    [Command to use after installation of a shared archive])
+_LT_DECL([], [postuninstall_cmds], [2],
+    [Command to use after uninstallation of a shared archive])
+_LT_DECL([], [finish_cmds], [2],
+    [Commands used to finish a libtool library installation in a directory])
+_LT_DECL([], [finish_eval], [1],
+    [[As "finish_cmds", except a single script fragment to be evaled but
+    not shown]])
+_LT_DECL([], [hardcode_into_libs], [0],
+    [Whether we should hardcode library paths into libraries])
+_LT_DECL([], [sys_lib_search_path_spec], [2],
+    [Compile-time system search path for libraries])
+_LT_DECL([], [sys_lib_dlsearch_path_spec], [2],
+    [Run-time system search path for libraries])
+])# _LT_SYS_DYNAMIC_LINKER
+
+
+# _LT_PATH_TOOL_PREFIX(TOOL)
+# --------------------------
+# find a file program which can recognize shared library
+AC_DEFUN([_LT_PATH_TOOL_PREFIX],
+[m4_require([_LT_DECL_EGREP])dnl
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(lt_cv_path_MAGIC_CMD,
+[case $MAGIC_CMD in
+[[\\/*] |  ?:[\\/]*])
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+dnl $ac_dummy forces splitting on constant user-supplied paths.
+dnl POSIX.2 word splitting is done only on the output of word expansions,
+dnl not every word.  This closes a longstanding sh security hole.
+  ac_dummy="m4_if([$2], , $PATH, [$2])"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/$1; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/$1"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac])
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  AC_MSG_RESULT($MAGIC_CMD)
+else
+  AC_MSG_RESULT(no)
+fi
+_LT_DECL([], [MAGIC_CMD], [0],
+        [Used to examine libraries when file_magic_cmd begins with "file"])dnl
+])# _LT_PATH_TOOL_PREFIX
+
+# Old name:
+AU_ALIAS([AC_PATH_TOOL_PREFIX], [_LT_PATH_TOOL_PREFIX])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_PATH_TOOL_PREFIX], [])
+
+
+# _LT_PATH_MAGIC
+# --------------
+# find a file program which can recognize a shared library
+m4_defun([_LT_PATH_MAGIC],
+[_LT_PATH_TOOL_PREFIX(${ac_tool_prefix}file, /usr/bin$PATH_SEPARATOR$PATH)
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    _LT_PATH_TOOL_PREFIX(file, /usr/bin$PATH_SEPARATOR$PATH)
+  else
+    MAGIC_CMD=:
+  fi
+fi
+])# _LT_PATH_MAGIC
+
+
+# LT_PATH_LD
+# ----------
+# find the pathname to the GNU or non-GNU linker
+AC_DEFUN([LT_PATH_LD],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PROG_ECHO_BACKSLASH])dnl
+
+AC_ARG_WITH([gnu-ld],
+    [AS_HELP_STRING([--with-gnu-ld],
+       [assume the C compiler uses GNU ld @<:@default=no@:>@])],
+    [test "$withval" = no || with_gnu_ld=yes],
+    [with_gnu_ld=no])dnl
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  AC_MSG_CHECKING([for ld used by $CC])
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [[\\/]]* | ?:[[\\/]]*)
+      re_direlt='/[[^/]][[^/]]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  AC_MSG_CHECKING([for GNU ld])
+else
+  AC_MSG_CHECKING([for non-GNU ld])
+fi
+AC_CACHE_VAL(lt_cv_path_LD,
+[if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi])
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  AC_MSG_RESULT($LD)
+else
+  AC_MSG_RESULT(no)
+fi
+test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
+_LT_PATH_LD_GNU
+AC_SUBST([LD])
+
+_LT_TAGDECL([], [LD], [1], [The linker used to build libraries])
+])# LT_PATH_LD
+
+# Old names:
+AU_ALIAS([AM_PROG_LD], [LT_PATH_LD])
+AU_ALIAS([AC_PROG_LD], [LT_PATH_LD])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_LD], [])
+dnl AC_DEFUN([AC_PROG_LD], [])
+
+
+# _LT_PATH_LD_GNU
+#- --------------
+m4_defun([_LT_PATH_LD_GNU],
+[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], lt_cv_prog_gnu_ld,
+[# I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac])
+with_gnu_ld=$lt_cv_prog_gnu_ld
+])# _LT_PATH_LD_GNU
+
+
+# _LT_CMD_RELOAD
+# --------------
+# find reload flag for linker
+#   -- PORTME Some linkers may need a different reload flag.
+m4_defun([_LT_CMD_RELOAD],
+[AC_CACHE_CHECK([for $LD option to reload object files],
+  lt_cv_ld_reload_flag,
+  [lt_cv_ld_reload_flag='-r'])
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+_LT_TAGDECL([], [reload_flag], [1], [How to create reloadable object files])dnl
+_LT_TAGDECL([], [reload_cmds], [2])dnl
+])# _LT_CMD_RELOAD
+
+
+# _LT_CHECK_MAGIC_METHOD
+# ----------------------
+# how to check for library dependencies
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_MAGIC_METHOD],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+AC_CACHE_CHECK([how to recognize dependent libraries],
+lt_cv_deplibs_check_method,
+[lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[[4-9]]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[[45]]*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[[3-9]]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|ELF-[[0-9]][[0-9]]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    [lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]']
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[[0-9]][[0-9]][[0-9]]|PA-RISC[[0-9]]\.[[0-9]]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[[3-9]]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[[^/]]+(\.so\.[[0-9]]+\.[[0-9]]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[ML]]SB (shared object|dynamic lib) M[[0-9]][[0-9]]* Version [[0-9]]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [[0-9]][[0-9]]*-bit [[LM]]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+_LT_DECL([], [deplibs_check_method], [1],
+    [Method to check whether dependent libraries are shared objects])
+_LT_DECL([], [file_magic_cmd], [1],
+    [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+    [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+    [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
+])# _LT_CHECK_MAGIC_METHOD
+
+
+# LT_PATH_NM
+# ----------
+# find the pathname to a BSD- or MS-compatible name lister
+AC_DEFUN([LT_PATH_NM],
+[AC_REQUIRE([AC_PROG_CC])dnl
+AC_CACHE_CHECK([for BSD- or MS-compatible name lister (nm)], lt_cv_path_NM,
+[if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi])
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    AC_CHECK_TOOLS(DUMPBIN, [dumpbin "link -dump"], :)
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+  AC_SUBST([DUMPBIN])
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+AC_SUBST([NM])
+_LT_DECL([], [NM], [1], [A BSD- or MS-compatible name lister])dnl
+
+AC_CACHE_CHECK([the name lister ($NM) interface], [lt_cv_nm_interface],
+  [lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&AS_MESSAGE_LOG_FD)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  (eval echo "\"\$as_me:$LINENO: output\"" >&AS_MESSAGE_LOG_FD)
+  cat conftest.out >&AS_MESSAGE_LOG_FD
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*])
+])# LT_PATH_NM
+
+# Old names:
+AU_ALIAS([AM_PROG_NM], [LT_PATH_NM])
+AU_ALIAS([AC_PROG_NM], [LT_PATH_NM])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_PROG_NM], [])
+dnl AC_DEFUN([AC_PROG_NM], [])
+
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+#  -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+    [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+  [lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&AS_MESSAGE_LOG_FD
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
+
+# LT_LIB_M
+# --------
+# check for math library
+AC_DEFUN([LT_LIB_M],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+LIBM=
+case $host in
+*-*-beos* | *-*-cegcc* | *-*-cygwin* | *-*-haiku* | *-*-pw32* | *-*-darwin*)
+  # These system don't have libm, or don't need it
+  ;;
+*-ncr-sysv4.3*)
+  AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
+  AC_CHECK_LIB(m, cos, LIBM="$LIBM -lm")
+  ;;
+*)
+  AC_CHECK_LIB(m, cos, LIBM="-lm")
+  ;;
+esac
+AC_SUBST([LIBM])
+])# LT_LIB_M
+
+# Old name:
+AU_ALIAS([AC_CHECK_LIBM], [LT_LIB_M])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_CHECK_LIBM], [])
+
+
+# _LT_COMPILER_NO_RTTI([TAGNAME])
+# -------------------------------
+m4_defun([_LT_COMPILER_NO_RTTI],
+[m4_require([_LT_TAG_COMPILER])dnl
+
+_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -Xcompiler -fno-builtin' ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin' ;;
+  esac
+
+  _LT_COMPILER_OPTION([if $compiler supports -fno-rtti -fno-exceptions],
+    lt_cv_prog_compiler_rtti_exceptions,
+    [-fno-rtti -fno-exceptions], [],
+    [_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)="$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1) -fno-rtti -fno-exceptions"])
+fi
+_LT_TAGDECL([no_builtin_flag], [lt_prog_compiler_no_builtin_flag], [1],
+       [Compiler flag to turn off builtin functions])
+])# _LT_COMPILER_NO_RTTI
+
+
+# _LT_CMD_GLOBAL_SYMBOLS
+# ----------------------
+m4_defun([_LT_CMD_GLOBAL_SYMBOLS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_PROG_CC])dnl
+AC_REQUIRE([AC_PROG_AWK])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+AC_REQUIRE([LT_PATH_LD])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+AC_MSG_CHECKING([command to parse $NM output from $compiler object])
+AC_CACHE_VAL([lt_cv_sys_global_symbol_pipe],
+[
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[[BCDEGRST]]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([[_A-Za-z]][[_A-Za-z0-9]]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[[BCDT]]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[[ABCDGISTW]]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[[ABCDEGRST]]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[[BCDEGRST]]'
+  ;;
+osf*)
+  symcode='[[BCDEGQRST]]'
+  ;;
+solaris*)
+  symcode='[[BDRT]]'
+  ;;
+sco3.2v5*)
+  symcode='[[DT]]'
+  ;;
+sysv4.2uw2*)
+  symcode='[[DT]]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[[ABDT]]'
+  ;;
+sysv4)
+  symcode='[[DFNSTU]]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[[ABCDGIRSTW]]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # 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};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx]"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[    ]]\($symcode$symcode*\)[[       ]][[    ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if AC_TRY_EVAL(ac_compile); then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if AC_TRY_EVAL(NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT@&t@_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[[]] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
+         if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&AS_MESSAGE_LOG_FD
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
+    fi
+  else
+    echo "$progname: failed program was:" >&AS_MESSAGE_LOG_FD
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+])
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  AC_MSG_RESULT(failed)
+else
+  AC_MSG_RESULT(ok)
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
+    [Take the output of nm and produce a listing of raw symbols and C names])
+_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
+    [Transform the output of nm in a proper C declaration])
+_LT_DECL([global_symbol_to_c_name_address],
+    [lt_cv_sys_global_symbol_to_c_name_address], [1],
+    [Transform the output of nm in a C name address pair])
+_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
+    [lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
+    [Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+    [Specify filename containing input files for $NM])
+]) # _LT_CMD_GLOBAL_SYMBOLS
+
+
+# _LT_COMPILER_PIC([TAGNAME])
+# ---------------------------
+m4_defun([_LT_COMPILER_PIC],
+[m4_require([_LT_TAG_COMPILER])dnl
+_LT_TAGVAR(lt_prog_compiler_wl, $1)=
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+_LT_TAGVAR(lt_prog_compiler_static, $1)=
+
+m4_if([$1], [CXX], [
+  # C++ specific cases for pic, static, wl, etc.
+  if test "$GXX" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+    aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+    mingw* | cygwin* | os2* | pw32* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+    *djgpp*)
+      # DJGPP does not support shared libraries at all
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+      ;;
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+    *qnx* | *nto*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+  else
+    case $host_os in
+      aix[[4-9]]*)
+       # All AIX code is PIC.
+       if test "$host_cpu" = ia64; then
+         # AIX 5 now supports IA64 processor
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       else
+         _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+       fi
+       ;;
+      chorus*)
+       case $cc_basename in
+       cxch68*)
+         # Green Hills C++ Compiler
+         # _LT_TAGVAR(lt_prog_compiler_static, $1)="--no_auto_instantiation -u __main -u __premain -u _abort -r $COOL_DIR/lib/libOrb.a $MVME_DIR/lib/CC/libC.a $MVME_DIR/lib/classix/libcx.s.a"
+         ;;
+       esac
+       ;;
+      mingw* | cygwin* | os2* | pw32* | cegcc*)
+       # This hack is so that the source file can tell whether it is being
+       # built for inclusion in a dll (and should export symbols for example).
+       m4_if([$1], [GCJ], [],
+         [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+       ;;
+      dgux*)
+       case $cc_basename in
+         ec++*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         ghcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      freebsd* | dragonfly*)
+       # FreeBSD uses GNU C++
+       ;;
+      hpux9* | hpux10* | hpux11*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           if test "$host_cpu" != ia64; then
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+           fi
+           ;;
+         aCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+           case $host_cpu in
+           hppa*64*|ia64*)
+             # +Z the default
+             ;;
+           *)
+             _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+             ;;
+           esac
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      interix*)
+       # This is c89, which is MS Visual C++ (no shared libs)
+       # Anyone wants to do a port?
+       ;;
+      irix5* | irix6* | nonstopux*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           # CC pic flag -KPIC is the default.
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+       case $cc_basename in
+         KCC*)
+           # KAI C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           ;;
+         ecpc* )
+           # old Intel C++ for x86_64 which still supported -KPIC.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         icpc* )
+           # Intel C++, used to be incompatible with GCC.
+           # ICC 10 doesn't accept -KPIC any more.
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+           ;;
+         pgCC* | pgcpp*)
+           # Portland Group C++ compiler
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         cxx*)
+           # Compaq C++
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         xlc* | xlC* | bgxl[[cC]]* | mpixl[[cC]]*)
+           # IBM XL 8.0, 9.0 on PPC and BlueGene
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *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)='-Qoption ld '
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+      lynxos*)
+       ;;
+      m88k*)
+       ;;
+      mvs*)
+       case $cc_basename in
+         cxx*)
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-W c,exportall'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      netbsd* | netbsdelf*-gnu)
+       ;;
+      *qnx* | *nto*)
+        # QNX uses GNU C++, but need to define -shared option too, otherwise
+        # it will coredump.
+        _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+        ;;
+      osf3* | osf4* | osf5*)
+       case $cc_basename in
+         KCC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='--backend -Wl,'
+           ;;
+         RCC*)
+           # Rational C++ 2.4.1
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         cxx*)
+           # Digital/Compaq C++
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           # Make sure the PIC flag is empty.  It appears that all Alpha
+           # Linux and Compaq Tru64 Unix objects are PIC.
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      psos*)
+       ;;
+      solaris*)
+       case $cc_basename in
+         CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+           _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 '
+           ;;
+         gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sunos4*)
+       case $cc_basename in
+         CC*)
+           # Sun C++ 4.x
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+         lcc*)
+           # Lucid
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+       case $cc_basename in
+         CC*)
+           _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+           ;;
+       esac
+       ;;
+      tandem*)
+       case $cc_basename in
+         NCC*)
+           # NonStop-UX NCC 3.20
+           _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+           ;;
+         *)
+           ;;
+       esac
+       ;;
+      vxworks*)
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+       ;;
+    esac
+  fi
+],
+[
+  if test "$GCC" = yes; then
+    _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+    _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            _LT_TAGVAR(lt_prog_compiler_pic, $1)='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[[3-9]]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
+      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
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      else
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      m4_if([$1], [GCJ], [],
+       [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # PIC (with -KPIC) is the default.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+        ;;
+      ccc*)
+        _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+        # All Alpha code is PIC.
+        _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-qpic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *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
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      # All OSF/1 code is PIC.
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    rdos*)
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-non_shared'
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld ';;
+      *)
+       _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Kconform_pic'
+       _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    unicos*)
+      _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(lt_prog_compiler_pic, $1)='-pic'
+      _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+      ;;
+
+    *)
+      _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no
+      ;;
+    esac
+  fi
+])
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)=
+    ;;
+  *)
+    _LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
+    ;;
+esac
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+  [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+  _LT_COMPILER_OPTION([if $compiler PIC flag $_LT_TAGVAR(lt_prog_compiler_pic, $1) works],
+    [_LT_TAGVAR(lt_cv_prog_compiler_pic_works, $1)],
+    [$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])], [],
+    [case $_LT_TAGVAR(lt_prog_compiler_pic, $1) in
+     "" | " "*) ;;
+     *) _LT_TAGVAR(lt_prog_compiler_pic, $1)=" $_LT_TAGVAR(lt_prog_compiler_pic, $1)" ;;
+     esac],
+    [_LT_TAGVAR(lt_prog_compiler_pic, $1)=
+     _LT_TAGVAR(lt_prog_compiler_can_build_shared, $1)=no])
+fi
+_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
+       [Additional compiler flags for building library objects])
+
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+       [How to pass a linker flag through the compiler])
+#
+# Check to make sure the static flag actually works.
+#
+wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1) eval lt_tmp_static_flag=\"$_LT_TAGVAR(lt_prog_compiler_static, $1)\"
+_LT_LINKER_OPTION([if $compiler static flag $lt_tmp_static_flag works],
+  _LT_TAGVAR(lt_cv_prog_compiler_static_works, $1),
+  $lt_tmp_static_flag,
+  [],
+  [_LT_TAGVAR(lt_prog_compiler_static, $1)=])
+_LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
+       [Compiler flag to prevent dynamic linking])
+])# _LT_COMPILER_PIC
+
+
+# _LT_LINKER_SHLIBS([TAGNAME])
+# ----------------------------
+# See if the linker supports building shared libraries.
+m4_defun([_LT_LINKER_SHLIBS],
+[AC_REQUIRE([LT_PATH_LD])dnl
+AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_DECL_SED])dnl
+m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_TAG_COMPILER])dnl
+AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+m4_if([$1], [CXX], [
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  case $host_os in
+  aix[[4-9]]*)
+    # If we're using GNU nm, then we don't want the "-C" option.
+    # -C means demangle to AIX nm, but means don't demangle with GNU nm
+    # Also, AIX nm treats weak defined symbols like other global defined
+    # symbols, whereas GNU nm marks them as "W".
+    if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    else
+      _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+    fi
+    ;;
+  pw32*)
+    _LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
+    ;;
+  cygwin* | mingw* | cegcc*)
+    case $cc_basename in
+    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']
+      ;;
+    esac
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
+  *)
+    _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+    ;;
+  esac
+], [
+  runpath_var=
+  _LT_TAGVAR(allow_undefined_flag, $1)=
+  _LT_TAGVAR(always_export_symbols, $1)=no
+  _LT_TAGVAR(archive_cmds, $1)=
+  _LT_TAGVAR(archive_expsym_cmds, $1)=
+  _LT_TAGVAR(compiler_needs_object, $1)=no
+  _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+  _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+  _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  _LT_TAGVAR(hardcode_automatic, $1)=no
+  _LT_TAGVAR(hardcode_direct, $1)=no
+  _LT_TAGVAR(hardcode_direct_absolute, $1)=no
+  _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+  _LT_TAGVAR(hardcode_libdir_separator, $1)=
+  _LT_TAGVAR(hardcode_minus_L, $1)=no
+  _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+  _LT_TAGVAR(inherit_rpath, $1)=no
+  _LT_TAGVAR(link_all_deplibs, $1)=unknown
+  _LT_TAGVAR(module_cmds, $1)=
+  _LT_TAGVAR(module_expsym_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_new_cmds, $1)=
+  _LT_TAGVAR(old_archive_from_expsyms_cmds, $1)=
+  _LT_TAGVAR(thread_safe_flag_spec, $1)=
+  _LT_TAGVAR(whole_archive_flag_spec, $1)=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  _LT_TAGVAR(include_expsyms, $1)=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+dnl Note also adjust exclude_expsyms for C++ above.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
+    _LT_TAGVAR(link_all_deplibs, $1)=no
+    ;;
+  esac
+
+  _LT_TAGVAR(ld_shlibs, $1)=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[[2-9]]*) ;;
+         *\ \(GNU\ Binutils\)\ [[3-9]]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+    _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[[3-9]]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+      # as there is no search path for DLLs.
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=no
+      _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+      _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']
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    haiku*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    interix[[3-9]]*)
+      _LT_TAGVAR(hardcode_direct, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         _LT_TAGVAR(whole_archive_flag_spec, $1)=
+         tmp_sharedflag='--shared' ;;
+       xl[[cC]]* | bgxl[[cC]]* | mpixl[[cC]]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         _LT_TAGVAR(compiler_needs_object, $1)=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       _LT_TAGVAR(archive_cmds, $1)='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       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)='${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~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [[01]].* | *\ 2.[[0-9]].* | *\ 2.1[[0-5]].*)
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+    esac
+
+    if test "$_LT_TAGVAR(ld_shlibs, $1)" = no; then
+      runpath_var=
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=
+      _LT_TAGVAR(whole_archive_flag_spec, $1)=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      _LT_TAGVAR(archive_expsym_cmds, $1)='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       _LT_TAGVAR(hardcode_direct, $1)=unsupported
+      fi
+      ;;
+
+    aix[[4-9]]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         _LT_TAGVAR(export_symbols_cmds, $1)='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && ([substr](\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      _LT_TAGVAR(archive_cmds, $1)=''
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[[012]]|aix4.[[012]].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         _LT_TAGVAR(hardcode_direct, $1)=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+       _LT_TAGVAR(link_all_deplibs, $1)=no
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      _LT_TAGVAR(always_export_symbols, $1)=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+         _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        _LT_SYS_MODULE_PATH_AIX([$1])
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+         _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+         fi
+         _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            _LT_TAGVAR(archive_expsym_cmds, $1)=''
+        ;;
+      m68k)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[[45]]*)
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       _LT_TAGVAR(always_export_symbols, $1)=yes
+       _LT_TAGVAR(file_list_spec, $1)='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+       _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+         else
+           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+         fi~
+         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+         linknames='
+       # 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'
+       _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+         lt_tool_outputfile="@TOOL_OUTPUT@"~
+         case $lt_outputfile in
+           *.exe|*.EXE) ;;
+           *)
+             lt_outputfile="$lt_outputfile.exe"
+             lt_tool_outputfile="$lt_tool_outputfile.exe"
+             ;;
+         esac~
+         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+           $RM "$lt_outputfile.manifest";
+         fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+       _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+       # FIXME: Should let the user specify the lib program.
+       _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+      _LT_DARWIN_LINKER_FEATURES($1)
+      ;;
+
+    dgux*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $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
+    # extra space).
+    freebsd2.2*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    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
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+       m4_if($1, [], [
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         _LT_LINKER_OPTION([if $CC understands -b],
+           _LT_TAGVAR(lt_cv_prog_compiler__b, $1), [-b],
+           [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'],
+           [_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'])],
+         [_LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'])
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         _LT_TAGVAR(hardcode_direct, $1)=no
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         ;;
+       *)
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         _LT_TAGVAR(hardcode_minus_L, $1)=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+         [lt_cv_irix_exported_symbol],
+         [save_LDFLAGS="$LDFLAGS"
+          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+          AC_LINK_IFELSE(
+            [AC_LANG_SOURCE(
+               [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+                             [C++], [[int foo (void) { return 0; }]],
+                             [Fortran 77], [[
+      subroutine foo
+      end]],
+                             [Fortran], [[
+      subroutine foo
+      end]])])],
+             [lt_cv_irix_exported_symbol=yes],
+             [lt_cv_irix_exported_symbol=no])
+           LDFLAGS="$save_LDFLAGS"])
+       if test "$lt_cv_irix_exported_symbol" = yes; then
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+       fi
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(inherit_rpath, $1)=yes
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    newsos6)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       _LT_TAGVAR(hardcode_direct, $1)=yes
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       else
+         case $host_os in
+          openbsd[[01]].* | openbsd2.[[0-7]] | openbsd2.[[0-7]].*)
+            _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+            ;;
+          *)
+            _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       _LT_TAGVAR(ld_shlibs, $1)=no
+      fi
+      ;;
+
+    os2*)
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+      _LT_TAGVAR(archive_cmds, $1)='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      _LT_TAGVAR(old_archive_from_new_cmds, $1)='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+      else
+       _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+      fi
+      _LT_TAGVAR(archive_cmds_need_lc, $1)='no'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+      ;;
+
+    solaris*)
+      _LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      case $host_os in
+      solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_direct, $1)=yes
+      _LT_TAGVAR(hardcode_minus_L, $1)=yes
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(reload_cmds, $1)='$CC -r -o $output$reload_objs'
+         _LT_TAGVAR(hardcode_direct, $1)=no
+        ;;
+       motorola)
+         _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         _LT_TAGVAR(hardcode_direct, $1)=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    sysv4.3*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       _LT_TAGVAR(ld_shlibs, $1)=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+      _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+      _LT_TAGVAR(link_all_deplibs, $1)=yes
+      _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      _LT_TAGVAR(archive_cmds, $1)='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      ;;
+
+    *)
+      _LT_TAGVAR(ld_shlibs, $1)=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+])
+AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+_LT_TAGVAR(with_gnu_ld, $1)=$with_gnu_ld
+
+_LT_DECL([], [libext], [0], [Old archive suffix (normally "a")])dnl
+_LT_DECL([], [shrext_cmds], [1], [Shared library suffix (normally ".so")])dnl
+_LT_DECL([], [extract_expsyms_cmds], [2],
+    [The commands to extract the exported symbol list from a shared archive])
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$_LT_TAGVAR(archive_cmds_need_lc, $1)" in
+x|xyes)
+  # Assume -lc should be added
+  _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $_LT_TAGVAR(archive_cmds, $1) in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      AC_CACHE_CHECK([whether -lc should be explicitly linked in],
+       [lt_cv_]_LT_TAGVAR(archive_cmds_need_lc, $1),
+       [$RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if AC_TRY_EVAL(ac_compile) 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$_LT_TAGVAR(lt_prog_compiler_wl, $1)
+         pic_flag=$_LT_TAGVAR(lt_prog_compiler_pic, $1)
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$_LT_TAGVAR(allow_undefined_flag, $1)
+         _LT_TAGVAR(allow_undefined_flag, $1)=
+         if AC_TRY_EVAL(_LT_TAGVAR(archive_cmds, $1) 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1)
+         then
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+         else
+           lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+         fi
+         _LT_TAGVAR(allow_undefined_flag, $1)=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+       ])
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=$lt_cv_[]_LT_TAGVAR(archive_cmds_need_lc, $1)
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+_LT_TAGDECL([build_libtool_need_lc], [archive_cmds_need_lc], [0],
+    [Whether or not to add -lc for building shared libraries])
+_LT_TAGDECL([allow_libtool_libs_with_static_runtimes],
+    [enable_shared_with_static_runtimes], [0],
+    [Whether or not to disallow shared libs when runtime libs are static])
+_LT_TAGDECL([], [export_dynamic_flag_spec], [1],
+    [Compiler flag to allow reflexive dlopens])
+_LT_TAGDECL([], [whole_archive_flag_spec], [1],
+    [Compiler flag to generate shared objects directly from archives])
+_LT_TAGDECL([], [compiler_needs_object], [1],
+    [Whether the compiler copes with passing no objects directly])
+_LT_TAGDECL([], [old_archive_from_new_cmds], [2],
+    [Create an old-style archive from a shared archive])
+_LT_TAGDECL([], [old_archive_from_expsyms_cmds], [2],
+    [Create a temporary old-style archive to link instead of a shared archive])
+_LT_TAGDECL([], [archive_cmds], [2], [Commands used to build a shared archive])
+_LT_TAGDECL([], [archive_expsym_cmds], [2])
+_LT_TAGDECL([], [module_cmds], [2],
+    [Commands used to build a loadable module if different from building
+    a shared archive.])
+_LT_TAGDECL([], [module_expsym_cmds], [2])
+_LT_TAGDECL([], [with_gnu_ld], [1],
+    [Whether we are building with GNU ld or not])
+_LT_TAGDECL([], [allow_undefined_flag], [1],
+    [Flag that allows shared libraries with undefined symbols to be built])
+_LT_TAGDECL([], [no_undefined_flag], [1],
+    [Flag that enforces no undefined symbols])
+_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_separator], [1],
+    [Whether we need a single "-rpath" flag with a separated argument])
+_LT_TAGDECL([], [hardcode_direct], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary])
+_LT_TAGDECL([], [hardcode_direct_absolute], [0],
+    [Set to "yes" if using DIR/libNAME${shared_ext} during linking hardcodes
+    DIR into the resulting binary and the resulting library dependency is
+    "absolute", i.e impossible to change by setting ${shlibpath_var} if the
+    library is relocated])
+_LT_TAGDECL([], [hardcode_minus_L], [0],
+    [Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_shlibpath_var], [0],
+    [Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+    into the resulting binary])
+_LT_TAGDECL([], [hardcode_automatic], [0],
+    [Set to "yes" if building a shared library automatically hardcodes DIR
+    into the library and all subsequent libraries and executables linked
+    against it])
+_LT_TAGDECL([], [inherit_rpath], [0],
+    [Set to yes if linker adds runtime paths of dependent libraries
+    to runtime path list])
+_LT_TAGDECL([], [link_all_deplibs], [0],
+    [Whether libtool must link a program against all its dependency libraries])
+_LT_TAGDECL([], [always_export_symbols], [0],
+    [Set to "yes" if exported symbols are required])
+_LT_TAGDECL([], [export_symbols_cmds], [2],
+    [The commands to list exported symbols])
+_LT_TAGDECL([], [exclude_expsyms], [1],
+    [Symbols that should not be listed in the preloaded symbols])
+_LT_TAGDECL([], [include_expsyms], [1],
+    [Symbols that must always be exported])
+_LT_TAGDECL([], [prelink_cmds], [2],
+    [Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+    [Commands necessary for finishing linking programs])
+_LT_TAGDECL([], [file_list_spec], [1],
+    [Specify filename containing input files])
+dnl FIXME: Not yet implemented
+dnl _LT_TAGDECL([], [thread_safe_flag_spec], [1],
+dnl    [Compiler flag to generate thread safe objects])
+])# _LT_LINKER_SHLIBS
+
+
+# _LT_LANG_C_CONFIG([TAG])
+# ------------------------
+# Ensure that the configuration variables for a C compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_C_CONFIG],
+[m4_require([_LT_DECL_EGREP])dnl
+lt_save_CC="$CC"
+AC_LANG_PUSH(C)
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+_LT_TAG_COMPILER
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+## 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_SYS_DYNAMIC_LINKER($1)
+  _LT_LINKER_HARDCODE_LIBPATH($1)
+  LT_SYS_DLOPEN_SELF
+  _LT_CMD_STRIPLIB
+
+  # Report which library types will actually be built
+  AC_MSG_CHECKING([if libtool supports shared libraries])
+  AC_MSG_RESULT([$can_build_shared])
+
+  AC_MSG_CHECKING([whether to build shared libraries])
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[[4-9]]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  AC_MSG_RESULT([$enable_shared])
+
+  AC_MSG_CHECKING([whether to build static libraries])
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  AC_MSG_RESULT([$enable_static])
+
+  _LT_CONFIG($1)
+fi
+AC_LANG_POP
+CC="$lt_save_CC"
+])# _LT_LANG_C_CONFIG
+
+
+# _LT_LANG_CXX_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a C++ compiler are suitably
+# defined.  These variables are subsequently used by _LT_CONFIG to write
+# the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_CXX_CONFIG],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
+if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
+    ( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
+    (test "X$CXX" != "Xg++"))) ; then
+  AC_PROG_CXXCPP
+else
+  _lt_caught_CXX_error=yes
+fi
+
+AC_LANG_PUSH(C++)
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_LT_TAGVAR(compiler_needs_object, $1)=no
+_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_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for C++ test sources.
+ac_ext=cpp
+
+# Object file extension for compiled C++ test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the CXX compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_caught_CXX_error" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="int some_variable = 0;"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code='int main(int, char *[[]]) { return(0); }'
+
+  # 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_LD=$LD
+  lt_save_GCC=$GCC
+  GCC=$GXX
+  lt_save_with_gnu_ld=$with_gnu_ld
+  lt_save_path_LD=$lt_cv_path_LD
+  if test -n "${lt_cv_prog_gnu_ldcxx+set}"; then
+    lt_cv_prog_gnu_ld=$lt_cv_prog_gnu_ldcxx
+  else
+    $as_unset lt_cv_prog_gnu_ld
+  fi
+  if test -n "${lt_cv_path_LDCXX+set}"; then
+    lt_cv_path_LD=$lt_cv_path_LDCXX
+  else
+    $as_unset lt_cv_path_LD
+  fi
+  test -z "${LDCXX+set}" || LD=$LDCXX
+  CC=${CXX-"c++"}
+  CFLAGS=$CXXFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    # We don't want -fno-exception when compiling C++ code, so set the
+    # no_builtin_flag separately
+    if test "$GXX" = yes; then
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=' -fno-builtin'
+    else
+      _LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)=
+    fi
+
+    if test "$GXX" = yes; then
+      # Set up default GNU C++ configuration
+
+      LT_PATH_LD
+
+      # Check if GNU C++ uses GNU ld as the underlying linker, since the
+      # archiving commands below assume that GNU ld is being used.
+      if test "$with_gnu_ld" = yes; then
+        _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+        # If archive_cmds runs LD, not CC, wlarc should be empty
+        # XXX I think wlarc can be eliminated in ltcf-cxx, but I need to
+        #     investigate it a little bit more. (MM)
+        wlarc='${wl}'
+
+        # ancient GNU ld didn't support --whole-archive et. al.
+        if eval "`$CC -print-prog-name=ld` --help 2>&1" |
+         $GREP 'no-whole-archive' > /dev/null; then
+          _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+        else
+          _LT_TAGVAR(whole_archive_flag_spec, $1)=
+        fi
+      else
+        with_gnu_ld=no
+        wlarc=
+
+        # A generic and very simple default shared library creation
+        # command for GNU C++ for the case where it uses the native
+        # linker, instead of GNU ld.  If possible, this setting should
+        # overridden to take advantage of the native linker features on
+        # the platform it is being used on.
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+      fi
+
+      # Commands to make compiler produce verbose output that lists
+      # what "hidden" libraries, object files and flags are used when
+      # linking a shared library.
+      output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+    else
+      GXX=no
+      with_gnu_ld=no
+      wlarc=
+    fi
+
+    # PORTME: fill in a description of your system's C++ link characteristics
+    AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
+    _LT_TAGVAR(ld_shlibs, $1)=yes
+    case $host_os in
+      aix3*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+      aix[[4-9]]*)
+        if test "$host_cpu" = ia64; then
+          # On IA64, the linker does run time linking by default, so we don't
+          # have to do anything special.
+          aix_use_runtimelinking=no
+          exp_sym_flag='-Bexport'
+          no_entry_flag=""
+        else
+          aix_use_runtimelinking=no
+
+          # Test if we are trying to use run time linking or normal
+          # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+          # need to do runtime linking.
+          case $host_os in aix4.[[23]]|aix4.[[23]].*|aix[[5-9]]*)
+           for ld_flag in $LDFLAGS; do
+             case $ld_flag in
+             *-brtl*)
+               aix_use_runtimelinking=yes
+               break
+               ;;
+             esac
+           done
+           ;;
+          esac
+
+          exp_sym_flag='-bexport'
+          no_entry_flag='-bnoentry'
+        fi
+
+        # When large executables or shared objects are built, AIX ld can
+        # have problems creating the table of contents.  If linking a library
+        # or program results in "error TOC overflow" add -mminimal-toc to
+        # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+        # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+        _LT_TAGVAR(archive_cmds, $1)=''
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        _LT_TAGVAR(file_list_spec, $1)='${wl}-f,'
+
+        if test "$GXX" = yes; then
+          case $host_os in aix4.[[012]]|aix4.[[012]].*)
+          # We only want to do this on AIX 4.2 and lower, the check
+          # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+            strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+           # We have reworked collect2
+           :
+         else
+           # We have old collect2
+           _LT_TAGVAR(hardcode_direct, $1)=unsupported
+           # It fails to find uninstalled libraries when the uninstalled
+           # path is not listed in the libpath.  Setting hardcode_minus_L
+           # to unsupported forces relinking
+           _LT_TAGVAR(hardcode_minus_L, $1)=yes
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=
+         fi
+          esac
+          shared_flag='-shared'
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag="$shared_flag "'${wl}-G'
+         fi
+        else
+          # not using gcc
+          if test "$host_cpu" = ia64; then
+         # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+         # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+          else
+           if test "$aix_use_runtimelinking" = yes; then
+             shared_flag='${wl}-G'
+           else
+             shared_flag='${wl}-bM:SRE'
+           fi
+          fi
+        fi
+
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-bexpall'
+        # It seems that -bexpall does not export symbols beginning with
+        # underscore (_), so it is better to generate a list of symbols to
+       # export.
+        _LT_TAGVAR(always_export_symbols, $1)=yes
+        if test "$aix_use_runtimelinking" = yes; then
+          # Warning - without using the other runtime loading flags (-brtl),
+          # -berok will link without error, but may produce a broken library.
+          _LT_TAGVAR(allow_undefined_flag, $1)='-berok'
+          # Determine the default libpath from the value encoded in an empty
+          # executable.
+          _LT_SYS_MODULE_PATH_AIX([$1])
+          _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+
+          _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+        else
+          if test "$host_cpu" = ia64; then
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $libdir:/usr/lib:/lib'
+           _LT_TAGVAR(allow_undefined_flag, $1)="-z nodefs"
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+          else
+           # Determine the default libpath from the value encoded in an
+           # empty executable.
+           _LT_SYS_MODULE_PATH_AIX([$1])
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
+           # Warning - without using the other run time loading flags,
+           # -berok will link without error, but may produce a broken library.
+           _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-bernotok'
+           _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-berok'
+           if test "$with_gnu_ld" = yes; then
+             # We only use this code for GNU lds that support --whole-archive.
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           else
+             # Exported symbols can be pulled into shared objects from archives
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='$convenience'
+           fi
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=yes
+           # This is similar to how AIX traditionally builds its shared
+           # libraries.
+           _LT_TAGVAR(archive_expsym_cmds, $1)="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+          fi
+        fi
+        ;;
+
+      beos*)
+       if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+         # support --undefined.  This deserves some investigation.  FIXME
+         _LT_TAGVAR(archive_cmds, $1)='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      chorus*)
+        case $cc_basename in
+          *)
+         # FIXME: insert proper C++ library support
+         _LT_TAGVAR(ld_shlibs, $1)=no
+         ;;
+        esac
+        ;;
+
+      cygwin* | mingw* | pw32* | cegcc*)
+       case $GXX,$cc_basename in
+       ,cl* | no,cl*)
+         # Native MSVC
+         # hardcode_libdir_flag_spec is actually meaningless, as there is
+         # no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=yes
+         _LT_TAGVAR(file_list_spec, $1)='@'
+         # Tell ltmain to make .lib files, not .a files.
+         libext=lib
+         # Tell ltmain to make .dll files, not .so files.
+         shrext_cmds=".dll"
+         # FIXME: Setting linknames here is a bad hack.
+         _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+         _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+             $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+           else
+             $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+           fi~
+           $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+           linknames='
+         # 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
+         # Don't use ranlib
+         _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+         _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+           lt_tool_outputfile="@TOOL_OUTPUT@"~
+           case $lt_outputfile in
+             *.exe|*.EXE) ;;
+             *)
+               lt_outputfile="$lt_outputfile.exe"
+               lt_tool_outputfile="$lt_tool_outputfile.exe"
+               ;;
+           esac~
+           func_to_tool_file "$lt_outputfile"~
+           if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+             $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+             $RM "$lt_outputfile.manifest";
+           fi'
+         ;;
+       *)
+         # g++
+         # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+         # as there is no search path for DLLs.
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+         _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+         _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+         _LT_TAGVAR(always_export_symbols, $1)=no
+         _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+         if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+           # If the export-symbols file already is a .def file (1st line
+           # is EXPORTS), use it as is; otherwise, prepend...
+           _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+             cp $export_symbols $output_objdir/$soname.def;
+           else
+             echo EXPORTS > $output_objdir/$soname.def;
+             cat $export_symbols >> $output_objdir/$soname.def;
+           fi~
+           $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+         else
+           _LT_TAGVAR(ld_shlibs, $1)=no
+         fi
+         ;;
+       esac
+       ;;
+      darwin* | rhapsody*)
+        _LT_DARWIN_LINKER_FEATURES($1)
+       ;;
+
+      dgux*)
+        case $cc_basename in
+          ec++*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          ghcx*)
+           # Green Hills C++ Compiler
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      freebsd2.*)
+        # C++ shared libraries reported to be fairly broken before
+       # switch to ELF
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      freebsd-elf*)
+        _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+        ;;
+
+      freebsd* | dragonfly*)
+        # FreeBSD 3 and later use GNU C++ and GNU ld with standard ELF
+        # conventions
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+        ;;
+
+      haiku*)
+        _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+        _LT_TAGVAR(link_all_deplibs, $1)=yes
+        ;;
+
+      hpux9*)
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+        _LT_TAGVAR(hardcode_direct, $1)=yes
+        _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                            # but as the default
+                                            # location of the library.
+
+        case $cc_basename in
+          CC*)
+            # FIXME: insert proper C++ library support
+            _LT_TAGVAR(ld_shlibs, $1)=no
+            ;;
+          aCC*)
+            _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -b ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            # Commands to make compiler produce verbose output that lists
+            # what "hidden" libraries, object files and flags are used when
+            # linking a shared library.
+            #
+            # There doesn't appear to be a way to prevent this compiler from
+            # explicitly linking system object files so we need to strip them
+            # from the output so that they don't get included in the library
+            # dependencies.
+            output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $EGREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+            ;;
+          *)
+            if test "$GXX" = yes; then
+              _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+            else
+              # FIXME: insert proper C++ library support
+              _LT_TAGVAR(ld_shlibs, $1)=no
+            fi
+            ;;
+        esac
+        ;;
+
+      hpux10*|hpux11*)
+        if test $with_gnu_ld = no; then
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
+         _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+          case $host_cpu in
+            hppa*64*|ia64*)
+              ;;
+            *)
+             _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+              ;;
+          esac
+        fi
+        case $host_cpu in
+          hppa*64*|ia64*)
+            _LT_TAGVAR(hardcode_direct, $1)=no
+            _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+            ;;
+          *)
+            _LT_TAGVAR(hardcode_direct, $1)=yes
+            _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+            _LT_TAGVAR(hardcode_minus_L, $1)=yes # Not in the search PATH,
+                                                # but as the default
+                                                # location of the library.
+            ;;
+        esac
+
+        case $cc_basename in
+          CC*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          aCC*)
+           case $host_cpu in
+             hppa*64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             ia64*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+             *)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+               ;;
+           esac
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`($CC -b $CFLAGS -v conftest.$objext 2>&1) | $GREP "\-L"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test $with_gnu_ld = no; then
+               case $host_cpu in
+                 hppa*64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 ia64*)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+                 *)
+                   _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+                   ;;
+               esac
+             fi
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      interix[[3-9]]*)
+       _LT_TAGVAR(hardcode_direct, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+       # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+       # Instead, shared libraries are loaded at an image base (0x10000000 by
+       # default) and relocated if they conflict, which is a slow very memory
+       # consuming and fragmenting process.  To avoid this, we pick a random,
+       # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+       # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+       _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       _LT_TAGVAR(archive_expsym_cmds, $1)='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+       ;;
+      irix5* | irix6*)
+        case $cc_basename in
+          CC*)
+           # SGI C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared -all -multigot $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+
+           # Archives containing C++ object files must be created using
+           # "CC -ar", where "CC" is the IRIX C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -ar -WR,-u -o $oldlib $oldobjs'
+           ;;
+          *)
+           if test "$GXX" = yes; then
+             if test "$with_gnu_ld" = no; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+             else
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+             fi
+           fi
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+           ;;
+        esac
+        _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+        _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+        _LT_TAGVAR(inherit_rpath, $1)=yes
+        ;;
+
+      linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo $lib | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib ${wl}-retain-symbols-file,$export_symbols; mv \$templib $lib'
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1 | $GREP "ld"`; rm -f libconftest$shared_ext; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+
+           # Archives containing C++ object files must be created using
+           # "CC -Bstatic", where "CC" is the KAI C++ compiler.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs'
+           ;;
+         icpc* | ecpc* )
+           # Intel C++
+           with_gnu_ld=yes
+           # version 8.0 and above of icpc choke on multiply defined symbols
+           # if we add $predep_objects and $postdep_objects, however 7.1 and
+           # earlier do not add the objects themselves.
+           case `$CC -V 2>&1` in
+             *"Version 7."*)
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+             *)  # Version 8.0 or newer
+               tmp_idyn=
+               case $host_cpu in
+                 ia64*) tmp_idyn=' -i_dynamic';;
+               esac
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared'"$tmp_idyn"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+               ;;
+           esac
+           _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+           ;;
+          pgCC* | pgcpp*)
+            # Portland Group C++ compiler
+           case `$CC -V` in
+           *pgCC\ [[1-5]].* | *pgcpp\ [[1-5]].*)
+             _LT_TAGVAR(prelink_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $objs $libobjs $compile_deplibs~
+               compile_command="$compile_command `find $tpldir -name \*.o | sort | $NL2SP`"'
+             _LT_TAGVAR(old_archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $oldobjs$old_deplibs~
+               $AR $AR_FLAGS $oldlib$oldobjs$old_deplibs `find $tpldir -name \*.o | sort | $NL2SP`~
+               $RANLIB $oldlib'
+             _LT_TAGVAR(archive_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='tpldir=Template.dir~
+               rm -rf $tpldir~
+               $CC --prelink_objects --instantiation_dir $tpldir $predep_objects $libobjs $deplibs $convenience $postdep_objects~
+               $CC -shared $pic_flag $predep_objects $libobjs $deplibs `find $tpldir -name \*.o | sort | $NL2SP` $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           *) # Version 6 and above use weak symbols
+             _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname -o $lib'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname ${wl}-retain-symbols-file ${wl}$export_symbols -o $lib'
+             ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}--rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+            ;;
+         cxx*)
+           # Compaq C++
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname  -o $lib ${wl}-retain-symbols-file $wl$export_symbols'
+
+           runpath_var=LD_RUN_PATH
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld .*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "X$list" | $Xsed'
+           ;;
+         xl* | mpixl* | bgxl*)
+           # IBM XL 8.0 on PPC, with GNU ld
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           if test "x$supports_anon_versioning" = xyes; then
+             _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
+               cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+               echo "local: *; };" >> $output_objdir/$libname.ver~
+               $CC -qmkshrobj $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+           fi
+           ;;
+         *)
+           case `$CC -V 2>&1 | sed 5q` in
+           *Sun\ C*)
+             # Sun C++ 5.9
+             _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+             _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+             _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G${allow_undefined_flag} -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file ${wl}$export_symbols'
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+             _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+             _LT_TAGVAR(compiler_needs_object, $1)=yes
+
+             # Not sure whether something based on
+             # $CC $CFLAGS -v conftest.$objext -o libconftest$shared_ext 2>&1
+             # would be better.
+             output_verbose_link_cmd='func_echo_all'
+
+             # Archives containing C++ object files must be created using
+             # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+             # necessary to make sure instantiated templates are included
+             # in the archive.
+             _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+             ;;
+           esac
+           ;;
+       esac
+       ;;
+
+      lynxos*)
+        # FIXME: insert proper C++ library support
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      m88k*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      mvs*)
+        case $cc_basename in
+          cxx*)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+         *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+       esac
+       ;;
+
+      netbsd*)
+        if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+         _LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable  -o $lib $predep_objects $libobjs $deplibs $postdep_objects $linker_flags'
+         wlarc=
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       fi
+       # Workaround some broken pre-1.5 toolchains
+       output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP conftest.$objext | $SED -e "s:-lgcc -lc -lgcc::"'
+       ;;
+
+      *nto* | *qnx*)
+        _LT_TAGVAR(ld_shlibs, $1)=yes
+       ;;
+
+      openbsd2*)
+        # C++ shared libraries are fairly broken
+       _LT_TAGVAR(ld_shlibs, $1)=no
+       ;;
+
+      openbsd*)
+       if test -f /usr/libexec/ld.so; then
+         _LT_TAGVAR(hardcode_direct, $1)=yes
+         _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+         _LT_TAGVAR(hardcode_direct_absolute, $1)=yes
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $lib'
+         _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+         if test -z "`echo __ELF__ | $CC -E - | grep __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-retain-symbols-file,$export_symbols -o $lib'
+           _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-E'
+           _LT_TAGVAR(whole_archive_flag_spec, $1)="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+         fi
+         output_verbose_link_cmd=func_echo_all
+       else
+         _LT_TAGVAR(ld_shlibs, $1)=no
+       fi
+       ;;
+
+      osf3* | osf4* | osf5*)
+        case $cc_basename in
+          KCC*)
+           # Kuck and Associates, Inc. (KAI) C++ Compiler
+
+           # KCC will only create a shared library if the output file
+           # ends with ".so" (or ".sl" for HP-UX), so rename the library
+           # to its proper name (with version) after linking.
+           _LT_TAGVAR(archive_cmds, $1)='tempext=`echo $shared_ext | $SED -e '\''s/\([[^()0-9A-Za-z{}]]\)/\\\\\1/g'\''`; templib=`echo "$lib" | $SED -e "s/\${tempext}\..*/.so/"`; $CC $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags --soname $soname -o \$templib; mv \$templib $lib'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath,$libdir'
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Archives containing C++ object files must be created using
+           # the KAI C++ compiler.
+           case $host in
+             osf3*) _LT_TAGVAR(old_archive_cmds, $1)='$CC -Bstatic -o $oldlib $oldobjs' ;;
+             *) _LT_TAGVAR(old_archive_cmds, $1)='$CC -o $oldlib $oldobjs' ;;
+           esac
+           ;;
+          RCC*)
+           # Rational C++ 2.4.1
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          cxx*)
+           case $host in
+             osf3*)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $soname `test -n "$verstring" && func_echo_all "${wl}-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+               ;;
+             *)
+               _LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done~
+                 echo "-hidden">> $lib.exp~
+                 $CC -shared$allow_undefined_flag $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -msym -soname $soname ${wl}-input ${wl}$lib.exp  `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~
+                 $RM $lib.exp'
+               _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-rpath $libdir'
+               ;;
+           esac
+
+           _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+           # Commands to make compiler produce verbose output that lists
+           # what "hidden" libraries, object files and flags are used when
+           # linking a shared library.
+           #
+           # There doesn't appear to be a way to prevent this compiler from
+           # explicitly linking system object files so we need to strip them
+           # from the output so that they don't get included in the library
+           # dependencies.
+           output_verbose_link_cmd='templist=`$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP "ld" | $GREP -v "ld:"`; templist=`func_echo_all "$templist" | $SED "s/\(^.*ld.*\)\( .*ld.*$\)/\1/"`; list=""; for z in $templist; do case $z in conftest.$objext) list="$list $z";; *.$objext);; *) list="$list $z";;esac; done; func_echo_all "$list"'
+           ;;
+         *)
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
+             case $host in
+               osf3*)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+               *)
+                 _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+                 ;;
+             esac
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
+             _LT_TAGVAR(hardcode_libdir_separator, $1)=:
+
+             # Commands to make compiler produce verbose output that lists
+             # what "hidden" libraries, object files and flags are used when
+             # linking a shared library.
+             output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+
+           else
+             # FIXME: insert proper C++ library support
+             _LT_TAGVAR(ld_shlibs, $1)=no
+           fi
+           ;;
+        esac
+        ;;
+
+      psos*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      sunos4*)
+        case $cc_basename in
+          CC*)
+           # Sun C++ 4.x
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          lcc*)
+           # Lucid
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      solaris*)
+        case $cc_basename in
+          CC* | sunCC*)
+           # Sun C++ 4.2, 5.x and Centerline C++
+            _LT_TAGVAR(archive_cmds_need_lc,$1)=yes
+           _LT_TAGVAR(no_undefined_flag, $1)=' -zdefs'
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G${allow_undefined_flag}  -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+             $CC -G${allow_undefined_flag} ${wl}-M ${wl}$lib.exp -h$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+           _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
+           _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+           case $host_os in
+             solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+             *)
+               # The compiler driver will combine and reorder linker options,
+               # but understands `-z linker_flag'.
+               # Supported since Solaris 2.6 (maybe 2.5.1?)
+               _LT_TAGVAR(whole_archive_flag_spec, $1)='-z allextract$convenience -z defaultextract'
+               ;;
+           esac
+           _LT_TAGVAR(link_all_deplibs, $1)=yes
+
+           output_verbose_link_cmd='func_echo_all'
+
+           # Archives containing C++ object files must be created using
+           # "CC -xar", where "CC" is the Sun C++ compiler.  This is
+           # necessary to make sure instantiated templates are included
+           # in the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -xar -o $oldlib $oldobjs'
+           ;;
+          gcx*)
+           # Green Hills C++ Compiler
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+
+           # The C++ compiler must be used to create the archive.
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC $LDFLAGS -archive -o $oldlib $oldobjs'
+           ;;
+          *)
+           # GNU C++ compiler with Solaris linker
+           if test "$GXX" = yes && test "$with_gnu_ld" = no; then
+             _LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
+             if $CC --version | $GREP -v '^2\.7' > /dev/null; then
+               _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -shared $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             else
+               # g++ 2.7 appears to require `-G' NOT `-shared' on this
+               # platform.
+               _LT_TAGVAR(archive_cmds, $1)='$CC -G -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+               _LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+                 $CC -G -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+
+               # Commands to make compiler produce verbose output that lists
+               # what "hidden" libraries, object files and flags are used when
+               # linking a shared library.
+               output_verbose_link_cmd='$CC -G $CFLAGS -v conftest.$objext 2>&1 | $GREP -v "^Configured with:" | $GREP "\-L"'
+             fi
+
+             _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R $wl$libdir'
+             case $host_os in
+               solaris2.[[0-5]] | solaris2.[[0-5]].*) ;;
+               *)
+                 _LT_TAGVAR(whole_archive_flag_spec, $1)='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+                 ;;
+             esac
+           fi
+           ;;
+        esac
+        ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[[01]].[[10]]* | unixware7* | sco3.2v5.0.[[024]]*)
+      _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+      _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+      _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+      runpath_var='LD_RUN_PATH'
+
+      case $cc_basename in
+        CC*)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+      esac
+      ;;
+
+      sysv5* | sco3.2v5* | sco5v6*)
+       # Note: We can NOT use -z defs as we might desire, because we do not
+       # link with -lc, and that would cause any symbols used from libc to
+       # always be unresolved, which means just about no library would
+       # ever link correctly.  If we're not using GNU ld we use -z text
+       # though, which does catch some bad symbols but isn't as heavy-handed
+       # as -z defs.
+       _LT_TAGVAR(no_undefined_flag, $1)='${wl}-z,text'
+       _LT_TAGVAR(allow_undefined_flag, $1)='${wl}-z,nodefs'
+       _LT_TAGVAR(archive_cmds_need_lc, $1)=no
+       _LT_TAGVAR(hardcode_shlibpath_var, $1)=no
+       _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-R,$libdir'
+       _LT_TAGVAR(hardcode_libdir_separator, $1)=':'
+       _LT_TAGVAR(link_all_deplibs, $1)=yes
+       _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}-Bexport'
+       runpath_var='LD_RUN_PATH'
+
+       case $cc_basename in
+          CC*)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(old_archive_cmds, $1)='$CC -Tprelink_objects $oldobjs~
+             '"$_LT_TAGVAR(old_archive_cmds, $1)"
+           _LT_TAGVAR(reload_cmds, $1)='$CC -Tprelink_objects $reload_objs~
+             '"$_LT_TAGVAR(reload_cmds, $1)"
+           ;;
+         *)
+           _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+           ;;
+       esac
+      ;;
+
+      tandem*)
+        case $cc_basename in
+          NCC*)
+           # NonStop-UX NCC 3.20
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+          *)
+           # FIXME: insert proper C++ library support
+           _LT_TAGVAR(ld_shlibs, $1)=no
+           ;;
+        esac
+        ;;
+
+      vxworks*)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+
+      *)
+        # FIXME: insert proper C++ library support
+        _LT_TAGVAR(ld_shlibs, $1)=no
+        ;;
+    esac
+
+    AC_MSG_RESULT([$_LT_TAGVAR(ld_shlibs, $1)])
+    test "$_LT_TAGVAR(ld_shlibs, $1)" = no && can_build_shared=no
+
+    _LT_TAGVAR(GCC, $1)="$GXX"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## 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...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+  LDCXX=$LD
+  LD=$lt_save_LD
+  GCC=$lt_save_GCC
+  with_gnu_ld=$lt_save_with_gnu_ld
+  lt_cv_path_LDCXX=$lt_cv_path_LD
+  lt_cv_path_LD=$lt_save_path_LD
+  lt_cv_prog_gnu_ldcxx=$lt_cv_prog_gnu_ld
+  lt_cv_prog_gnu_ld=$lt_save_with_gnu_ld
+fi # test "$_lt_caught_CXX_error" != yes
+
+AC_LANG_POP
+])# _LT_LANG_CXX_CONFIG
+
+
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+  case ${2} in
+  .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+  *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+  esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
+# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
+# ---------------------------------
+# Figure out "hidden" library dependencies from verbose
+# compiler output when linking a shared library.
+# Parse the compiler output and extract the necessary
+# objects, libraries and library flags.
+m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
+[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
+# Dependencies to place before and after the object being linked:
+_LT_TAGVAR(predep_objects, $1)=
+_LT_TAGVAR(postdep_objects, $1)=
+_LT_TAGVAR(predeps, $1)=
+_LT_TAGVAR(postdeps, $1)=
+_LT_TAGVAR(compiler_lib_search_path, $1)=
+
+dnl we can't use the lt_simple_compile_test_code here,
+dnl because it contains code intended for an executable,
+dnl not a library.  It's possible we should let each
+dnl tag define a new lt_????_link_test_code variable,
+dnl but it's only used here...
+m4_if([$1], [], [cat > conftest.$ac_ext <<_LT_EOF
+int a;
+void foo (void) { a = 0; }
+_LT_EOF
+], [$1], [CXX], [cat > conftest.$ac_ext <<_LT_EOF
+class Foo
+{
+public:
+  Foo (void) { a = 0; }
+private:
+  int a;
+};
+_LT_EOF
+], [$1], [F77], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer*4 a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [FC], [cat > conftest.$ac_ext <<_LT_EOF
+      subroutine foo
+      implicit none
+      integer a
+      a=0
+      return
+      end
+_LT_EOF
+], [$1], [GCJ], [cat > conftest.$ac_ext <<_LT_EOF
+public class foo {
+  private int a;
+  public void bar (void) {
+    a = 0;
+  }
+};
+_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
+dnl objects, libraries and library flags.
+if AC_TRY_EVAL(ac_compile); then
+  # Parse the compiler output and extract the necessary
+  # objects, libraries and library flags.
+
+  # Sentinel used to keep track of whether or not we are before
+  # the conftest object file.
+  pre_test_object_deps_done=no
+
+  for p in `eval "$output_verbose_link_cmd"`; do
+    case ${prev}${p} in
+
+    -L* | -R* | -l*)
+       # Some compilers place space between "-{L,R}" and the path.
+       # Remove the space.
+       if test $p = "-L" ||
+          test $p = "-R"; then
+        prev=$p
+        continue
+       fi
+
+       # Expand the sysroot to ease extracting the directories later.
+       if test -z "$prev"; then
+         case $p in
+         -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+         -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+         -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+         esac
+       fi
+       case $p in
+       =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+       esac
+       if test "$pre_test_object_deps_done" = no; then
+        case ${prev} in
+        -L | -R)
+          # Internal compiler library paths should come after those
+          # provided the user.  The postdeps already come after the
+          # user supplied libs so there is no need to process them.
+          if test -z "$_LT_TAGVAR(compiler_lib_search_path, $1)"; then
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${prev}${p}"
+          else
+            _LT_TAGVAR(compiler_lib_search_path, $1)="${_LT_TAGVAR(compiler_lib_search_path, $1)} ${prev}${p}"
+          fi
+          ;;
+        # The "-l" case would never come before the object being
+        # linked, so don't bother handling this case.
+        esac
+       else
+        if test -z "$_LT_TAGVAR(postdeps, $1)"; then
+          _LT_TAGVAR(postdeps, $1)="${prev}${p}"
+        else
+          _LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
+        fi
+       fi
+       prev=
+       ;;
+
+    *.lto.$objext) ;; # Ignore GCC LTO objects
+    *.$objext)
+       # This assumes that the test object file only shows up
+       # once in the compiler output.
+       if test "$p" = "conftest.$objext"; then
+        pre_test_object_deps_done=yes
+        continue
+       fi
+
+       if test "$pre_test_object_deps_done" = no; then
+        if test -z "$_LT_TAGVAR(predep_objects, $1)"; then
+          _LT_TAGVAR(predep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(predep_objects, $1)="$_LT_TAGVAR(predep_objects, $1) $p"
+        fi
+       else
+        if test -z "$_LT_TAGVAR(postdep_objects, $1)"; then
+          _LT_TAGVAR(postdep_objects, $1)="$p"
+        else
+          _LT_TAGVAR(postdep_objects, $1)="$_LT_TAGVAR(postdep_objects, $1) $p"
+        fi
+       fi
+       ;;
+
+    *) ;; # Ignore the rest.
+
+    esac
+  done
+
+  # Clean up.
+  rm -f a.out a.exe
+else
+  echo "libtool.m4: error: problem compiling $1 test program"
+fi
+
+$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
+
+# PORTME: override above test on systems where it is broken
+m4_if([$1], [CXX],
+[case $host_os in
+interix[[3-9]]*)
+  # Interix 3.5 installs completely hosed .la files for C++, so rather than
+  # hack all around it, let's just trust "g++" to DTRT.
+  _LT_TAGVAR(predep_objects,$1)=
+  _LT_TAGVAR(postdep_objects,$1)=
+  _LT_TAGVAR(postdeps,$1)=
+  ;;
+
+linux*)
+  case `$CC -V 2>&1 | sed 5q` in
+  *Sun\ C*)
+    # Sun C++ 5.9
+
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+
+solaris*)
+  case $cc_basename in
+  CC* | sunCC*)
+    # The more standards-conforming stlport4 library is
+    # incompatible with the Cstd library. Avoid specifying
+    # it if it's in CXXFLAGS. Ignore libCrun as
+    # -library=stlport4 depends on it.
+    case " $CXX $CXXFLAGS " in
+    *" -library=stlport4 "*)
+      solaris_use_stlport4=yes
+      ;;
+    esac
+
+    # Adding this requires a known-good setup of shared libraries for
+    # Sun compiler versions before 5.6, else PIC objects from an old
+    # archive will be linked into the output, leading to subtle bugs.
+    if test "$solaris_use_stlport4" != yes; then
+      _LT_TAGVAR(postdeps,$1)='-library=Cstd -library=Crun'
+    fi
+    ;;
+  esac
+  ;;
+esac
+])
+
+case " $_LT_TAGVAR(postdeps, $1) " in
+*" -lc "*) _LT_TAGVAR(archive_cmds_need_lc, $1)=no ;;
+esac
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=
+if test -n "${_LT_TAGVAR(compiler_lib_search_path, $1)}"; then
+ _LT_TAGVAR(compiler_lib_search_dirs, $1)=`echo " ${_LT_TAGVAR(compiler_lib_search_path, $1)}" | ${SED} -e 's! -L! !g' -e 's!^ !!'`
+fi
+_LT_TAGDECL([], [compiler_lib_search_dirs], [1],
+    [The directories searched by this compiler when creating a shared library])
+_LT_TAGDECL([], [predep_objects], [1],
+    [Dependencies to place before and after the objects being linked to
+    create a shared library])
+_LT_TAGDECL([], [postdep_objects], [1])
+_LT_TAGDECL([], [predeps], [1])
+_LT_TAGDECL([], [postdeps], [1])
+_LT_TAGDECL([], [compiler_lib_search_path], [1],
+    [The library search path used internally by the compiler when linking
+    a shared library])
+])# _LT_SYS_HIDDEN_LIBDEPS
+
+
+# _LT_LANG_F77_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for a Fortran 77 compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_F77_CONFIG],
+[AC_LANG_PUSH(Fortran 77)
+if test -z "$F77" || test "X$F77" = "Xno"; then
+  _lt_disable_F77=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_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_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for f77 test sources.
+ac_ext=f
+
+# Object file extension for compiled f77 test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the F77 compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_F77" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # 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_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${F77-"f77"}
+  CFLAGS=$FFLAGS
+  compiler=$CC
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+  GCC=$G77
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$G77"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## 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...
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC="$lt_save_CC"
+  CFLAGS="$lt_save_CFLAGS"
+fi # test "$_lt_disable_F77" != yes
+
+AC_LANG_POP
+])# _LT_LANG_F77_CONFIG
+
+
+# _LT_LANG_FC_CONFIG([TAG])
+# -------------------------
+# Ensure that the configuration variables for a Fortran compiler are
+# suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_FC_CONFIG],
+[AC_LANG_PUSH(Fortran)
+
+if test -z "$FC" || test "X$FC" = "Xno"; then
+  _lt_disable_FC=yes
+fi
+
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+_LT_TAGVAR(allow_undefined_flag, $1)=
+_LT_TAGVAR(always_export_symbols, $1)=no
+_LT_TAGVAR(archive_expsym_cmds, $1)=
+_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_separator, $1)=
+_LT_TAGVAR(hardcode_minus_L, $1)=no
+_LT_TAGVAR(hardcode_automatic, $1)=no
+_LT_TAGVAR(inherit_rpath, $1)=no
+_LT_TAGVAR(module_cmds, $1)=
+_LT_TAGVAR(module_expsym_cmds, $1)=
+_LT_TAGVAR(link_all_deplibs, $1)=unknown
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+_LT_TAGVAR(no_undefined_flag, $1)=
+_LT_TAGVAR(whole_archive_flag_spec, $1)=
+_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=no
+
+# Source file extension for fc test sources.
+ac_ext=${ac_fc_srcext-f}
+
+# Object file extension for compiled fc test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# No sense in running all these tests if we already determined that
+# the FC compiler isn't working.  Some variables (like enable_shared)
+# are currently assumed to apply to all compilers on this platform,
+# and will be corrupted by setting them based on a non-working compiler.
+if test "$_lt_disable_FC" != yes; then
+  # Code to be used in simple compile tests
+  lt_simple_compile_test_code="\
+      subroutine t
+      return
+      end
+"
+
+  # Code to be used in simple link tests
+  lt_simple_link_test_code="\
+      program t
+      end
+"
+
+  # 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_GCC=$GCC
+  lt_save_CFLAGS=$CFLAGS
+  CC=${FC-"f95"}
+  CFLAGS=$FCFLAGS
+  compiler=$CC
+  GCC=$ac_cv_fc_compiler_gnu
+
+  _LT_TAGVAR(compiler, $1)=$CC
+  _LT_CC_BASENAME([$compiler])
+
+  if test -n "$compiler"; then
+    AC_MSG_CHECKING([if libtool supports shared libraries])
+    AC_MSG_RESULT([$can_build_shared])
+
+    AC_MSG_CHECKING([whether to build shared libraries])
+    test "$can_build_shared" = "no" && enable_shared=no
+
+    # On AIX, shared libraries and static libraries use the same namespace, and
+    # are all built from PIC.
+    case $host_os in
+      aix3*)
+        test "$enable_shared" = yes && enable_static=no
+        if test -n "$RANLIB"; then
+          archive_cmds="$archive_cmds~\$RANLIB \$lib"
+          postinstall_cmds='$RANLIB $lib'
+        fi
+        ;;
+      aix[[4-9]]*)
+       if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+         test "$enable_shared" = yes && enable_static=no
+       fi
+        ;;
+    esac
+    AC_MSG_RESULT([$enable_shared])
+
+    AC_MSG_CHECKING([whether to build static libraries])
+    # Make sure either enable_shared or enable_static is yes.
+    test "$enable_shared" = yes || enable_static=yes
+    AC_MSG_RESULT([$enable_static])
+
+    _LT_TAGVAR(GCC, $1)="$ac_cv_fc_compiler_gnu"
+    _LT_TAGVAR(LD, $1)="$LD"
+
+    ## 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...
+    _LT_SYS_HIDDEN_LIBDEPS($1)
+    _LT_COMPILER_PIC($1)
+    _LT_COMPILER_C_O($1)
+    _LT_COMPILER_FILE_LOCKS($1)
+    _LT_LINKER_SHLIBS($1)
+    _LT_SYS_DYNAMIC_LINKER($1)
+    _LT_LINKER_HARDCODE_LIBPATH($1)
+
+    _LT_CONFIG($1)
+  fi # test -n "$compiler"
+
+  GCC=$lt_save_GCC
+  CC=$lt_save_CC
+  CFLAGS=$lt_save_CFLAGS
+fi # test "$_lt_disable_FC" != yes
+
+AC_LANG_POP
+])# _LT_LANG_FC_CONFIG
+
+
+# _LT_LANG_GCJ_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Java Compiler compiler
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GCJ_CONFIG],
+[AC_REQUIRE([LT_PROG_GCJ])dnl
+AC_LANG_SAVE
+
+# Source file extension for Java test sources.
+ac_ext=java
+
+# Object file extension for compiled Java test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="class foo {}"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='public class conftest { public static void main(String[[]] argv) {}; }'
+
+# 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=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# GCJ 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_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
+# are suitably defined.  These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_RC_CONFIG],
+[AC_REQUIRE([LT_PROG_RC])dnl
+AC_LANG_SAVE
+
+# Source file extension for RC test sources.
+ac_ext=rc
+
+# Object file extension for compiled RC test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code='sample MENU { MENUITEM "&Soup", 100, CHECKED }'
+
+# Code to be used in simple link tests
+lt_simple_link_test_code="$lt_simple_compile_test_code"
+
+# 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=
+CC=${RC-"windres"}
+CFLAGS=
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_CC_BASENAME([$compiler])
+_LT_TAGVAR(lt_cv_prog_compiler_c_o, $1)=yes
+
+if test -n "$compiler"; then
+  :
+  _LT_CONFIG($1)
+fi
+
+GCC=$lt_save_GCC
+AC_LANG_RESTORE
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_RC_CONFIG
+
+
+# LT_PROG_GCJ
+# -----------
+AC_DEFUN([LT_PROG_GCJ],
+[m4_ifdef([AC_PROG_GCJ], [AC_PROG_GCJ],
+  [m4_ifdef([A][M_PROG_GCJ], [A][M_PROG_GCJ],
+    [AC_CHECK_TOOL(GCJ, gcj,)
+      test "x${GCJFLAGS+set}" = xset || GCJFLAGS="-g -O2"
+      AC_SUBST(GCJFLAGS)])])[]dnl
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_GCJ], [LT_PROG_GCJ])
+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],
+[AC_CHECK_TOOL(RC, windres,)
+])
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_RC], [LT_PROG_RC])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_RC], [])
+
+
+# _LT_DECL_EGREP
+# --------------
+# If we don't have a new enough Autoconf to choose the best grep
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_EGREP],
+[AC_REQUIRE([AC_PROG_EGREP])dnl
+AC_REQUIRE([AC_PROG_FGREP])dnl
+test -z "$GREP" && GREP=grep
+_LT_DECL([], [GREP], [1], [A grep program that handles long lines])
+_LT_DECL([], [EGREP], [1], [An ERE matcher])
+_LT_DECL([], [FGREP], [1], [A literal string matcher])
+dnl Non-bleeding-edge autoconf doesn't subst GREP, so do it here too
+AC_SUBST([GREP])
+])
+
+
+# _LT_DECL_OBJDUMP
+# --------------
+# If we don't have a new enough Autoconf to choose the best objdump
+# available, choose the one first in the user's PATH.
+m4_defun([_LT_DECL_OBJDUMP],
+[AC_CHECK_TOOL(OBJDUMP, objdump, false)
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
+AC_SUBST([OBJDUMP])
+])
+
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
+
+# _LT_DECL_SED
+# ------------
+# Check for a fully-functional sed program, that truncates
+# as few characters as possible.  Prefer GNU sed if found.
+m4_defun([_LT_DECL_SED],
+[AC_PROG_SED
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+_LT_DECL([], [SED], [1], [A sed program that does not truncate output])
+_LT_DECL([], [Xsed], ["\$SED -e 1s/^X//"],
+    [Sed that helps us avoid accidentally triggering echo(1) options like -n])
+])# _LT_DECL_SED
+
+m4_ifndef([AC_PROG_SED], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into   #
+#  GNU Autoconf as AC_PROG_SED.  When it is available in   #
+#  a released version of Autoconf we should remove this    #
+#  macro and use it instead.                               #
+############################################################
+
+m4_defun([AC_PROG_SED],
+[AC_MSG_CHECKING([for a sed that does not truncate output])
+AC_CACHE_VAL(lt_cv_path_SED,
+[# Loop through the user's path and test for sed and gsed.
+# Then use that list of sed's as ones to test for truncation.
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for lt_ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      if $as_executable_p "$as_dir/$lt_ac_prog$ac_exec_ext"; then
+        lt_ac_sed_list="$lt_ac_sed_list $as_dir/$lt_ac_prog$ac_exec_ext"
+      fi
+    done
+  done
+done
+IFS=$as_save_IFS
+lt_ac_max=0
+lt_ac_count=0
+# Add /usr/xpg4/bin/sed as it is typically found on Solaris
+# along with /bin/sed that truncates output.
+for lt_ac_sed in $lt_ac_sed_list /usr/xpg4/bin/sed; do
+  test ! -f $lt_ac_sed && continue
+  cat /dev/null > conftest.in
+  lt_ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >conftest.in
+  # Check for GNU sed and select it if it is found.
+  if "$lt_ac_sed" --version 2>&1 < /dev/null | grep 'GNU' > /dev/null; then
+    lt_cv_path_SED=$lt_ac_sed
+    break
+  fi
+  while true; do
+    cat conftest.in conftest.in >conftest.tmp
+    mv conftest.tmp conftest.in
+    cp conftest.in conftest.nl
+    echo >>conftest.nl
+    $lt_ac_sed -e 's/a$//' < conftest.nl >conftest.out || break
+    cmp -s conftest.out conftest.nl || break
+    # 10000 chars as input seems more than enough
+    test $lt_ac_count -gt 10 && break
+    lt_ac_count=`expr $lt_ac_count + 1`
+    if test $lt_ac_count -gt $lt_ac_max; then
+      lt_ac_max=$lt_ac_count
+      lt_cv_path_SED=$lt_ac_sed
+    fi
+  done
+done
+])
+SED=$lt_cv_path_SED
+AC_SUBST([SED])
+AC_MSG_RESULT([$SED])
+])#AC_PROG_SED
+])#m4_ifndef
+
+# Old name:
+AU_ALIAS([LT_AC_PROG_SED], [AC_PROG_SED])
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([LT_AC_PROG_SED], [])
+
+
+# _LT_CHECK_SHELL_FEATURES
+# ------------------------
+# Find out whether the shell is Bourne or XSI compatible,
+# or has some other useful features.
+m4_defun([_LT_CHECK_SHELL_FEATURES],
+[AC_MSG_CHECKING([whether the shell understands some XSI constructs])
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+AC_MSG_RESULT([$xsi_shell])
+_LT_CONFIG_LIBTOOL_INIT([xsi_shell='$xsi_shell'])
+
+AC_MSG_CHECKING([whether the shell understands "+="])
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$[1]+=\$[2]" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+AC_MSG_RESULT([$lt_shell_append])
+_LT_CONFIG_LIBTOOL_INIT([lt_shell_append='$lt_shell_append'])
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+_LT_DECL([], [lt_unset], [0], [whether the shell understands "unset"])dnl
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+_LT_DECL([SP2NL], [lt_SP2NL], [1], [turn spaces into newlines])dnl
+_LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
+])# _LT_CHECK_SHELL_FEATURES
+
+
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([    ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
+
+
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+    case ${1} in
+      */*) func_dirname_result="${1%/*}${2}" ;;
+      *  ) func_dirname_result="${3}" ;;
+    esac
+    func_basename_result="${1##*/}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+    # positional parameters, so assign one to ordinary parameter first.
+    func_stripname_result=${3}
+    func_stripname_result=${func_stripname_result#"${1}"}
+    func_stripname_result=${func_stripname_result%"${2}"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+    func_split_long_opt_name=${1%%=*}
+    func_split_long_opt_arg=${1#*=}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+    func_split_short_opt_arg=${1#??}
+    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
+
+  _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+    case ${1} in
+      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+      *)    func_lo2o_result=${1} ;;
+    esac])
+
+  _LT_PROG_FUNCTION_REPLACE([func_xform], [    func_xform_result=${1%.*}.lo])
+
+  _LT_PROG_FUNCTION_REPLACE([func_arith], [    func_arith_result=$(( $[*] ))])
+
+  _LT_PROG_FUNCTION_REPLACE([func_len], [    func_len_result=${#1}])
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  _LT_PROG_FUNCTION_REPLACE([func_append], [    eval "${1}+=\\${2}"])
+
+  _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+    func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+    eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
+
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path).  These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+         [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+         [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/zfs/config/ltmain.sh b/zfs/config/ltmain.sh
new file mode 100644 (file)
index 0000000..bffda54
--- /dev/null
@@ -0,0 +1,9661 @@
+
+# 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, 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.
+
+# GNU Libtool is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html,
+# or obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+# Usage: $progname [OPTION]... [MODE-ARG]...
+#
+# Provide generalized library-building support services.
+#
+#       --config             show all configuration variables
+#       --debug              enable verbose shell tracing
+#   -n, --dry-run            display commands without modifying any files
+#       --features           display basic configuration information and exit
+#       --mode=MODE          use operation mode MODE
+#       --preserve-dup-deps  don't remove duplicate dependency libraries
+#       --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
+#       --version            print version information
+#   -h, --help, --help-all   print short, long, or detailed help message
+#
+# MODE must be one of the following:
+#
+#         clean              remove files from the build directory
+#         compile            compile a source file into a libtool object
+#         execute            automatically set library path, then run a program
+#         finish             complete the installation of libtool libraries
+#         install            install libraries or executables
+#         link               create a library or an executable
+#         uninstall          remove libraries from an installed directory
+#
+# MODE-ARGS vary depending on the MODE.  When passed as first option,
+# `--mode=MODE' may be abbreviated as `MODE' or a unique abbreviation of that.
+# Try `$progname --help --mode=MODE' for a more detailed description of MODE.
+#
+# When reporting a bug, please describe a test case to reproduce it and
+# include the following information:
+#
+#         host-triplet:        $host
+#         shell:               $SHELL
+#         compiler:            $LTCC
+#         compiler flags:              $LTCFLAGS
+#         linker:              $LD (gnu? $with_gnu_ld)
+#         $progname:   (GNU libtool) 2.4.2 Debian-2.4.2-1.11
+#         automake:    $automake_version
+#         autoconf:    $autoconf_version
+#
+# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
+
+PROGRAM=libtool
+PACKAGE=libtool
+VERSION="2.4.2 Debian-2.4.2-1.11"
+TIMESTAMP=""
+package_revision=1.3337
+
+# Be Bourne compatible
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+}
+
+# NLS nuisances: We save the old values to restore during execute mode.
+lt_user_locale=
+lt_safe_locale=
+for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+do
+  eval "if test \"\${$lt_var+set}\" = set; then
+          save_$lt_var=\$$lt_var
+          $lt_var=C
+         export $lt_var
+         lt_user_locale=\"$lt_var=\\\$save_\$lt_var; \$lt_user_locale\"
+         lt_safe_locale=\"$lt_var=C; \$lt_safe_locale\"
+       fi"
+done
+LC_ALL=C
+LANGUAGE=C
+export LANGUAGE LC_ALL
+
+$lt_unset CDPATH
+
+
+# Work around backward compatibility issue on IRIX 6.5. On IRIX 6.4+, sh
+# is ksh but when the shell is invoked as "sh" and the current value of
+# the _XPG environment variable is not equal to 1 (one), the special
+# positional parameter $0, within a function call, is the name of the
+# function.
+progpath="$0"
+
+
+
+: ${CP="cp -f"}
+test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
+: ${MAKE="make"}
+: ${MKDIR="mkdir"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
+: ${Xsed="$SED -e 1s/^X//"}
+
+# Global variables:
+EXIT_SUCCESS=0
+EXIT_FAILURE=1
+EXIT_MISMATCH=63  # $? = 63 is used to indicate version mismatch to missing.
+EXIT_SKIP=77     # $? = 77 is used to indicate a skipped test to automake.
+
+exit_status=$EXIT_SUCCESS
+
+# Make sure IFS has a sensible default
+lt_nl='
+'
+IFS="  $lt_nl"
+
+dirname="s,/[^/]*$,,"
+basename="s,^.*/,,"
+
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE.  If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+    func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+    func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
+# func_dirname_and_basename file append nondir_replacement
+# perform func_basename and func_dirname in a single function
+# call:
+#   dirname:  Compute the dirname of FILE.  If nonempty,
+#             add APPEND to the result, otherwise set result
+#             to NONDIR_REPLACEMENT.
+#             value returned in "$func_dirname_result"
+#   basename: Compute filename of FILE.
+#             value retuned in "$func_basename_result"
+# Implementation must be kept synchronized with func_dirname
+# and func_basename. For efficiency, we do not delegate to
+# those functions but instead duplicate the functionality here.
+func_dirname_and_basename ()
+{
+    # Extract subdirectory from the argument.
+    func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+    if test "X$func_dirname_result" = "X${1}"; then
+      func_dirname_result="${3}"
+    else
+      func_dirname_result="$func_dirname_result${2}"
+    fi
+    func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+    case ${2} in
+      .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+      *)  func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+    esac
+} # func_stripname may be replaced by extended shell implementation
+
+
+# These SED scripts presuppose an absolute path with a trailing slash.
+pathcar='s,^/\([^/]*\).*$,\1,'
+pathcdr='s,^/[^/]*,,'
+removedotparts=':dotsl
+               s@/\./@/@g
+               t dotsl
+               s,/\.$,/,'
+collapseslashes='s@/\{1,\}@/@g'
+finalslash='s,/*$,/,'
+
+# func_normal_abspath PATH
+# Remove doubled-up and trailing slashes, "." path components,
+# and cancel out any ".." path components in PATH after making
+# it an absolute path.
+#             value returned in "$func_normal_abspath_result"
+func_normal_abspath ()
+{
+  # Start from root dir and reassemble the path.
+  func_normal_abspath_result=
+  func_normal_abspath_tpath=$1
+  func_normal_abspath_altnamespace=
+  case $func_normal_abspath_tpath in
+    "")
+      # Empty path, that just means $cwd.
+      func_stripname '' '/' "`pwd`"
+      func_normal_abspath_result=$func_stripname_result
+      return
+    ;;
+    # The next three entries are used to spot a run of precisely
+    # two leading slashes without using negated character classes;
+    # we take advantage of case's first-match behaviour.
+    ///*)
+      # Unusual form of absolute path, do nothing.
+    ;;
+    //*)
+      # Not necessarily an ordinary path; POSIX reserves leading '//'
+      # and for example Cygwin uses it to access remote file shares
+      # over CIFS/SMB, so we conserve a leading double slash if found.
+      func_normal_abspath_altnamespace=/
+    ;;
+    /*)
+      # Absolute path, do nothing.
+    ;;
+    *)
+      # Relative path, prepend $cwd.
+      func_normal_abspath_tpath=`pwd`/$func_normal_abspath_tpath
+    ;;
+  esac
+  # Cancel out all the simple stuff to save iterations.  We also want
+  # the path to end with a slash for ease of parsing, so make sure
+  # there is one (and only one) here.
+  func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$removedotparts" -e "$collapseslashes" -e "$finalslash"`
+  while :; do
+    # Processed it all yet?
+    if test "$func_normal_abspath_tpath" = / ; then
+      # If we ascended to the root using ".." the result may be empty now.
+      if test -z "$func_normal_abspath_result" ; then
+        func_normal_abspath_result=/
+      fi
+      break
+    fi
+    func_normal_abspath_tcomponent=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcar"`
+    func_normal_abspath_tpath=`$ECHO "$func_normal_abspath_tpath" | $SED \
+        -e "$pathcdr"`
+    # Figure out what to do with it
+    case $func_normal_abspath_tcomponent in
+      "")
+        # Trailing empty path component, ignore it.
+      ;;
+      ..)
+        # Parent dir; strip last assembled component from result.
+        func_dirname "$func_normal_abspath_result"
+        func_normal_abspath_result=$func_dirname_result
+      ;;
+      *)
+        # Actual path component, append it.
+        func_normal_abspath_result=$func_normal_abspath_result/$func_normal_abspath_tcomponent
+      ;;
+    esac
+  done
+  # Restore leading double-slash if one was found on entry.
+  func_normal_abspath_result=$func_normal_abspath_altnamespace$func_normal_abspath_result
+}
+
+# func_relative_path SRCDIR DSTDIR
+# generates a relative path from SRCDIR to DSTDIR, with a trailing
+# slash if non-empty, suitable for immediately appending a filename
+# without needing to append a separator.
+#             value returned in "$func_relative_path_result"
+func_relative_path ()
+{
+  func_relative_path_result=
+  func_normal_abspath "$1"
+  func_relative_path_tlibdir=$func_normal_abspath_result
+  func_normal_abspath "$2"
+  func_relative_path_tbindir=$func_normal_abspath_result
+
+  # Ascend the tree starting from libdir
+  while :; do
+    # check if we have found a prefix of bindir
+    case $func_relative_path_tbindir in
+      $func_relative_path_tlibdir)
+        # found an exact match
+        func_relative_path_tcancelled=
+        break
+        ;;
+      $func_relative_path_tlibdir*)
+        # found a matching prefix
+        func_stripname "$func_relative_path_tlibdir" '' "$func_relative_path_tbindir"
+        func_relative_path_tcancelled=$func_stripname_result
+        if test -z "$func_relative_path_result"; then
+          func_relative_path_result=.
+        fi
+        break
+        ;;
+      *)
+        func_dirname $func_relative_path_tlibdir
+        func_relative_path_tlibdir=${func_dirname_result}
+        if test "x$func_relative_path_tlibdir" = x ; then
+          # Have to descend all the way to the root!
+          func_relative_path_result=../$func_relative_path_result
+          func_relative_path_tcancelled=$func_relative_path_tbindir
+          break
+        fi
+        func_relative_path_result=../$func_relative_path_result
+        ;;
+    esac
+  done
+
+  # Now calculate path; take care to avoid doubling-up slashes.
+  func_stripname '' '/' "$func_relative_path_result"
+  func_relative_path_result=$func_stripname_result
+  func_stripname '/' '/' "$func_relative_path_tcancelled"
+  if test "x$func_stripname_result" != x ; then
+    func_relative_path_result=${func_relative_path_result}/${func_stripname_result}
+  fi
+
+  # Normalisation. If bindir is libdir, return empty string,
+  # else relative path ending with a slash; either way, target
+  # file name can be directly appended.
+  if test ! -z "$func_relative_path_result"; then
+    func_stripname './' '' "$func_relative_path_result/"
+    func_relative_path_result=$func_stripname_result
+  fi
+}
+
+# The name of this program:
+func_dirname_and_basename "$progpath"
+progname=$func_basename_result
+
+# Make sure we have an absolute path for reexecution:
+case $progpath in
+  [\\/]*|[A-Za-z]:\\*) ;;
+  *[\\/]*)
+     progdir=$func_dirname_result
+     progdir=`cd "$progdir" && pwd`
+     progpath="$progdir/$progname"
+     ;;
+  *)
+     save_IFS="$IFS"
+     IFS=${PATH_SEPARATOR-:}
+     for progdir in $PATH; do
+       IFS="$save_IFS"
+       test -x "$progdir/$progname" && break
+     done
+     IFS="$save_IFS"
+     test -n "$progdir" || progdir=`pwd`
+     progpath="$progdir/$progname"
+     ;;
+esac
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+Xsed="${SED}"' -e 1s/^X//'
+sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes.  A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
+# Re-`\' parameter expansions in output of double_quote_subst that were
+# `\'-ed in input to the same.  If an odd number of `\' preceded a '$'
+# in input to double_quote_subst, that '$' was protected from expansion.
+# Since each input `\' is now two `\'s, look for any number of runs of
+# four `\'s followed by two `\'s and then a '$'.  `\' that '$'.
+bs='\\'
+bs2='\\\\'
+bs4='\\\\\\\\'
+dollar='\$'
+sed_double_backslash="\
+  s/$bs4/&\\
+/g
+  s/^$bs2$dollar/$bs&/
+  s/\\([^$bs]\\)$bs2$dollar/\\1$bs2$bs$dollar/g
+  s/\n//g"
+
+# Standard options:
+opt_dry_run=false
+opt_help=false
+opt_quiet=false
+opt_verbose=false
+opt_warning=:
+
+# func_echo arg...
+# Echo program name prefixed message, along with the current mode
+# name if it has been set yet.
+func_echo ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
+}
+
+# func_verbose arg...
+# Echo program name prefixed message in verbose mode only.
+func_verbose ()
+{
+    $opt_verbose && func_echo ${1+"$@"}
+
+    # A bug in bash halts the script if the last line of a function
+    # fails when set -e is in force, so we need another command to
+    # work around that:
+    :
+}
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO "$*"
+}
+
+# func_error arg...
+# Echo program name prefixed message to standard error.
+func_error ()
+{
+    $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
+}
+
+# func_warning arg...
+# Echo program name prefixed warning message to standard error.
+func_warning ()
+{
+    $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
+
+    # bash bug again:
+    :
+}
+
+# func_fatal_error arg...
+# Echo program name prefixed message to standard error, and exit.
+func_fatal_error ()
+{
+    func_error ${1+"$@"}
+    exit $EXIT_FAILURE
+}
+
+# func_fatal_help arg...
+# Echo program name prefixed message to standard error, followed by
+# a help hint, and exit.
+func_fatal_help ()
+{
+    func_error ${1+"$@"}
+    func_fatal_error "$help"
+}
+help="Try \`$progname --help' for more information."  ## default
+
+
+# func_grep expression filename
+# Check whether EXPRESSION matches any line of FILENAME, without output.
+func_grep ()
+{
+    $GREP "$1" "$2" >/dev/null 2>&1
+}
+
+
+# func_mkdir_p directory-path
+# Make sure the entire path to DIRECTORY-PATH is available.
+func_mkdir_p ()
+{
+    my_directory_path="$1"
+    my_dir_list=
+
+    if test -n "$my_directory_path" && test "$opt_dry_run" != ":"; then
+
+      # Protect directory names starting with `-'
+      case $my_directory_path in
+        -*) my_directory_path="./$my_directory_path" ;;
+      esac
+
+      # While some portion of DIR does not yet exist...
+      while test ! -d "$my_directory_path"; do
+        # ...make a list in topmost first order.  Use a colon delimited
+       # list incase some portion of path contains whitespace.
+        my_dir_list="$my_directory_path:$my_dir_list"
+
+        # If the last portion added has no slash in it, the list is done
+        case $my_directory_path in */*) ;; *) break ;; esac
+
+        # ...otherwise throw away the child directory and loop
+        my_directory_path=`$ECHO "$my_directory_path" | $SED -e "$dirname"`
+      done
+      my_dir_list=`$ECHO "$my_dir_list" | $SED 's,:*$,,'`
+
+      save_mkdir_p_IFS="$IFS"; IFS=':'
+      for my_dir in $my_dir_list; do
+       IFS="$save_mkdir_p_IFS"
+        # mkdir can fail with a `File exist' error if two processes
+        # try to create one of the directories concurrently.  Don't
+        # stop in that case!
+        $MKDIR "$my_dir" 2>/dev/null || :
+      done
+      IFS="$save_mkdir_p_IFS"
+
+      # Bail out if we (or some other process) failed to create a directory.
+      test -d "$my_directory_path" || \
+        func_fatal_error "Failed to create \`$1'"
+    fi
+}
+
+
+# func_mktempdir [string]
+# Make a temporary directory that won't clash with other running
+# libtool processes, and avoids race conditions if possible.  If
+# given, STRING is the basename for that directory.
+func_mktempdir ()
+{
+    my_template="${TMPDIR-/tmp}/${1-$progname}"
+
+    if test "$opt_dry_run" = ":"; then
+      # Return a directory name, but don't create it in dry-run mode
+      my_tmpdir="${my_template}-$$"
+    else
+
+      # If mktemp works, use that first and foremost
+      my_tmpdir=`mktemp -d "${my_template}-XXXXXXXX" 2>/dev/null`
+
+      if test ! -d "$my_tmpdir"; then
+        # Failing that, at least try and use $RANDOM to avoid a race
+        my_tmpdir="${my_template}-${RANDOM-0}$$"
+
+        save_mktempdir_umask=`umask`
+        umask 0077
+        $MKDIR "$my_tmpdir"
+        umask $save_mktempdir_umask
+      fi
+
+      # If we're not in dry-run mode, bomb out on failure
+      test -d "$my_tmpdir" || \
+        func_fatal_error "cannot create temporary directory \`$my_tmpdir'"
+    fi
+
+    $ECHO "$my_tmpdir"
+}
+
+
+# func_quote_for_eval arg
+# Aesthetically quote ARG to be evaled later.
+# This function returns two values: FUNC_QUOTE_FOR_EVAL_RESULT
+# is double-quoted, suitable for a subsequent eval, whereas
+# FUNC_QUOTE_FOR_EVAL_UNQUOTED_RESULT has merely all characters
+# which are still active within double quotes backslashified.
+func_quote_for_eval ()
+{
+    case $1 in
+      *[\\\`\"\$]*)
+       func_quote_for_eval_unquoted_result=`$ECHO "$1" | $SED "$sed_quote_subst"` ;;
+      *)
+        func_quote_for_eval_unquoted_result="$1" ;;
+    esac
+
+    case $func_quote_for_eval_unquoted_result in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting, command substitution and and variable
+      # expansion for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        func_quote_for_eval_result="\"$func_quote_for_eval_unquoted_result\""
+        ;;
+      *)
+        func_quote_for_eval_result="$func_quote_for_eval_unquoted_result"
+    esac
+}
+
+
+# func_quote_for_expand arg
+# Aesthetically quote ARG to be evaled later; same as above,
+# but do not quote variable references.
+func_quote_for_expand ()
+{
+    case $1 in
+      *[\\\`\"]*)
+       my_arg=`$ECHO "$1" | $SED \
+           -e "$double_quote_subst" -e "$sed_double_backslash"` ;;
+      *)
+        my_arg="$1" ;;
+    esac
+
+    case $my_arg in
+      # Double-quote args containing shell metacharacters to delay
+      # word splitting and command substitution for a subsequent eval.
+      # Many Bourne shells cannot handle close brackets correctly
+      # in scan sets, so we specify it separately.
+      *[\[\~\#\^\&\*\(\)\{\}\|\;\<\>\?\'\ \    ]*|*]*|"")
+        my_arg="\"$my_arg\""
+        ;;
+    esac
+
+    func_quote_for_expand_result="$my_arg"
+}
+
+
+# func_show_eval cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.
+func_show_eval ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$my_cmd"
+      my_status=$?
+      if test "$my_status" -eq 0; then :; else
+       eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+
+# func_show_eval_locale cmd [fail_exp]
+# Unless opt_silent is true, then output CMD.  Then, if opt_dryrun is
+# not true, evaluate CMD.  If the evaluation of CMD fails, and FAIL_EXP
+# is given, then evaluate it.  Use the saved locale for evaluation.
+func_show_eval_locale ()
+{
+    my_cmd="$1"
+    my_fail_exp="${2-:}"
+
+    ${opt_silent-false} || {
+      func_quote_for_expand "$my_cmd"
+      eval "func_echo $func_quote_for_expand_result"
+    }
+
+    if ${opt_dry_run-false}; then :; else
+      eval "$lt_user_locale
+           $my_cmd"
+      my_status=$?
+      eval "$lt_safe_locale"
+      if test "$my_status" -eq 0; then :; else
+       eval "(exit $my_status); $my_fail_exp"
+      fi
+    fi
+}
+
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result.  All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+  case $1 in
+  [0-9]* | *[!a-zA-Z0-9_]*)
+    func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+    ;;
+  * )
+    func_tr_sh_result=$1
+    ;;
+  esac
+}
+
+
+# func_version
+# Echo version message to standard output and exit.
+func_version ()
+{
+    $opt_debug
+
+    $SED -n '/(C)/!b go
+       :more
+       /\./!{
+         N
+         s/\n# / /
+         b more
+       }
+       :go
+       /^# '$PROGRAM' (GNU /,/# warranty; / {
+        s/^# //
+       s/^# *$//
+        s/\((C)\)[ 0-9,-]*\( [1-9][0-9]*\)/\1\2/
+        p
+     }' < "$progpath"
+     exit $?
+}
+
+# func_usage
+# Echo short help message to standard output and exit.
+func_usage ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/^#  *.*--help/ {
+        s/^# //
+       s/^# *$//
+       s/\$progname/'$progname'/
+       p
+    }' < "$progpath"
+    echo
+    $ECHO "run \`$progname --help | more' for full usage"
+    exit $?
+}
+
+# func_help [NOEXIT]
+# Echo long help message to standard output and exit,
+# unless 'noexit' is passed as argument.
+func_help ()
+{
+    $opt_debug
+
+    $SED -n '/^# Usage:/,/# Report bugs to/ {
+       :print
+        s/^# //
+       s/^# *$//
+       s*\$progname*'$progname'*
+       s*\$host*'"$host"'*
+       s*\$SHELL*'"$SHELL"'*
+       s*\$LTCC*'"$LTCC"'*
+       s*\$LTCFLAGS*'"$LTCFLAGS"'*
+       s*\$LD*'"$LD"'*
+       s/\$with_gnu_ld/'"$with_gnu_ld"'/
+       s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+       s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
+       p
+       d
+     }
+     /^# .* home page:/b print
+     /^# General help using/b print
+     ' < "$progpath"
+    ret=$?
+    if test -z "$1"; then
+      exit $ret
+    fi
+}
+
+# func_missing_arg argname
+# Echo program name prefixed message to standard error and set global
+# exit_cmd.
+func_missing_arg ()
+{
+    $opt_debug
+
+    func_error "missing argument for $1."
+    exit_cmd=exit
+}
+
+
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+    my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+    my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+    func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+    func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+    my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+    my_sed_long_arg='1s/^--[^=]*=//'
+
+    func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+    func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
+
+
+
+
+
+magic="%%%MAGIC variable%%%"
+magic_exe="%%%MAGIC EXE variable%%%"
+
+# Global variables.
+nonopt=
+preserve_args=
+lo2o="s/\\.lo\$/.${objext}/"
+o2lo="s/\\.${objext}\$/.lo/"
+extracted_archives=
+extracted_serial=0
+
+# If this variable is set in any of the actions, the command in it
+# will be execed at the end.  This prevents here-documents from being
+# left over by shells.
+exec_cmd=
+
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+    eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+    func_quote_for_eval "${2}"
+    eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+    func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+    func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+    func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+    func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
+# func_fatal_configuration arg...
+# Echo program name prefixed message to standard error, followed by
+# a configuration failure hint, and exit.
+func_fatal_configuration ()
+{
+    func_error ${1+"$@"}
+    func_error "See the $PACKAGE documentation for more information."
+    func_fatal_error "Fatal configuration error."
+}
+
+
+# func_config
+# Display the configuration for all the tags in this script.
+func_config ()
+{
+    re_begincf='^# ### BEGIN LIBTOOL'
+    re_endcf='^# ### END LIBTOOL'
+
+    # Default configuration.
+    $SED "1,/$re_begincf CONFIG/d;/$re_endcf CONFIG/,\$d" < "$progpath"
+
+    # Now print the configurations for the tags.
+    for tagname in $taglist; do
+      $SED -n "/$re_begincf TAG CONFIG: $tagname\$/,/$re_endcf TAG CONFIG: $tagname\$/p" < "$progpath"
+    done
+
+    exit $?
+}
+
+# func_features
+# Display the features supported by this script.
+func_features ()
+{
+    echo "host: $host"
+    if test "$build_libtool_libs" = yes; then
+      echo "enable shared libraries"
+    else
+      echo "disable shared libraries"
+    fi
+    if test "$build_old_libs" = yes; then
+      echo "enable static libraries"
+    else
+      echo "disable static libraries"
+    fi
+
+    exit $?
+}
+
+# func_enable_tag tagname
+# Verify that TAGNAME is valid, and either flag an error and exit, or
+# enable the TAGNAME tag.  We also add TAGNAME to the global $taglist
+# variable here.
+func_enable_tag ()
+{
+  # Global variable:
+  tagname="$1"
+
+  re_begincf="^# ### BEGIN LIBTOOL TAG CONFIG: $tagname\$"
+  re_endcf="^# ### END LIBTOOL TAG CONFIG: $tagname\$"
+  sed_extractcf="/$re_begincf/,/$re_endcf/p"
+
+  # Validate tagname.
+  case $tagname in
+    *[!-_A-Za-z0-9,/]*)
+      func_fatal_error "invalid tag name: $tagname"
+      ;;
+  esac
+
+  # Don't test for the "default" C tag, as we know it's
+  # there but not specially marked.
+  case $tagname in
+    CC) ;;
+    *)
+      if $GREP "$re_begincf" "$progpath" >/dev/null 2>&1; then
+       taglist="$taglist $tagname"
+
+       # Evaluate the configuration.  Be careful to quote the path
+       # and the sed script, to avoid splitting on whitespace, but
+       # also don't use non-portable quotes within backquotes within
+       # quotes we have to do it in 2 steps:
+       extractedcf=`$SED -n -e "$sed_extractcf" < "$progpath"`
+       eval "$extractedcf"
+      else
+       func_error "ignoring unknown tag $tagname"
+      fi
+      ;;
+  esac
+}
+
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
+{
+  if test "$package_revision" != "$macro_revision"; then
+    if test "$VERSION" != "$macro_version"; then
+      if test -z "$macro_version"; then
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      else
+        cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+      fi
+    else
+      cat >&2 <<_LT_EOF
+$progname: Version mismatch error.  This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+    fi
+
+    exit $EXIT_MISMATCH
+  fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+  shift; set dummy --mode clean ${1+"$@"}; shift
+  ;;
+compile|compil|compi|comp|com|co|c)
+  shift; set dummy --mode compile ${1+"$@"}; shift
+  ;;
+execute|execut|execu|exec|exe|ex|e)
+  shift; set dummy --mode execute ${1+"$@"}; shift
+  ;;
+finish|finis|fini|fin|fi|f)
+  shift; set dummy --mode finish ${1+"$@"}; shift
+  ;;
+install|instal|insta|inst|ins|in|i)
+  shift; set dummy --mode install ${1+"$@"}; shift
+  ;;
+link|lin|li|l)
+  shift; set dummy --mode link ${1+"$@"}; shift
+  ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+  shift; set dummy --mode uninstall ${1+"$@"}; shift
+  ;;
+esac
+
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly.  This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+  # this just eases exit handling
+  while test $# -gt 0; do
+    opt="$1"
+    shift
+    case $opt in
+      --debug|-x)      opt_debug='set -x'
+                       func_echo "enabling shell trace mode"
+                       $opt_debug
+                       ;;
+      --dry-run|--dryrun|-n)
+                       opt_dry_run=:
+                       ;;
+      --config)
+                       opt_config=:
+func_config
+                       ;;
+      --dlopen|-dlopen)
+                       optarg="$1"
+                       opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
+                       shift
+                       ;;
+      --preserve-dup-deps)
+                       opt_preserve_dup_deps=:
+                       ;;
+      --features)
+                       opt_features=:
+func_features
+                       ;;
+      --finish)
+                       opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+                       ;;
+      --help)
+                       opt_help=:
+                       ;;
+      --help-all)
+                       opt_help_all=:
+opt_help=': help-all'
+                       ;;
+      --mode)
+                       test $# = 0 && func_missing_arg $opt && break
+                       optarg="$1"
+                       opt_mode="$optarg"
+case $optarg in
+  # Valid mode arguments:
+  clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+  # Catch anything else as an error
+  *) func_error "invalid argument for $opt"
+     exit_cmd=exit
+     break
+     ;;
+esac
+                       shift
+                       ;;
+      --no-silent|--no-quiet)
+                       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"
+                       ;;
+      --silent|--quiet)
+                       opt_silent=:
+func_append preserve_args " $opt"
+        opt_verbose=false
+                       ;;
+      --verbose|-v)
+                       opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+                       ;;
+      --tag)
+                       test $# = 0 && func_missing_arg $opt && break
+                       optarg="$1"
+                       opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
+                       shift
+                       ;;
+
+      -\?|-h)          func_usage                              ;;
+      --help)          func_help                               ;;
+      --version)       func_version                            ;;
+
+      # Separate optargs to long options:
+      --*=*)
+                       func_split_long_opt "$opt"
+                       set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
+                       shift
+                       ;;
+
+      # Separate non-argument short options:
+      -\?*|-h*|-n*|-v*)
+                       func_split_short_opt "$opt"
+                       set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+                       shift
+                       ;;
+
+      --)              break                                   ;;
+      -*)              func_fatal_help "unrecognized option \`$opt'" ;;
+      *)               set dummy "$opt" ${1+"$@"};     shift; break  ;;
+    esac
+  done
+
+  # Validate options:
+
+  # save first non-option argument
+  if test "$#" -gt 0; then
+    nonopt="$opt"
+    shift
+  fi
+
+  # preserve --debug
+  test "$opt_debug" = : || func_append preserve_args " --debug"
+
+  case $host in
+    *cygwin* | *mingw* | *pw32* | *cegcc*)
+      # don't eliminate duplications in $postdeps and $predeps
+      opt_duplicate_compiler_generated_deps=:
+      ;;
+    *)
+      opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
+      ;;
+  esac
+
+  $opt_help || {
+    # Sanity checks first:
+    func_check_version_match
+
+    if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+      func_fatal_configuration "not configured to build any kind of library"
+    fi
+
+    # Darwin sucks
+    eval std_shrext=\"$shrext_cmds\"
+
+    # Only execute mode is allowed to have -dlopen flags.
+    if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+      func_error "unrecognized option \`-dlopen'"
+      $ECHO "$help" 1>&2
+      exit $EXIT_FAILURE
+    fi
+
+    # Change the help message to a mode-specific one.
+    generic_help="$help"
+    help="Try \`$progname --help --mode=$opt_mode' for more information."
+  }
+
+
+  # Bail if the options were screwed
+  $exit_cmd $EXIT_FAILURE
+}
+
+
+
+
+## ----------- ##
+##    Main.    ##
+## ----------- ##
+
+# func_lalib_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_lalib_p ()
+{
+    test -f "$1" &&
+      $SED -e 4q "$1" 2>/dev/null \
+        | $GREP "^# Generated by .*$PACKAGE" > /dev/null 2>&1
+}
+
+# func_lalib_unsafe_p file
+# True iff FILE is a libtool `.la' library or `.lo' object file.
+# This function implements the same check as func_lalib_p without
+# resorting to external programs.  To this end, it redirects stdin and
+# closes it afterwards, without saving the original file descriptor.
+# As a safety measure, use it only where a negative result would be
+# fatal anyway.  Works if `file' does not exist.
+func_lalib_unsafe_p ()
+{
+    lalib_p=no
+    if test -f "$1" && test -r "$1" && exec 5<&0 <"$1"; then
+       for lalib_p_l in 1 2 3 4
+       do
+           read lalib_p_line
+           case "$lalib_p_line" in
+               \#\ Generated\ by\ *$PACKAGE* ) lalib_p=yes; break;;
+           esac
+       done
+       exec 0<&5 5<&-
+    fi
+    test "$lalib_p" = yes
+}
+
+# func_ltwrapper_script_p file
+# True iff FILE is a libtool wrapper script
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_script_p ()
+{
+    func_lalib_p "$1"
+}
+
+# func_ltwrapper_executable_p file
+# True iff FILE is a libtool wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_executable_p ()
+{
+    func_ltwrapper_exec_suffix=
+    case $1 in
+    *.exe) ;;
+    *) func_ltwrapper_exec_suffix=.exe ;;
+    esac
+    $GREP "$magic_exe" "$1$func_ltwrapper_exec_suffix" >/dev/null 2>&1
+}
+
+# func_ltwrapper_scriptname file
+# Assumes file is an ltwrapper_executable
+# uses $file to determine the appropriate filename for a
+# temporary ltwrapper_script.
+func_ltwrapper_scriptname ()
+{
+    func_dirname_and_basename "$1" "" "."
+    func_stripname '' '.exe' "$func_basename_result"
+    func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
+}
+
+# func_ltwrapper_p file
+# True iff FILE is a libtool wrapper script or wrapper executable
+# This function is only a basic sanity check; it will hardly flush out
+# determined imposters.
+func_ltwrapper_p ()
+{
+    func_ltwrapper_script_p "$1" || func_ltwrapper_executable_p "$1"
+}
+
+
+# func_execute_cmds commands fail_cmd
+# Execute tilde-delimited COMMANDS.
+# If FAIL_CMD is given, eval that upon failure.
+# FAIL_CMD may read-access the current command in variable CMD!
+func_execute_cmds ()
+{
+    $opt_debug
+    save_ifs=$IFS; IFS='~'
+    for cmd in $1; do
+      IFS=$save_ifs
+      eval cmd=\"$cmd\"
+      func_show_eval "$cmd" "${2-:}"
+    done
+    IFS=$save_ifs
+}
+
+
+# func_source file
+# Source FILE, adding directory component if necessary.
+# Note that it is not necessary on cygwin/mingw to append a dot to
+# FILE even if both FILE and FILE.exe exist: automatic-append-.exe
+# behavior happens only for exec(3), not for open(2)!  Also, sourcing
+# `FILE.' does not work on cygwin managed mounts.
+func_source ()
+{
+    $opt_debug
+    case $1 in
+    */* | *\\*)        . "$1" ;;
+    *)         . "./$1" ;;
+    esac
+}
+
+
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot.  Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+  func_resolve_sysroot_result=$1
+  case $func_resolve_sysroot_result in
+  =*)
+    func_stripname '=' '' "$func_resolve_sysroot_result"
+    func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+    ;;
+  esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+  case "$lt_sysroot:$1" in
+  ?*:"$lt_sysroot"*)
+    func_stripname "$lt_sysroot" '' "$1"
+    func_replace_sysroot_result="=$func_stripname_result"
+    ;;
+  *)
+    # Including no sysroot.
+    func_replace_sysroot_result=$1
+    ;;
+  esac
+}
+
+# func_infer_tag arg
+# Infer tagged configuration to use if any are available and
+# if one wasn't chosen via the "--tag" command line option.
+# Only attempt this if the compiler in the base compile
+# command doesn't match the default compiler.
+# arg is usually of the form 'gcc ...'
+func_infer_tag ()
+{
+    $opt_debug
+    if test -n "$available_tags" && test -z "$tagname"; then
+      CC_quoted=
+      for arg in $CC; do
+       func_append_quoted CC_quoted "$arg"
+      done
+      CC_expanded=`func_echo_all $CC`
+      CC_quoted_expanded=`func_echo_all $CC_quoted`
+      case $@ in
+      # Blanks in the command may have been stripped by the calling shell,
+      # but not from the CC environment variable when configure was run.
+      " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+      " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*) ;;
+      # Blanks at the start of $base_compile will cause this to fail
+      # if we don't check for them as well.
+      *)
+       for z in $available_tags; do
+         if $GREP "^# ### BEGIN LIBTOOL TAG CONFIG: $z$" < "$progpath" > /dev/null; then
+           # Evaluate the configuration.
+           eval "`${SED} -n -e '/^# ### BEGIN LIBTOOL TAG CONFIG: '$z'$/,/^# ### END LIBTOOL TAG CONFIG: '$z'$/p' < $progpath`"
+           CC_quoted=
+           for arg in $CC; do
+             # Double-quote args containing other shell metacharacters.
+             func_append_quoted CC_quoted "$arg"
+           done
+           CC_expanded=`func_echo_all $CC`
+           CC_quoted_expanded=`func_echo_all $CC_quoted`
+           case "$@ " in
+           " $CC "* | "$CC "* | " $CC_expanded "* | "$CC_expanded "* | \
+           " $CC_quoted"* | "$CC_quoted "* | " $CC_quoted_expanded "* | "$CC_quoted_expanded "*)
+             # The compiler in the base compile command matches
+             # the one in the tagged configuration.
+             # Assume this is the tagged configuration we want.
+             tagname=$z
+             break
+             ;;
+           esac
+         fi
+       done
+       # If $tagname still isn't set, then no tagged configuration
+       # was found and let the user know that the "--tag" command
+       # line option must be used.
+       if test -z "$tagname"; then
+         func_echo "unable to infer tagged configuration"
+         func_fatal_error "specify a tag with \`--tag'"
+#      else
+#        func_verbose "using $tagname tagged configuration"
+       fi
+       ;;
+      esac
+    fi
+}
+
+
+
+# func_write_libtool_object output_name pic_name nonpic_name
+# Create a libtool object file (analogous to a ".la" file),
+# but don't create it if we're doing a dry run.
+func_write_libtool_object ()
+{
+    write_libobj=${1}
+    if test "$build_libtool_libs" = yes; then
+      write_lobj=\'${2}\'
+    else
+      write_lobj=none
+    fi
+
+    if test "$build_old_libs" = yes; then
+      write_oldobj=\'${3}\'
+    else
+      write_oldobj=none
+    fi
+
+    $opt_dry_run || {
+      cat >${write_libobj}T <<EOF
+# $write_libobj - a libtool object file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# Name of the PIC object.
+pic_object=$write_lobj
+
+# Name of the non-PIC object
+non_pic_object=$write_oldobj
+
+EOF
+      $MV "${write_libobj}T" "${write_libobj}"
+    }
+}
+
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+  $opt_debug
+  func_convert_core_file_wine_to_w32_result="$1"
+  if test -n "$1"; then
+    # Unfortunately, winepath does not exit with a non-zero error code, so we
+    # are forced to check the contents of stdout. On the other hand, if the
+    # command is not found, the shell will set an exit code of 127 and print
+    # *an error message* to stdout. So we must check for both error code of
+    # zero AND non-empty stdout, which explains the odd construction:
+    func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+    if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+      func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+        $SED -e "$lt_sed_naive_backslashify"`
+    else
+      func_convert_core_file_wine_to_w32_result=
+    fi
+  fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+  $opt_debug
+  # unfortunately, winepath doesn't convert paths, only file names
+  func_convert_core_path_wine_to_w32_result=""
+  if test -n "$1"; then
+    oldIFS=$IFS
+    IFS=:
+    for func_convert_core_path_wine_to_w32_f in $1; do
+      IFS=$oldIFS
+      func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+      if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+        if test -z "$func_convert_core_path_wine_to_w32_result"; then
+          func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+        else
+          func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+        fi
+      fi
+    done
+    IFS=$oldIFS
+  fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+  $opt_debug
+  if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+    func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+    if test "$?" -ne 0; then
+      # on failure, ensure result is empty
+      func_cygpath_result=
+    fi
+  else
+    func_cygpath_result=
+    func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+  fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format.  Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+  $opt_debug
+  # awkward: cmd appends spaces to result
+  func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+    $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+  $opt_debug
+  if test -z "$2" && test -n "$1" ; then
+    func_error "Could not determine host file name corresponding to"
+    func_error "  \`$1'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback:
+    func_to_host_file_result="$1"
+  fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+  $opt_debug
+  if test -z "$4" && test -n "$3"; then
+    func_error "Could not determine the host path corresponding to"
+    func_error "  \`$3'"
+    func_error "Continuing, but uninstalled executables may not work."
+    # Fallback.  This is a deliberately simplistic "conversion" and
+    # should not be "improved".  See libtool.info.
+    if test "x$1" != "x$2"; then
+      lt_replace_pathsep_chars="s|$1|$2|g"
+      func_to_host_path_result=`echo "$3" |
+        $SED -e "$lt_replace_pathsep_chars"`
+    else
+      func_to_host_path_result="$3"
+    fi
+  fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+  $opt_debug
+  case $4 in
+  $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+    ;;
+  esac
+  case $4 in
+  $2 ) func_append func_to_host_path_result "$3"
+    ;;
+  esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+  $opt_debug
+  $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result.  If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+  $opt_debug
+  case ,$2, in
+    *,"$to_tool_file_cmd",*)
+      func_to_tool_file_result=$1
+      ;;
+    *)
+      $to_tool_file_cmd "$1"
+      func_to_tool_file_result=$func_to_host_file_result
+      ;;
+  esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+  func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+    # LT_CYGPATH in this case.
+    func_to_host_file_result=`cygpath -m "$1"`
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format.  Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_file_wine_to_w32 "$1"
+    func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    func_convert_core_msys_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_msys_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format.  Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set.  Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_file_result="$1"
+  if test -n "$1"; then
+    # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+    func_convert_core_file_wine_to_w32 "$1"
+    func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+    func_to_host_file_result="$func_cygpath_result"
+  fi
+  func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format.  If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+#   file name conversion function    : func_convert_file_X_to_Y ()
+#   path conversion function         : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same.  If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+  $opt_debug
+  if test -z "$to_host_path_cmd"; then
+    func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+    to_host_path_cmd="func_convert_path_${func_stripname_result}"
+  fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+  $opt_debug
+  func_init_to_host_path_cmd
+  $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+  func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper.  Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from ARG.  MSYS
+    # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+    # and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format.  Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format.  Requires a wine environment and
+# a working winepath.  Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+    func_convert_path_check : ";" \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+  fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format.  Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # See func_convert_path_msys_to_w32:
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format.  Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set.  Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+  $opt_debug
+  func_to_host_path_result="$1"
+  if test -n "$1"; then
+    # Remove leading and trailing path separator characters from
+    # ARG. msys behavior is inconsistent here, cygpath turns them
+    # into '.;' and ';.', and winepath ignores them completely.
+    func_stripname : : "$1"
+    func_to_host_path_tmp1=$func_stripname_result
+    func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+    func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+    func_to_host_path_result="$func_cygpath_result"
+    func_convert_path_check : : \
+      "$func_to_host_path_tmp1" "$func_to_host_path_result"
+    func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+  fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
+# func_mode_compile arg...
+func_mode_compile ()
+{
+    $opt_debug
+    # Get the compilation command and the source file.
+    base_compile=
+    srcfile="$nonopt"  #  always keep a non-empty value in "srcfile"
+    suppress_opt=yes
+    suppress_output=
+    arg_mode=normal
+    libobj=
+    later=
+    pie_flag=
+
+    for arg
+    do
+      case $arg_mode in
+      arg  )
+       # do not "continue".  Instead, add this to base_compile
+       lastarg="$arg"
+       arg_mode=normal
+       ;;
+
+      target )
+       libobj="$arg"
+       arg_mode=normal
+       continue
+       ;;
+
+      normal )
+       # Accept any command-line options.
+       case $arg in
+       -o)
+         test -n "$libobj" && \
+           func_fatal_error "you cannot specify \`-o' more than once"
+         arg_mode=target
+         continue
+         ;;
+
+       -pie | -fpie | -fPIE)
+          func_append pie_flag " $arg"
+         continue
+         ;;
+
+       -shared | -static | -prefer-pic | -prefer-non-pic)
+         func_append later " $arg"
+         continue
+         ;;
+
+       -no-suppress)
+         suppress_opt=no
+         continue
+         ;;
+
+       -Xcompiler)
+         arg_mode=arg  #  the next one goes into the "base_compile" arg list
+         continue      #  The current "srcfile" will either be retained or
+         ;;            #  replaced later.  I would guess that would be a bug.
+
+       -Wc,*)
+         func_stripname '-Wc,' '' "$arg"
+         args=$func_stripname_result
+         lastarg=
+         save_ifs="$IFS"; IFS=','
+         for arg in $args; do
+           IFS="$save_ifs"
+           func_append_quoted lastarg "$arg"
+         done
+         IFS="$save_ifs"
+         func_stripname ' ' '' "$lastarg"
+         lastarg=$func_stripname_result
+
+         # Add the arguments to base_compile.
+         func_append base_compile " $lastarg"
+         continue
+         ;;
+
+       *)
+         # Accept the current argument as the source file.
+         # The previous "srcfile" becomes the current argument.
+         #
+         lastarg="$srcfile"
+         srcfile="$arg"
+         ;;
+       esac  #  case $arg
+       ;;
+      esac    #  case $arg_mode
+
+      # Aesthetically quote the previous argument.
+      func_append_quoted base_compile "$lastarg"
+    done # for arg
+
+    case $arg_mode in
+    arg)
+      func_fatal_error "you must specify an argument for -Xcompile"
+      ;;
+    target)
+      func_fatal_error "you must specify a target with \`-o'"
+      ;;
+    *)
+      # Get the name of the library object.
+      test -z "$libobj" && {
+       func_basename "$srcfile"
+       libobj="$func_basename_result"
+      }
+      ;;
+    esac
+
+    # Recognize several different file suffixes.
+    # If the user specifies -o file.o, it is replaced with file.lo
+    case $libobj in
+    *.[cCFSifmso] | \
+    *.ada | *.adb | *.ads | *.asm | \
+    *.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
+    *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
+      func_xform "$libobj"
+      libobj=$func_xform_result
+      ;;
+    esac
+
+    case $libobj in
+    *.lo) func_lo2o "$libobj"; obj=$func_lo2o_result ;;
+    *)
+      func_fatal_error "cannot determine name of library object from \`$libobj'"
+      ;;
+    esac
+
+    func_infer_tag $base_compile
+
+    for arg in $later; do
+      case $arg in
+      -shared)
+       test "$build_libtool_libs" != yes && \
+         func_fatal_configuration "can not build a shared library"
+       build_old_libs=no
+       continue
+       ;;
+
+      -static)
+       build_libtool_libs=no
+       build_old_libs=yes
+       continue
+       ;;
+
+      -prefer-pic)
+       pic_mode=yes
+       continue
+       ;;
+
+      -prefer-non-pic)
+       pic_mode=no
+       continue
+       ;;
+      esac
+    done
+
+    func_quote_for_eval "$libobj"
+    test "X$libobj" != "X$func_quote_for_eval_result" \
+      && $ECHO "X$libobj" | $GREP '[]~#^*{};<>?"'"'"'   &()|`$[]' \
+      && func_warning "libobj name \`$libobj' may not contain shell special characters."
+    func_dirname_and_basename "$obj" "/" ""
+    objname="$func_basename_result"
+    xdir="$func_dirname_result"
+    lobj=${xdir}$objdir/$objname
+
+    test -z "$base_compile" && \
+      func_fatal_help "you must specify a compilation command"
+
+    # Delete any leftover library objects.
+    if test "$build_old_libs" = yes; then
+      removelist="$obj $lobj $libobj ${libobj}T"
+    else
+      removelist="$lobj $libobj ${libobj}T"
+    fi
+
+    # On Cygwin there's no "real" PIC flag so we must build both object types
+    case $host_os in
+    cygwin* | mingw* | pw32* | os2* | cegcc*)
+      pic_mode=default
+      ;;
+    esac
+    if test "$pic_mode" = no && test "$deplibs_check_method" != pass_all; then
+      # non-PIC code in shared libraries is not supported
+      pic_mode=default
+    fi
+
+    # Calculate the filename of the output object if compiler does
+    # not support -o with -c
+    if test "$compiler_c_o" = no; then
+      output_obj=`$ECHO "$srcfile" | $SED 's%^.*/%%; s%\.[^.]*$%%'`.${objext}
+      lockfile="$output_obj.lock"
+    else
+      output_obj=
+      need_locks=no
+      lockfile=
+    fi
+
+    # Lock this critical section if it is needed
+    # We use this script file to make the link, it avoids creating a new file
+    if test "$need_locks" = yes; then
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+       func_echo "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    elif test "$need_locks" = warn; then
+      if test -f "$lockfile"; then
+       $ECHO "\
+*** ERROR, $lockfile exists and contains:
+`cat $lockfile 2>/dev/null`
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+      func_append removelist " $output_obj"
+      $ECHO "$srcfile" > "$lockfile"
+    fi
+
+    $opt_dry_run || $RM $removelist
+    func_append removelist " $lockfile"
+    trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
+
+    func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+    srcfile=$func_to_tool_file_result
+    func_quote_for_eval "$srcfile"
+    qsrcfile=$func_quote_for_eval_result
+
+    # Only build a PIC object if we are building libtool libraries.
+    if test "$build_libtool_libs" = yes; then
+      # Without this assignment, base_compile gets emptied.
+      fbsd_hideous_sh_bug=$base_compile
+
+      if test "$pic_mode" != no; then
+       command="$base_compile $qsrcfile $pic_flag"
+      else
+       # Don't build PIC code
+       command="$base_compile $qsrcfile"
+      fi
+
+      func_mkdir_p "$xdir$objdir"
+
+      if test -z "$output_obj"; then
+       # Place PIC objects in $objdir
+       func_append command " -o $lobj"
+      fi
+
+      func_show_eval_locale "$command" \
+          'test -n "$output_obj" && $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed, then go on to compile the next one
+      if test -n "$output_obj" && test "X$output_obj" != "X$lobj"; then
+       func_show_eval '$MV "$output_obj" "$lobj"' \
+         'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+
+      # Allow error messages only from the first compilation.
+      if test "$suppress_opt" = yes; then
+       suppress_output=' >/dev/null 2>&1'
+      fi
+    fi
+
+    # Only build a position-dependent object if we build old libraries.
+    if test "$build_old_libs" = yes; then
+      if test "$pic_mode" != yes; then
+       # Don't build PIC code
+       command="$base_compile $qsrcfile$pie_flag"
+      else
+       command="$base_compile $qsrcfile $pic_flag"
+      fi
+      if test "$compiler_c_o" = yes; then
+       func_append command " -o $obj"
+      fi
+
+      # Suppress compiler output if we already did a PIC compilation.
+      func_append command "$suppress_output"
+      func_show_eval_locale "$command" \
+        '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
+
+      if test "$need_locks" = warn &&
+        test "X`cat $lockfile 2>/dev/null`" != "X$srcfile"; then
+       $ECHO "\
+*** ERROR, $lockfile contains:
+`cat $lockfile 2>/dev/null`
+
+but it should contain:
+$srcfile
+
+This indicates that another process is trying to use the same
+temporary object file, and libtool could not work around it because
+your compiler does not support \`-c' and \`-o' together.  If you
+repeat this compilation, it may succeed, by chance, but you had better
+avoid parallel builds (make -j) in this platform, or get a better
+compiler."
+
+       $opt_dry_run || $RM $removelist
+       exit $EXIT_FAILURE
+      fi
+
+      # Just move the object if needed
+      if test -n "$output_obj" && test "X$output_obj" != "X$obj"; then
+       func_show_eval '$MV "$output_obj" "$obj"' \
+         'error=$?; $opt_dry_run || $RM $removelist; exit $error'
+      fi
+    fi
+
+    $opt_dry_run || {
+      func_write_libtool_object "$libobj" "$objdir/$objname" "$objname"
+
+      # Unlock the critical section if it was locked
+      if test "$need_locks" != no; then
+       removelist=$lockfile
+        $RM "$lockfile"
+      fi
+    }
+
+    exit $EXIT_SUCCESS
+}
+
+$opt_help || {
+  test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
+}
+
+func_mode_help ()
+{
+    # We need to display help for each of the modes.
+    case $opt_mode in
+      "")
+        # Generic help is extracted from the usage comments
+        # at the start of this file.
+        func_help
+        ;;
+
+      clean)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=clean RM [RM-OPTION]... FILE...
+
+Remove files from the build directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, object or program, all the files associated
+with it are deleted. Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      compile)
+      $ECHO \
+"Usage: $progname [OPTION]... --mode=compile COMPILE-COMMAND... SOURCEFILE
+
+Compile a source file into a libtool library object.
+
+This mode accepts the following additional options:
+
+  -o OUTPUT-FILE    set the output file name to OUTPUT-FILE
+  -no-suppress      do not suppress compiler output for multiple passes
+  -prefer-pic       try to build PIC objects only
+  -prefer-non-pic   try to build non-PIC objects only
+  -shared           do not build a \`.o' file suitable for static linking
+  -static           only build a \`.o' file suitable for static linking
+  -Wc,FLAG          pass FLAG directly to the compiler
+
+COMPILE-COMMAND is a command to be used in creating a \`standard' object file
+from the given SOURCEFILE.
+
+The output file name is determined by removing the directory component from
+SOURCEFILE, then substituting the C source code suffix \`.c' with the
+library object suffix, \`.lo'."
+        ;;
+
+      execute)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=execute COMMAND [ARGS]...
+
+Automatically set library path, then run a program.
+
+This mode accepts the following additional options:
+
+  -dlopen FILE      add the directory containing FILE to the library path
+
+This mode sets the library path environment variable according to \`-dlopen'
+flags.
+
+If any of the ARGS are libtool executable wrappers, then they are translated
+into their corresponding uninstalled binary, and any of their required library
+directories are added to the library path.
+
+Then, COMMAND is executed, with ARGS as arguments."
+        ;;
+
+      finish)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=finish [LIBDIR]...
+
+Complete the installation of libtool libraries.
+
+Each LIBDIR is a directory that contains libtool libraries.
+
+The commands that this mode executes may require superuser privileges.  Use
+the \`--dry-run' option if you just want to see what would be executed."
+        ;;
+
+      install)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=install INSTALL-COMMAND...
+
+Install executables or libraries.
+
+INSTALL-COMMAND is the installation command.  The first component should be
+either the \`install' or \`cp' program.
+
+The following components of INSTALL-COMMAND are treated specially:
+
+  -inst-prefix-dir PREFIX-DIR  Use PREFIX-DIR as a staging area for installation
+
+The rest of the components are interpreted as arguments to that command (only
+BSD-compatible install options are recognized)."
+        ;;
+
+      link)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=link LINK-COMMAND...
+
+Link object files or libraries together to form another library, or to
+create an executable program.
+
+LINK-COMMAND is a command using the C compiler that you would use to create
+a program from several object files.
+
+The following components of LINK-COMMAND are treated specially:
+
+  -all-static       do not do any dynamic linking at all
+  -avoid-version    do not add a version suffix if possible
+  -bindir BINDIR    specify path to binaries directory (for systems where
+                    libraries must be found in the PATH setting at runtime)
+  -dlopen FILE      \`-dlpreopen' FILE if it cannot be dlopened at runtime
+  -dlpreopen FILE   link in FILE and add its symbols to lt_preloaded_symbols
+  -export-dynamic   allow symbols from OUTPUT-FILE to be resolved with dlsym(3)
+  -export-symbols SYMFILE
+                    try to export only the symbols listed in SYMFILE
+  -export-symbols-regex REGEX
+                    try to export only the symbols matching REGEX
+  -LLIBDIR          search LIBDIR for required installed libraries
+  -lNAME            OUTPUT-FILE requires the installed library libNAME
+  -module           build a library that can dlopened
+  -no-fast-install  disable the fast-install mode
+  -no-install       link a not-installable executable
+  -no-undefined     declare that a library does not refer to external symbols
+  -o OUTPUT-FILE    create OUTPUT-FILE from the specified objects
+  -objectlist FILE  Use a list of object files found in FILE to specify objects
+  -precious-files-regex REGEX
+                    don't remove output files matching REGEX
+  -release RELEASE  specify package release information
+  -rpath LIBDIR     the created library will eventually be installed in LIBDIR
+  -R[ ]LIBDIR       add LIBDIR to the runtime path of programs and libraries
+  -shared           only do dynamic linking of libtool libraries
+  -shrext SUFFIX    override the standard shared library file extension
+  -static           do not do any dynamic linking of uninstalled libtool libraries
+  -static-libtool-libs
+                    do not do any dynamic linking of libtool libraries
+  -version-info CURRENT[:REVISION[:AGE]]
+                    specify library version info [each variable defaults to 0]
+  -weak LIBNAME     declare that the target provides the LIBNAME interface
+  -Wc,FLAG
+  -Xcompiler FLAG   pass linker-specific FLAG directly to the compiler
+  -Wl,FLAG
+  -Xlinker FLAG     pass linker-specific FLAG directly to the linker
+  -XCClinker FLAG   pass link-specific FLAG to the compiler driver (CC)
+
+All other options (arguments beginning with \`-') are ignored.
+
+Every other argument is treated as a filename.  Files ending in \`.la' are
+treated as uninstalled libtool libraries, other files are standard or library
+object files.
+
+If the OUTPUT-FILE ends in \`.la', then a libtool library is created,
+only library objects (\`.lo' files) may be specified, and \`-rpath' is
+required, except when creating a convenience library.
+
+If OUTPUT-FILE ends in \`.a' or \`.lib', then a standard library is created
+using \`ar' and \`ranlib', or on Windows using \`lib'.
+
+If OUTPUT-FILE ends in \`.lo' or \`.${objext}', then a reloadable object file
+is created, otherwise an executable program is created."
+        ;;
+
+      uninstall)
+        $ECHO \
+"Usage: $progname [OPTION]... --mode=uninstall RM [RM-OPTION]... FILE...
+
+Remove libraries from an installation directory.
+
+RM is the name of the program to use to delete files associated with each FILE
+(typically \`/bin/rm').  RM-OPTIONS are options (such as \`-f') to be passed
+to RM.
+
+If FILE is a libtool library, all the files associated with it are deleted.
+Otherwise, only FILE itself is deleted using RM."
+        ;;
+
+      *)
+        func_fatal_help "invalid operation mode \`$opt_mode'"
+        ;;
+    esac
+
+    echo
+    $ECHO "Try \`$progname --help' for more information about other modes."
+}
+
+# Now that we've collected a possible --mode arg, show help if necessary
+if $opt_help; then
+  if test "$opt_help" = :; then
+    func_mode_help
+  else
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+       func_mode_help
+      done
+    } | sed -n '1p; 2,$s/^Usage:/  or: /p'
+    {
+      func_help noexit
+      for opt_mode in compile link execute install finish uninstall clean; do
+       echo
+       func_mode_help
+      done
+    } |
+    sed '1d
+      /^When reporting/,/^Report/{
+       H
+       d
+      }
+      $x
+      /information about other modes/d
+      /more detailed .*MODE/d
+      s/^Usage:.*--mode=\([^ ]*\) .*/Description of \1 mode:/'
+  fi
+  exit $?
+fi
+
+
+# func_mode_execute arg...
+func_mode_execute ()
+{
+    $opt_debug
+    # The first argument is the command name.
+    cmd="$nonopt"
+    test -z "$cmd" && \
+      func_fatal_help "you must specify a COMMAND"
+
+    # Handle -dlopen flags immediately.
+    for file in $opt_dlopen; do
+      test -f "$file" \
+       || func_fatal_help "\`$file' is not a file"
+
+      dir=
+      case $file in
+      *.la)
+       func_resolve_sysroot "$file"
+       file=$func_resolve_sysroot_result
+
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$file" \
+         || func_fatal_help "\`$lib' is not a valid libtool archive"
+
+       # Read the libtool library.
+       dlname=
+       library_names=
+       func_source "$file"
+
+       # Skip this library if it cannot be dlopened.
+       if test -z "$dlname"; then
+         # Warn if it was a shared library.
+         test -n "$library_names" && \
+           func_warning "\`$file' was not linked with \`-export-dynamic'"
+         continue
+       fi
+
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+
+       if test -f "$dir/$objdir/$dlname"; then
+         func_append dir "/$objdir"
+       else
+         if test ! -f "$dir/$dlname"; then
+           func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
+         fi
+       fi
+       ;;
+
+      *.lo)
+       # Just add the directory containing the .lo file.
+       func_dirname "$file" "" "."
+       dir="$func_dirname_result"
+       ;;
+
+      *)
+       func_warning "\`-dlopen' is ignored for non-libtool libraries and objects"
+       continue
+       ;;
+      esac
+
+      # Get the absolute pathname.
+      absdir=`cd "$dir" && pwd`
+      test -n "$absdir" && dir="$absdir"
+
+      # Now add the directory to shlibpath_var.
+      if eval "test -z \"\$$shlibpath_var\""; then
+       eval "$shlibpath_var=\"\$dir\""
+      else
+       eval "$shlibpath_var=\"\$dir:\$$shlibpath_var\""
+      fi
+    done
+
+    # This variable tells wrapper scripts just to set shlibpath_var
+    # rather than running their programs.
+    libtool_execute_magic="$magic"
+
+    # Check if any of the arguments is a wrapper script.
+    args=
+    for file
+    do
+      case $file in
+      -* | *.la | *.lo ) ;;
+      *)
+       # Do a test to see if this is really a libtool program.
+       if func_ltwrapper_script_p "$file"; then
+         func_source "$file"
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       elif func_ltwrapper_executable_p "$file"; then
+         func_ltwrapper_scriptname "$file"
+         func_source "$func_ltwrapper_scriptname_result"
+         # Transform arg to wrapped name.
+         file="$progdir/$program"
+       fi
+       ;;
+      esac
+      # Quote arguments (to preserve shell metacharacters).
+      func_append_quoted args "$file"
+    done
+
+    if test "X$opt_dry_run" = Xfalse; then
+      if test -n "$shlibpath_var"; then
+       # Export the shlibpath_var.
+       eval "export $shlibpath_var"
+      fi
+
+      # Restore saved environment variables
+      for lt_var in LANG LANGUAGE LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES
+      do
+       eval "if test \"\${save_$lt_var+set}\" = set; then
+                $lt_var=\$save_$lt_var; export $lt_var
+             else
+               $lt_unset $lt_var
+             fi"
+      done
+
+      # Now prepare to actually exec the command.
+      exec_cmd="\$cmd$args"
+    else
+      # Display what would be done.
+      if test -n "$shlibpath_var"; then
+       eval "\$ECHO \"\$shlibpath_var=\$$shlibpath_var\""
+       echo "export $shlibpath_var"
+      fi
+      $ECHO "$cmd$args"
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
+
+
+# func_mode_finish arg...
+func_mode_finish ()
+{
+    $opt_debug
+    libs=
+    libdirs=
+    admincmds=
+
+    for opt in "$nonopt" ${1+"$@"}
+    do
+      if test -d "$opt"; then
+       func_append libdirs " $opt"
+
+      elif test -f "$opt"; then
+       if func_lalib_unsafe_p "$opt"; then
+         func_append libs " $opt"
+       else
+         func_warning "\`$opt' is not a valid libtool archive"
+       fi
+
+      else
+       func_fatal_error "invalid argument \`$opt'"
+      fi
+    done
+
+    if test -n "$libs"; then
+      if test -n "$lt_sysroot"; then
+        sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+        sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+      else
+        sysroot_cmd=
+      fi
+
+      # Remove sysroot references
+      if $opt_dry_run; then
+        for lib in $libs; do
+          echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+        done
+      else
+        tmpdir=`func_mktempdir`
+        for lib in $libs; do
+         sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+           > $tmpdir/tmp-la
+         mv -f $tmpdir/tmp-la $lib
+       done
+        ${RM}r "$tmpdir"
+      fi
+    fi
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      for libdir in $libdirs; do
+       if test -n "$finish_cmds"; then
+         # Do each command in the finish commands.
+         func_execute_cmds "$finish_cmds" 'admincmds="$admincmds
+'"$cmd"'"'
+       fi
+       if test -n "$finish_eval"; then
+         # Do the single finish_eval.
+         eval cmds=\"$finish_eval\"
+         $opt_dry_run || eval "$cmds" || func_append admincmds "
+       $cmds"
+       fi
+      done
+    fi
+
+    # Exit here if they wanted silent mode.
+    $opt_silent && exit $EXIT_SUCCESS
+
+    if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+      echo "----------------------------------------------------------------------"
+      echo "Libraries have been installed in:"
+      for libdir in $libdirs; do
+       $ECHO "   $libdir"
+      done
+      echo
+      echo "If you ever happen to want to link against installed libraries"
+      echo "in a given directory, LIBDIR, you must either use libtool, and"
+      echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+      echo "flag during linking and do at least one of the following:"
+      if test -n "$shlibpath_var"; then
+       echo "   - add LIBDIR to the \`$shlibpath_var' environment variable"
+       echo "     during execution"
+      fi
+      if test -n "$runpath_var"; then
+       echo "   - add LIBDIR to the \`$runpath_var' environment variable"
+       echo "     during linking"
+      fi
+      if test -n "$hardcode_libdir_flag_spec"; then
+       libdir=LIBDIR
+       eval flag=\"$hardcode_libdir_flag_spec\"
+
+       $ECHO "   - use the \`$flag' linker flag"
+      fi
+      if test -n "$admincmds"; then
+       $ECHO "   - have your system administrator run these commands:$admincmds"
+      fi
+      if test -f /etc/ld.so.conf; then
+       echo "   - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+      fi
+      echo
+
+      echo "See any operating system documentation about shared libraries for"
+      case $host in
+       solaris2.[6789]|solaris2.1[0-9])
+         echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+         echo "pages."
+         ;;
+       *)
+         echo "more information, such as the ld(1) and ld.so(8) manual pages."
+         ;;
+      esac
+      echo "----------------------------------------------------------------------"
+    fi
+    exit $EXIT_SUCCESS
+}
+
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
+
+
+# func_mode_install arg...
+func_mode_install ()
+{
+    $opt_debug
+    # There may be an optional sh(1) argument at the beginning of
+    # install_prog (especially on Windows NT).
+    if test "$nonopt" = "$SHELL" || test "$nonopt" = /bin/sh ||
+       # Allow the use of GNU shtool's install command.
+       case $nonopt in *shtool*) :;; *) false;; esac; then
+      # Aesthetically quote it.
+      func_quote_for_eval "$nonopt"
+      install_prog="$func_quote_for_eval_result "
+      arg=$1
+      shift
+    else
+      install_prog=
+      arg=$nonopt
+    fi
+
+    # The real first argument should be the name of the installation program.
+    # Aesthetically quote it.
+    func_quote_for_eval "$arg"
+    func_append install_prog "$func_quote_for_eval_result"
+    install_shared_prog=$install_prog
+    case " $install_prog " in
+      *[\\\ /]cp\ *) install_cp=: ;;
+      *) install_cp=false ;;
+    esac
+
+    # We need to accept at least all the BSD install flags.
+    dest=
+    files=
+    opts=
+    prev=
+    install_type=
+    isdir=no
+    stripme=
+    no_mode=:
+    for arg
+    do
+      arg2=
+      if test -n "$dest"; then
+       func_append files " $dest"
+       dest=$arg
+       continue
+      fi
+
+      case $arg in
+      -d) isdir=yes ;;
+      -f)
+       if $install_cp; then :; else
+         prev=$arg
+       fi
+       ;;
+      -g | -m | -o)
+       prev=$arg
+       ;;
+      -s)
+       stripme=" -s"
+       continue
+       ;;
+      -*)
+       ;;
+      *)
+       # If the previous option needed an argument, then skip it.
+       if test -n "$prev"; then
+         if test "x$prev" = x-m && test -n "$install_override_mode"; then
+           arg2=$install_override_mode
+           no_mode=false
+         fi
+         prev=
+       else
+         dest=$arg
+         continue
+       fi
+       ;;
+      esac
+
+      # Aesthetically quote the argument.
+      func_quote_for_eval "$arg"
+      func_append install_prog " $func_quote_for_eval_result"
+      if test -n "$arg2"; then
+       func_quote_for_eval "$arg2"
+      fi
+      func_append install_shared_prog " $func_quote_for_eval_result"
+    done
+
+    test -z "$install_prog" && \
+      func_fatal_help "you must specify an install program"
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prev' option requires an argument"
+
+    if test -n "$install_override_mode" && $no_mode; then
+      if $install_cp; then :; else
+       func_quote_for_eval "$install_override_mode"
+       func_append install_shared_prog " -m $func_quote_for_eval_result"
+      fi
+    fi
+
+    if test -z "$files"; then
+      if test -z "$dest"; then
+       func_fatal_help "no file or destination specified"
+      else
+       func_fatal_help "you must specify a destination"
+      fi
+    fi
+
+    # Strip any trailing slash from the destination.
+    func_stripname '' '/' "$dest"
+    dest=$func_stripname_result
+
+    # Check to see that the destination is a directory.
+    test -d "$dest" && isdir=yes
+    if test "$isdir" = yes; then
+      destdir="$dest"
+      destname=
+    else
+      func_dirname_and_basename "$dest" "" "."
+      destdir="$func_dirname_result"
+      destname="$func_basename_result"
+
+      # Not a directory, so check to see that there is only one file specified.
+      set dummy $files; shift
+      test "$#" -gt 1 && \
+       func_fatal_help "\`$dest' is not a directory"
+    fi
+    case $destdir in
+    [\\/]* | [A-Za-z]:[\\/]*) ;;
+    *)
+      for file in $files; do
+       case $file in
+       *.lo) ;;
+       *)
+         func_fatal_help "\`$destdir' must be an absolute directory name"
+         ;;
+       esac
+      done
+      ;;
+    esac
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    staticlibs=
+    future_libdirs=
+    current_libdirs=
+    for file in $files; do
+
+      # Do each installation.
+      case $file in
+      *.$libext)
+       # Do the static libraries later.
+       func_append staticlibs " $file"
+       ;;
+
+      *.la)
+       func_resolve_sysroot "$file"
+       file=$func_resolve_sysroot_result
+
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$file" \
+         || func_fatal_help "\`$file' is not a valid libtool archive"
+
+       library_names=
+       old_library=
+       relink_command=
+       func_source "$file"
+
+       # Add the libdir to current_libdirs if it is the destination.
+       if test "X$destdir" = "X$libdir"; then
+         case "$current_libdirs " in
+         *" $libdir "*) ;;
+         *) func_append current_libdirs " $libdir" ;;
+         esac
+       else
+         # Note the libdir as a future libdir.
+         case "$future_libdirs " in
+         *" $libdir "*) ;;
+         *) func_append future_libdirs " $libdir" ;;
+         esac
+       fi
+
+       func_dirname "$file" "/" ""
+       dir="$func_dirname_result"
+       func_append dir "$objdir"
+
+       if test -n "$relink_command"; then
+         # Determine the prefix the user has applied to our future dir.
+         inst_prefix_dir=`$ECHO "$destdir" | $SED -e "s%$libdir\$%%"`
+
+         # Don't allow the user to place us outside of our expected
+         # location b/c this prevents finding dependent libraries that
+         # are installed to the same prefix.
+         # At present, this check doesn't affect windows .dll's that
+         # are installed into $libdir/../bin (currently, that works fine)
+         # but it's something to keep an eye on.
+         test "$inst_prefix_dir" = "$destdir" && \
+           func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
+
+         if test -n "$inst_prefix_dir"; then
+           # Stick the inst_prefix_dir data into the link command.
+           relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%-inst-prefix-dir $inst_prefix_dir%"`
+         else
+           relink_command=`$ECHO "$relink_command" | $SED "s%@inst_prefix_dir@%%"`
+         fi
+
+         func_warning "relinking \`$file'"
+         func_show_eval "$relink_command" \
+           'func_fatal_error "error: relink \`$file'\'' with the above command before installing it"'
+       fi
+
+       # See the names of the shared library.
+       set dummy $library_names; shift
+       if test -n "$1"; then
+         realname="$1"
+         shift
+
+         srcname="$realname"
+         test -n "$relink_command" && srcname="$realname"T
+
+         # Install the shared library and build the symlinks.
+         func_show_eval "$install_shared_prog $dir/$srcname $destdir/$realname" \
+             'exit $?'
+         tstripme="$stripme"
+         case $host_os in
+         cygwin* | mingw* | pw32* | cegcc*)
+           case $realname in
+           *.dll.a)
+             tstripme=""
+             ;;
+           esac
+           ;;
+         esac
+         if test -n "$tstripme" && test -n "$striplib"; then
+           func_show_eval "$striplib $destdir/$realname" 'exit $?'
+         fi
+
+         if test "$#" -gt 0; then
+           # Delete the old symlinks, and create new ones.
+           # Try `ln -sf' first, because the `ln' binary might depend on
+           # the symlink we replace!  Solaris /bin/ln does not understand -f,
+           # so we also need to try rm && ln -s.
+           for linkname
+           do
+             test "$linkname" != "$realname" \
+               && func_show_eval "(cd $destdir && { $LN_S -f $realname $linkname || { $RM $linkname && $LN_S $realname $linkname; }; })"
+           done
+         fi
+
+         # Do each command in the postinstall commands.
+         lib="$destdir/$realname"
+         func_execute_cmds "$postinstall_cmds" 'exit $?'
+       fi
+
+       # Install the pseudo-library for information purposes.
+       func_basename "$file"
+       name="$func_basename_result"
+       instname="$dir/$name"i
+       func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
+
+       # Maybe install the static library, too.
+       test -n "$old_library" && func_append staticlibs " $dir/$old_library"
+       ;;
+
+      *.lo)
+       # Install (i.e. copy) a libtool object.
+
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         func_basename "$file"
+         destfile="$func_basename_result"
+         destfile="$destdir/$destfile"
+       fi
+
+       # Deduce the name of the destination old-style object file.
+       case $destfile in
+       *.lo)
+         func_lo2o "$destfile"
+         staticdest=$func_lo2o_result
+         ;;
+       *.$objext)
+         staticdest="$destfile"
+         destfile=
+         ;;
+       *)
+         func_fatal_help "cannot copy a libtool object to \`$destfile'"
+         ;;
+       esac
+
+       # Install the libtool object if requested.
+       test -n "$destfile" && \
+         func_show_eval "$install_prog $file $destfile" 'exit $?'
+
+       # Install the old object if enabled.
+       if test "$build_old_libs" = yes; then
+         # Deduce the name of the old-style object file.
+         func_lo2o "$file"
+         staticobj=$func_lo2o_result
+         func_show_eval "$install_prog \$staticobj \$staticdest" 'exit $?'
+       fi
+       exit $EXIT_SUCCESS
+       ;;
+
+      *)
+       # Figure out destination file name, if it wasn't already specified.
+       if test -n "$destname"; then
+         destfile="$destdir/$destname"
+       else
+         func_basename "$file"
+         destfile="$func_basename_result"
+         destfile="$destdir/$destfile"
+       fi
+
+       # If the file is missing, and there is a .exe on the end, strip it
+       # because it is most likely a libtool script we actually want to
+       # install
+       stripped_ext=""
+       case $file in
+         *.exe)
+           if test ! -f "$file"; then
+             func_stripname '' '.exe' "$file"
+             file=$func_stripname_result
+             stripped_ext=".exe"
+           fi
+           ;;
+       esac
+
+       # Do a test to see if this is really a libtool program.
+       case $host in
+       *cygwin* | *mingw*)
+           if func_ltwrapper_executable_p "$file"; then
+             func_ltwrapper_scriptname "$file"
+             wrapper=$func_ltwrapper_scriptname_result
+           else
+             func_stripname '' '.exe' "$file"
+             wrapper=$func_stripname_result
+           fi
+           ;;
+       *)
+           wrapper=$file
+           ;;
+       esac
+       if func_ltwrapper_script_p "$wrapper"; then
+         notinst_deplibs=
+         relink_command=
+
+         func_source "$wrapper"
+
+         # Check the variables that should have been set.
+         test -z "$generated_by_libtool_version" && \
+           func_fatal_error "invalid libtool wrapper script \`$wrapper'"
+
+         finalize=yes
+         for lib in $notinst_deplibs; do
+           # Check to see that each library is installed.
+           libdir=
+           if test -f "$lib"; then
+             func_source "$lib"
+           fi
+           libfile="$libdir/"`$ECHO "$lib" | $SED 's%^.*/%%g'` ### testsuite: skip nested quoting test
+           if test -n "$libdir" && test ! -f "$libfile"; then
+             func_warning "\`$lib' has not been installed in \`$libdir'"
+             finalize=no
+           fi
+         done
+
+         relink_command=
+         func_source "$wrapper"
+
+         outputname=
+         if test "$fast_install" = no && test -n "$relink_command"; then
+           $opt_dry_run || {
+             if test "$finalize" = yes; then
+               tmpdir=`func_mktempdir`
+               func_basename "$file$stripped_ext"
+               file="$func_basename_result"
+               outputname="$tmpdir/$file"
+               # Replace the output file specification.
+               relink_command=`$ECHO "$relink_command" | $SED 's%@OUTPUT@%'"$outputname"'%g'`
+
+               $opt_silent || {
+                 func_quote_for_expand "$relink_command"
+                 eval "func_echo $func_quote_for_expand_result"
+               }
+               if eval "$relink_command"; then :
+                 else
+                 func_error "error: relink \`$file' with the above command before installing it"
+                 $opt_dry_run || ${RM}r "$tmpdir"
+                 continue
+               fi
+               file="$outputname"
+             else
+               func_warning "cannot relink \`$file'"
+             fi
+           }
+         else
+           # Install the binary that we compiled earlier.
+           file=`$ECHO "$file$stripped_ext" | $SED "s%\([^/]*\)$%$objdir/\1%"`
+         fi
+       fi
+
+       # remove .exe since cygwin /usr/bin/install will append another
+       # one anyway
+       case $install_prog,$host in
+       */usr/bin/install*,*cygwin*)
+         case $file:$destfile in
+         *.exe:*.exe)
+           # this is ok
+           ;;
+         *.exe:*)
+           destfile=$destfile.exe
+           ;;
+         *:*.exe)
+           func_stripname '' '.exe' "$destfile"
+           destfile=$func_stripname_result
+           ;;
+         esac
+         ;;
+       esac
+       func_show_eval "$install_prog\$stripme \$file \$destfile" 'exit $?'
+       $opt_dry_run || if test -n "$outputname"; then
+         ${RM}r "$tmpdir"
+       fi
+       ;;
+      esac
+    done
+
+    for file in $staticlibs; do
+      func_basename "$file"
+      name="$func_basename_result"
+
+      # 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 $tool_oldlib" 'exit $?'
+      fi
+
+      # Do each command in the postinstall commands.
+      func_execute_cmds "$old_postinstall_cmds" 'exit $?'
+    done
+
+    test -n "$future_libdirs" && \
+      func_warning "remember to run \`$progname --finish$future_libdirs'"
+
+    if test -n "$current_libdirs"; then
+      # Maybe just do a dry run.
+      $opt_dry_run && current_libdirs=" -n$current_libdirs"
+      exec_cmd='$SHELL $progpath $preserve_args --finish$current_libdirs'
+    else
+      exit $EXIT_SUCCESS
+    fi
+}
+
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
+
+
+# func_generate_dlsyms outputname originator pic_p
+# Extract symbols from dlprefiles and create ${outputname}S.o with
+# a dlpreopen symbol table.
+func_generate_dlsyms ()
+{
+    $opt_debug
+    my_outputname="$1"
+    my_originator="$2"
+    my_pic_p="${3-no}"
+    my_prefix=`$ECHO "$my_originator" | sed 's%[^a-zA-Z0-9]%_%g'`
+    my_dlsyms=
+
+    if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+      if test -n "$NM" && test -n "$global_symbol_pipe"; then
+       my_dlsyms="${my_outputname}S.c"
+      else
+       func_error "not configured to extract global symbols from dlpreopened files"
+      fi
+    fi
+
+    if test -n "$my_dlsyms"; then
+      case $my_dlsyms in
+      "") ;;
+      *.c)
+       # Discover the nlist of each of the dlfiles.
+       nlist="$output_objdir/${my_outputname}.nm"
+
+       func_show_eval "$RM $nlist ${nlist}S ${nlist}T"
+
+       # Parse the name list into a source file.
+       func_verbose "creating $output_objdir/$my_dlsyms"
+
+       $opt_dry_run || $ECHO > "$output_objdir/$my_dlsyms" "\
+/* $my_dlsyms - symbol resolution table for \`$my_outputname' dlsym emulation. */
+/* Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION */
+
+#ifdef __cplusplus
+extern \"C\" {
+#endif
+
+#if defined(__GNUC__) && (((__GNUC__ == 4) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ > 4))
+#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
+#endif
+
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+/* External symbol declarations for the compiler. */\
+"
+
+       if test "$dlself" = yes; then
+         func_verbose "generating symbol list for \`$output'"
+
+         $opt_dry_run || echo ': @PROGRAM@ ' > "$nlist"
+
+         # Add our own program objects to the symbol list.
+         progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+         for progfile in $progfiles; do
+           func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+           func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+           $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
+         done
+
+         if test -n "$exclude_expsyms"; then
+           $opt_dry_run || {
+             eval '$EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+           }
+         fi
+
+         if test -n "$export_symbols_regex"; then
+           $opt_dry_run || {
+             eval '$EGREP -e "$export_symbols_regex" "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+           }
+         fi
+
+         # Prepare the list of exported symbols
+         if test -z "$export_symbols"; then
+           export_symbols="$output_objdir/$outputname.exp"
+           $opt_dry_run || {
+             $RM $export_symbols
+             eval "${SED} -n -e '/^: @PROGRAM@ $/d' -e 's/^.* \(.*\)$/\1/p' "'< "$nlist" > "$export_symbols"'
+             case $host in
+             *cygwin* | *mingw* | *cegcc* )
+                eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                eval 'cat "$export_symbols" >> "$output_objdir/$outputname.def"'
+               ;;
+             esac
+           }
+         else
+           $opt_dry_run || {
+             eval "${SED} -e 's/\([].[*^$]\)/\\\\\1/g' -e 's/^/ /' -e 's/$/$/'"' < "$export_symbols" > "$output_objdir/$outputname.exp"'
+             eval '$GREP -f "$output_objdir/$outputname.exp" < "$nlist" > "$nlist"T'
+             eval '$MV "$nlist"T "$nlist"'
+             case $host in
+               *cygwin* | *mingw* | *cegcc* )
+                 eval "echo EXPORTS "'> "$output_objdir/$outputname.def"'
+                 eval 'cat "$nlist" >> "$output_objdir/$outputname.def"'
+                 ;;
+             esac
+           }
+         fi
+       fi
+
+       for dlprefile in $dlprefiles; do
+         func_verbose "extracting global C symbols from \`$dlprefile'"
+         func_basename "$dlprefile"
+         name="$func_basename_result"
+          case $host in
+           *cygwin* | *mingw* | *cegcc* )
+             # if an import library, we need to obtain dlname
+             if func_win32_import_lib_p "$dlprefile"; then
+               func_tr_sh "$dlprefile"
+               eval "curr_lafile=\$libfile_$func_tr_sh_result"
+               dlprefile_dlbasename=""
+               if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+                 # Use subshell, to avoid clobbering current variable values
+                 dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+                 if test -n "$dlprefile_dlname" ; then
+                   func_basename "$dlprefile_dlname"
+                   dlprefile_dlbasename="$func_basename_result"
+                 else
+                   # no lafile. user explicitly requested -dlpreopen <import library>.
+                   $sharedlib_from_linklib_cmd "$dlprefile"
+                   dlprefile_dlbasename=$sharedlib_from_linklib_result
+                 fi
+               fi
+               $opt_dry_run || {
+                 if test -n "$dlprefile_dlbasename" ; then
+                   eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+                 else
+                   func_warning "Could not compute DLL name from $name"
+                   eval '$ECHO ": $name " >> "$nlist"'
+                 fi
+                 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+                   $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+               }
+             else # not an import lib
+               $opt_dry_run || {
+                 eval '$ECHO ": $name " >> "$nlist"'
+                 func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+                 eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+               }
+             fi
+           ;;
+           *)
+             $opt_dry_run || {
+               eval '$ECHO ": $name " >> "$nlist"'
+               func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+               eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+             }
+           ;;
+          esac
+       done
+
+       $opt_dry_run || {
+         # Make sure we have at least an empty file.
+         test -f "$nlist" || : > "$nlist"
+
+         if test -n "$exclude_expsyms"; then
+           $EGREP -v " ($exclude_expsyms)$" "$nlist" > "$nlist"T
+           $MV "$nlist"T "$nlist"
+         fi
+
+         # Try sorting and uniquifying the output.
+         if $GREP -v "^: " < "$nlist" |
+             if sort -k 3 </dev/null >/dev/null 2>&1; then
+               sort -k 3
+             else
+               sort +2
+             fi |
+             uniq > "$nlist"S; then
+           :
+         else
+           $GREP -v "^: " < "$nlist" > "$nlist"S
+         fi
+
+         if test -f "$nlist"S; then
+           eval "$global_symbol_to_cdecl"' < "$nlist"S >> "$output_objdir/$my_dlsyms"'
+         else
+           echo '/* NONE */' >> "$output_objdir/$my_dlsyms"
+         fi
+
+         echo >> "$output_objdir/$my_dlsyms" "\
+
+/* The mapping between symbol names and symbols.  */
+typedef struct {
+  const char *name;
+  void *address;
+} lt_dlsymlist;
+extern LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[];
+LT_DLSYM_CONST lt_dlsymlist
+lt_${my_prefix}_LTX_preloaded_symbols[] =
+{\
+  { \"$my_originator\", (void *) 0 },"
+
+         case $need_lib_prefix in
+         no)
+           eval "$global_symbol_to_c_name_address" < "$nlist" >> "$output_objdir/$my_dlsyms"
+           ;;
+         *)
+           eval "$global_symbol_to_c_name_address_lib_prefix" < "$nlist" >> "$output_objdir/$my_dlsyms"
+           ;;
+         esac
+         echo >> "$output_objdir/$my_dlsyms" "\
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt_${my_prefix}_LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif\
+"
+       } # !$opt_dry_run
+
+       pic_flag_for_symtable=
+       case "$compile_command " in
+       *" -static "*) ;;
+       *)
+         case $host in
+         # compiling the symbol table file with pic_flag works around
+         # a FreeBSD bug that causes programs to crash when -lm is
+         # 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*)
+           pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
+         *-*-hpux*)
+           pic_flag_for_symtable=" $pic_flag"  ;;
+         *)
+           if test "X$my_pic_p" != Xno; then
+             pic_flag_for_symtable=" $pic_flag"
+           fi
+           ;;
+         esac
+         ;;
+       esac
+       symtab_cflags=
+       for arg in $LTCFLAGS; do
+         case $arg in
+         -pie | -fpie | -fPIE) ;;
+         *) func_append symtab_cflags " $arg" ;;
+         esac
+       done
+
+       # Now compile the dynamic symbol file.
+       func_show_eval '(cd $output_objdir && $LTCC$symtab_cflags -c$no_builtin_flag$pic_flag_for_symtable "$my_dlsyms")' 'exit $?'
+
+       # Clean up the generated files.
+       func_show_eval '$RM "$output_objdir/$my_dlsyms" "$nlist" "${nlist}S" "${nlist}T"'
+
+       # Transform the symbol file into the correct name.
+       symfileobj="$output_objdir/${my_outputname}S.$objext"
+       case $host in
+       *cygwin* | *mingw* | *cegcc* )
+         if test -f "$output_objdir/$my_outputname.def"; then
+           compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+           finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$output_objdir/$my_outputname.def $symfileobj%"`
+         else
+           compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+           finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         fi
+         ;;
+       *)
+         compile_command=`$ECHO "$compile_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         finalize_command=`$ECHO "$finalize_command" | $SED "s%@SYMFILE@%$symfileobj%"`
+         ;;
+       esac
+       ;;
+      *)
+       func_fatal_error "unknown suffix for \`$my_dlsyms'"
+       ;;
+      esac
+    else
+      # We keep going just in case the user didn't refer to
+      # lt_preloaded_symbols.  The linker will fail if global_symbol_pipe
+      # really was required.
+
+      # Nullify the symbol file.
+      compile_command=`$ECHO "$compile_command" | $SED "s% @SYMFILE@%%"`
+      finalize_command=`$ECHO "$finalize_command" | $SED "s% @SYMFILE@%%"`
+    fi
+}
+
+# func_win32_libid arg
+# return the library type of file 'arg'
+#
+# Need a lot of goo to handle *both* DLLs and import libs
+# Has to be a shell function in order to 'eat' the argument
+# that is supplied when $file_magic_command is called.
+# Despite the name, also deal with 64 bit binaries.
+func_win32_libid ()
+{
+  $opt_debug
+  win32_libid_type="unknown"
+  win32_fileres=`file -L $1 2>/dev/null`
+  case $win32_fileres in
+  *ar\ archive\ import\ library*) # definitely import
+    win32_libid_type="x86 archive import"
+    ;;
+  *ar\ archive*) # could be an import, or static
+    # Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
+    if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
+       $EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
+      func_to_tool_file "$1" func_convert_file_msys_to_w32
+      win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
+       $SED -n -e '
+           1,100{
+               / I /{
+                   s,.*,import,
+                   p
+                   q
+               }
+           }'`
+      case $win32_nmres in
+      import*)  win32_libid_type="x86 archive import";;
+      *)        win32_libid_type="x86 archive static";;
+      esac
+    fi
+    ;;
+  *DLL*)
+    win32_libid_type="x86 DLL"
+    ;;
+  *executable*) # but shell scripts are "executable" too...
+    case $win32_fileres in
+    *MS\ Windows\ PE\ Intel*)
+      win32_libid_type="x86 DLL"
+      ;;
+    esac
+    ;;
+  esac
+  $ECHO "$win32_libid_type"
+}
+
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+  $opt_debug
+  sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+  $opt_debug
+  match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+  $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+    $SED '/^Contents of section '"$match_literal"':/{
+      # Place marker at beginning of archive member dllname section
+      s/.*/====MARK====/
+      p
+      d
+    }
+    # These lines can sometimes be longer than 43 characters, but
+    # are always uninteresting
+    /:[         ]*file format pe[i]\{,1\}-/d
+    /^In archive [^:]*:/d
+    # Ensure marker is printed
+    /^====MARK====/p
+    # Remove all lines with less than 43 characters
+    /^.\{43\}/!d
+    # From remaining lines, remove first 43 characters
+    s/^.\{43\}//' |
+    $SED -n '
+      # Join marker and all lines until next marker into a single line
+      /^====MARK====/ b para
+      H
+      $ b para
+      b
+      :para
+      x
+      s/\n//g
+      # Remove the marker
+      s/^====MARK====//
+      # Remove trailing dots and whitespace
+      s/[\. \t]*$//
+      # Print
+      /./p' |
+    # we now have a list, one entry per line, of the stringified
+    # contents of the appropriate section of all members of the
+    # archive which possess that section. Heuristic: eliminate
+    # all those which have a first or second character that is
+    # a '.' (that is, objdump's representation of an unprintable
+    # character.) This should work for all archives with less than
+    # 0x302f exports -- but will fail for DLLs whose name actually
+    # begins with a literal '.' or a single character followed by
+    # a '.'.
+    #
+    # Of those that remain, print the first one.
+    $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+  test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+  $opt_debug
+  func_to_tool_file "$1" func_convert_file_msys_to_w32
+  func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+  test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+#    $sharedlib_from_linklib_cmd
+# Result is available in the variable
+#    $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+  $opt_debug
+  if func_cygming_gnu_implib_p "$1" ; then
+    # binutils import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+  elif func_cygming_ms_implib_p "$1" ; then
+    # ms-generated import library
+    sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+  else
+    # unknown
+    sharedlib_from_linklib_result=""
+  fi
+}
+
+
+# func_extract_an_archive dir oldlib
+func_extract_an_archive ()
+{
+    $opt_debug
+    f_ex_an_ar_dir="$1"; shift
+    f_ex_an_ar_oldlib="$1"
+    if test "$lock_old_archive_extraction" = yes; then
+      lockfile=$f_ex_an_ar_oldlib.lock
+      until $opt_dry_run || ln "$progpath" "$lockfile" 2>/dev/null; do
+       func_echo "Waiting for $lockfile to be removed"
+       sleep 2
+      done
+    fi
+    func_show_eval "(cd \$f_ex_an_ar_dir && $AR x \"\$f_ex_an_ar_oldlib\")" \
+                  'stat=$?; rm -f "$lockfile"; exit $stat'
+    if test "$lock_old_archive_extraction" = yes; then
+      $opt_dry_run || rm -f "$lockfile"
+    fi
+    if ($AR t "$f_ex_an_ar_oldlib" | sort | sort -uc >/dev/null 2>&1); then
+     :
+    else
+      func_fatal_error "object name conflicts in archive: $f_ex_an_ar_dir/$f_ex_an_ar_oldlib"
+    fi
+}
+
+
+# func_extract_archives gentop oldlib ...
+func_extract_archives ()
+{
+    $opt_debug
+    my_gentop="$1"; shift
+    my_oldlibs=${1+"$@"}
+    my_oldobjs=""
+    my_xlib=""
+    my_xabs=""
+    my_xdir=""
+
+    for my_xlib in $my_oldlibs; do
+      # Extract the objects.
+      case $my_xlib in
+       [\\/]* | [A-Za-z]:[\\/]*) my_xabs="$my_xlib" ;;
+       *) my_xabs=`pwd`"/$my_xlib" ;;
+      esac
+      func_basename "$my_xlib"
+      my_xlib="$func_basename_result"
+      my_xlib_u=$my_xlib
+      while :; do
+        case " $extracted_archives " in
+       *" $my_xlib_u "*)
+         func_arith $extracted_serial + 1
+         extracted_serial=$func_arith_result
+         my_xlib_u=lt$extracted_serial-$my_xlib ;;
+       *) break ;;
+       esac
+      done
+      extracted_archives="$extracted_archives $my_xlib_u"
+      my_xdir="$my_gentop/$my_xlib_u"
+
+      func_mkdir_p "$my_xdir"
+
+      case $host in
+      *-darwin*)
+       func_verbose "Extracting $my_xabs"
+       # Do not bother doing anything if just a dry run
+       $opt_dry_run || {
+         darwin_orig_dir=`pwd`
+         cd $my_xdir || exit $?
+         darwin_archive=$my_xabs
+         darwin_curdir=`pwd`
+         darwin_base_archive=`basename "$darwin_archive"`
+         darwin_arches=`$LIPO -info "$darwin_archive" 2>/dev/null | $GREP Architectures 2>/dev/null || true`
+         if test -n "$darwin_arches"; then
+           darwin_arches=`$ECHO "$darwin_arches" | $SED -e 's/.*are://'`
+           darwin_arch=
+           func_verbose "$darwin_base_archive has multiple architectures $darwin_arches"
+           for darwin_arch in  $darwin_arches ; do
+             func_mkdir_p "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             $LIPO -thin $darwin_arch -output "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}" "${darwin_archive}"
+             cd "unfat-$$/${darwin_base_archive}-${darwin_arch}"
+             func_extract_an_archive "`pwd`" "${darwin_base_archive}"
+             cd "$darwin_curdir"
+             $RM "unfat-$$/${darwin_base_archive}-${darwin_arch}/${darwin_base_archive}"
+           done # $darwin_arches
+            ## Okay now we've a bunch of thin objects, gotta fatten them up :)
+           darwin_filelist=`find unfat-$$ -type f -name \*.o -print -o -name \*.lo -print | $SED -e "$basename" | sort -u`
+           darwin_file=
+           darwin_files=
+           for darwin_file in $darwin_filelist; do
+             darwin_files=`find unfat-$$ -name $darwin_file -print | sort | $NL2SP`
+             $LIPO -create -output "$darwin_file" $darwin_files
+           done # $darwin_filelist
+           $RM -rf unfat-$$
+           cd "$darwin_orig_dir"
+         else
+           cd $darwin_orig_dir
+           func_extract_an_archive "$my_xdir" "$my_xabs"
+         fi # $darwin_arches
+       } # !$opt_dry_run
+       ;;
+      *)
+        func_extract_an_archive "$my_xdir" "$my_xabs"
+       ;;
+      esac
+      my_oldobjs="$my_oldobjs "`find $my_xdir -name \*.$objext -print -o -name \*.lo -print | sort | $NL2SP`
+    done
+
+    func_extract_archives_result="$my_oldobjs"
+}
+
+
+# func_emit_wrapper [arg=no]
+#
+# Emit a libtool wrapper script on stdout.
+# Don't directly open a file because we may want to
+# incorporate the script contents within a cygwin/mingw
+# wrapper executable.  Must ONLY be called from within
+# func_mode_link because it depends on a number of variables
+# set therein.
+#
+# ARG is the value that the WRAPPER_SCRIPT_BELONGS_IN_OBJDIR
+# variable will take.  If 'yes', then the emitted script
+# will assume that the directory in which it is stored is
+# the $objdir directory.  This is a cygwin/mingw-specific
+# behavior.
+func_emit_wrapper ()
+{
+       func_emit_wrapper_arg1=${1-no}
+
+       $ECHO "\
+#! $SHELL
+
+# $output - temporary wrapper script for $objdir/$outputname
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# The $output program cannot be directly executed until all the libtool
+# libraries that it depends on are installed.
+#
+# This wrapper script should never be moved out of the build directory.
+# If it is, it will not operate correctly.
+
+# Sed substitution that helps us do robust quoting.  It backslashifies
+# metacharacters that are still active within double-quoted strings.
+sed_quote_subst='$sed_quote_subst'
+
+# Be Bourne compatible
+if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in *posix*) set -o posix;; esac
+fi
+BIN_SH=xpg4; export BIN_SH # for Tru64
+DUALCASE=1; export DUALCASE # for MKS sh
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+relink_command=\"$relink_command\"
+
+# This environment variable determines our operation mode.
+if test \"\$libtool_install_magic\" = \"$magic\"; then
+  # install mode needs the following variables:
+  generated_by_libtool_version='$macro_version'
+  notinst_deplibs='$notinst_deplibs'
+else
+  # When we are sourced in execute mode, \$file and \$ECHO are already set.
+  if test \"\$libtool_execute_magic\" != \"$magic\"; then
+    file=\"\$0\""
+
+    qECHO=`$ECHO "$ECHO" | $SED "$sed_quote_subst"`
+    $ECHO "\
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+    ECHO=\"$qECHO\"
+  fi
+
+# Very basic option parsing. These options are (a) specific to
+# the libtool wrapper, (b) are identical between the wrapper
+# /script/ and the wrapper /executable/ which is used only on
+# windows platforms, and (c) all begin with the string "--lt-"
+# (application programs are unlikely to have options which match
+# this pattern).
+#
+# There are only two supported options: --lt-debug and
+# --lt-dump-script. There is, deliberately, no --lt-help.
+#
+# The first argument to this parsing function should be the
+# script's $0 value, followed by "$@".
+lt_option_debug=
+func_parse_lt_options ()
+{
+  lt_script_arg0=\$0
+  shift
+  for lt_opt
+  do
+    case \"\$lt_opt\" in
+    --lt-debug) lt_option_debug=1 ;;
+    --lt-dump-script)
+        lt_dump_D=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%/[^/]*$%%'\`
+        test \"X\$lt_dump_D\" = \"X\$lt_script_arg0\" && lt_dump_D=.
+        lt_dump_F=\`\$ECHO \"X\$lt_script_arg0\" | $SED -e 's/^X//' -e 's%^.*/%%'\`
+        cat \"\$lt_dump_D/\$lt_dump_F\"
+        exit 0
+      ;;
+    --lt-*)
+        \$ECHO \"Unrecognized --lt- option: '\$lt_opt'\" 1>&2
+        exit 1
+      ;;
+    esac
+  done
+
+  # Print the debug banner immediately:
+  if test -n \"\$lt_option_debug\"; then
+    echo \"${outputname}:${output}:\${LINENO}: libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\" 1>&2
+  fi
+}
+
+# Used when --lt-debug. Prints its arguments to stdout
+# (redirection is the responsibility of the caller)
+func_lt_dump_args ()
+{
+  lt_dump_args_N=1;
+  for lt_arg
+  do
+    \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[\$lt_dump_args_N]: \$lt_arg\"
+    lt_dump_args_N=\`expr \$lt_dump_args_N + 1\`
+  done
+}
+
+# Core function for launching the target application
+func_exec_program_core ()
+{
+"
+  case $host in
+  # Backslashes separate directories on plain windows
+  *-*-mingw | *-*-os2* | *-cegcc*)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir\\\\\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir\\\\\$program\" \${1+\"\$@\"}
+"
+    ;;
+
+  *)
+    $ECHO "\
+      if test -n \"\$lt_option_debug\"; then
+        \$ECHO \"${outputname}:${output}:\${LINENO}: newargv[0]: \$progdir/\$program\" 1>&2
+        func_lt_dump_args \${1+\"\$@\"} 1>&2
+      fi
+      exec \"\$progdir/\$program\" \${1+\"\$@\"}
+"
+    ;;
+  esac
+  $ECHO "\
+      \$ECHO \"\$0: cannot exec \$program \$*\" 1>&2
+      exit 1
+}
+
+# A function to encapsulate launching the target application
+# Strips options in the --lt-* namespace from \$@ and
+# launches target application with the remaining arguments.
+func_exec_program ()
+{
+  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+\"\$@\"}
+}
+
+  # Parse options
+  func_parse_lt_options \"\$0\" \${1+\"\$@\"}
+
+  # Find the directory that this script lives in.
+  thisdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*$%%'\`
+  test \"x\$thisdir\" = \"x\$file\" && thisdir=.
+
+  # Follow symbolic links until we get to the real thisdir.
+  file=\`ls -ld \"\$file\" | $SED -n 's/.*-> //p'\`
+  while test -n \"\$file\"; do
+    destdir=\`\$ECHO \"\$file\" | $SED 's%/[^/]*\$%%'\`
+
+    # If there was a directory component, then change thisdir.
+    if test \"x\$destdir\" != \"x\$file\"; then
+      case \"\$destdir\" in
+      [\\\\/]* | [A-Za-z]:[\\\\/]*) thisdir=\"\$destdir\" ;;
+      *) thisdir=\"\$thisdir/\$destdir\" ;;
+      esac
+    fi
+
+    file=\`\$ECHO \"\$file\" | $SED 's%^.*/%%'\`
+    file=\`ls -ld \"\$thisdir/\$file\" | $SED -n 's/.*-> //p'\`
+  done
+
+  # Usually 'no', except on cygwin/mingw when embedded into
+  # the cwrapper.
+  WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=$func_emit_wrapper_arg1
+  if test \"\$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR\" = \"yes\"; then
+    # special case for '.'
+    if test \"\$thisdir\" = \".\"; then
+      thisdir=\`pwd\`
+    fi
+    # remove .libs from thisdir
+    case \"\$thisdir\" in
+    *[\\\\/]$objdir ) thisdir=\`\$ECHO \"\$thisdir\" | $SED 's%[\\\\/][^\\\\/]*$%%'\` ;;
+    $objdir )   thisdir=. ;;
+    esac
+  fi
+
+  # Try to get the absolute directory name.
+  absdir=\`cd \"\$thisdir\" && pwd\`
+  test -n \"\$absdir\" && thisdir=\"\$absdir\"
+"
+
+       if test "$fast_install" = yes; then
+         $ECHO "\
+  program=lt-'$outputname'$exeext
+  progdir=\"\$thisdir/$objdir\"
+
+  if test ! -f \"\$progdir/\$program\" ||
+     { file=\`ls -1dt \"\$progdir/\$program\" \"\$progdir/../\$program\" 2>/dev/null | ${SED} 1q\`; \\
+       test \"X\$file\" != \"X\$progdir/\$program\"; }; then
+
+    file=\"\$\$-\$program\"
+
+    if test ! -d \"\$progdir\"; then
+      $MKDIR \"\$progdir\"
+    else
+      $RM \"\$progdir/\$file\"
+    fi"
+
+         $ECHO "\
+
+    # relink executable if necessary
+    if test -n \"\$relink_command\"; then
+      if relink_command_output=\`eval \$relink_command 2>&1\`; then :
+      else
+       $ECHO \"\$relink_command_output\" >&2
+       $RM \"\$progdir/\$file\"
+       exit 1
+      fi
+    fi
+
+    $MV \"\$progdir/\$file\" \"\$progdir/\$program\" 2>/dev/null ||
+    { $RM \"\$progdir/\$program\";
+      $MV \"\$progdir/\$file\" \"\$progdir/\$program\"; }
+    $RM \"\$progdir/\$file\"
+  fi"
+       else
+         $ECHO "\
+  program='$outputname'
+  progdir=\"\$thisdir/$objdir\"
+"
+       fi
+
+       $ECHO "\
+
+  if test -f \"\$progdir/\$program\"; then"
+
+       # fixup the dll searchpath if we need to.
+       #
+       # Fix the DLL searchpath if we need to.  Do this before prepending
+       # to shlibpath, because on Windows, both are PATH and uninstalled
+       # libraries must come first.
+       if test -n "$dllsearchpath"; then
+         $ECHO "\
+    # Add the dll search path components to the executable PATH
+    PATH=$dllsearchpath:\$PATH
+"
+       fi
+
+       # Export our shlibpath_var if we have one.
+       if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+         $ECHO "\
+    # Add our own library path to $shlibpath_var
+    $shlibpath_var=\"$temp_rpath\$$shlibpath_var\"
+
+    # Some systems cannot cope with colon-terminated $shlibpath_var
+    # The second colon is a workaround for a bug in BeOS R4 sed
+    $shlibpath_var=\`\$ECHO \"\$$shlibpath_var\" | $SED 's/::*\$//'\`
+
+    export $shlibpath_var
+"
+       fi
+
+       $ECHO "\
+    if test \"\$libtool_execute_magic\" != \"$magic\"; then
+      # Run the actual program with our arguments.
+      func_exec_program \${1+\"\$@\"}
+    fi
+  else
+    # The program doesn't exist.
+    \$ECHO \"\$0: error: \\\`\$progdir/\$program' does not exist\" 1>&2
+    \$ECHO \"This script is just a wrapper for \$program.\" 1>&2
+    \$ECHO \"See the $PACKAGE documentation for more information.\" 1>&2
+    exit 1
+  fi
+fi\
+"
+}
+
+
+# func_emit_cwrapperexe_src
+# emit the source code for a wrapper executable on stdout
+# Must ONLY be called from within func_mode_link because
+# it depends on a number of variable set therein.
+func_emit_cwrapperexe_src ()
+{
+       cat <<EOF
+
+/* $cwrappersource - temporary wrapper executable for $objdir/$outputname
+   Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+
+   The $output program cannot be directly executed until all the libtool
+   libraries that it depends on are installed.
+
+   This wrapper executable should never be moved out of the build directory.
+   If it is, it will not operate correctly.
+*/
+EOF
+           cat <<"EOF"
+#ifdef _MSC_VER
+# define _CRT_SECURE_NO_DEPRECATE 1
+#endif
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef _MSC_VER
+# include <direct.h>
+# include <process.h>
+# include <io.h>
+#else
+# include <unistd.h>
+# include <stdint.h>
+# ifdef __CYGWIN__
+#  include <io.h>
+# endif
+#endif
+#include <malloc.h>
+#include <stdarg.h>
+#include <assert.h>
+#include <string.h>
+#include <ctype.h>
+#include <errno.h>
+#include <fcntl.h>
+#include <sys/stat.h>
+
+/* declarations of non-ANSI functions */
+#if defined(__MINGW32__)
+# ifdef __STRICT_ANSI__
+int _putenv (const char *);
+# endif
+#elif defined(__CYGWIN__)
+# ifdef __STRICT_ANSI__
+char *realpath (const char *, char *);
+int putenv (char *);
+int setenv (const char *, const char *, int);
+# endif
+/* #elif defined (other platforms) ... */
+#endif
+
+/* portability defines, excluding path handling macros */
+#if defined(_MSC_VER)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+# define S_IXUSR _S_IEXEC
+# ifndef _INTPTR_T_DEFINED
+#  define _INTPTR_T_DEFINED
+#  define intptr_t int
+# endif
+#elif defined(__MINGW32__)
+# define setmode _setmode
+# define stat    _stat
+# define chmod   _chmod
+# define getcwd  _getcwd
+# define putenv  _putenv
+#elif defined(__CYGWIN__)
+# define HAVE_SETENV
+# define FOPEN_WB "wb"
+/* #elif defined (other platforms) ... */
+#endif
+
+#if defined(PATH_MAX)
+# define LT_PATHMAX PATH_MAX
+#elif defined(MAXPATHLEN)
+# define LT_PATHMAX MAXPATHLEN
+#else
+# define LT_PATHMAX 1024
+#endif
+
+#ifndef S_IXOTH
+# define S_IXOTH 0
+#endif
+#ifndef S_IXGRP
+# define S_IXGRP 0
+#endif
+
+/* path handling portability macros */
+#ifndef DIR_SEPARATOR
+# define DIR_SEPARATOR '/'
+# define PATH_SEPARATOR ':'
+#endif
+
+#if defined (_WIN32) || defined (__MSDOS__) || defined (__DJGPP__) || \
+  defined (__OS2__)
+# define HAVE_DOS_BASED_FILE_SYSTEM
+# define FOPEN_WB "wb"
+# ifndef DIR_SEPARATOR_2
+#  define DIR_SEPARATOR_2 '\\'
+# endif
+# ifndef PATH_SEPARATOR_2
+#  define PATH_SEPARATOR_2 ';'
+# endif
+#endif
+
+#ifndef DIR_SEPARATOR_2
+# define IS_DIR_SEPARATOR(ch) ((ch) == DIR_SEPARATOR)
+#else /* DIR_SEPARATOR_2 */
+# define IS_DIR_SEPARATOR(ch) \
+       (((ch) == DIR_SEPARATOR) || ((ch) == DIR_SEPARATOR_2))
+#endif /* DIR_SEPARATOR_2 */
+
+#ifndef PATH_SEPARATOR_2
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR)
+#else /* PATH_SEPARATOR_2 */
+# define IS_PATH_SEPARATOR(ch) ((ch) == PATH_SEPARATOR_2)
+#endif /* PATH_SEPARATOR_2 */
+
+#ifndef FOPEN_WB
+# define FOPEN_WB "w"
+#endif
+#ifndef _O_BINARY
+# define _O_BINARY 0
+#endif
+
+#define XMALLOC(type, num)      ((type *) xmalloc ((num) * sizeof(type)))
+#define XFREE(stale) do { \
+  if (stale) { free ((void *) stale); stale = 0; } \
+} while (0)
+
+#if defined(LT_DEBUGWRAPPER)
+static int lt_debug = 1;
+#else
+static int lt_debug = 0;
+#endif
+
+const char *program_name = "libtool-wrapper"; /* in case xstrdup fails */
+
+void *xmalloc (size_t num);
+char *xstrdup (const char *string);
+const char *base_name (const char *name);
+char *find_executable (const char *wrapper);
+char *chase_symlinks (const char *pathspec);
+int make_executable (const char *path);
+int check_executable (const char *path);
+char *strendzap (char *str, const char *pat);
+void lt_debugprintf (const char *file, int line, const char *fmt, ...);
+void lt_fatal (const char *file, int line, const char *message, ...);
+static const char *nonnull (const char *s);
+static const char *nonempty (const char *s);
+void lt_setenv (const char *name, const char *value);
+char *lt_extend_str (const char *orig_value, const char *add, int to_end);
+void lt_update_exe_path (const char *name, const char *value);
+void lt_update_lib_path (const char *name, const char *value);
+char **prepare_spawn (char **argv);
+void lt_dump_script (FILE *f);
+EOF
+
+           cat <<EOF
+volatile const char * MAGIC_EXE = "$magic_exe";
+const char * LIB_PATH_VARNAME = "$shlibpath_var";
+EOF
+
+           if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
+              func_to_host_path "$temp_rpath"
+             cat <<EOF
+const char * LIB_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+           else
+             cat <<"EOF"
+const char * LIB_PATH_VALUE   = "";
+EOF
+           fi
+
+           if test -n "$dllsearchpath"; then
+              func_to_host_path "$dllsearchpath:"
+             cat <<EOF
+const char * EXE_PATH_VARNAME = "PATH";
+const char * EXE_PATH_VALUE   = "$func_to_host_path_result";
+EOF
+           else
+             cat <<"EOF"
+const char * EXE_PATH_VARNAME = "";
+const char * EXE_PATH_VALUE   = "";
+EOF
+           fi
+
+           if test "$fast_install" = yes; then
+             cat <<EOF
+const char * TARGET_PROGRAM_NAME = "lt-$outputname"; /* hopefully, no .exe */
+EOF
+           else
+             cat <<EOF
+const char * TARGET_PROGRAM_NAME = "$outputname"; /* hopefully, no .exe */
+EOF
+           fi
+
+
+           cat <<"EOF"
+
+#define LTWRAPPER_OPTION_PREFIX         "--lt-"
+
+static const char *ltwrapper_option_prefix = LTWRAPPER_OPTION_PREFIX;
+static const char *dumpscript_opt       = LTWRAPPER_OPTION_PREFIX "dump-script";
+static const char *debug_opt            = LTWRAPPER_OPTION_PREFIX "debug";
+
+int
+main (int argc, char *argv[])
+{
+  char **newargz;
+  int  newargc;
+  char *tmp_pathspec;
+  char *actual_cwrapper_path;
+  char *actual_cwrapper_name;
+  char *target_name;
+  char *lt_argv_zero;
+  intptr_t rval = 127;
+
+  int i;
+
+  program_name = (char *) xstrdup (base_name (argv[0]));
+  newargz = XMALLOC (char *, argc + 1);
+
+  /* very simple arg parsing; don't want to rely on getopt
+   * also, copy all non cwrapper options to newargz, except
+   * argz[0], which is handled differently
+   */
+  newargc=0;
+  for (i = 1; i < argc; i++)
+    {
+      if (strcmp (argv[i], dumpscript_opt) == 0)
+       {
+EOF
+           case "$host" in
+             *mingw* | *cygwin* )
+               # make stdout use "unix" line endings
+               echo "          setmode(1,_O_BINARY);"
+               ;;
+             esac
+
+           cat <<"EOF"
+         lt_dump_script (stdout);
+         return 0;
+       }
+      if (strcmp (argv[i], debug_opt) == 0)
+       {
+          lt_debug = 1;
+          continue;
+       }
+      if (strcmp (argv[i], ltwrapper_option_prefix) == 0)
+        {
+          /* however, if there is an option in the LTWRAPPER_OPTION_PREFIX
+             namespace, but it is not one of the ones we know about and
+             have already dealt with, above (inluding dump-script), then
+             report an error. Otherwise, targets might begin to believe
+             they are allowed to use options in the LTWRAPPER_OPTION_PREFIX
+             namespace. The first time any user complains about this, we'll
+             need to make LTWRAPPER_OPTION_PREFIX a configure-time option
+             or a configure.ac-settable value.
+           */
+          lt_fatal (__FILE__, __LINE__,
+                   "unrecognized %s option: '%s'",
+                    ltwrapper_option_prefix, argv[i]);
+        }
+      /* otherwise ... */
+      newargz[++newargc] = xstrdup (argv[i]);
+    }
+  newargz[++newargc] = NULL;
+
+EOF
+           cat <<EOF
+  /* The GNU banner must be the first non-error debug message */
+  lt_debugprintf (__FILE__, __LINE__, "libtool wrapper (GNU $PACKAGE$TIMESTAMP) $VERSION\n");
+EOF
+           cat <<"EOF"
+  lt_debugprintf (__FILE__, __LINE__, "(main) argv[0]: %s\n", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__, "(main) program_name: %s\n", program_name);
+
+  tmp_pathspec = find_executable (argv[0]);
+  if (tmp_pathspec == NULL)
+    lt_fatal (__FILE__, __LINE__, "couldn't find %s", argv[0]);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (before symlink chase) at: %s\n",
+                 tmp_pathspec);
+
+  actual_cwrapper_path = chase_symlinks (tmp_pathspec);
+  lt_debugprintf (__FILE__, __LINE__,
+                  "(main) found exe (after symlink chase) at: %s\n",
+                 actual_cwrapper_path);
+  XFREE (tmp_pathspec);
+
+  actual_cwrapper_name = xstrdup (base_name (actual_cwrapper_path));
+  strendzap (actual_cwrapper_path, actual_cwrapper_name);
+
+  /* wrapper name transforms */
+  strendzap (actual_cwrapper_name, ".exe");
+  tmp_pathspec = lt_extend_str (actual_cwrapper_name, ".exe", 1);
+  XFREE (actual_cwrapper_name);
+  actual_cwrapper_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  /* target_name transforms -- use actual target program name; might have lt- prefix */
+  target_name = xstrdup (base_name (TARGET_PROGRAM_NAME));
+  strendzap (target_name, ".exe");
+  tmp_pathspec = lt_extend_str (target_name, ".exe", 1);
+  XFREE (target_name);
+  target_name = tmp_pathspec;
+  tmp_pathspec = 0;
+
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(main) libtool target name: %s\n",
+                 target_name);
+EOF
+
+           cat <<EOF
+  newargz[0] =
+    XMALLOC (char, (strlen (actual_cwrapper_path) +
+                   strlen ("$objdir") + 1 + strlen (actual_cwrapper_name) + 1));
+  strcpy (newargz[0], actual_cwrapper_path);
+  strcat (newargz[0], "$objdir");
+  strcat (newargz[0], "/");
+EOF
+
+           cat <<"EOF"
+  /* stop here, and copy so we don't have to do this twice */
+  tmp_pathspec = xstrdup (newargz[0]);
+
+  /* do NOT want the lt- prefix here, so use actual_cwrapper_name */
+  strcat (newargz[0], actual_cwrapper_name);
+
+  /* DO want the lt- prefix here if it exists, so use target_name */
+  lt_argv_zero = lt_extend_str (tmp_pathspec, target_name, 1);
+  XFREE (tmp_pathspec);
+  tmp_pathspec = NULL;
+EOF
+
+           case $host_os in
+             mingw*)
+           cat <<"EOF"
+  {
+    char* p;
+    while ((p = strchr (newargz[0], '\\')) != NULL)
+      {
+       *p = '/';
+      }
+    while ((p = strchr (lt_argv_zero, '\\')) != NULL)
+      {
+       *p = '/';
+      }
+  }
+EOF
+           ;;
+           esac
+
+           cat <<"EOF"
+  XFREE (target_name);
+  XFREE (actual_cwrapper_path);
+  XFREE (actual_cwrapper_name);
+
+  lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
+  lt_setenv ("DUALCASE", "1");  /* for MSK sh */
+  /* Update the DLL searchpath.  EXE_PATH_VALUE ($dllsearchpath) must
+     be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+     because on Windows, both *_VARNAMEs are PATH but uninstalled
+     libraries must come first. */
+  lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+  lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+
+  lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
+                 nonnull (lt_argv_zero));
+  for (i = 0; i < newargc; i++)
+    {
+      lt_debugprintf (__FILE__, __LINE__, "(main) newargz[%d]: %s\n",
+                     i, nonnull (newargz[i]));
+    }
+
+EOF
+
+           case $host_os in
+             mingw*)
+               cat <<"EOF"
+  /* execv doesn't actually work on mingw as expected on unix */
+  newargz = prepare_spawn (newargz);
+  rval = _spawnv (_P_WAIT, lt_argv_zero, (const char * const *) newargz);
+  if (rval == -1)
+    {
+      /* failed to start process */
+      lt_debugprintf (__FILE__, __LINE__,
+                     "(main) failed to launch target \"%s\": %s\n",
+                     lt_argv_zero, nonnull (strerror (errno)));
+      return 127;
+    }
+  return rval;
+EOF
+               ;;
+             *)
+               cat <<"EOF"
+  execv (lt_argv_zero, newargz);
+  return rval; /* =127, but avoids unused variable warning */
+EOF
+               ;;
+           esac
+
+           cat <<"EOF"
+}
+
+void *
+xmalloc (size_t num)
+{
+  void *p = (void *) malloc (num);
+  if (!p)
+    lt_fatal (__FILE__, __LINE__, "memory exhausted");
+
+  return p;
+}
+
+char *
+xstrdup (const char *string)
+{
+  return string ? strcpy ((char *) xmalloc (strlen (string) + 1),
+                         string) : NULL;
+}
+
+const char *
+base_name (const char *name)
+{
+  const char *base;
+
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  /* Skip over the disk name in MSDOS pathnames. */
+  if (isalpha ((unsigned char) name[0]) && name[1] == ':')
+    name += 2;
+#endif
+
+  for (base = name; *name; name++)
+    if (IS_DIR_SEPARATOR (*name))
+      base = name + 1;
+  return base;
+}
+
+int
+check_executable (const char *path)
+{
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(check_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if ((stat (path, &st) >= 0)
+      && (st.st_mode & (S_IXUSR | S_IXGRP | S_IXOTH)))
+    return 1;
+  else
+    return 0;
+}
+
+int
+make_executable (const char *path)
+{
+  int rval = 0;
+  struct stat st;
+
+  lt_debugprintf (__FILE__, __LINE__, "(make_executable): %s\n",
+                  nonempty (path));
+  if ((!path) || (!*path))
+    return 0;
+
+  if (stat (path, &st) >= 0)
+    {
+      rval = chmod (path, st.st_mode | S_IXOTH | S_IXGRP | S_IXUSR);
+    }
+  return rval;
+}
+
+/* Searches for the full path of the wrapper.  Returns
+   newly allocated full path name if found, NULL otherwise
+   Does not chase symlinks, even on platforms that support them.
+*/
+char *
+find_executable (const char *wrapper)
+{
+  int has_slash = 0;
+  const char *p;
+  const char *p_next;
+  /* static buffer for getcwd */
+  char tmp[LT_PATHMAX + 1];
+  int tmp_len;
+  char *concat_name;
+
+  lt_debugprintf (__FILE__, __LINE__, "(find_executable): %s\n",
+                  nonempty (wrapper));
+
+  if ((wrapper == NULL) || (*wrapper == '\0'))
+    return NULL;
+
+  /* Absolute path? */
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+  if (isalpha ((unsigned char) wrapper[0]) && wrapper[1] == ':')
+    {
+      concat_name = xstrdup (wrapper);
+      if (check_executable (concat_name))
+       return concat_name;
+      XFREE (concat_name);
+    }
+  else
+    {
+#endif
+      if (IS_DIR_SEPARATOR (wrapper[0]))
+       {
+         concat_name = xstrdup (wrapper);
+         if (check_executable (concat_name))
+           return concat_name;
+         XFREE (concat_name);
+       }
+#if defined (HAVE_DOS_BASED_FILE_SYSTEM)
+    }
+#endif
+
+  for (p = wrapper; *p; p++)
+    if (*p == '/')
+      {
+       has_slash = 1;
+       break;
+      }
+  if (!has_slash)
+    {
+      /* no slashes; search PATH */
+      const char *path = getenv ("PATH");
+      if (path != NULL)
+       {
+         for (p = path; *p; p = p_next)
+           {
+             const char *q;
+             size_t p_len;
+             for (q = p; *q; q++)
+               if (IS_PATH_SEPARATOR (*q))
+                 break;
+             p_len = q - p;
+             p_next = (*q == '\0' ? q : q + 1);
+             if (p_len == 0)
+               {
+                 /* empty path: current directory */
+                 if (getcwd (tmp, LT_PATHMAX) == NULL)
+                   lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+                              nonnull (strerror (errno)));
+                 tmp_len = strlen (tmp);
+                 concat_name =
+                   XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+                 memcpy (concat_name, tmp, tmp_len);
+                 concat_name[tmp_len] = '/';
+                 strcpy (concat_name + tmp_len + 1, wrapper);
+               }
+             else
+               {
+                 concat_name =
+                   XMALLOC (char, p_len + 1 + strlen (wrapper) + 1);
+                 memcpy (concat_name, p, p_len);
+                 concat_name[p_len] = '/';
+                 strcpy (concat_name + p_len + 1, wrapper);
+               }
+             if (check_executable (concat_name))
+               return concat_name;
+             XFREE (concat_name);
+           }
+       }
+      /* not found in PATH; assume curdir */
+    }
+  /* Relative path | not found in path: prepend cwd */
+  if (getcwd (tmp, LT_PATHMAX) == NULL)
+    lt_fatal (__FILE__, __LINE__, "getcwd failed: %s",
+              nonnull (strerror (errno)));
+  tmp_len = strlen (tmp);
+  concat_name = XMALLOC (char, tmp_len + 1 + strlen (wrapper) + 1);
+  memcpy (concat_name, tmp, tmp_len);
+  concat_name[tmp_len] = '/';
+  strcpy (concat_name + tmp_len + 1, wrapper);
+
+  if (check_executable (concat_name))
+    return concat_name;
+  XFREE (concat_name);
+  return NULL;
+}
+
+char *
+chase_symlinks (const char *pathspec)
+{
+#ifndef S_ISLNK
+  return xstrdup (pathspec);
+#else
+  char buf[LT_PATHMAX];
+  struct stat s;
+  char *tmp_pathspec = xstrdup (pathspec);
+  char *p;
+  int has_symlinks = 0;
+  while (strlen (tmp_pathspec) && !has_symlinks)
+    {
+      lt_debugprintf (__FILE__, __LINE__,
+                     "checking path component for symlinks: %s\n",
+                     tmp_pathspec);
+      if (lstat (tmp_pathspec, &s) == 0)
+       {
+         if (S_ISLNK (s.st_mode) != 0)
+           {
+             has_symlinks = 1;
+             break;
+           }
+
+         /* search backwards for last DIR_SEPARATOR */
+         p = tmp_pathspec + strlen (tmp_pathspec) - 1;
+         while ((p > tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+           p--;
+         if ((p == tmp_pathspec) && (!IS_DIR_SEPARATOR (*p)))
+           {
+             /* no more DIR_SEPARATORS left */
+             break;
+           }
+         *p = '\0';
+       }
+      else
+       {
+         lt_fatal (__FILE__, __LINE__,
+                   "error accessing file \"%s\": %s",
+                   tmp_pathspec, nonnull (strerror (errno)));
+       }
+    }
+  XFREE (tmp_pathspec);
+
+  if (!has_symlinks)
+    {
+      return xstrdup (pathspec);
+    }
+
+  tmp_pathspec = realpath (pathspec, buf);
+  if (tmp_pathspec == 0)
+    {
+      lt_fatal (__FILE__, __LINE__,
+               "could not follow symlinks for %s", pathspec);
+    }
+  return xstrdup (tmp_pathspec);
+#endif
+}
+
+char *
+strendzap (char *str, const char *pat)
+{
+  size_t len, patlen;
+
+  assert (str != NULL);
+  assert (pat != NULL);
+
+  len = strlen (str);
+  patlen = strlen (pat);
+
+  if (patlen <= len)
+    {
+      str += len - patlen;
+      if (strcmp (str, pat) == 0)
+       *str = '\0';
+    }
+  return str;
+}
+
+void
+lt_debugprintf (const char *file, int line, const char *fmt, ...)
+{
+  va_list args;
+  if (lt_debug)
+    {
+      (void) fprintf (stderr, "%s:%s:%d: ", program_name, file, line);
+      va_start (args, fmt);
+      (void) vfprintf (stderr, fmt, args);
+      va_end (args);
+    }
+}
+
+static void
+lt_error_core (int exit_status, const char *file,
+              int line, const char *mode,
+              const char *message, va_list ap)
+{
+  fprintf (stderr, "%s:%s:%d: %s: ", program_name, file, line, mode);
+  vfprintf (stderr, message, ap);
+  fprintf (stderr, ".\n");
+
+  if (exit_status >= 0)
+    exit (exit_status);
+}
+
+void
+lt_fatal (const char *file, int line, const char *message, ...)
+{
+  va_list ap;
+  va_start (ap, message);
+  lt_error_core (EXIT_FAILURE, file, line, "FATAL", message, ap);
+  va_end (ap);
+}
+
+static const char *
+nonnull (const char *s)
+{
+  return s ? s : "(null)";
+}
+
+static const char *
+nonempty (const char *s)
+{
+  return (s && !*s) ? "(empty)" : nonnull (s);
+}
+
+void
+lt_setenv (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_setenv) setting '%s' to '%s'\n",
+                  nonnull (name), nonnull (value));
+  {
+#ifdef HAVE_SETENV
+    /* always make a copy, for consistency with !HAVE_SETENV */
+    char *str = xstrdup (value);
+    setenv (name, str, 1);
+#else
+    int len = strlen (name) + 1 + strlen (value) + 1;
+    char *str = XMALLOC (char, len);
+    sprintf (str, "%s=%s", name, value);
+    if (putenv (str) != EXIT_SUCCESS)
+      {
+        XFREE (str);
+      }
+#endif
+  }
+}
+
+char *
+lt_extend_str (const char *orig_value, const char *add, int to_end)
+{
+  char *new_value;
+  if (orig_value && *orig_value)
+    {
+      int orig_value_len = strlen (orig_value);
+      int add_len = strlen (add);
+      new_value = XMALLOC (char, add_len + orig_value_len + 1);
+      if (to_end)
+        {
+          strcpy (new_value, orig_value);
+          strcpy (new_value + orig_value_len, add);
+        }
+      else
+        {
+          strcpy (new_value, add);
+          strcpy (new_value + add_len, orig_value);
+        }
+    }
+  else
+    {
+      new_value = xstrdup (add);
+    }
+  return new_value;
+}
+
+void
+lt_update_exe_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_update_exe_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      /* some systems can't cope with a ':'-terminated path #' */
+      int len = strlen (new_value);
+      while (((len = strlen (new_value)) > 0) && IS_PATH_SEPARATOR (new_value[len-1]))
+        {
+          new_value[len-1] = '\0';
+        }
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+void
+lt_update_lib_path (const char *name, const char *value)
+{
+  lt_debugprintf (__FILE__, __LINE__,
+                 "(lt_update_lib_path) modifying '%s' by prepending '%s'\n",
+                  nonnull (name), nonnull (value));
+
+  if (name && *name && value && *value)
+    {
+      char *new_value = lt_extend_str (getenv (name), value, 0);
+      lt_setenv (name, new_value);
+      XFREE (new_value);
+    }
+}
+
+EOF
+           case $host_os in
+             mingw*)
+               cat <<"EOF"
+
+/* Prepares an argument vector before calling spawn().
+   Note that spawn() does not by itself call the command interpreter
+     (getenv ("COMSPEC") != NULL ? getenv ("COMSPEC") :
+      ({ OSVERSIONINFO v; v.dwOSVersionInfoSize = sizeof(OSVERSIONINFO);
+         GetVersionEx(&v);
+         v.dwPlatformId == VER_PLATFORM_WIN32_NT;
+      }) ? "cmd.exe" : "command.com").
+   Instead it simply concatenates the arguments, separated by ' ', and calls
+   CreateProcess().  We must quote the arguments since Win32 CreateProcess()
+   interprets characters like ' ', '\t', '\\', '"' (but not '<' and '>') in a
+   special way:
+   - Space and tab are interpreted as delimiters. They are not treated as
+     delimiters if they are surrounded by double quotes: "...".
+   - Unescaped double quotes are removed from the input. Their only effect is
+     that within double quotes, space and tab are treated like normal
+     characters.
+   - Backslashes not followed by double quotes are not special.
+   - But 2*n+1 backslashes followed by a double quote become
+     n backslashes followed by a double quote (n >= 0):
+       \" -> "
+       \\\" -> \"
+       \\\\\" -> \\"
+ */
+#define SHELL_SPECIAL_CHARS "\"\\ \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+#define SHELL_SPACE_CHARS " \001\002\003\004\005\006\007\010\011\012\013\014\015\016\017\020\021\022\023\024\025\026\027\030\031\032\033\034\035\036\037"
+char **
+prepare_spawn (char **argv)
+{
+  size_t argc;
+  char **new_argv;
+  size_t i;
+
+  /* Count number of arguments.  */
+  for (argc = 0; argv[argc] != NULL; argc++)
+    ;
+
+  /* Allocate new argument vector.  */
+  new_argv = XMALLOC (char *, argc + 1);
+
+  /* Put quoted arguments into the new argument vector.  */
+  for (i = 0; i < argc; i++)
+    {
+      const char *string = argv[i];
+
+      if (string[0] == '\0')
+       new_argv[i] = xstrdup ("\"\"");
+      else if (strpbrk (string, SHELL_SPECIAL_CHARS) != NULL)
+       {
+         int quote_around = (strpbrk (string, SHELL_SPACE_CHARS) != NULL);
+         size_t length;
+         unsigned int backslashes;
+         const char *s;
+         char *quoted_string;
+         char *p;
+
+         length = 0;
+         backslashes = 0;
+         if (quote_around)
+           length++;
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               length += backslashes + 1;
+             length++;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           length += backslashes + 1;
+
+         quoted_string = XMALLOC (char, length + 1);
+
+         p = quoted_string;
+         backslashes = 0;
+         if (quote_around)
+           *p++ = '"';
+         for (s = string; *s != '\0'; s++)
+           {
+             char c = *s;
+             if (c == '"')
+               {
+                 unsigned int j;
+                 for (j = backslashes + 1; j > 0; j--)
+                   *p++ = '\\';
+               }
+             *p++ = c;
+             if (c == '\\')
+               backslashes++;
+             else
+               backslashes = 0;
+           }
+         if (quote_around)
+           {
+             unsigned int j;
+             for (j = backslashes; j > 0; j--)
+               *p++ = '\\';
+             *p++ = '"';
+           }
+         *p = '\0';
+
+         new_argv[i] = quoted_string;
+       }
+      else
+       new_argv[i] = (char *) string;
+    }
+  new_argv[argc] = NULL;
+
+  return new_argv;
+}
+EOF
+               ;;
+           esac
+
+            cat <<"EOF"
+void lt_dump_script (FILE* f)
+{
+EOF
+           func_emit_wrapper yes |
+             $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/  fputs ("\1", f);/p
+g
+D'
+            cat <<"EOF"
+}
+EOF
+}
+# end: func_emit_cwrapperexe_src
+
+# func_win32_import_lib_p ARG
+# True if ARG is an import lib, as indicated by $file_magic_cmd
+func_win32_import_lib_p ()
+{
+    $opt_debug
+    case `eval $file_magic_cmd \"\$1\" 2>/dev/null | $SED -e 10q` in
+    *import*) : ;;
+    *) false ;;
+    esac
+}
+
+# func_mode_link arg...
+func_mode_link ()
+{
+    $opt_debug
+    case $host in
+    *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+      # It is impossible to link a dll without this setting, and
+      # we shouldn't force the makefile maintainer to figure out
+      # which system we are compiling for in order to pass an extra
+      # flag for every libtool invocation.
+      # allow_undefined=no
+
+      # FIXME: Unfortunately, there are problems with the above when trying
+      # to make a dll which has undefined symbols, in which case not
+      # even a static library is built.  For now, we need to specify
+      # -no-undefined on the libtool link line when we can be certain
+      # that all symbols are satisfied, otherwise we get a static library.
+      allow_undefined=yes
+      ;;
+    *)
+      allow_undefined=yes
+      ;;
+    esac
+    libtool_args=$nonopt
+    base_compile="$nonopt $@"
+    compile_command=$nonopt
+    finalize_command=$nonopt
+
+    compile_rpath=
+    finalize_rpath=
+    compile_shlibpath=
+    finalize_shlibpath=
+    convenience=
+    old_convenience=
+    deplibs=
+    old_deplibs=
+    compiler_flags=
+    linker_flags=
+    dllsearchpath=
+    lib_search_path=`pwd`
+    inst_prefix_dir=
+    new_inherited_linker_flags=
+
+    avoid_version=no
+    bindir=
+    dlfiles=
+    dlprefiles=
+    dlself=no
+    export_dynamic=no
+    export_symbols=
+    export_symbols_regex=
+    generated=
+    libobjs=
+    ltlibs=
+    module=no
+    no_install=no
+    objs=
+    non_pic_objects=
+    precious_files_regex=
+    prefer_static_libs=no
+    preload=no
+    prev=
+    prevarg=
+    release=
+    rpath=
+    xrpath=
+    perm_rpath=
+    temp_rpath=
+    thread_safe=no
+    vinfo=
+    vinfo_number=no
+    weak_libs=
+    single_module="${wl}-single_module"
+    func_infer_tag $base_compile
+
+    # We need to know -static, to get the right output filenames.
+    for arg
+    do
+      case $arg in
+      -shared)
+       test "$build_libtool_libs" != yes && \
+         func_fatal_configuration "can not build a shared library"
+       build_old_libs=no
+       break
+       ;;
+      -all-static | -static | -static-libtool-libs)
+       case $arg in
+       -all-static)
+         if test "$build_libtool_libs" = yes && test -z "$link_static_flag"; then
+           func_warning "complete static linking is impossible in this configuration"
+         fi
+         if test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=yes
+         ;;
+       -static)
+         if test -z "$pic_flag" && test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=built
+         ;;
+       -static-libtool-libs)
+         if test -z "$pic_flag" && test -n "$link_static_flag"; then
+           dlopen_self=$dlopen_self_static
+         fi
+         prefer_static_libs=yes
+         ;;
+       esac
+       build_libtool_libs=no
+       build_old_libs=yes
+       break
+       ;;
+      esac
+    done
+
+    # See if our shared archives depend on static archives.
+    test -n "$old_archive_from_new_cmds" && build_old_libs=yes
+
+    # Go through the arguments, transforming them on the way.
+    while test "$#" -gt 0; do
+      arg="$1"
+      shift
+      func_quote_for_eval "$arg"
+      qarg=$func_quote_for_eval_unquoted_result
+      func_append libtool_args " $func_quote_for_eval_result"
+
+      # If the previous option needs an argument, assign it.
+      if test -n "$prev"; then
+       case $prev in
+       output)
+         func_append compile_command " @OUTPUT@"
+         func_append finalize_command " @OUTPUT@"
+         ;;
+       esac
+
+       case $prev in
+       bindir)
+         bindir="$arg"
+         prev=
+         continue
+         ;;
+       dlfiles|dlprefiles)
+         if test "$preload" = no; then
+           # Add the symbol object into the linking commands.
+           func_append compile_command " @SYMFILE@"
+           func_append finalize_command " @SYMFILE@"
+           preload=yes
+         fi
+         case $arg in
+         *.la | *.lo) ;;  # We handle these cases below.
+         force)
+           if test "$dlself" = no; then
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         self)
+           if test "$prev" = dlprefiles; then
+             dlself=yes
+           elif test "$prev" = dlfiles && test "$dlopen_self" != yes; then
+             dlself=yes
+           else
+             dlself=needless
+             export_dynamic=yes
+           fi
+           prev=
+           continue
+           ;;
+         *)
+           if test "$prev" = dlfiles; then
+             func_append dlfiles " $arg"
+           else
+             func_append dlprefiles " $arg"
+           fi
+           prev=
+           continue
+           ;;
+         esac
+         ;;
+       expsyms)
+         export_symbols="$arg"
+         test -f "$arg" \
+           || func_fatal_error "symbol file \`$arg' does not exist"
+         prev=
+         continue
+         ;;
+       expsyms_regex)
+         export_symbols_regex="$arg"
+         prev=
+         continue
+         ;;
+       framework)
+         case $host in
+           *-*-darwin*)
+             case "$deplibs " in
+               *" $qarg.ltframework "*) ;;
+               *) func_append deplibs " $qarg.ltframework" # this is fixed later
+                  ;;
+             esac
+             ;;
+         esac
+         prev=
+         continue
+         ;;
+       inst_prefix)
+         inst_prefix_dir="$arg"
+         prev=
+         continue
+         ;;
+       objectlist)
+         if test -f "$arg"; then
+           save_arg=$arg
+           moreargs=
+           for fil in `cat "$save_arg"`
+           do
+#            func_append moreargs " $fil"
+             arg=$fil
+             # A libtool-controlled object.
+
+             # Check to see that this really is a libtool object.
+             if func_lalib_unsafe_p "$arg"; then
+               pic_object=
+               non_pic_object=
+
+               # Read the .lo file
+               func_source "$arg"
+
+               if test -z "$pic_object" ||
+                  test -z "$non_pic_object" ||
+                  test "$pic_object" = none &&
+                  test "$non_pic_object" = none; then
+                 func_fatal_error "cannot find name of object for \`$arg'"
+               fi
+
+               # Extract subdirectory from the argument.
+               func_dirname "$arg" "/" ""
+               xdir="$func_dirname_result"
+
+               if test "$pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 pic_object="$xdir$pic_object"
+
+                 if test "$prev" = dlfiles; then
+                   if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+                     func_append dlfiles " $pic_object"
+                     prev=
+                     continue
+                   else
+                     # If libtool objects are unsupported, then we need to preload.
+                     prev=dlprefiles
+                   fi
+                 fi
+
+                 # CHECK ME:  I think I busted this.  -Ossama
+                 if test "$prev" = dlprefiles; then
+                   # Preload the old-style object.
+                   func_append dlprefiles " $pic_object"
+                   prev=
+                 fi
+
+                 # A PIC object.
+                 func_append libobjs " $pic_object"
+                 arg="$pic_object"
+               fi
+
+               # Non-PIC object.
+               if test "$non_pic_object" != none; then
+                 # Prepend the subdirectory the object is found in.
+                 non_pic_object="$xdir$non_pic_object"
+
+                 # A standard non-PIC object
+                 func_append non_pic_objects " $non_pic_object"
+                 if test -z "$pic_object" || test "$pic_object" = none ; then
+                   arg="$non_pic_object"
+                 fi
+               else
+                 # If the PIC object exists, use it instead.
+                 # $xdir was prepended to $pic_object above.
+                 non_pic_object="$pic_object"
+                 func_append non_pic_objects " $non_pic_object"
+               fi
+             else
+               # Only an error if not doing a dry-run.
+               if $opt_dry_run; then
+                 # Extract subdirectory from the argument.
+                 func_dirname "$arg" "/" ""
+                 xdir="$func_dirname_result"
+
+                 func_lo2o "$arg"
+                 pic_object=$xdir$objdir/$func_lo2o_result
+                 non_pic_object=$xdir$func_lo2o_result
+                 func_append libobjs " $pic_object"
+                 func_append non_pic_objects " $non_pic_object"
+               else
+                 func_fatal_error "\`$arg' is not a valid libtool object"
+               fi
+             fi
+           done
+         else
+           func_fatal_error "link input file \`$arg' does not exist"
+         fi
+         arg=$save_arg
+         prev=
+         continue
+         ;;
+       precious_regex)
+         precious_files_regex="$arg"
+         prev=
+         continue
+         ;;
+       release)
+         release="-$arg"
+         prev=
+         continue
+         ;;
+       rpath | xrpath)
+         # We need an absolute path.
+         case $arg in
+         [\\/]* | [A-Za-z]:[\\/]*) ;;
+         *)
+           func_fatal_error "only absolute run-paths are allowed"
+           ;;
+         esac
+         if test "$prev" = rpath; then
+           case "$rpath " in
+           *" $arg "*) ;;
+           *) func_append rpath " $arg" ;;
+           esac
+         else
+           case "$xrpath " in
+           *" $arg "*) ;;
+           *) func_append xrpath " $arg" ;;
+           esac
+         fi
+         prev=
+         continue
+         ;;
+       shrext)
+         shrext_cmds="$arg"
+         prev=
+         continue
+         ;;
+       weak)
+         func_append weak_libs " $arg"
+         prev=
+         continue
+         ;;
+       xcclinker)
+         func_append linker_flags " $qarg"
+         func_append compiler_flags " $qarg"
+         prev=
+         func_append compile_command " $qarg"
+         func_append finalize_command " $qarg"
+         continue
+         ;;
+       xcompiler)
+         func_append compiler_flags " $qarg"
+         prev=
+         func_append compile_command " $qarg"
+         func_append finalize_command " $qarg"
+         continue
+         ;;
+       xlinker)
+         func_append linker_flags " $qarg"
+         func_append compiler_flags " $wl$qarg"
+         prev=
+         func_append compile_command " $wl$qarg"
+         func_append finalize_command " $wl$qarg"
+         continue
+         ;;
+       *)
+         eval "$prev=\"\$arg\""
+         prev=
+         continue
+         ;;
+       esac
+      fi # test -n "$prev"
+
+      prevarg="$arg"
+
+      case $arg in
+      -all-static)
+       if test -n "$link_static_flag"; then
+         # See comment for -static flag below, for more details.
+         func_append compile_command " $link_static_flag"
+         func_append finalize_command " $link_static_flag"
+       fi
+       continue
+       ;;
+
+      -allow-undefined)
+       # FIXME: remove this flag sometime in the future.
+       func_fatal_error "\`-allow-undefined' must not be used because it is the default"
+       ;;
+
+      -avoid-version)
+       avoid_version=yes
+       continue
+       ;;
+
+      -bindir)
+       prev=bindir
+       continue
+       ;;
+
+      -dlopen)
+       prev=dlfiles
+       continue
+       ;;
+
+      -dlpreopen)
+       prev=dlprefiles
+       continue
+       ;;
+
+      -export-dynamic)
+       export_dynamic=yes
+       continue
+       ;;
+
+      -export-symbols | -export-symbols-regex)
+       if test -n "$export_symbols" || test -n "$export_symbols_regex"; then
+         func_fatal_error "more than one -exported-symbols argument is not allowed"
+       fi
+       if test "X$arg" = "X-export-symbols"; then
+         prev=expsyms
+       else
+         prev=expsyms_regex
+       fi
+       continue
+       ;;
+
+      -framework)
+       prev=framework
+       continue
+       ;;
+
+      -inst-prefix-dir)
+       prev=inst_prefix
+       continue
+       ;;
+
+      # The native IRIX linker understands -LANG:*, -LIST:* and -LNO:*
+      # so, if we see these flags be careful not to treat them like -L
+      -L[A-Z][A-Z]*:*)
+       case $with_gcc/$host in
+       no/*-*-irix* | /*-*-irix*)
+         func_append compile_command " $arg"
+         func_append finalize_command " $arg"
+         ;;
+       esac
+       continue
+       ;;
+
+      -L*)
+       func_stripname "-L" '' "$arg"
+       if test -z "$func_stripname_result"; then
+         if test "$#" -gt 0; then
+           func_fatal_error "require no space between \`-L' and \`$1'"
+         else
+           func_fatal_error "need path for \`-L' option"
+         fi
+       fi
+       func_resolve_sysroot "$func_stripname_result"
+       dir=$func_resolve_sysroot_result
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       *)
+         absdir=`cd "$dir" && pwd`
+         test -z "$absdir" && \
+           func_fatal_error "cannot determine absolute directory name of \`$dir'"
+         dir="$absdir"
+         ;;
+       esac
+       case "$deplibs " in
+       *" -L$dir "* | *" $arg "*)
+         # Will only happen for absolute or sysroot arguments
+         ;;
+       *)
+         # Preserve sysroot, but never include relative directories
+         case $dir in
+           [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+           *) func_append deplibs " -L$dir" ;;
+         esac
+         func_append lib_search_path " $dir"
+         ;;
+       esac
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+         testbindir=`$ECHO "$dir" | $SED 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$dir:"*) ;;
+         ::) dllsearchpath=$dir;;
+         *) func_append dllsearchpath ":$dir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         ::) dllsearchpath=$testbindir;;
+         *) func_append dllsearchpath ":$testbindir";;
+         esac
+         ;;
+       esac
+       continue
+       ;;
+
+      -l*)
+       if test "X$arg" = "X-lc" || test "X$arg" = "X-lm"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-beos* | *-cegcc* | *-*-haiku*)
+           # These systems don't actually have a C or math library (as such)
+           continue
+           ;;
+         *-*-os2*)
+           # These systems don't actually have a C library (as such)
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C and math libraries are in the System framework
+           func_append deplibs " System.ltframework"
+           continue
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           test "X$arg" = "X-lc" && continue
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           test "X$arg" = "X-lc" && continue
+           ;;
+         esac
+       elif test "X$arg" = "X-lc_r"; then
+        case $host in
+        *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+          # Do not include libc_r directly, use -pthread flag.
+          continue
+          ;;
+        esac
+       fi
+       func_append deplibs " $arg"
+       continue
+       ;;
+
+      -module)
+       module=yes
+       continue
+       ;;
+
+      # Tru64 UNIX uses -model [arg] to determine the layout of C++
+      # classes, name mangling, and exception handling.
+      # Darwin uses the -arch flag to determine output architecture.
+      -model|-arch|-isysroot|--sysroot)
+       func_append compiler_flags " $arg"
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+       prev=xcompiler
+       continue
+       ;;
+
+      -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"
+       case "$new_inherited_linker_flags " in
+           *" $arg "*) ;;
+           * ) func_append new_inherited_linker_flags " $arg" ;;
+       esac
+       continue
+       ;;
+
+      -multi_module)
+       single_module="${wl}-multi_module"
+       continue
+       ;;
+
+      -no-fast-install)
+       fast_install=no
+       continue
+       ;;
+
+      -no-install)
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin* | *-cegcc*)
+         # The PATH hackery in wrapper scripts is required on Windows
+         # and Darwin in order for the loader to find any dlls it needs.
+         func_warning "\`-no-install' is ignored for $host"
+         func_warning "assuming \`-no-fast-install' instead"
+         fast_install=no
+         ;;
+       *) no_install=yes ;;
+       esac
+       continue
+       ;;
+
+      -no-undefined)
+       allow_undefined=no
+       continue
+       ;;
+
+      -objectlist)
+       prev=objectlist
+       continue
+       ;;
+
+      -o) prev=output ;;
+
+      -precious-files-regex)
+       prev=precious_regex
+       continue
+       ;;
+
+      -release)
+       prev=release
+       continue
+       ;;
+
+      -rpath)
+       prev=rpath
+       continue
+       ;;
+
+      -R)
+       prev=xrpath
+       continue
+       ;;
+
+      -R*)
+       func_stripname '-R' '' "$arg"
+       dir=$func_stripname_result
+       # We need an absolute path.
+       case $dir in
+       [\\/]* | [A-Za-z]:[\\/]*) ;;
+       =*)
+         func_stripname '=' '' "$dir"
+         dir=$lt_sysroot$func_stripname_result
+         ;;
+       *)
+         func_fatal_error "only absolute run-paths are allowed"
+         ;;
+       esac
+       case "$xrpath " in
+       *" $dir "*) ;;
+       *) func_append xrpath " $dir" ;;
+       esac
+       continue
+       ;;
+
+      -shared)
+       # The effects of -shared are defined in a previous loop.
+       continue
+       ;;
+
+      -shrext)
+       prev=shrext
+       continue
+       ;;
+
+      -static | -static-libtool-libs)
+       # The effects of -static are defined in a previous loop.
+       # We used to do the same as -all-static on platforms that
+       # didn't have a PIC flag, but the assumption that the effects
+       # would be equivalent was wrong.  It would break on at least
+       # Digital Unix and AIX.
+       continue
+       ;;
+
+      -thread-safe)
+       thread_safe=yes
+       continue
+       ;;
+
+      -version-info)
+       prev=vinfo
+       continue
+       ;;
+
+      -version-number)
+       prev=vinfo
+       vinfo_number=yes
+       continue
+       ;;
+
+      -weak)
+        prev=weak
+       continue
+       ;;
+
+      -Wc,*)
+       func_stripname '-Wc,' '' "$arg"
+       args=$func_stripname_result
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+         func_append arg " $func_quote_for_eval_result"
+         func_append compiler_flags " $func_quote_for_eval_result"
+       done
+       IFS="$save_ifs"
+       func_stripname ' ' '' "$arg"
+       arg=$func_stripname_result
+       ;;
+
+      -Wl,*)
+       func_stripname '-Wl,' '' "$arg"
+       args=$func_stripname_result
+       arg=
+       save_ifs="$IFS"; IFS=','
+       for flag in $args; do
+         IFS="$save_ifs"
+          func_quote_for_eval "$flag"
+         func_append arg " $wl$func_quote_for_eval_result"
+         func_append compiler_flags " $wl$func_quote_for_eval_result"
+         func_append linker_flags " $func_quote_for_eval_result"
+       done
+       IFS="$save_ifs"
+       func_stripname ' ' '' "$arg"
+       arg=$func_stripname_result
+       ;;
+
+      -Xcompiler)
+       prev=xcompiler
+       continue
+       ;;
+
+      -Xlinker)
+       prev=xlinker
+       continue
+       ;;
+
+      -XCClinker)
+       prev=xcclinker
+       continue
+       ;;
+
+      # -msg_* for osf cc
+      -msg_*)
+       func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+
+      # Flags to be passed through unchanged, with rationale:
+      # -64, -mips[0-9]      enable 64-bit mode for the SGI compiler
+      # -r[0-9][0-9]*        specify processor for the SGI compiler
+      # -xarch=*, -xtarget=* enable 64-bit mode for the Sun compiler
+      # +DA*, +DD*           enable 64-bit mode for the HP compiler
+      # -q*                  compiler args for the IBM compiler
+      # -m*, -t[45]*, -txscale* architecture-specific flags for GCC
+      # -F/path              path to uninstalled frameworks, gcc on darwin
+      # -p, -pg, --coverage, -fprofile-*  profiling flags for GCC
+      # @file                GCC response files
+      # -tp=*                Portland pgcc target processor selection
+      # --sysroot=*          for sysroot support
+      # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
+      -64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
+      -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+      -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
+        func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+        func_append compile_command " $arg"
+        func_append finalize_command " $arg"
+        func_append compiler_flags " $arg"
+        continue
+        ;;
+
+      # Some other compiler flag.
+      -* | +*)
+        func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+
+      *.$objext)
+       # A standard object.
+       func_append objs " $arg"
+       ;;
+
+      *.lo)
+       # A libtool-controlled object.
+
+       # Check to see that this really is a libtool object.
+       if func_lalib_unsafe_p "$arg"; then
+         pic_object=
+         non_pic_object=
+
+         # Read the .lo file
+         func_source "$arg"
+
+         if test -z "$pic_object" ||
+            test -z "$non_pic_object" ||
+            test "$pic_object" = none &&
+            test "$non_pic_object" = none; then
+           func_fatal_error "cannot find name of object for \`$arg'"
+         fi
+
+         # Extract subdirectory from the argument.
+         func_dirname "$arg" "/" ""
+         xdir="$func_dirname_result"
+
+         if test "$pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           pic_object="$xdir$pic_object"
+
+           if test "$prev" = dlfiles; then
+             if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
+               func_append dlfiles " $pic_object"
+               prev=
+               continue
+             else
+               # If libtool objects are unsupported, then we need to preload.
+               prev=dlprefiles
+             fi
+           fi
+
+           # CHECK ME:  I think I busted this.  -Ossama
+           if test "$prev" = dlprefiles; then
+             # Preload the old-style object.
+             func_append dlprefiles " $pic_object"
+             prev=
+           fi
+
+           # A PIC object.
+           func_append libobjs " $pic_object"
+           arg="$pic_object"
+         fi
+
+         # Non-PIC object.
+         if test "$non_pic_object" != none; then
+           # Prepend the subdirectory the object is found in.
+           non_pic_object="$xdir$non_pic_object"
+
+           # A standard non-PIC object
+           func_append non_pic_objects " $non_pic_object"
+           if test -z "$pic_object" || test "$pic_object" = none ; then
+             arg="$non_pic_object"
+           fi
+         else
+           # If the PIC object exists, use it instead.
+           # $xdir was prepended to $pic_object above.
+           non_pic_object="$pic_object"
+           func_append non_pic_objects " $non_pic_object"
+         fi
+       else
+         # Only an error if not doing a dry-run.
+         if $opt_dry_run; then
+           # Extract subdirectory from the argument.
+           func_dirname "$arg" "/" ""
+           xdir="$func_dirname_result"
+
+           func_lo2o "$arg"
+           pic_object=$xdir$objdir/$func_lo2o_result
+           non_pic_object=$xdir$func_lo2o_result
+           func_append libobjs " $pic_object"
+           func_append non_pic_objects " $non_pic_object"
+         else
+           func_fatal_error "\`$arg' is not a valid libtool object"
+         fi
+       fi
+       ;;
+
+      *.$libext)
+       # An archive.
+       func_append deplibs " $arg"
+       func_append old_deplibs " $arg"
+       continue
+       ;;
+
+      *.la)
+       # A libtool-controlled library.
+
+       func_resolve_sysroot "$arg"
+       if test "$prev" = dlfiles; then
+         # This library was specified with -dlopen.
+         func_append dlfiles " $func_resolve_sysroot_result"
+         prev=
+       elif test "$prev" = dlprefiles; then
+         # The library was specified with -dlpreopen.
+         func_append dlprefiles " $func_resolve_sysroot_result"
+         prev=
+       else
+         func_append deplibs " $func_resolve_sysroot_result"
+       fi
+       continue
+       ;;
+
+      # Some other compiler argument.
+      *)
+       # Unknown arguments in both finalize_command and compile_command need
+       # to be aesthetically quoted because they are evaled later.
+       func_quote_for_eval "$arg"
+       arg="$func_quote_for_eval_result"
+       ;;
+      esac # arg
+
+      # Now actually substitute the argument into the commands.
+      if test -n "$arg"; then
+       func_append compile_command " $arg"
+       func_append finalize_command " $arg"
+      fi
+    done # argument parsing loop
+
+    test -n "$prev" && \
+      func_fatal_help "the \`$prevarg' option requires an argument"
+
+    if test "$export_dynamic" = yes && test -n "$export_dynamic_flag_spec"; then
+      eval arg=\"$export_dynamic_flag_spec\"
+      func_append compile_command " $arg"
+      func_append finalize_command " $arg"
+    fi
+
+    oldlibs=
+    # calculate the name of the file, without its directory
+    func_basename "$output"
+    outputname="$func_basename_result"
+    libobjs_save="$libobjs"
+
+    if test -n "$shlibpath_var"; then
+      # get the directories listed in $shlibpath_var
+      eval shlib_search_path=\`\$ECHO \"\${$shlibpath_var}\" \| \$SED \'s/:/ /g\'\`
+    else
+      shlib_search_path=
+    fi
+    eval sys_lib_search_path=\"$sys_lib_search_path_spec\"
+    eval sys_lib_dlsearch_path=\"$sys_lib_dlsearch_path_spec\"
+
+    func_dirname "$output" "/" ""
+    output_objdir="$func_dirname_result$objdir"
+    func_to_tool_file "$output_objdir/"
+    tool_output_objdir=$func_to_tool_file_result
+    # Create the object directory.
+    func_mkdir_p "$output_objdir"
+
+    # Determine the type of output
+    case $output in
+    "")
+      func_fatal_help "you must specify an output file"
+      ;;
+    *.$libext) linkmode=oldlib ;;
+    *.lo | *.$objext) linkmode=obj ;;
+    *.la) linkmode=lib ;;
+    *) linkmode=prog ;; # Anything else should be a program.
+    esac
+
+    specialdeplibs=
+
+    libs=
+    # Find all interdependent deplibs by searching for libraries
+    # that are linked more than once (e.g. -la -lb -la)
+    for deplib in $deplibs; do
+      if $opt_preserve_dup_deps ; then
+       case "$libs " in
+       *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+       esac
+      fi
+      func_append libs " $deplib"
+    done
+
+    if test "$linkmode" = lib; then
+      libs="$predeps $libs $compiler_lib_search_path $postdeps"
+
+      # Compute libraries that are listed more than once in $predeps
+      # $postdeps and mark them as special (i.e., whose duplicates are
+      # not to be eliminated).
+      pre_post_deps=
+      if $opt_duplicate_compiler_generated_deps; then
+       for pre_post_dep in $predeps $postdeps; do
+         case "$pre_post_deps " in
+         *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
+         esac
+         func_append pre_post_deps " $pre_post_dep"
+       done
+      fi
+      pre_post_deps=
+    fi
+
+    deplibs=
+    newdependency_libs=
+    newlib_search_path=
+    need_relink=no # whether we're linking any uninstalled libtool libraries
+    notinst_deplibs= # not-installed libtool libraries
+    notinst_path= # paths that contain not-installed libtool libraries
+
+    case $linkmode in
+    lib)
+       passes="conv dlpreopen link"
+       for file in $dlfiles $dlprefiles; do
+         case $file in
+         *.la) ;;
+         *)
+           func_fatal_help "libraries can \`-dlopen' only libtool libraries: $file"
+           ;;
+         esac
+       done
+       ;;
+    prog)
+       compile_deplibs=
+       finalize_deplibs=
+       alldeplibs=no
+       newdlfiles=
+       newdlprefiles=
+       passes="conv scan dlopen dlpreopen link"
+       ;;
+    *)  passes="conv"
+       ;;
+    esac
+
+    for pass in $passes; do
+      # The preopen pass in lib mode reverses $deplibs; put it back here
+      # so that -L comes before libs that need it for instance...
+      if test "$linkmode,$pass" = "lib,link"; then
+       ## FIXME: Find the place where the list is rebuilt in the wrong
+       ##        order, and fix it there properly
+        tmp_deplibs=
+       for deplib in $deplibs; do
+         tmp_deplibs="$deplib $tmp_deplibs"
+       done
+       deplibs="$tmp_deplibs"
+      fi
+
+      if test "$linkmode,$pass" = "lib,link" ||
+        test "$linkmode,$pass" = "prog,scan"; then
+       libs="$deplibs"
+       deplibs=
+      fi
+      if test "$linkmode" = prog; then
+       case $pass in
+       dlopen) libs="$dlfiles" ;;
+       dlpreopen) libs="$dlprefiles" ;;
+       link)
+         libs="$deplibs %DEPLIBS%"
+         test "X$link_all_deplibs" != Xno && libs="$libs $dependency_libs"
+         ;;
+       esac
+      fi
+      if test "$linkmode,$pass" = "lib,dlpreopen"; then
+       # Collect and forward deplibs of preopened libtool libs
+       for lib in $dlprefiles; do
+         # Ignore non-libtool-libs
+         dependency_libs=
+         func_resolve_sysroot "$lib"
+         case $lib in
+         *.la) func_source "$func_resolve_sysroot_result" ;;
+         esac
+
+         # Collect preopened libtool deplibs, except any this library
+         # has declared as weak libs
+         for deplib in $dependency_libs; do
+           func_basename "$deplib"
+            deplib_base=$func_basename_result
+           case " $weak_libs " in
+           *" $deplib_base "*) ;;
+           *) func_append deplibs " $deplib" ;;
+           esac
+         done
+       done
+       libs="$dlprefiles"
+      fi
+      if test "$pass" = dlopen; then
+       # Collect dlpreopened libraries
+       save_deplibs="$deplibs"
+       deplibs=
+      fi
+
+      for deplib in $libs; do
+       lib=
+       found=no
+       case $deplib in
+       -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"
+         else
+           func_append compiler_flags " $deplib"
+           if test "$linkmode" = lib ; then
+               case "$new_inherited_linker_flags " in
+                   *" $deplib "*) ;;
+                   * ) func_append new_inherited_linker_flags " $deplib" ;;
+               esac
+           fi
+         fi
+         continue
+         ;;
+       -l*)
+         if test "$linkmode" != lib && test "$linkmode" != prog; then
+           func_warning "\`-l' is ignored for archives/objects"
+           continue
+         fi
+         func_stripname '-l' '' "$deplib"
+         name=$func_stripname_result
+         if test "$linkmode" = lib; then
+           searchdirs="$newlib_search_path $lib_search_path $compiler_lib_search_dirs $sys_lib_search_path $shlib_search_path"
+         else
+           searchdirs="$newlib_search_path $lib_search_path $sys_lib_search_path $shlib_search_path"
+         fi
+         for searchdir in $searchdirs; do
+           for search_ext in .la $std_shrext .so .a; do
+             # Search the libtool library
+             lib="$searchdir/lib${name}${search_ext}"
+             if test -f "$lib"; then
+               if test "$search_ext" = ".la"; then
+                 found=yes
+               else
+                 found=no
+               fi
+               break 2
+             fi
+           done
+         done
+         if test "$found" != yes; then
+           # deplib doesn't seem to be a libtool library
+           if test "$linkmode,$pass" = "prog,link"; then
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             deplibs="$deplib $deplibs"
+             test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+           fi
+           continue
+         else # deplib is a libtool library
+           # If $allow_libtool_libs_with_static_runtimes && $deplib is a stdlib,
+           # We need to do some special things here, and not later.
+           if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+             case " $predeps $postdeps " in
+             *" $deplib "*)
+               if func_lalib_p "$lib"; then
+                 library_names=
+                 old_library=
+                 func_source "$lib"
+                 for l in $old_library $library_names; do
+                   ll="$l"
+                 done
+                 if test "X$ll" = "X$old_library" ; then # only static version available
+                   found=no
+                   func_dirname "$lib" "" "."
+                   ladir="$func_dirname_result"
+                   lib=$ladir/$old_library
+                   if test "$linkmode,$pass" = "prog,link"; then
+                     compile_deplibs="$deplib $compile_deplibs"
+                     finalize_deplibs="$deplib $finalize_deplibs"
+                   else
+                     deplibs="$deplib $deplibs"
+                     test "$linkmode" = lib && newdependency_libs="$deplib $newdependency_libs"
+                   fi
+                   continue
+                 fi
+               fi
+               ;;
+             *) ;;
+             esac
+           fi
+         fi
+         ;; # -l
+       *.ltframework)
+         if test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$deplib $compile_deplibs"
+           finalize_deplibs="$deplib $finalize_deplibs"
+         else
+           deplibs="$deplib $deplibs"
+           if test "$linkmode" = lib ; then
+               case "$new_inherited_linker_flags " in
+                   *" $deplib "*) ;;
+                   * ) func_append new_inherited_linker_flags " $deplib" ;;
+               esac
+           fi
+         fi
+         continue
+         ;;
+       -L*)
+         case $linkmode in
+         lib)
+           deplibs="$deplib $deplibs"
+           test "$pass" = conv && continue
+           newdependency_libs="$deplib $newdependency_libs"
+           func_stripname '-L' '' "$deplib"
+           func_resolve_sysroot "$func_stripname_result"
+           func_append newlib_search_path " $func_resolve_sysroot_result"
+           ;;
+         prog)
+           if test "$pass" = conv; then
+             deplibs="$deplib $deplibs"
+             continue
+           fi
+           if test "$pass" = scan; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           func_stripname '-L' '' "$deplib"
+           func_resolve_sysroot "$func_stripname_result"
+           func_append newlib_search_path " $func_resolve_sysroot_result"
+           ;;
+         *)
+           func_warning "\`-L' is ignored for archives/objects"
+           ;;
+         esac # linkmode
+         continue
+         ;; # -L
+       -R*)
+         if test "$pass" = link; then
+           func_stripname '-R' '' "$deplib"
+           func_resolve_sysroot "$func_stripname_result"
+           dir=$func_resolve_sysroot_result
+           # Make sure the xrpath contains only unique directories.
+           case "$xrpath " in
+           *" $dir "*) ;;
+           *) func_append xrpath " $dir" ;;
+           esac
+         fi
+         deplibs="$deplib $deplibs"
+         continue
+         ;;
+       *.la)
+         func_resolve_sysroot "$deplib"
+         lib=$func_resolve_sysroot_result
+         ;;
+       *.$libext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+           continue
+         fi
+         case $linkmode in
+         lib)
+           # Linking convenience modules into shared libraries is allowed,
+           # but linking other static libraries is non-portable.
+           case " $dlpreconveniencelibs " in
+           *" $deplib "*) ;;
+           *)
+             valid_a_lib=no
+             case $deplibs_check_method in
+               match_pattern*)
+                 set dummy $deplibs_check_method; shift
+                 match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+                 if eval "\$ECHO \"$deplib\"" 2>/dev/null | $SED 10q \
+                   | $EGREP "$match_pattern_regex" > /dev/null; then
+                   valid_a_lib=yes
+                 fi
+               ;;
+               pass_all)
+                 valid_a_lib=yes
+               ;;
+             esac
+             if test "$valid_a_lib" != yes; then
+               echo
+               $ECHO "*** Warning: Trying to link with static lib archive $deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because the file extensions .$libext of this argument makes me believe"
+               echo "*** that it is just a static archive that I should not use here."
+             else
+               echo
+               $ECHO "*** Warning: Linking the shared library $output against the"
+               $ECHO "*** static library $deplib is not portable!"
+               deplibs="$deplib $deplibs"
+             fi
+             ;;
+           esac
+           continue
+           ;;
+         prog)
+           if test "$pass" != link; then
+             deplibs="$deplib $deplibs"
+           else
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           fi
+           continue
+           ;;
+         esac # linkmode
+         ;; # *.$libext
+       *.lo | *.$objext)
+         if test "$pass" = conv; then
+           deplibs="$deplib $deplibs"
+         elif test "$linkmode" = prog; then
+           if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
+             # If there is no dlopen support or we're linking statically,
+             # we need to preload.
+             func_append newdlprefiles " $deplib"
+             compile_deplibs="$deplib $compile_deplibs"
+             finalize_deplibs="$deplib $finalize_deplibs"
+           else
+             func_append newdlfiles " $deplib"
+           fi
+         fi
+         continue
+         ;;
+       %DEPLIBS%)
+         alldeplibs=yes
+         continue
+         ;;
+       esac # case $deplib
+
+       if test "$found" = yes || test -f "$lib"; then :
+       else
+         func_fatal_error "cannot find the library \`$lib' or unhandled argument \`$deplib'"
+       fi
+
+       # Check to see that this really is a libtool archive.
+       func_lalib_unsafe_p "$lib" \
+         || func_fatal_error "\`$lib' is not a valid libtool archive"
+
+       func_dirname "$lib" "" "."
+       ladir="$func_dirname_result"
+
+       dlname=
+       dlopen=
+       dlpreopen=
+       libdir=
+       library_names=
+       old_library=
+       inherited_linker_flags=
+       # If the library was installed with an old release of libtool,
+       # it will not redefine variables installed, or shouldnotlink
+       installed=yes
+       shouldnotlink=no
+       avoidtemprpath=
+
+
+       # Read the .la file
+       func_source "$lib"
+
+       # Convert "-framework foo" to "foo.ltframework"
+       if test -n "$inherited_linker_flags"; then
+         tmp_inherited_linker_flags=`$ECHO "$inherited_linker_flags" | $SED 's/-framework \([^ $]*\)/\1.ltframework/g'`
+         for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
+           case " $new_inherited_linker_flags " in
+             *" $tmp_inherited_linker_flag "*) ;;
+             *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
+           esac
+         done
+       fi
+       dependency_libs=`$ECHO " $dependency_libs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       if test "$linkmode,$pass" = "lib,link" ||
+          test "$linkmode,$pass" = "prog,scan" ||
+          { test "$linkmode" != prog && test "$linkmode" != lib; }; then
+         test -n "$dlopen" && func_append dlfiles " $dlopen"
+         test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
+       fi
+
+       if test "$pass" = conv; then
+         # Only check for convenience libraries
+         deplibs="$lib $deplibs"
+         if test -z "$libdir"; then
+           if test -z "$old_library"; then
+             func_fatal_error "cannot find name of link library for \`$lib'"
+           fi
+           # It is a libtool convenience library, so add in its objects.
+           func_append convenience " $ladir/$objdir/$old_library"
+           func_append old_convenience " $ladir/$objdir/$old_library"
+           tmp_libs=
+           for deplib in $dependency_libs; do
+             deplibs="$deplib $deplibs"
+             if $opt_preserve_dup_deps ; then
+               case "$tmp_libs " in
+               *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+               esac
+             fi
+             func_append tmp_libs " $deplib"
+           done
+         elif test "$linkmode" != prog && test "$linkmode" != lib; then
+           func_fatal_error "\`$lib' is not a convenience library"
+         fi
+         continue
+       fi # $pass = conv
+
+
+       # Get the name of the library we link against.
+       linklib=
+       if test -n "$old_library" &&
+          { test "$prefer_static_libs" = yes ||
+            test "$prefer_static_libs,$installed" = "built,no"; }; then
+         linklib=$old_library
+       else
+         for l in $old_library $library_names; do
+           linklib="$l"
+         done
+       fi
+       if test -z "$linklib"; then
+         func_fatal_error "cannot find name of link library for \`$lib'"
+       fi
+
+       # This library was specified with -dlopen.
+       if test "$pass" = dlopen; then
+         if test -z "$libdir"; then
+           func_fatal_error "cannot -dlopen a convenience library: \`$lib'"
+         fi
+         if test -z "$dlname" ||
+            test "$dlopen_support" != yes ||
+            test "$build_libtool_libs" = no; then
+           # If there is no dlname, no dlopen support or we're linking
+           # statically, we need to preload.  We also need to preload any
+           # dependent libraries so libltdl's deplib preloader doesn't
+           # bomb out in the load deplibs phase.
+           func_append dlprefiles " $lib $dependency_libs"
+         else
+           func_append newdlfiles " $lib"
+         fi
+         continue
+       fi # $pass = dlopen
+
+       # We need an absolute path.
+       case $ladir in
+       [\\/]* | [A-Za-z]:[\\/]*) abs_ladir="$ladir" ;;
+       *)
+         abs_ladir=`cd "$ladir" && pwd`
+         if test -z "$abs_ladir"; then
+           func_warning "cannot determine absolute directory name of \`$ladir'"
+           func_warning "passing it literally to the linker, although it might fail"
+           abs_ladir="$ladir"
+         fi
+         ;;
+       esac
+       func_basename "$lib"
+       laname="$func_basename_result"
+
+       # Find the relevant object directory and library name.
+       if test "X$installed" = Xyes; then
+         if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           func_warning "library \`$lib' was moved."
+           dir="$ladir"
+           absdir="$abs_ladir"
+           libdir="$abs_ladir"
+         else
+           dir="$lt_sysroot$libdir"
+           absdir="$lt_sysroot$libdir"
+         fi
+         test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+       else
+         if test ! -f "$ladir/$objdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+           dir="$ladir"
+           absdir="$abs_ladir"
+           # Remove this search path later
+           func_append notinst_path " $abs_ladir"
+         else
+           dir="$ladir/$objdir"
+           absdir="$abs_ladir/$objdir"
+           # Remove this search path later
+           func_append notinst_path " $abs_ladir"
+         fi
+       fi # $installed = yes
+       func_stripname 'lib' '.la' "$laname"
+       name=$func_stripname_result
+
+       # This library was specified with -dlpreopen.
+       if test "$pass" = dlpreopen; then
+         if test -z "$libdir" && test "$linkmode" = prog; then
+           func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
+         fi
+         case "$host" in
+           # special handling for platforms with PE-DLLs.
+           *cygwin* | *mingw* | *cegcc* )
+             # Linker will automatically link against shared library if both
+             # static and shared are present.  Therefore, ensure we extract
+             # symbols from the import library if a shared library is present
+             # (otherwise, the dlopen module name will be incorrect).  We do
+             # this by putting the import library name into $newdlprefiles.
+             # We recover the dlopen module name by 'saving' the la file
+             # name in a special purpose variable, and (later) extracting the
+             # dlname from the la file.
+             if test -n "$dlname"; then
+               func_tr_sh "$dir/$linklib"
+               eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+               func_append newdlprefiles " $dir/$linklib"
+             else
+               func_append newdlprefiles " $dir/$old_library"
+               # Keep a list of preopened convenience libraries to check
+               # that they are being used correctly in the link pass.
+               test -z "$libdir" && \
+                 func_append dlpreconveniencelibs " $dir/$old_library"
+             fi
+           ;;
+           * )
+             # Prefer using a static library (so that no silly _DYNAMIC symbols
+             # are required to link).
+             if test -n "$old_library"; then
+               func_append newdlprefiles " $dir/$old_library"
+               # Keep a list of preopened convenience libraries to check
+               # that they are being used correctly in the link pass.
+               test -z "$libdir" && \
+                 func_append dlpreconveniencelibs " $dir/$old_library"
+             # Otherwise, use the dlname, so that lt_dlopen finds it.
+             elif test -n "$dlname"; then
+               func_append newdlprefiles " $dir/$dlname"
+             else
+               func_append newdlprefiles " $dir/$linklib"
+             fi
+           ;;
+         esac
+       fi # $pass = dlpreopen
+
+       if test -z "$libdir"; then
+         # Link the convenience library
+         if test "$linkmode" = lib; then
+           deplibs="$dir/$old_library $deplibs"
+         elif test "$linkmode,$pass" = "prog,link"; then
+           compile_deplibs="$dir/$old_library $compile_deplibs"
+           finalize_deplibs="$dir/$old_library $finalize_deplibs"
+         else
+           deplibs="$lib $deplibs" # used for prog,scan pass
+         fi
+         continue
+       fi
+
+
+       if test "$linkmode" = prog && test "$pass" != link; then
+         func_append newlib_search_path " $ladir"
+         deplibs="$lib $deplibs"
+
+         linkalldeplibs=no
+         if test "$link_all_deplibs" != no || test -z "$library_names" ||
+            test "$build_libtool_libs" = no; then
+           linkalldeplibs=yes
+         fi
+
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           case $deplib in
+           -L*) func_stripname '-L' '' "$deplib"
+                func_resolve_sysroot "$func_stripname_result"
+                func_append newlib_search_path " $func_resolve_sysroot_result"
+                ;;
+           esac
+           # Need to link against all dependency_libs?
+           if test "$linkalldeplibs" = yes; then
+             deplibs="$deplib $deplibs"
+           else
+             # Need to hardcode shared library paths
+             # or/and link against static libraries
+             newdependency_libs="$deplib $newdependency_libs"
+           fi
+           if $opt_preserve_dup_deps ; then
+             case "$tmp_libs " in
+             *" $deplib "*) func_append specialdeplibs " $deplib" ;;
+             esac
+           fi
+           func_append tmp_libs " $deplib"
+         done # for deplib
+         continue
+       fi # $linkmode = prog...
+
+       if test "$linkmode,$pass" = "prog,link"; then
+         if test -n "$library_names" &&
+            { { test "$prefer_static_libs" = no ||
+                test "$prefer_static_libs,$installed" = "built,yes"; } ||
+              test -z "$old_library"; }; then
+           # We need to hardcode the library path
+           if test -n "$shlibpath_var" && test -z "$avoidtemprpath" ; then
+             # Make sure the rpath contains only unique directories.
+             case "$temp_rpath:" in
+             *"$absdir:"*) ;;
+             *) func_append temp_rpath "$absdir:" ;;
+             esac
+           fi
+
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) func_append compile_rpath " $absdir" ;;
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) func_append finalize_rpath " $libdir" ;;
+             esac
+             ;;
+           esac
+         fi # $linkmode,$pass = prog,link...
+
+         if test "$alldeplibs" = yes &&
+            { test "$deplibs_check_method" = pass_all ||
+              { test "$build_libtool_libs" = yes &&
+                test -n "$library_names"; }; }; then
+           # We only need to search for static libraries
+           continue
+         fi
+       fi
+
+       link_static=no # Whether the deplib will be linked statically
+       use_static_libs=$prefer_static_libs
+       if test "$use_static_libs" = built && test "$installed" = yes; then
+         use_static_libs=no
+       fi
+       if test -n "$library_names" &&
+          { test "$use_static_libs" = no || test -z "$old_library"; }; then
+         case $host in
+         *cygwin* | *mingw* | *cegcc*)
+             # No point in relinking DLLs because paths are not encoded
+             func_append notinst_deplibs " $lib"
+             need_relink=no
+           ;;
+         *)
+           if test "$installed" = no; then
+             func_append notinst_deplibs " $lib"
+             need_relink=yes
+           fi
+           ;;
+         esac
+         # This is a shared library
+
+         # Warn about portability, can't link against -module's on some
+         # systems (darwin).  Don't bleat about dlopened modules though!
+         dlopenmodule=""
+         for dlpremoduletest in $dlprefiles; do
+           if test "X$dlpremoduletest" = "X$lib"; then
+             dlopenmodule="$dlpremoduletest"
+             break
+           fi
+         done
+         if test -z "$dlopenmodule" && test "$shouldnotlink" = yes && test "$pass" = link; then
+           echo
+           if test "$linkmode" = prog; then
+             $ECHO "*** Warning: Linking the executable $output against the loadable module"
+           else
+             $ECHO "*** Warning: Linking the shared library $output against the loadable module"
+           fi
+           $ECHO "*** $linklib is not portable!"
+         fi
+         if test "$linkmode" = lib &&
+            test "$hardcode_into_libs" = yes; then
+           # Hardcode the library path.
+           # Skip directories that are in the system default run-time
+           # search path.
+           case " $sys_lib_dlsearch_path " in
+           *" $absdir "*) ;;
+           *)
+             case "$compile_rpath " in
+             *" $absdir "*) ;;
+             *) func_append compile_rpath " $absdir" ;;
+             esac
+             ;;
+           esac
+           case " $sys_lib_dlsearch_path " in
+           *" $libdir "*) ;;
+           *)
+             case "$finalize_rpath " in
+             *" $libdir "*) ;;
+             *) func_append finalize_rpath " $libdir" ;;
+             esac
+             ;;
+           esac
+         fi
+
+         if test -n "$old_archive_from_expsyms_cmds"; then
+           # figure out the soname
+           set dummy $library_names
+           shift
+           realname="$1"
+           shift
+           libname=`eval "\\$ECHO \"$libname_spec\""`
+           # use dlname if we got it. it's perfectly good, no?
+           if test -n "$dlname"; then
+             soname="$dlname"
+           elif test -n "$soname_spec"; then
+             # bleh windows
+             case $host in
+             *cygwin* | mingw* | *cegcc*)
+               func_arith $current - $age
+               major=$func_arith_result
+               versuffix="-$major"
+               ;;
+             esac
+             eval soname=\"$soname_spec\"
+           else
+             soname="$realname"
+           fi
+
+           # Make a new name for the extract_expsyms_cmds to use
+           soroot="$soname"
+           func_basename "$soroot"
+           soname="$func_basename_result"
+           func_stripname 'lib' '.dll' "$soname"
+           newlib=libimp-$func_stripname_result.a
+
+           # If the library has no export list, then create one now
+           if test -f "$output_objdir/$soname-def"; then :
+           else
+             func_verbose "extracting exported symbol list from \`$soname'"
+             func_execute_cmds "$extract_expsyms_cmds" 'exit $?'
+           fi
+
+           # Create $newlib
+           if test -f "$output_objdir/$newlib"; then :; else
+             func_verbose "generating import library for \`$soname'"
+             func_execute_cmds "$old_archive_from_expsyms_cmds" 'exit $?'
+           fi
+           # make sure the library variables are pointing to the new library
+           dir=$output_objdir
+           linklib=$newlib
+         fi # test -n "$old_archive_from_expsyms_cmds"
+
+         if test "$linkmode" = prog || test "$opt_mode" != relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           lib_linked=yes
+           case $hardcode_action in
+           immediate | unsupported)
+             if test "$hardcode_direct" = no; then
+               add="$dir/$linklib"
+               case $host in
+                 *-*-sco3.2v5.0.[024]*) add_dir="-L$dir" ;;
+                 *-*-sysv4*uw2*) add_dir="-L$dir" ;;
+                 *-*-sysv5OpenUNIX* | *-*-sysv5UnixWare7.[01].[10]* | \
+                   *-*-unixware7*) add_dir="-L$dir" ;;
+                 *-*-darwin* )
+                   # if the lib is a (non-dlopened) module then we can not
+                   # link against it, someone is ignoring the earlier warnings
+                   if /usr/bin/file -L $add 2> /dev/null |
+                        $GREP ": [^:]* bundle" >/dev/null ; then
+                     if test "X$dlopenmodule" != "X$lib"; then
+                       $ECHO "*** Warning: lib $linklib is a module, not a shared library"
+                       if test -z "$old_library" ; then
+                         echo
+                         echo "*** And there doesn't seem to be a static archive available"
+                         echo "*** The link will probably fail, sorry"
+                       else
+                         add="$dir/$old_library"
+                       fi
+                     elif test -n "$old_library"; then
+                       add="$dir/$old_library"
+                     fi
+                   fi
+               esac
+             elif test "$hardcode_minus_L" = no; then
+               case $host in
+               *-*-sunos*) add_shlibpath="$dir" ;;
+               esac
+               add_dir="-L$dir"
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = no; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           relink)
+             if test "$hardcode_direct" = yes &&
+                test "$hardcode_direct_absolute" = no; then
+               add="$dir/$linklib"
+             elif test "$hardcode_minus_L" = yes; then
+               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
+                   [\\/]*)
+                     func_append add_dir " -L$inst_prefix_dir$libdir"
+                     ;;
+                 esac
+               fi
+               add="-l$name"
+             elif test "$hardcode_shlibpath_var" = yes; then
+               add_shlibpath="$dir"
+               add="-l$name"
+             else
+               lib_linked=no
+             fi
+             ;;
+           *) lib_linked=no ;;
+           esac
+
+           if test "$lib_linked" != yes; then
+             func_fatal_configuration "unsupported hardcode properties"
+           fi
+
+           if test -n "$add_shlibpath"; then
+             case :$compile_shlibpath: in
+             *":$add_shlibpath:"*) ;;
+             *) func_append compile_shlibpath "$add_shlibpath:" ;;
+             esac
+           fi
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && compile_deplibs="$add_dir $compile_deplibs"
+             test -n "$add" && compile_deplibs="$add $compile_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+             if test "$hardcode_direct" != yes &&
+                test "$hardcode_minus_L" != yes &&
+                test "$hardcode_shlibpath_var" = yes; then
+               case :$finalize_shlibpath: in
+               *":$libdir:"*) ;;
+               *) func_append finalize_shlibpath "$libdir:" ;;
+               esac
+             fi
+           fi
+         fi
+
+         if test "$linkmode" = prog || test "$opt_mode" = relink; then
+           add_shlibpath=
+           add_dir=
+           add=
+           # Finalize command for both is simple: just hardcode it.
+           if test "$hardcode_direct" = yes &&
+              test "$hardcode_direct_absolute" = no; then
+             add="$libdir/$linklib"
+           elif test "$hardcode_minus_L" = yes; then
+             add_dir="-L$libdir"
+             add="-l$name"
+           elif test "$hardcode_shlibpath_var" = yes; then
+             case :$finalize_shlibpath: in
+             *":$libdir:"*) ;;
+             *) func_append finalize_shlibpath "$libdir:" ;;
+             esac
+             add="-l$name"
+           elif test "$hardcode_automatic" = yes; then
+             if test -n "$inst_prefix_dir" &&
+                test -f "$inst_prefix_dir$libdir/$linklib" ; then
+               add="$inst_prefix_dir$libdir/$linklib"
+             else
+               add="$libdir/$linklib"
+             fi
+           else
+             # We cannot seem to hardcode it, guess we'll fake it.
+             add_dir="-L$libdir"
+             # Try looking first in the location we're being installed to.
+             if test -n "$inst_prefix_dir"; then
+               case $libdir in
+                 [\\/]*)
+                   func_append add_dir " -L$inst_prefix_dir$libdir"
+                   ;;
+               esac
+             fi
+             add="-l$name"
+           fi
+
+           if test "$linkmode" = prog; then
+             test -n "$add_dir" && finalize_deplibs="$add_dir $finalize_deplibs"
+             test -n "$add" && finalize_deplibs="$add $finalize_deplibs"
+           else
+             test -n "$add_dir" && deplibs="$add_dir $deplibs"
+             test -n "$add" && deplibs="$add $deplibs"
+           fi
+         fi
+       elif test "$linkmode" = prog; then
+         # Here we assume that one of hardcode_direct or hardcode_minus_L
+         # is not unsupported.  This is valid on all known static and
+         # shared platforms.
+         if test "$hardcode_direct" != unsupported; then
+           test -n "$old_library" && linklib="$old_library"
+           compile_deplibs="$dir/$linklib $compile_deplibs"
+           finalize_deplibs="$dir/$linklib $finalize_deplibs"
+         else
+           compile_deplibs="-l$name -L$dir $compile_deplibs"
+           finalize_deplibs="-l$name -L$dir $finalize_deplibs"
+         fi
+       elif test "$build_libtool_libs" = yes; then
+         # Not a shared library
+         if test "$deplibs_check_method" != pass_all; then
+           # We're trying link a shared library against a static one
+           # but the system doesn't support it.
+
+           # Just print a warning and add the library to dependency_libs so
+           # that the program can be linked against the static library.
+           echo
+           $ECHO "*** Warning: This system can not link to static lib archive $lib."
+           echo "*** I have the capability to make that library automatically link in when"
+           echo "*** you link to this library.  But I can only do this if you have a"
+           echo "*** shared version of the library, which you do not appear to have."
+           if test "$module" = yes; then
+             echo "*** But as you try to build a module library, libtool will still create "
+             echo "*** a static module, that should work as long as the dlopening application"
+             echo "*** is linked with the -dlopen flag to resolve symbols at runtime."
+             if test -z "$global_symbol_pipe"; then
+               echo
+               echo "*** However, this would only work if libtool was able to extract symbol"
+               echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+               echo "*** not find such a program.  So, this module is probably useless."
+               echo "*** \`nm' from GNU binutils and a full rebuild may help."
+             fi
+             if test "$build_old_libs" = no; then
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         else
+           deplibs="$dir/$old_library $deplibs"
+           link_static=yes
+         fi
+       fi # link shared/static library?
+
+       if test "$linkmode" = lib; then
+         if test -n "$dependency_libs" &&
+            { test "$hardcode_into_libs" != yes ||
+              test "$build_old_libs" = yes ||
+              test "$link_static" = yes; }; then
+           # Extract -R from dependency_libs
+           temp_deplibs=
+           for libdir in $dependency_libs; do
+             case $libdir in
+             -R*) func_stripname '-R' '' "$libdir"
+                  temp_xrpath=$func_stripname_result
+                  case " $xrpath " in
+                  *" $temp_xrpath "*) ;;
+                  *) func_append xrpath " $temp_xrpath";;
+                  esac;;
+             *) func_append temp_deplibs " $libdir";;
+             esac
+           done
+           dependency_libs="$temp_deplibs"
+         fi
+
+         func_append newlib_search_path " $absdir"
+         # Link against this library
+         test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
+         # ... and its dependency_libs
+         tmp_libs=
+         for deplib in $dependency_libs; do
+           newdependency_libs="$deplib $newdependency_libs"
+           case $deplib in
+              -L*) func_stripname '-L' '' "$deplib"
+                   func_resolve_sysroot "$func_stripname_result";;
+              *) func_resolve_sysroot "$deplib" ;;
+            esac
+           if $opt_preserve_dup_deps ; then
+             case "$tmp_libs " in
+             *" $func_resolve_sysroot_result "*)
+                func_append specialdeplibs " $func_resolve_sysroot_result" ;;
+             esac
+           fi
+           func_append tmp_libs " $func_resolve_sysroot_result"
+         done
+
+         if test "$link_all_deplibs" != no; then
+           # Add the search paths of all dependency libraries
+           for deplib in $dependency_libs; do
+             path=
+             case $deplib in
+             -L*) path="$deplib" ;;
+             *.la)
+               func_resolve_sysroot "$deplib"
+               deplib=$func_resolve_sysroot_result
+               func_dirname "$deplib" "" "."
+               dir=$func_dirname_result
+               # We need an absolute path.
+               case $dir in
+               [\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
+               *)
+                 absdir=`cd "$dir" && pwd`
+                 if test -z "$absdir"; then
+                   func_warning "cannot determine absolute directory name of \`$dir'"
+                   absdir="$dir"
+                 fi
+                 ;;
+               esac
+               if $GREP "^installed=no" $deplib > /dev/null; then
+               case $host in
+               *-*-darwin*)
+                 depdepl=
+                 eval deplibrary_names=`${SED} -n -e 's/^library_names=\(.*\)$/\1/p' $deplib`
+                 if test -n "$deplibrary_names" ; then
+                   for tmp in $deplibrary_names ; do
+                     depdepl=$tmp
+                   done
+                   if test -f "$absdir/$objdir/$depdepl" ; then
+                     depdepl="$absdir/$objdir/$depdepl"
+                     darwin_install_name=`${OTOOL} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
+                      if test -z "$darwin_install_name"; then
+                          darwin_install_name=`${OTOOL64} -L $depdepl  | awk '{if (NR == 2) {print $1;exit}}'`
+                      fi
+                     func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+                     func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
+                     path=
+                   fi
+                 fi
+                 ;;
+               *)
+                 path="-L$absdir/$objdir"
+                 ;;
+               esac
+               else
+                 eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+                 test -z "$libdir" && \
+                   func_fatal_error "\`$deplib' is not a valid libtool archive"
+                 test "$absdir" != "$libdir" && \
+                   func_warning "\`$deplib' seems to be moved"
+
+                 path="-L$absdir"
+               fi
+               ;;
+             esac
+             case " $deplibs " in
+             *" $path "*) ;;
+             *) deplibs="$path $deplibs" ;;
+             esac
+           done
+         fi # link_all_deplibs != no
+       fi # linkmode = lib
+      done # for deplib in $libs
+      if test "$pass" = link; then
+       if test "$linkmode" = "prog"; then
+         compile_deplibs="$new_inherited_linker_flags $compile_deplibs"
+         finalize_deplibs="$new_inherited_linker_flags $finalize_deplibs"
+       else
+         compiler_flags="$compiler_flags "`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       fi
+      fi
+      dependency_libs="$newdependency_libs"
+      if test "$pass" = dlpreopen; then
+       # Link the dlpreopened libraries before other libraries
+       for deplib in $save_deplibs; do
+         deplibs="$deplib $deplibs"
+       done
+      fi
+      if test "$pass" != dlopen; then
+       if test "$pass" != conv; then
+         # Make sure lib_search_path contains only unique directories.
+         lib_search_path=
+         for dir in $newlib_search_path; do
+           case "$lib_search_path " in
+           *" $dir "*) ;;
+           *) func_append lib_search_path " $dir" ;;
+           esac
+         done
+         newlib_search_path=
+       fi
+
+       if test "$linkmode,$pass" != "prog,link"; then
+         vars="deplibs"
+       else
+         vars="compile_deplibs finalize_deplibs"
+       fi
+       for var in $vars dependency_libs; do
+         # Add libraries to $var in reverse order
+         eval tmp_libs=\"\$$var\"
+         new_libs=
+         for deplib in $tmp_libs; do
+           # FIXME: Pedantically, this is the right thing to do, so
+           #        that some nasty dependency loop isn't accidentally
+           #        broken:
+           #new_libs="$deplib $new_libs"
+           # Pragmatically, this seems to cause very few problems in
+           # practice:
+           case $deplib in
+           -L*) new_libs="$deplib $new_libs" ;;
+           -R*) ;;
+           *)
+             # And here is the reason: when a library appears more
+             # than once as an explicit dependence of a library, or
+             # is implicitly linked in more than once by the
+             # compiler, it is considered special, and multiple
+             # occurrences thereof are not removed.  Compare this
+             # with having the same library being listed as a
+             # dependency of multiple other libraries: in this case,
+             # we know (pedantically, we assume) the library does not
+             # need to be listed more than once, so we keep only the
+             # last copy.  This is not always right, but it is rare
+             # enough that we require users that really mean to play
+             # such unportable linking tricks to link the library
+             # using -Wl,-lname, so that libtool does not consider it
+             # for duplicate removal.
+             case " $specialdeplibs " in
+             *" $deplib "*) new_libs="$deplib $new_libs" ;;
+             *)
+               case " $new_libs " in
+               *" $deplib "*) ;;
+               *) new_libs="$deplib $new_libs" ;;
+               esac
+               ;;
+             esac
+             ;;
+           esac
+         done
+         tmp_libs=
+         for deplib in $new_libs; do
+           case $deplib in
+           -L*)
+             case " $tmp_libs " in
+             *" $deplib "*) ;;
+             *) func_append tmp_libs " $deplib" ;;
+             esac
+             ;;
+           *) func_append tmp_libs " $deplib" ;;
+           esac
+         done
+         eval $var=\"$tmp_libs\"
+       done # for var
+      fi
+      # Last step: remove runtime libs from dependency_libs
+      # (they stay in deplibs)
+      tmp_libs=
+      for i in $dependency_libs ; do
+       case " $predeps $postdeps $compiler_lib_search_path " in
+       *" $i "*)
+         i=""
+         ;;
+       esac
+       if test -n "$i" ; then
+         func_append tmp_libs " $i"
+       fi
+      done
+      dependency_libs=$tmp_libs
+    done # for pass
+    if test "$linkmode" = prog; then
+      dlfiles="$newdlfiles"
+    fi
+    if test "$linkmode" = prog || test "$linkmode" = lib; then
+      dlprefiles="$newdlprefiles"
+    fi
+
+    case $linkmode in
+    oldlib)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       func_warning "\`-dlopen' is ignored for archives"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+       func_warning "\`-l' and \`-L' are ignored for archives" ;;
+      esac
+
+      test -n "$rpath" && \
+       func_warning "\`-rpath' is ignored for archives"
+
+      test -n "$xrpath" && \
+       func_warning "\`-R' is ignored for archives"
+
+      test -n "$vinfo" && \
+       func_warning "\`-version-info/-version-number' is ignored for archives"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for archives"
+
+      test -n "$export_symbols$export_symbols_regex" && \
+       func_warning "\`-export-symbols' is ignored for archives"
+
+      # Now set the variables for building old libraries.
+      build_libtool_libs=no
+      oldlibs="$output"
+      func_append objs "$old_deplibs"
+      ;;
+
+    lib)
+      # Make sure we only generate libraries of the form `libNAME.la'.
+      case $outputname in
+      lib*)
+       func_stripname 'lib' '.la' "$outputname"
+       name=$func_stripname_result
+       eval shared_ext=\"$shrext_cmds\"
+       eval libname=\"$libname_spec\"
+       ;;
+      *)
+       test "$module" = no && \
+         func_fatal_help "libtool library \`$output' must begin with \`lib'"
+
+       if test "$need_lib_prefix" != no; then
+         # Add the "lib" prefix for modules if required
+         func_stripname '' '.la' "$outputname"
+         name=$func_stripname_result
+         eval shared_ext=\"$shrext_cmds\"
+         eval libname=\"$libname_spec\"
+       else
+         func_stripname '' '.la' "$outputname"
+         libname=$func_stripname_result
+       fi
+       ;;
+      esac
+
+      if test -n "$objs"; then
+       if test "$deplibs_check_method" != pass_all; then
+         func_fatal_error "cannot build libtool library \`$output' from non-libtool objects on this host:$objs"
+       else
+         echo
+         $ECHO "*** Warning: Linking the shared library $output against the non-libtool"
+         $ECHO "*** objects $objs is not portable!"
+         func_append libobjs " $objs"
+       fi
+      fi
+
+      test "$dlself" != no && \
+       func_warning "\`-dlopen self' is ignored for libtool libraries"
+
+      set dummy $rpath
+      shift
+      test "$#" -gt 1 && \
+       func_warning "ignoring multiple \`-rpath's for a libtool library"
+
+      install_libdir="$1"
+
+      oldlibs=
+      if test -z "$rpath"; then
+       if test "$build_libtool_libs" = yes; then
+         # Building a libtool convenience library.
+         # Some compilers have problems with a `.al' extension so
+         # convenience libraries should have the same extension an
+         # archive normally would.
+         oldlibs="$output_objdir/$libname.$libext $oldlibs"
+         build_libtool_libs=convenience
+         build_old_libs=yes
+       fi
+
+       test -n "$vinfo" && \
+         func_warning "\`-version-info/-version-number' is ignored for convenience libraries"
+
+       test -n "$release" && \
+         func_warning "\`-release' is ignored for convenience libraries"
+      else
+
+       # Parse the version information argument.
+       save_ifs="$IFS"; IFS=':'
+       set dummy $vinfo 0 0 0
+       shift
+       IFS="$save_ifs"
+
+       test -n "$7" && \
+         func_fatal_help "too many parameters to \`-version-info'"
+
+       # convert absolute version numbers to libtool ages
+       # this retains compatibility with .la files and attempts
+       # to make the code below a bit more comprehensible
+
+       case $vinfo_number in
+       yes)
+         number_major="$1"
+         number_minor="$2"
+         number_revision="$3"
+         #
+         # There are really only two kinds -- those that
+         # use the current revision as the major version
+         # and those that subtract age and use age as
+         # a minor version.  But, then there is irix
+         # 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
+           age="$number_minor"
+           revision="$number_revision"
+           ;;
+         freebsd-aout|freebsd-elf|qnx|sunos)
+           current="$number_major"
+           revision="$number_minor"
+           age="0"
+           ;;
+         irix|nonstopux)
+           func_arith $number_major + $number_minor
+           current=$func_arith_result
+           age="$number_minor"
+           revision="$number_minor"
+           lt_irix_increment=no
+           ;;
+         *)
+           func_fatal_configuration "$modename: unknown library version type \`$version_type'"
+           ;;
+         esac
+         ;;
+       no)
+         current="$1"
+         revision="$2"
+         age="$3"
+         ;;
+       esac
+
+       # Check that each of the things are valid numbers.
+       case $current in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "CURRENT \`$current' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       case $revision in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "REVISION \`$revision' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       case $age in
+       0|[1-9]|[1-9][0-9]|[1-9][0-9][0-9]|[1-9][0-9][0-9][0-9]|[1-9][0-9][0-9][0-9][0-9]) ;;
+       *)
+         func_error "AGE \`$age' must be a nonnegative integer"
+         func_fatal_error "\`$vinfo' is not valid version information"
+         ;;
+       esac
+
+       if test "$age" -gt "$current"; then
+         func_error "AGE \`$age' is greater than the current interface number \`$current'"
+         func_fatal_error "\`$vinfo' is not valid version information"
+       fi
+
+       # Calculate the version variables.
+       major=
+       versuffix=
+       verstring=
+       case $version_type in
+       none) ;;
+
+       darwin)
+         # Like Linux, but with the current version available in
+         # verstring for coding it into the library header
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix="$major.$age.$revision"
+         # Darwin ld doesn't like 0 for these options...
+         func_arith $current + 1
+         minor_current=$func_arith_result
+         xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
+         verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
+         ;;
+
+       freebsd-aout)
+         major=".$current"
+         versuffix=".$current.$revision";
+         ;;
+
+       freebsd-elf)
+         major=".$current"
+         versuffix=".$current"
+         ;;
+
+       irix | nonstopux)
+         if test "X$lt_irix_increment" = "Xno"; then
+           func_arith $current - $age
+         else
+           func_arith $current - $age + 1
+         fi
+         major=$func_arith_result
+
+         case $version_type in
+           nonstopux) verstring_prefix=nonstopux ;;
+           *)         verstring_prefix=sgi ;;
+         esac
+         verstring="$verstring_prefix$major.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$revision
+         while test "$loop" -ne 0; do
+           func_arith $revision - $loop
+           iface=$func_arith_result
+           func_arith $loop - 1
+           loop=$func_arith_result
+           verstring="$verstring_prefix$major.$iface:$verstring"
+         done
+
+         # Before this point, $major must not contain `.'.
+         major=.$major
+         versuffix="$major.$revision"
+         ;;
+
+       linux) # correct to gnu/linux during the next big refactor
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix="$major.$age.$revision"
+         ;;
+
+       osf)
+         func_arith $current - $age
+         major=.$func_arith_result
+         versuffix=".$current.$age.$revision"
+         verstring="$current.$age.$revision"
+
+         # Add in all the interfaces that we are compatible with.
+         loop=$age
+         while test "$loop" -ne 0; do
+           func_arith $current - $loop
+           iface=$func_arith_result
+           func_arith $loop - 1
+           loop=$func_arith_result
+           verstring="$verstring:${iface}.0"
+         done
+
+         # Make executables depend on our current version.
+         func_append verstring ":${current}.0"
+         ;;
+
+       qnx)
+         major=".$current"
+         versuffix=".$current"
+         ;;
+
+       sunos)
+         major=".$current"
+         versuffix=".$current.$revision"
+         ;;
+
+       windows)
+         # Use '-' rather than '.', since we only want one
+         # extension on DOS 8.3 filesystems.
+         func_arith $current - $age
+         major=$func_arith_result
+         versuffix="-$major"
+         ;;
+
+       *)
+         func_fatal_configuration "unknown library version type \`$version_type'"
+         ;;
+       esac
+
+       # Clear the version info if we defaulted, and they specified a release.
+       if test -z "$vinfo" && test -n "$release"; then
+         major=
+         case $version_type in
+         darwin)
+           # we can't check for "0.0" in archive_cmds due to quoting
+           # problems, so we reset it completely
+           verstring=
+           ;;
+         *)
+           verstring="0.0"
+           ;;
+         esac
+         if test "$need_version" = no; then
+           versuffix=
+         else
+           versuffix=".0.0"
+         fi
+       fi
+
+       # Remove version info from name if versioning should be avoided
+       if test "$avoid_version" = yes && test "$need_version" = no; then
+         major=
+         versuffix=
+         verstring=""
+       fi
+
+       # Check to see if the archive will have undefined symbols.
+       if test "$allow_undefined" = yes; then
+         if test "$allow_undefined_flag" = unsupported; then
+           func_warning "undefined symbols not allowed in $host shared libraries"
+           build_libtool_libs=no
+           build_old_libs=yes
+         fi
+       else
+         # Don't allow undefined symbols.
+         allow_undefined_flag="$no_undefined_flag"
+       fi
+
+      fi
+
+      func_generate_dlsyms "$libname" "$libname" "yes"
+      func_append libobjs " $symfileobj"
+      test "X$libobjs" = "X " && libobjs=
+
+      if test "$opt_mode" != relink; then
+       # Remove our outputs, but don't remove object files since they
+       # may have been created when compiling PIC objects.
+       removelist=
+       tempremovelist=`$ECHO "$output_objdir/*"`
+       for p in $tempremovelist; do
+         case $p in
+           *.$objext | *.gcno)
+              ;;
+           $output_objdir/$outputname | $output_objdir/$libname.* | $output_objdir/${libname}${release}.*)
+              if test "X$precious_files_regex" != "X"; then
+                if $ECHO "$p" | $EGREP -e "$precious_files_regex" >/dev/null 2>&1
+                then
+                  continue
+                fi
+              fi
+              func_append removelist " $p"
+              ;;
+           *) ;;
+         esac
+       done
+       test -n "$removelist" && \
+         func_show_eval "${RM}r \$removelist"
+      fi
+
+      # Now set the variables for building old libraries.
+      if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
+       func_append oldlibs " $output_objdir/$libname.$libext"
+
+       # Transform .lo files to .o files.
+       oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
+      fi
+
+      # Eliminate all temporary directories.
+      #for path in $notinst_path; do
+      #        lib_search_path=`$ECHO "$lib_search_path " | $SED "s% $path % %g"`
+      #        deplibs=`$ECHO "$deplibs " | $SED "s% -L$path % %g"`
+      #        dependency_libs=`$ECHO "$dependency_libs " | $SED "s% -L$path % %g"`
+      #done
+
+      if test -n "$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       temp_xrpath=
+       for libdir in $xrpath; do
+         func_replace_sysroot "$libdir"
+         func_append temp_xrpath " -R$func_replace_sysroot_result"
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) func_append finalize_rpath " $libdir" ;;
+         esac
+       done
+       if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
+         dependency_libs="$temp_xrpath $dependency_libs"
+       fi
+      fi
+
+      # Make sure dlfiles contains only unique files that won't be dlpreopened
+      old_dlfiles="$dlfiles"
+      dlfiles=
+      for lib in $old_dlfiles; do
+       case " $dlprefiles $dlfiles " in
+       *" $lib "*) ;;
+       *) func_append dlfiles " $lib" ;;
+       esac
+      done
+
+      # Make sure dlprefiles contains only unique files
+      old_dlprefiles="$dlprefiles"
+      dlprefiles=
+      for lib in $old_dlprefiles; do
+       case "$dlprefiles " in
+       *" $lib "*) ;;
+       *) func_append dlprefiles " $lib" ;;
+       esac
+      done
+
+      if test "$build_libtool_libs" = yes; then
+       if test -n "$rpath"; then
+         case $host in
+         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-beos* | *-cegcc* | *-*-haiku*)
+           # these systems don't actually have a c library (as such)!
+           ;;
+         *-*-rhapsody* | *-*-darwin1.[012])
+           # Rhapsody C library is in the System framework
+           func_append deplibs " System.ltframework"
+           ;;
+         *-*-netbsd*)
+           # Don't link with libc until the a.out ld.so is fixed.
+           ;;
+         *-*-openbsd* | *-*-freebsd* | *-*-dragonfly*)
+           # Do not include libc due to us having libc/libc_r.
+           ;;
+         *-*-sco3.2v5* | *-*-sco5v6*)
+           # Causes problems with __ctype
+           ;;
+         *-*-sysv4.2uw2* | *-*-sysv5* | *-*-unixware* | *-*-OpenUNIX*)
+           # Compiler inserts libc in the correct place for threads to work
+           ;;
+         *)
+           # Add libc to deplibs on all other systems if necessary.
+           if test "$build_libtool_need_lc" = "yes"; then
+             func_append deplibs " -lc"
+           fi
+           ;;
+         esac
+       fi
+
+       # Transform deplibs into only deplibs that can be linked in shared.
+       name_save=$name
+       libname_save=$libname
+       release_save=$release
+       versuffix_save=$versuffix
+       major_save=$major
+       # I'm not sure if I'm treating the release correctly.  I think
+       # release should show up in the -l (ie -lgmp5) so we don't want to
+       # add it in twice.  Is that correct?
+       release=""
+       versuffix=""
+       major=""
+       newdeplibs=
+       droppeddeps=no
+       case $deplibs_check_method in
+       pass_all)
+         # Don't check for shared/static.  Everything works.
+         # This might be a little naive.  We might want to check
+         # whether the library exists or not.  But this is on
+         # osf3 & osf4 and I'm not really sure... Just
+         # implementing what was already the behavior.
+         newdeplibs=$deplibs
+         ;;
+       test_compile)
+         # This code stresses the "libraries are programs" paradigm to its
+         # limits. Maybe even breaks it.  We compile a program, linking it
+         # against the deplibs as a proxy for the library.  Then we can check
+         # whether they linked in statically or dynamically with ldd.
+         $opt_dry_run || $RM conftest.c
+         cat > conftest.c <<EOF
+         int main() { return 0; }
+EOF
+         $opt_dry_run || $RM conftest
+         if $LTCC $LTCFLAGS -o conftest conftest.c $deplibs; then
+           ldd_output=`ldd conftest`
+           for i in $deplibs; do
+             case $i in
+             -l*)
+               func_stripname -l '' "$i"
+               name=$func_stripname_result
+               if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                 case " $predeps $postdeps " in
+                 *" $i "*)
+                   func_append newdeplibs " $i"
+                   i=""
+                   ;;
+                 esac
+               fi
+               if test -n "$i" ; then
+                 libname=`eval "\\$ECHO \"$libname_spec\""`
+                 deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+                 set dummy $deplib_matches; shift
+                 deplib_match=$1
+                 if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                   func_append newdeplibs " $i"
+                 else
+                   droppeddeps=yes
+                   echo
+                   $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+                   echo "*** I have the capability to make that library automatically link in when"
+                   echo "*** you link to this library.  But I can only do this if you have a"
+                   echo "*** shared version of the library, which I believe you do not have"
+                   echo "*** because a test_compile did reveal that the linker did not use it for"
+                   echo "*** its dynamic dependency list that programs get resolved with at runtime."
+                 fi
+               fi
+               ;;
+             *)
+               func_append newdeplibs " $i"
+               ;;
+             esac
+           done
+         else
+           # Error occurred in the first compile.  Let's try to salvage
+           # the situation: Compile a separate program for each library.
+           for i in $deplibs; do
+             case $i in
+             -l*)
+               func_stripname -l '' "$i"
+               name=$func_stripname_result
+               $opt_dry_run || $RM conftest
+               if $LTCC $LTCFLAGS -o conftest conftest.c $i; then
+                 ldd_output=`ldd conftest`
+                 if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+                   case " $predeps $postdeps " in
+                   *" $i "*)
+                     func_append newdeplibs " $i"
+                     i=""
+                     ;;
+                   esac
+                 fi
+                 if test -n "$i" ; then
+                   libname=`eval "\\$ECHO \"$libname_spec\""`
+                   deplib_matches=`eval "\\$ECHO \"$library_names_spec\""`
+                   set dummy $deplib_matches; shift
+                   deplib_match=$1
+                   if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
+                     func_append newdeplibs " $i"
+                   else
+                     droppeddeps=yes
+                     echo
+                     $ECHO "*** Warning: dynamic linker does not accept needed library $i."
+                     echo "*** I have the capability to make that library automatically link in when"
+                     echo "*** you link to this library.  But I can only do this if you have a"
+                     echo "*** shared version of the library, which you do not appear to have"
+                     echo "*** because a test_compile did reveal that the linker did not use this one"
+                     echo "*** as a dynamic dependency that programs can get resolved with at runtime."
+                   fi
+                 fi
+               else
+                 droppeddeps=yes
+                 echo
+                 $ECHO "*** Warning!  Library $i is needed by this library but I was not able to"
+                 echo "*** make it link in!  You will probably need to install it or some"
+                 echo "*** library that it depends on before this library will be fully"
+                 echo "*** functional.  Installing it before continuing would be even better."
+               fi
+               ;;
+             *)
+               func_append newdeplibs " $i"
+               ;;
+             esac
+           done
+         fi
+         ;;
+       file_magic*)
+         set dummy $deplibs_check_method; shift
+         file_magic_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+         for a_deplib in $deplibs; do
+           case $a_deplib in
+           -l*)
+             func_stripname -l '' "$a_deplib"
+             name=$func_stripname_result
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 func_append newdeplibs " $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval "\\$ECHO \"$libname_spec\""`
+               if test -n "$file_magic_glob"; then
+                 libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+               else
+                 libnameglob=$libname
+               fi
+               test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 if test "$want_nocaseglob" = yes; then
+                   shopt -s nocaseglob
+                   potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+                   $nocaseglob
+                 else
+                   potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+                 fi
+                 for potent_lib in $potential_libs; do
+                     # Follow soft links.
+                     if ls -lLd "$potent_lib" 2>/dev/null |
+                        $GREP " -> " >/dev/null; then
+                       continue
+                     fi
+                     # The statement above tries to avoid entering an
+                     # endless loop below, in case of cyclic links.
+                     # We might still enter an endless loop, since a link
+                     # loop can be closed while we follow links,
+                     # but so what?
+                     potlib="$potent_lib"
+                     while test -h "$potlib" 2>/dev/null; do
+                       potliblink=`ls -ld $potlib | ${SED} 's/.* -> //'`
+                       case $potliblink in
+                       [\\/]* | [A-Za-z]:[\\/]*) potlib="$potliblink";;
+                       *) potlib=`$ECHO "$potlib" | $SED 's,[^/]*$,,'`"$potliblink";;
+                       esac
+                     done
+                     if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
+                        $SED -e 10q |
+                        $EGREP "$file_magic_regex" > /dev/null; then
+                       func_append newdeplibs " $a_deplib"
+                       a_deplib=""
+                       break 2
+                     fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               echo
+               $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $ECHO "*** with $libname but no candidates were found. (...for file magic test)"
+               else
+                 $ECHO "*** with $libname and none of the candidates passed a file format test"
+                 $ECHO "*** using a file magic. Last file checked: $potlib"
+               fi
+             fi
+             ;;
+           *)
+             # Add a -L argument.
+             func_append newdeplibs " $a_deplib"
+             ;;
+           esac
+         done # Gone through all deplibs.
+         ;;
+       match_pattern*)
+         set dummy $deplibs_check_method; shift
+         match_pattern_regex=`expr "$deplibs_check_method" : "$1 \(.*\)"`
+         for a_deplib in $deplibs; do
+           case $a_deplib in
+           -l*)
+             func_stripname -l '' "$a_deplib"
+             name=$func_stripname_result
+             if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+               case " $predeps $postdeps " in
+               *" $a_deplib "*)
+                 func_append newdeplibs " $a_deplib"
+                 a_deplib=""
+                 ;;
+               esac
+             fi
+             if test -n "$a_deplib" ; then
+               libname=`eval "\\$ECHO \"$libname_spec\""`
+               for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
+                 potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+                 for potent_lib in $potential_libs; do
+                   potlib="$potent_lib" # see symlink-check above in file_magic test
+                   if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
+                      $EGREP "$match_pattern_regex" > /dev/null; then
+                     func_append newdeplibs " $a_deplib"
+                     a_deplib=""
+                     break 2
+                   fi
+                 done
+               done
+             fi
+             if test -n "$a_deplib" ; then
+               droppeddeps=yes
+               echo
+               $ECHO "*** Warning: linker path does not have real file for library $a_deplib."
+               echo "*** I have the capability to make that library automatically link in when"
+               echo "*** you link to this library.  But I can only do this if you have a"
+               echo "*** shared version of the library, which you do not appear to have"
+               echo "*** because I did check the linker path looking for a file starting"
+               if test -z "$potlib" ; then
+                 $ECHO "*** with $libname but no candidates were found. (...for regex pattern test)"
+               else
+                 $ECHO "*** with $libname and none of the candidates passed a file format test"
+                 $ECHO "*** using a regex pattern. Last file checked: $potlib"
+               fi
+             fi
+             ;;
+           *)
+             # Add a -L argument.
+             func_append newdeplibs " $a_deplib"
+             ;;
+           esac
+         done # Gone through all deplibs.
+         ;;
+       none | unknown | *)
+         newdeplibs=""
+         tmp_deplibs=`$ECHO " $deplibs" | $SED 's/ -lc$//; s/ -[LR][^ ]*//g'`
+         if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
+           for i in $predeps $postdeps ; do
+             # can't use Xsed below, because $i might contain '/'
+             tmp_deplibs=`$ECHO " $tmp_deplibs" | $SED "s,$i,,"`
+           done
+         fi
+         case $tmp_deplibs in
+         *[!\  \ ]*)
+           echo
+           if test "X$deplibs_check_method" = "Xnone"; then
+             echo "*** Warning: inter-library dependencies are not supported in this platform."
+           else
+             echo "*** Warning: inter-library dependencies are not known to be supported."
+           fi
+           echo "*** All declared inter-library dependencies are being dropped."
+           droppeddeps=yes
+           ;;
+         esac
+         ;;
+       esac
+       versuffix=$versuffix_save
+       major=$major_save
+       release=$release_save
+       libname=$libname_save
+       name=$name_save
+
+       case $host in
+       *-*-rhapsody* | *-*-darwin1.[012])
+         # On Rhapsody replace the C library with the System framework
+         newdeplibs=`$ECHO " $newdeplibs" | $SED 's/ -lc / System.ltframework /'`
+         ;;
+       esac
+
+       if test "$droppeddeps" = yes; then
+         if test "$module" = yes; then
+           echo
+           echo "*** Warning: libtool could not satisfy all declared inter-library"
+           $ECHO "*** dependencies of module $libname.  Therefore, libtool will create"
+           echo "*** a static module, that should work as long as the dlopening"
+           echo "*** application is linked with the -dlopen flag."
+           if test -z "$global_symbol_pipe"; then
+             echo
+             echo "*** However, this would only work if libtool was able to extract symbol"
+             echo "*** lists from a program, using \`nm' or equivalent, but libtool could"
+             echo "*** not find such a program.  So, this module is probably useless."
+             echo "*** \`nm' from GNU binutils and a full rebuild may help."
+           fi
+           if test "$build_old_libs" = no; then
+             oldlibs="$output_objdir/$libname.$libext"
+             build_libtool_libs=module
+             build_old_libs=yes
+           else
+             build_libtool_libs=no
+           fi
+         else
+           echo "*** The inter-library dependencies that have been dropped here will be"
+           echo "*** automatically added whenever a program is linked with this library"
+           echo "*** or is declared to -dlopen it."
+
+           if test "$allow_undefined" = no; then
+             echo
+             echo "*** Since this library must not contain undefined symbols,"
+             echo "*** because either the platform does not support them or"
+             echo "*** it was explicitly requested with -no-undefined,"
+             echo "*** libtool will only create a static version of it."
+             if test "$build_old_libs" = no; then
+               oldlibs="$output_objdir/$libname.$libext"
+               build_libtool_libs=module
+               build_old_libs=yes
+             else
+               build_libtool_libs=no
+             fi
+           fi
+         fi
+       fi
+       # Done checking deplibs!
+       deplibs=$newdeplibs
+      fi
+      # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+      case $host in
+       *-*-darwin*)
+         newdeplibs=`$ECHO " $newdeplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         new_inherited_linker_flags=`$ECHO " $new_inherited_linker_flags" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         deplibs=`$ECHO " $deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+         ;;
+      esac
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $deplibs " in
+         *" -L$path/$objdir "*)
+           func_append new_libs " -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) func_append new_libs " $deplib" ;;
+         esac
+         ;;
+       *) func_append new_libs " $deplib" ;;
+       esac
+      done
+      deplibs="$new_libs"
+
+      # All the library-specific variables (install_libdir is set above).
+      library_names=
+      old_library=
+      dlname=
+
+      # 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=
+         dep_rpath=
+         rpath="$finalize_rpath"
+         test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
+         for libdir in $rpath; do
+           if test -n "$hardcode_libdir_flag_spec"; then
+             if test -n "$hardcode_libdir_separator"; then
+               func_replace_sysroot "$libdir"
+               libdir=$func_replace_sysroot_result
+               if test -z "$hardcode_libdirs"; then
+                 hardcode_libdirs="$libdir"
+               else
+                 # Just accumulate the unique libdirs.
+                 case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+                 *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+                   ;;
+                 *)
+                   func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+                   ;;
+                 esac
+               fi
+             else
+               eval flag=\"$hardcode_libdir_flag_spec\"
+               func_append dep_rpath " $flag"
+             fi
+           elif test -n "$runpath_var"; then
+             case "$perm_rpath " in
+             *" $libdir "*) ;;
+             *) func_append perm_rpath " $libdir" ;;
+             esac
+           fi
+         done
+         # Substitute the hardcoded libdirs into the rpath.
+         if test -n "$hardcode_libdir_separator" &&
+            test -n "$hardcode_libdirs"; then
+           libdir="$hardcode_libdirs"
+           eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
+         fi
+         if test -n "$runpath_var" && test -n "$perm_rpath"; then
+           # We should set the runpath_var.
+           rpath=
+           for dir in $perm_rpath; do
+             func_append rpath "$dir:"
+           done
+           eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
+         fi
+         test -n "$dep_rpath" && deplibs="$dep_rpath $deplibs"
+       fi
+
+       shlibpath="$finalize_shlibpath"
+       test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+       if test -n "$shlibpath"; then
+         eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
+       fi
+
+       # Get the real and link names of the library.
+       eval shared_ext=\"$shrext_cmds\"
+       eval library_names=\"$library_names_spec\"
+       set dummy $library_names
+       shift
+       realname="$1"
+       shift
+
+       if test -n "$soname_spec"; then
+         eval soname=\"$soname_spec\"
+       else
+         soname="$realname"
+       fi
+       if test -z "$dlname"; then
+         dlname=$soname
+       fi
+
+       lib="$output_objdir/$realname"
+       linknames=
+       for link
+       do
+         func_append linknames " $link"
+       done
+
+       # Use standard objects if they are pic
+       test -z "$pic_flag" && libobjs=`$ECHO "$libobjs" | $SP2NL | $SED "$lo2o" | $NL2SP`
+       test "X$libobjs" = "X " && libobjs=
+
+       delfiles=
+       if test -n "$export_symbols" && test -n "$include_expsyms"; then
+         $opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
+         export_symbols="$output_objdir/$libname.uexp"
+         func_append delfiles " $export_symbols"
+       fi
+
+       orig_export_symbols=
+       case $host_os in
+       cygwin* | mingw* | cegcc*)
+         if test -n "$export_symbols" && test -z "$export_symbols_regex"; then
+           # exporting using user supplied symfile
+           if test "x`$SED 1q $export_symbols`" != xEXPORTS; then
+             # and it's NOT already a .def file. Must figure out
+             # which of the given symbols are data symbols and tag
+             # them as such. So, trigger use of export_symbols_cmds.
+             # export_symbols gets reassigned inside the "prepare
+             # the list of exported symbols" if statement, so the
+             # include_expsyms logic still works.
+             orig_export_symbols="$export_symbols"
+             export_symbols=
+             always_export_symbols=yes
+           fi
+         fi
+         ;;
+       esac
+
+       # Prepare the list of exported symbols
+       if test -z "$export_symbols"; then
+         if test "$always_export_symbols" = yes || test -n "$export_symbols_regex"; then
+           func_verbose "generating symbol list for \`$libname.la'"
+           export_symbols="$output_objdir/$libname.exp"
+           $opt_dry_run || $RM $export_symbols
+           cmds=$export_symbols_cmds
+           save_ifs="$IFS"; IFS='~'
+           for cmd1 in $cmds; do
+             IFS="$save_ifs"
+             # Take the normal branch if the nm_file_list_spec branch
+             # doesn't work or if tool conversion is not needed.
+             case $nm_file_list_spec~$to_tool_file_cmd in
+               *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+                 try_normal_branch=yes
+                 eval cmd=\"$cmd1\"
+                 func_len " $cmd"
+                 len=$func_len_result
+                 ;;
+               *)
+                 try_normal_branch=no
+                 ;;
+             esac
+             if test "$try_normal_branch" = yes \
+                && { test "$len" -lt "$max_cmd_len" \
+                     || test "$max_cmd_len" -le -1; }
+             then
+               func_show_eval "$cmd" 'exit $?'
+               skipped_export=false
+             elif test -n "$nm_file_list_spec"; then
+               func_basename "$output"
+               output_la=$func_basename_result
+               save_libobjs=$libobjs
+               save_output=$output
+               output=${output_objdir}/${output_la}.nm
+               func_to_tool_file "$output"
+               libobjs=$nm_file_list_spec$func_to_tool_file_result
+               func_append delfiles " $output"
+               func_verbose "creating $NM input file list: $output"
+               for obj in $save_libobjs; do
+                 func_to_tool_file "$obj"
+                 $ECHO "$func_to_tool_file_result"
+               done > "$output"
+               eval cmd=\"$cmd1\"
+               func_show_eval "$cmd" 'exit $?'
+               output=$save_output
+               libobjs=$save_libobjs
+               skipped_export=false
+             else
+               # The command line is too long to execute in one step.
+               func_verbose "using reloadable object file for export list..."
+               skipped_export=:
+               # Break out early, otherwise skipped_export may be
+               # set to false by a later but shorter cmd.
+               break
+             fi
+           done
+           IFS="$save_ifs"
+           if test -n "$export_symbols_regex" && test "X$skipped_export" != "X:"; then
+             func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+       fi
+
+       if test -n "$export_symbols" && test -n "$include_expsyms"; then
+         tmp_export_symbols="$export_symbols"
+         test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+         $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+       fi
+
+       if test "X$skipped_export" != "X:" && test -n "$orig_export_symbols"; then
+         # The given exports_symbols file has to be filtered, so filter it.
+         func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+         # FIXME: $output_objdir/$libname.filter potentially contains lots of
+         # 's' commands which not all seds can handle. GNU sed should be fine
+         # though. Also, the filter scales superlinearly with the number of
+         # global variables. join(1) would be nice here, but unfortunately
+         # isn't a blessed tool.
+         $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+         func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+         export_symbols=$output_objdir/$libname.def
+         $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+       fi
+
+       tmp_deplibs=
+       for test_deplib in $deplibs; do
+         case " $convenience " in
+         *" $test_deplib "*) ;;
+         *)
+           func_append tmp_deplibs " $test_deplib"
+           ;;
+         esac
+       done
+       deplibs="$tmp_deplibs"
+
+       if test -n "$convenience"; then
+         if test -n "$whole_archive_flag_spec" &&
+           test "$compiler_needs_object" = yes &&
+           test -z "$libobjs"; then
+           # extract the archives, so we have objects to list.
+           # TODO: could optimize this to just extract one archive.
+           whole_archive_flag_spec=
+         fi
+         if test -n "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+           test "X$libobjs" = "X " && libobjs=
+         else
+           gentop="$output_objdir/${outputname}x"
+           func_append generated " $gentop"
+
+           func_extract_archives $gentop $convenience
+           func_append libobjs " $func_extract_archives_result"
+           test "X$libobjs" = "X " && libobjs=
+         fi
+       fi
+
+       if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
+         eval flag=\"$thread_safe_flag_spec\"
+         func_append linker_flags " $flag"
+       fi
+
+       # Make a backup of the uninstalled library when relinking
+       if test "$opt_mode" = relink; then
+         $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
+       fi
+
+       # Do each of the archive commands.
+       if test "$module" = yes && test -n "$module_cmds" ; then
+         if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+           eval test_cmds=\"$module_expsym_cmds\"
+           cmds=$module_expsym_cmds
+         else
+           eval test_cmds=\"$module_cmds\"
+           cmds=$module_cmds
+         fi
+       else
+         if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+           eval test_cmds=\"$archive_expsym_cmds\"
+           cmds=$archive_expsym_cmds
+         else
+           eval test_cmds=\"$archive_cmds\"
+           cmds=$archive_cmds
+         fi
+       fi
+
+       if test "X$skipped_export" != "X:" &&
+          func_len " $test_cmds" &&
+          len=$func_len_result &&
+          test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         :
+       else
+         # The command line is too long to link in one step, link piecewise
+         # or, if using GNU ld and skipped_export is not :, use a linker
+         # script.
+
+         # Save the value of $output and $libobjs because we want to
+         # use them later.  If we have whole_archive_flag_spec, we
+         # want to use save_libobjs as it was before
+         # whole_archive_flag_spec was expanded, because we can't
+         # assume the linker understands whole_archive_flag_spec.
+         # This may have to be revisited, in case too many
+         # convenience libraries get linked in and end up exceeding
+         # the spec.
+         if test -z "$convenience" || test -z "$whole_archive_flag_spec"; then
+           save_libobjs=$libobjs
+         fi
+         save_output=$output
+         func_basename "$output"
+         output_la=$func_basename_result
+
+         # Clear the reloadable object creation command queue and
+         # initialize k to one.
+         test_cmds=
+         concat_cmds=
+         objlist=
+         last_robj=
+         k=1
+
+         if test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "$with_gnu_ld" = yes; then
+           output=${output_objdir}/${output_la}.lnkscript
+           func_verbose "creating GNU ld script: $output"
+           echo 'INPUT (' > $output
+           for obj in $save_libobjs
+           do
+             func_to_tool_file "$obj"
+             $ECHO "$func_to_tool_file_result" >> $output
+           done
+           echo ')' >> $output
+           func_append delfiles " $output"
+           func_to_tool_file "$output"
+           output=$func_to_tool_file_result
+         elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
+           output=${output_objdir}/${output_la}.lnk
+           func_verbose "creating linker input file list: $output"
+           : > $output
+           set x $save_libobjs
+           shift
+           firstobj=
+           if test "$compiler_needs_object" = yes; then
+             firstobj="$1 "
+             shift
+           fi
+           for obj
+           do
+             func_to_tool_file "$obj"
+             $ECHO "$func_to_tool_file_result" >> $output
+           done
+           func_append delfiles " $output"
+           func_to_tool_file "$output"
+           output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
+         else
+           if test -n "$save_libobjs"; then
+             func_verbose "creating reloadable object files..."
+             output=$output_objdir/$output_la-${k}.$objext
+             eval test_cmds=\"$reload_cmds\"
+             func_len " $test_cmds"
+             len0=$func_len_result
+             len=$len0
+
+             # Loop over the list of objects to be linked.
+             for obj in $save_libobjs
+             do
+               func_len " $obj"
+               func_arith $len + $func_len_result
+               len=$func_arith_result
+               if test "X$objlist" = X ||
+                  test "$len" -lt "$max_cmd_len"; then
+                 func_append objlist " $obj"
+               else
+                 # The command $test_cmds is almost too long, add a
+                 # command to the queue.
+                 if test "$k" -eq 1 ; then
+                   # The first file doesn't have a previous command to add.
+                   reload_objs=$objlist
+                   eval concat_cmds=\"$reload_cmds\"
+                 else
+                   # All subsequent reloadable object files will link in
+                   # the last one created.
+                   reload_objs="$objlist $last_robj"
+                   eval concat_cmds=\"\$concat_cmds~$reload_cmds~\$RM $last_robj\"
+                 fi
+                 last_robj=$output_objdir/$output_la-${k}.$objext
+                 func_arith $k + 1
+                 k=$func_arith_result
+                 output=$output_objdir/$output_la-${k}.$objext
+                 objlist=" $obj"
+                 func_len " $last_robj"
+                 func_arith $len0 + $func_len_result
+                 len=$func_arith_result
+               fi
+             done
+             # Handle the remaining objects by creating one last
+             # reloadable object file.  All subsequent reloadable object
+             # files will link in the last one created.
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             reload_objs="$objlist $last_robj"
+             eval concat_cmds=\"\${concat_cmds}$reload_cmds\"
+             if test -n "$last_robj"; then
+               eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
+             fi
+             func_append delfiles " $output"
+
+           else
+             output=
+           fi
+
+           if ${skipped_export-false}; then
+             func_verbose "generating symbol list for \`$libname.la'"
+             export_symbols="$output_objdir/$libname.exp"
+             $opt_dry_run || $RM $export_symbols
+             libobjs=$output
+             # Append the command to create the export file.
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\$concat_cmds$export_symbols_cmds\"
+             if test -n "$last_robj"; then
+               eval concat_cmds=\"\$concat_cmds~\$RM $last_robj\"
+             fi
+           fi
+
+           test -n "$save_libobjs" &&
+             func_verbose "creating a temporary reloadable object file: $output"
+
+           # Loop through the commands generated above and execute them.
+           save_ifs="$IFS"; IFS='~'
+           for cmd in $concat_cmds; do
+             IFS="$save_ifs"
+             $opt_silent || {
+                 func_quote_for_expand "$cmd"
+                 eval "func_echo $func_quote_for_expand_result"
+             }
+             $opt_dry_run || eval "$cmd" || {
+               lt_exit=$?
+
+               # Restore the uninstalled library and exit
+               if test "$opt_mode" = relink; then
+                 ( cd "$output_objdir" && \
+                   $RM "${realname}T" && \
+                   $MV "${realname}U" "$realname" )
+               fi
+
+               exit $lt_exit
+             }
+           done
+           IFS="$save_ifs"
+
+           if test -n "$export_symbols_regex" && ${skipped_export-false}; then
+             func_show_eval '$EGREP -e "$export_symbols_regex" "$export_symbols" > "${export_symbols}T"'
+             func_show_eval '$MV "${export_symbols}T" "$export_symbols"'
+           fi
+         fi
+
+          if ${skipped_export-false}; then
+           if test -n "$export_symbols" && test -n "$include_expsyms"; then
+             tmp_export_symbols="$export_symbols"
+             test -n "$orig_export_symbols" && tmp_export_symbols="$orig_export_symbols"
+             $opt_dry_run || eval '$ECHO "$include_expsyms" | $SP2NL >> "$tmp_export_symbols"'
+           fi
+
+           if test -n "$orig_export_symbols"; then
+             # The given exports_symbols file has to be filtered, so filter it.
+             func_verbose "filter symbol list for \`$libname.la' to tag DATA exports"
+             # FIXME: $output_objdir/$libname.filter potentially contains lots of
+             # 's' commands which not all seds can handle. GNU sed should be fine
+             # though. Also, the filter scales superlinearly with the number of
+             # global variables. join(1) would be nice here, but unfortunately
+             # isn't a blessed tool.
+             $opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
+             func_append delfiles " $export_symbols $output_objdir/$libname.filter"
+             export_symbols=$output_objdir/$libname.def
+             $opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
+           fi
+         fi
+
+         libobjs=$output
+         # Restore the value of output.
+         output=$save_output
+
+         if test -n "$convenience" && test -n "$whole_archive_flag_spec"; then
+           eval libobjs=\"\$libobjs $whole_archive_flag_spec\"
+           test "X$libobjs" = "X " && libobjs=
+         fi
+         # Expand the library linking commands again to reset the
+         # value of $libobjs for piecewise linking.
+
+         # Do each of the archive commands.
+         if test "$module" = yes && test -n "$module_cmds" ; then
+           if test -n "$export_symbols" && test -n "$module_expsym_cmds"; then
+             cmds=$module_expsym_cmds
+           else
+             cmds=$module_cmds
+           fi
+         else
+           if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then
+             cmds=$archive_expsym_cmds
+           else
+             cmds=$archive_cmds
+           fi
+         fi
+       fi
+
+       if test -n "$delfiles"; then
+         # Append the command to remove temporary files to $cmds.
+         eval cmds=\"\$cmds~\$RM $delfiles\"
+       fi
+
+       # Add any objects from preloaded convenience libraries
+       if test -n "$dlprefiles"; then
+         gentop="$output_objdir/${outputname}x"
+         func_append generated " $gentop"
+
+         func_extract_archives $gentop $dlprefiles
+         func_append libobjs " $func_extract_archives_result"
+         test "X$libobjs" = "X " && libobjs=
+       fi
+
+       save_ifs="$IFS"; IFS='~'
+       for cmd in $cmds; do
+         IFS="$save_ifs"
+         eval cmd=\"$cmd\"
+         $opt_silent || {
+           func_quote_for_expand "$cmd"
+           eval "func_echo $func_quote_for_expand_result"
+         }
+         $opt_dry_run || eval "$cmd" || {
+           lt_exit=$?
+
+           # Restore the uninstalled library and exit
+           if test "$opt_mode" = relink; then
+             ( cd "$output_objdir" && \
+               $RM "${realname}T" && \
+               $MV "${realname}U" "$realname" )
+           fi
+
+           exit $lt_exit
+         }
+       done
+       IFS="$save_ifs"
+
+       # Restore the uninstalled library and exit
+       if test "$opt_mode" = relink; then
+         $opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
+
+         if test -n "$convenience"; then
+           if test -z "$whole_archive_flag_spec"; then
+             func_show_eval '${RM}r "$gentop"'
+           fi
+         fi
+
+         exit $EXIT_SUCCESS
+       fi
+
+       # Create links to the real library.
+       for linkname in $linknames; do
+         if test "$realname" != "$linkname"; then
+           func_show_eval '(cd "$output_objdir" && $RM "$linkname" && $LN_S "$realname" "$linkname")' 'exit $?'
+         fi
+       done
+
+       # If -module or -export-dynamic was specified, set the dlname.
+       if test "$module" = yes || test "$export_dynamic" = yes; then
+         # On all known operating systems, these are identical.
+         dlname="$soname"
+       fi
+      fi
+      ;;
+
+    obj)
+      if test -n "$dlfiles$dlprefiles" || test "$dlself" != no; then
+       func_warning "\`-dlopen' is ignored for objects"
+      fi
+
+      case " $deplibs" in
+      *\ -l* | *\ -L*)
+       func_warning "\`-l' and \`-L' are ignored for objects" ;;
+      esac
+
+      test -n "$rpath" && \
+       func_warning "\`-rpath' is ignored for objects"
+
+      test -n "$xrpath" && \
+       func_warning "\`-R' is ignored for objects"
+
+      test -n "$vinfo" && \
+       func_warning "\`-version-info' is ignored for objects"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for objects"
+
+      case $output in
+      *.lo)
+       test -n "$objs$old_deplibs" && \
+         func_fatal_error "cannot build library object \`$output' from non-libtool objects"
+
+       libobj=$output
+       func_lo2o "$libobj"
+       obj=$func_lo2o_result
+       ;;
+      *)
+       libobj=
+       obj="$output"
+       ;;
+      esac
+
+      # Delete the old objects.
+      $opt_dry_run || $RM $obj $libobj
+
+      # Objects from convenience libraries.  This assumes
+      # single-version convenience libraries.  Whenever we create
+      # different ones for PIC/non-PIC, this we'll have to duplicate
+      # the extraction.
+      reload_conv_objs=
+      gentop=
+      # reload_cmds runs $LD directly, so let us get rid of
+      # -Wl from whole_archive_flag_spec and hope we can get by with
+      # turning comma into space..
+      wl=
+
+      if test -n "$convenience"; then
+       if test -n "$whole_archive_flag_spec"; then
+         eval tmp_whole_archive_flags=\"$whole_archive_flag_spec\"
+         reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
+       else
+         gentop="$output_objdir/${obj}x"
+         func_append generated " $gentop"
+
+         func_extract_archives $gentop $convenience
+         reload_conv_objs="$reload_objs $func_extract_archives_result"
+       fi
+      fi
+
+      # If we're not building shared, we need to use non_pic_objs
+      test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
+      # Create the old-style object.
+      reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
+
+      output="$obj"
+      func_execute_cmds "$reload_cmds" 'exit $?'
+
+      # Exit if we aren't doing a library object file.
+      if test -z "$libobj"; then
+       if test -n "$gentop"; then
+         func_show_eval '${RM}r "$gentop"'
+       fi
+
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$build_libtool_libs" != yes; then
+       if test -n "$gentop"; then
+         func_show_eval '${RM}r "$gentop"'
+       fi
+
+       # Create an invalid libtool object if no PIC, so that we don't
+       # accidentally link it into a program.
+       # $show "echo timestamp > $libobj"
+       # $opt_dry_run || eval "echo timestamp > $libobj" || exit $?
+       exit $EXIT_SUCCESS
+      fi
+
+      if test -n "$pic_flag" || test "$pic_mode" != default; then
+       # Only do commands if we really have different PIC objects.
+       reload_objs="$libobjs $reload_conv_objs"
+       output="$libobj"
+       func_execute_cmds "$reload_cmds" 'exit $?'
+      fi
+
+      if test -n "$gentop"; then
+       func_show_eval '${RM}r "$gentop"'
+      fi
+
+      exit $EXIT_SUCCESS
+      ;;
+
+    prog)
+      case $host in
+       *cygwin*) func_stripname '' '.exe' "$output"
+                 output=$func_stripname_result.exe;;
+      esac
+      test -n "$vinfo" && \
+       func_warning "\`-version-info' is ignored for programs"
+
+      test -n "$release" && \
+       func_warning "\`-release' is ignored for programs"
+
+      test "$preload" = yes \
+        && test "$dlopen_support" = unknown \
+       && test "$dlopen_self" = unknown \
+       && test "$dlopen_self_static" = unknown && \
+         func_warning "\`LT_INIT([dlopen])' not used. Assuming no dlopen support."
+
+      case $host in
+      *-*-rhapsody* | *-*-darwin1.[012])
+       # On Rhapsody replace the C library is the System framework
+       compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's/ -lc / System.ltframework /'`
+       finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's/ -lc / System.ltframework /'`
+       ;;
+      esac
+
+      case $host in
+      *-*-darwin*)
+       # Don't allow lazy linking, it breaks C++ global constructors
+       # But is supposedly fixed on 10.4 or later (yay!).
+       if test "$tagname" = CXX ; then
+         case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
+           10.[0123])
+             func_append compile_command " ${wl}-bind_at_load"
+             func_append finalize_command " ${wl}-bind_at_load"
+           ;;
+         esac
+       fi
+       # Time to change all our "foo.ltframework" stuff back to "-framework foo"
+       compile_deplibs=`$ECHO " $compile_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       finalize_deplibs=`$ECHO " $finalize_deplibs" | $SED 's% \([^ $]*\).ltframework% -framework \1%g'`
+       ;;
+      esac
+
+
+      # move library search paths that coincide with paths to not yet
+      # installed libraries to the beginning of the library search list
+      new_libs=
+      for path in $notinst_path; do
+       case " $new_libs " in
+       *" -L$path/$objdir "*) ;;
+       *)
+         case " $compile_deplibs " in
+         *" -L$path/$objdir "*)
+           func_append new_libs " -L$path/$objdir" ;;
+         esac
+         ;;
+       esac
+      done
+      for deplib in $compile_deplibs; do
+       case $deplib in
+       -L*)
+         case " $new_libs " in
+         *" $deplib "*) ;;
+         *) func_append new_libs " $deplib" ;;
+         esac
+         ;;
+       *) func_append new_libs " $deplib" ;;
+       esac
+      done
+      compile_deplibs="$new_libs"
+
+
+      func_append compile_command " $compile_deplibs"
+      func_append finalize_command " $finalize_deplibs"
+
+      if test -n "$rpath$xrpath"; then
+       # If the user specified any rpath flags, then add them.
+       for libdir in $rpath $xrpath; do
+         # This is the magic to use -rpath.
+         case "$finalize_rpath " in
+         *" $libdir "*) ;;
+         *) func_append finalize_rpath " $libdir" ;;
+         esac
+       done
+      fi
+
+      # Now hardcode the library paths
+      rpath=
+      hardcode_libdirs=
+      for libdir in $compile_rpath $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           func_append rpath " $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$perm_rpath " in
+         *" $libdir "*) ;;
+         *) func_append perm_rpath " $libdir" ;;
+         esac
+       fi
+       case $host in
+       *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-cegcc*)
+         testbindir=`${ECHO} "$libdir" | ${SED} -e 's*/lib$*/bin*'`
+         case :$dllsearchpath: in
+         *":$libdir:"*) ;;
+         ::) dllsearchpath=$libdir;;
+         *) func_append dllsearchpath ":$libdir";;
+         esac
+         case :$dllsearchpath: in
+         *":$testbindir:"*) ;;
+         ::) dllsearchpath=$testbindir;;
+         *) func_append dllsearchpath ":$testbindir";;
+         esac
+         ;;
+       esac
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      compile_rpath="$rpath"
+
+      rpath=
+      hardcode_libdirs=
+      for libdir in $finalize_rpath; do
+       if test -n "$hardcode_libdir_flag_spec"; then
+         if test -n "$hardcode_libdir_separator"; then
+           if test -z "$hardcode_libdirs"; then
+             hardcode_libdirs="$libdir"
+           else
+             # Just accumulate the unique libdirs.
+             case $hardcode_libdir_separator$hardcode_libdirs$hardcode_libdir_separator in
+             *"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
+               ;;
+             *)
+               func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
+               ;;
+             esac
+           fi
+         else
+           eval flag=\"$hardcode_libdir_flag_spec\"
+           func_append rpath " $flag"
+         fi
+       elif test -n "$runpath_var"; then
+         case "$finalize_perm_rpath " in
+         *" $libdir "*) ;;
+         *) func_append finalize_perm_rpath " $libdir" ;;
+         esac
+       fi
+      done
+      # Substitute the hardcoded libdirs into the rpath.
+      if test -n "$hardcode_libdir_separator" &&
+        test -n "$hardcode_libdirs"; then
+       libdir="$hardcode_libdirs"
+       eval rpath=\" $hardcode_libdir_flag_spec\"
+      fi
+      finalize_rpath="$rpath"
+
+      if test -n "$libobjs" && test "$build_old_libs" = yes; then
+       # Transform all the library objects into standard objects.
+       compile_command=`$ECHO "$compile_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+       finalize_command=`$ECHO "$finalize_command" | $SP2NL | $SED "$lo2o" | $NL2SP`
+      fi
+
+      func_generate_dlsyms "$outputname" "@PROGRAM@" "no"
+
+      # template prelinking step
+      if test -n "$prelink_cmds"; then
+       func_execute_cmds "$prelink_cmds" 'exit $?'
+      fi
+
+      wrappers_required=yes
+      case $host in
+      *cegcc* | *mingw32ce*)
+        # Disable wrappers for cegcc and mingw32ce hosts, we are cross compiling anyway.
+        wrappers_required=no
+        ;;
+      *cygwin* | *mingw* )
+        if test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      *)
+        if test "$need_relink" = no || test "$build_libtool_libs" != yes; then
+          wrappers_required=no
+        fi
+        ;;
+      esac
+      if test "$wrappers_required" = no; then
+       # Replace the output file specification.
+       compile_command=`$ECHO "$compile_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+       link_command="$compile_command$compile_rpath"
+
+       # We have no uninstalled library dependencies, so finalize right now.
+       exit_status=0
+       func_show_eval "$link_command" 'exit_status=$?'
+
+       if test -n "$postlink_cmds"; then
+         func_to_tool_file "$output"
+         postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+         func_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
+       # Delete the generated files.
+       if test -f "$output_objdir/${outputname}S.${objext}"; then
+         func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
+       fi
+
+       exit $exit_status
+      fi
+
+      if test -n "$compile_shlibpath$finalize_shlibpath"; then
+       compile_command="$shlibpath_var=\"$compile_shlibpath$finalize_shlibpath\$$shlibpath_var\" $compile_command"
+      fi
+      if test -n "$finalize_shlibpath"; then
+       finalize_command="$shlibpath_var=\"$finalize_shlibpath\$$shlibpath_var\" $finalize_command"
+      fi
+
+      compile_var=
+      finalize_var=
+      if test -n "$runpath_var"; then
+       if test -n "$perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $perm_rpath; do
+           func_append rpath "$dir:"
+         done
+         compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+       if test -n "$finalize_perm_rpath"; then
+         # We should set the runpath_var.
+         rpath=
+         for dir in $finalize_perm_rpath; do
+           func_append rpath "$dir:"
+         done
+         finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
+       fi
+      fi
+
+      if test "$no_install" = yes; then
+       # We don't need to create a wrapper script.
+       link_command="$compile_var$compile_command$compile_rpath"
+       # Replace the output file specification.
+       link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output"'%g'`
+       # Delete the old output file.
+       $opt_dry_run || $RM $output
+       # Link the executable and exit
+       func_show_eval "$link_command" 'exit $?'
+
+       if test -n "$postlink_cmds"; then
+         func_to_tool_file "$output"
+         postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+         func_execute_cmds "$postlink_cmds" 'exit $?'
+       fi
+
+       exit $EXIT_SUCCESS
+      fi
+
+      if test "$hardcode_action" = relink; then
+       # Fast installation is not supported
+       link_command="$compile_var$compile_command$compile_rpath"
+       relink_command="$finalize_var$finalize_command$finalize_rpath"
+
+       func_warning "this platform does not like uninstalled shared libraries"
+       func_warning "\`$output' will be relinked during installation"
+      else
+       if test "$fast_install" != no; then
+         link_command="$finalize_var$compile_command$finalize_rpath"
+         if test "$fast_install" = yes; then
+           relink_command=`$ECHO "$compile_var$compile_command$compile_rpath" | $SED 's%@OUTPUT@%\$progdir/\$file%g'`
+         else
+           # fast_install is set to needless
+           relink_command=
+         fi
+       else
+         link_command="$compile_var$compile_command$compile_rpath"
+         relink_command="$finalize_var$finalize_command$finalize_rpath"
+       fi
+      fi
+
+      # Replace the output file specification.
+      link_command=`$ECHO "$link_command" | $SED 's%@OUTPUT@%'"$output_objdir/$outputname"'%g'`
+
+      # Delete the old output files.
+      $opt_dry_run || $RM $output $output_objdir/$outputname $output_objdir/lt-$outputname
+
+      func_show_eval "$link_command" 'exit $?'
+
+      if test -n "$postlink_cmds"; then
+       func_to_tool_file "$output_objdir/$outputname"
+       postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+       func_execute_cmds "$postlink_cmds" 'exit $?'
+      fi
+
+      # Now create the wrapper script.
+      func_verbose "creating $output"
+
+      # Quote the relink command for shipping.
+      if test -n "$relink_command"; then
+       # Preserve any variables that may affect compiler behavior
+       for var in $variables_saved_for_relink; do
+         if eval test -z \"\${$var+set}\"; then
+           relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+         elif eval var_value=\$$var; test -z "$var_value"; then
+           relink_command="$var=; export $var; $relink_command"
+         else
+           func_quote_for_eval "$var_value"
+           relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+         fi
+       done
+       relink_command="(cd `pwd`; $relink_command)"
+       relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      fi
+
+      # Only actually do things if not in dry run mode.
+      $opt_dry_run || {
+       # win32 will think the script is a binary if it has
+       # a .exe suffix, so we strip it off here.
+       case $output in
+         *.exe) func_stripname '' '.exe' "$output"
+                output=$func_stripname_result ;;
+       esac
+       # test for cygwin because mv fails w/o .exe extensions
+       case $host in
+         *cygwin*)
+           exeext=.exe
+           func_stripname '' '.exe' "$outputname"
+           outputname=$func_stripname_result ;;
+         *) exeext= ;;
+       esac
+       case $host in
+         *cygwin* | *mingw* )
+           func_dirname_and_basename "$output" "" "."
+           output_name=$func_basename_result
+           output_path=$func_dirname_result
+           cwrappersource="$output_path/$objdir/lt-$output_name.c"
+           cwrapper="$output_path/$output_name.exe"
+           $RM $cwrappersource $cwrapper
+           trap "$RM $cwrappersource $cwrapper; exit $EXIT_FAILURE" 1 2 15
+
+           func_emit_cwrapperexe_src > $cwrappersource
+
+           # The wrapper executable is built using the $host compiler,
+           # because it contains $host paths and files. If cross-
+           # compiling, it, like the target executable, must be
+           # executed on the $host or under an emulation environment.
+           $opt_dry_run || {
+             $LTCC $LTCFLAGS -o $cwrapper $cwrappersource
+             $STRIP $cwrapper
+           }
+
+           # Now, create the wrapper script for func_source use:
+           func_ltwrapper_scriptname $cwrapper
+           $RM $func_ltwrapper_scriptname_result
+           trap "$RM $func_ltwrapper_scriptname_result; exit $EXIT_FAILURE" 1 2 15
+           $opt_dry_run || {
+             # note: this script will not be executed, so do not chmod.
+             if test "x$build" = "x$host" ; then
+               $cwrapper --lt-dump-script > $func_ltwrapper_scriptname_result
+             else
+               func_emit_wrapper no > $func_ltwrapper_scriptname_result
+             fi
+           }
+         ;;
+         * )
+           $RM $output
+           trap "$RM $output; exit $EXIT_FAILURE" 1 2 15
+
+           func_emit_wrapper no > $output
+           chmod +x $output
+         ;;
+       esac
+      }
+      exit $EXIT_SUCCESS
+      ;;
+    esac
+
+    # See if we need to build an old-fashioned archive.
+    for oldlib in $oldlibs; do
+
+      if test "$build_libtool_libs" = convenience; then
+       oldobjs="$libobjs_save $symfileobj"
+       addlibs="$convenience"
+       build_libtool_libs=no
+      else
+       if test "$build_libtool_libs" = module; then
+         oldobjs="$libobjs_save"
+         build_libtool_libs=no
+       else
+         oldobjs="$old_deplibs $non_pic_objects"
+         if test "$preload" = yes && test -f "$symfileobj"; then
+           func_append oldobjs " $symfileobj"
+         fi
+       fi
+       addlibs="$old_convenience"
+      fi
+
+      if test -n "$addlibs"; then
+       gentop="$output_objdir/${outputname}x"
+       func_append generated " $gentop"
+
+       func_extract_archives $gentop $addlibs
+       func_append oldobjs " $func_extract_archives_result"
+      fi
+
+      # Do each command in the archive commands.
+      if test -n "$old_archive_from_new_cmds" && test "$build_libtool_libs" = yes; then
+       cmds=$old_archive_from_new_cmds
+      else
+
+       # Add any objects from preloaded convenience libraries
+       if test -n "$dlprefiles"; then
+         gentop="$output_objdir/${outputname}x"
+         func_append generated " $gentop"
+
+         func_extract_archives $gentop $dlprefiles
+         func_append oldobjs " $func_extract_archives_result"
+       fi
+
+       # POSIX demands no paths to be encoded in archives.  We have
+       # to avoid creating archives with duplicate basenames if we
+       # might have to extract them afterwards, e.g., when creating a
+       # static archive out of a convenience library, or when linking
+       # the entirety of a libtool archive into another (currently
+       # not supported by libtool).
+       if (for obj in $oldobjs
+           do
+             func_basename "$obj"
+             $ECHO "$func_basename_result"
+           done | sort | sort -uc >/dev/null 2>&1); then
+         :
+       else
+         echo "copying selected object files to avoid basename conflicts..."
+         gentop="$output_objdir/${outputname}x"
+         func_append generated " $gentop"
+         func_mkdir_p "$gentop"
+         save_oldobjs=$oldobjs
+         oldobjs=
+         counter=1
+         for obj in $save_oldobjs
+         do
+           func_basename "$obj"
+           objbase="$func_basename_result"
+           case " $oldobjs " in
+           " ") oldobjs=$obj ;;
+           *[\ /]"$objbase "*)
+             while :; do
+               # Make sure we don't pick an alternate name that also
+               # overlaps.
+               newobj=lt$counter-$objbase
+               func_arith $counter + 1
+               counter=$func_arith_result
+               case " $oldobjs " in
+               *[\ /]"$newobj "*) ;;
+               *) if test ! -f "$gentop/$newobj"; then break; fi ;;
+               esac
+             done
+             func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
+             func_append oldobjs " $gentop/$newobj"
+             ;;
+           *) func_append oldobjs " $obj" ;;
+           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"
+       len=$func_len_result
+       if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+         cmds=$old_archive_cmds
+       elif test -n "$archiver_list_spec"; then
+         func_verbose "using command file archive linking..."
+         for obj in $oldobjs
+         do
+           func_to_tool_file "$obj"
+           $ECHO "$func_to_tool_file_result"
+         done > $output_objdir/$libname.libcmd
+         func_to_tool_file "$output_objdir/$libname.libcmd"
+         oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+         cmds=$old_archive_cmds
+       else
+         # the command line is too long to link in one step, link in parts
+         func_verbose "using piecewise archive linking..."
+         save_RANLIB=$RANLIB
+         RANLIB=:
+         objlist=
+         concat_cmds=
+         save_oldobjs=$oldobjs
+         oldobjs=
+         # Is there a better way of finding the last object in the list?
+         for obj in $save_oldobjs
+         do
+           last_oldobj=$obj
+         done
+         eval test_cmds=\"$old_archive_cmds\"
+         func_len " $test_cmds"
+         len0=$func_len_result
+         len=$len0
+         for obj in $save_oldobjs
+         do
+           func_len " $obj"
+           func_arith $len + $func_len_result
+           len=$func_arith_result
+           func_append objlist " $obj"
+           if test "$len" -lt "$max_cmd_len"; then
+             :
+           else
+             # the above command should be used before it gets too long
+             oldobjs=$objlist
+             if test "$obj" = "$last_oldobj" ; then
+               RANLIB=$save_RANLIB
+             fi
+             test -z "$concat_cmds" || concat_cmds=$concat_cmds~
+             eval concat_cmds=\"\${concat_cmds}$old_archive_cmds\"
+             objlist=
+             len=$len0
+           fi
+         done
+         RANLIB=$save_RANLIB
+         oldobjs=$objlist
+         if test "X$oldobjs" = "X" ; then
+           eval cmds=\"\$concat_cmds\"
+         else
+           eval cmds=\"\$concat_cmds~\$old_archive_cmds\"
+         fi
+       fi
+      fi
+      func_execute_cmds "$cmds" 'exit $?'
+    done
+
+    test -n "$generated" && \
+      func_show_eval "${RM}r$generated"
+
+    # Now create the libtool archive.
+    case $output in
+    *.la)
+      old_library=
+      test "$build_old_libs" = yes && old_library="$libname.$libext"
+      func_verbose "creating $output"
+
+      # Preserve any variables that may affect compiler behavior
+      for var in $variables_saved_for_relink; do
+       if eval test -z \"\${$var+set}\"; then
+         relink_command="{ test -z \"\${$var+set}\" || $lt_unset $var || { $var=; export $var; }; }; $relink_command"
+       elif eval var_value=\$$var; test -z "$var_value"; then
+         relink_command="$var=; export $var; $relink_command"
+       else
+         func_quote_for_eval "$var_value"
+         relink_command="$var=$func_quote_for_eval_result; export $var; $relink_command"
+       fi
+      done
+      # Quote the link command for shipping.
+      relink_command="(cd `pwd`; $SHELL $progpath $preserve_args --mode=relink $libtool_args @inst_prefix_dir@)"
+      relink_command=`$ECHO "$relink_command" | $SED "$sed_quote_subst"`
+      if test "$hardcode_automatic" = yes ; then
+       relink_command=
+      fi
+
+      # Only create the output if not a dry run.
+      $opt_dry_run || {
+       for installed in no yes; do
+         if test "$installed" = yes; then
+           if test -z "$install_libdir"; then
+             break
+           fi
+           output="$output_objdir/$outputname"i
+           # Replace all uninstalled libtool libraries with the installed ones
+           newdependency_libs=
+           for deplib in $dependency_libs; do
+             case $deplib in
+             *.la)
+               func_basename "$deplib"
+               name="$func_basename_result"
+               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"
+               ;;
+             -L*)
+               func_stripname -L '' "$deplib"
+               func_replace_sysroot "$func_stripname_result"
+               func_append newdependency_libs " -L$func_replace_sysroot_result"
+               ;;
+             -R*)
+               func_stripname -R '' "$deplib"
+               func_replace_sysroot "$func_stripname_result"
+               func_append newdependency_libs " -R$func_replace_sysroot_result"
+               ;;
+             *) func_append newdependency_libs " $deplib" ;;
+             esac
+           done
+           dependency_libs="$newdependency_libs"
+           newdlfiles=
+
+           for lib in $dlfiles; do
+             case $lib in
+             *.la)
+               func_basename "$lib"
+               name="$func_basename_result"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "\`$lib' is not a valid libtool archive"
+               func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
+               ;;
+             *) func_append newdlfiles " $lib" ;;
+             esac
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+             *.la)
+               # Only pass preopened files to the pseudo-archive (for
+               # eventual linking with the app. that links it) if we
+               # didn't already link the preopened objects directly into
+               # the library:
+               func_basename "$lib"
+               name="$func_basename_result"
+               eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
+               test -z "$libdir" && \
+                 func_fatal_error "\`$lib' is not a valid libtool archive"
+               func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
+               ;;
+             esac
+           done
+           dlprefiles="$newdlprefiles"
+         else
+           newdlfiles=
+           for lib in $dlfiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             func_append newdlfiles " $abs"
+           done
+           dlfiles="$newdlfiles"
+           newdlprefiles=
+           for lib in $dlprefiles; do
+             case $lib in
+               [\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
+               *) abs=`pwd`"/$lib" ;;
+             esac
+             func_append newdlprefiles " $abs"
+           done
+           dlprefiles="$newdlprefiles"
+         fi
+         $RM $output
+         # place dlname in correct position for cygwin
+         # In fact, it would be nice if we could use this code for all target
+         # systems that can't hard-code library paths into their executables
+         # and that have no shared library path variable independent of PATH,
+         # but it turns out we can't easily determine that from inspecting
+         # libtool variables, so we have to hard-code the OSs to which it
+         # applies here; at the moment, that means platforms that use the PE
+         # object format with DLL files.  See the long comment at the top of
+         # tests/bindir.at for full details.
+         tdlname=$dlname
+         case $host,$output,$installed,$module,$dlname in
+           *cygwin*,*lai,yes,no,*.dll | *mingw*,*lai,yes,no,*.dll | *cegcc*,*lai,yes,no,*.dll)
+             # If a -bindir argument was supplied, place the dll there.
+             if test "x$bindir" != x ;
+             then
+               func_relative_path "$install_libdir" "$bindir"
+               tdlname=$func_relative_path_result$dlname
+             else
+               # Otherwise fall back on heuristic.
+               tdlname=../bin/$dlname
+             fi
+             ;;
+         esac
+         $ECHO > $output "\
+# $outputname - a libtool library file
+# Generated by $PROGRAM (GNU $PACKAGE$TIMESTAMP) $VERSION
+#
+# Please DO NOT delete this file!
+# It is necessary for linking the library.
+
+# The name that we can dlopen(3).
+dlname='$tdlname'
+
+# Names of this library.
+library_names='$library_names'
+
+# The name of the static archive.
+old_library='$old_library'
+
+# Linker flags that can not go in dependency_libs.
+inherited_linker_flags='$new_inherited_linker_flags'
+
+# Libraries that this one depends upon.
+dependency_libs='$dependency_libs'
+
+# Names of additional weak libraries provided by this library
+weak_library_names='$weak_libs'
+
+# Version information for $libname.
+current=$current
+age=$age
+revision=$revision
+
+# Is this an already installed library?
+installed=$installed
+
+# Should we warn about portability when linking against -modules?
+shouldnotlink=$module
+
+# Files to dlopen/dlpreopen
+dlopen='$dlfiles'
+dlpreopen='$dlprefiles'
+
+# Directory that this library needs to be installed in:
+libdir='$install_libdir'"
+         if test "$installed" = no && test "$need_relink" = yes; then
+           $ECHO >> $output "\
+relink_command=\"$relink_command\""
+         fi
+       done
+      }
+
+      # Do a symbolic link so that the libtool archive can be found in
+      # LD_LIBRARY_PATH before the program is installed.
+      func_show_eval '( cd "$output_objdir" && $RM "$outputname" && $LN_S "../$outputname" "$outputname" )' 'exit $?'
+      ;;
+    esac
+    exit $EXIT_SUCCESS
+}
+
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
+    func_mode_link ${1+"$@"}
+
+
+# func_mode_uninstall arg...
+func_mode_uninstall ()
+{
+    $opt_debug
+    RM="$nonopt"
+    files=
+    rmforce=
+    exit_status=0
+
+    # This variable tells wrapper scripts just to set variables rather
+    # than running their programs.
+    libtool_install_magic="$magic"
+
+    for arg
+    do
+      case $arg in
+      -f) func_append RM " $arg"; rmforce=yes ;;
+      -*) func_append RM " $arg" ;;
+      *) func_append files " $arg" ;;
+      esac
+    done
+
+    test -z "$RM" && \
+      func_fatal_help "you must specify an RM program"
+
+    rmdirs=
+
+    for file in $files; do
+      func_dirname "$file" "" "."
+      dir="$func_dirname_result"
+      if test "X$dir" = X.; then
+       odir="$objdir"
+      else
+       odir="$dir/$objdir"
+      fi
+      func_basename "$file"
+      name="$func_basename_result"
+      test "$opt_mode" = uninstall && odir="$dir"
+
+      # Remember odir for removal later, being careful to avoid duplicates
+      if test "$opt_mode" = clean; then
+       case " $rmdirs " in
+         *" $odir "*) ;;
+         *) func_append rmdirs " $odir" ;;
+       esac
+      fi
+
+      # Don't error if the file doesn't exist and rm -f was used.
+      if { test -L "$file"; } >/dev/null 2>&1 ||
+        { test -h "$file"; } >/dev/null 2>&1 ||
+        test -f "$file"; then
+       :
+      elif test -d "$file"; then
+       exit_status=1
+       continue
+      elif test "$rmforce" = yes; then
+       continue
+      fi
+
+      rmfiles="$file"
+
+      case $name in
+      *.la)
+       # Possibly a libtool archive, so verify it.
+       if func_lalib_p "$file"; then
+         func_source $dir/$name
+
+         # Delete the libtool libraries and symlinks.
+         for n in $library_names; do
+           func_append rmfiles " $odir/$n"
+         done
+         test -n "$old_library" && func_append rmfiles " $odir/$old_library"
+
+         case "$opt_mode" in
+         clean)
+           case " $library_names " in
+           *" $dlname "*) ;;
+           *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
+           esac
+           test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
+           ;;
+         uninstall)
+           if test -n "$library_names"; then
+             # Do each command in the postuninstall commands.
+             func_execute_cmds "$postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+           fi
+
+           if test -n "$old_library"; then
+             # Do each command in the old_postuninstall commands.
+             func_execute_cmds "$old_postuninstall_cmds" 'test "$rmforce" = yes || exit_status=1'
+           fi
+           # FIXME: should reinstall the best remaining shared library.
+           ;;
+         esac
+       fi
+       ;;
+
+      *.lo)
+       # Possibly a libtool object, so verify it.
+       if func_lalib_p "$file"; then
+
+         # Read the .lo file
+         func_source $dir/$name
+
+         # Add PIC object to the list of files to remove.
+         if test -n "$pic_object" &&
+            test "$pic_object" != none; then
+           func_append rmfiles " $dir/$pic_object"
+         fi
+
+         # Add non-PIC object to the list of files to remove.
+         if test -n "$non_pic_object" &&
+            test "$non_pic_object" != none; then
+           func_append rmfiles " $dir/$non_pic_object"
+         fi
+       fi
+       ;;
+
+      *)
+       if test "$opt_mode" = clean ; then
+         noexename=$name
+         case $file in
+         *.exe)
+           func_stripname '' '.exe' "$file"
+           file=$func_stripname_result
+           func_stripname '' '.exe' "$name"
+           noexename=$func_stripname_result
+           # $file with .exe has already been added to rmfiles,
+           # add $file without .exe
+           func_append rmfiles " $file"
+           ;;
+         esac
+         # Do a test to see if this is a libtool program.
+         if func_ltwrapper_p "$file"; then
+           if func_ltwrapper_executable_p "$file"; then
+             func_ltwrapper_scriptname "$file"
+             relink_command=
+             func_source $func_ltwrapper_scriptname_result
+             func_append rmfiles " $func_ltwrapper_scriptname_result"
+           else
+             relink_command=
+             func_source $dir/$noexename
+           fi
+
+           # note $name still contains .exe if it was in $file originally
+           # as does the version of $file that was added into $rmfiles
+           func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
+           if test "$fast_install" = yes && test -n "$relink_command"; then
+             func_append rmfiles " $odir/lt-$name"
+           fi
+           if test "X$noexename" != "X$name" ; then
+             func_append rmfiles " $odir/lt-${noexename}.c"
+           fi
+         fi
+       fi
+       ;;
+      esac
+      func_show_eval "$RM $rmfiles" 'exit_status=1'
+    done
+
+    # Try to remove the ${objdir}s in the directories where we deleted files
+    for dir in $rmdirs; do
+      if test -d "$dir"; then
+       func_show_eval "rmdir $dir >/dev/null 2>&1"
+      fi
+    done
+
+    exit $exit_status
+}
+
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
+    func_mode_uninstall ${1+"$@"}
+
+test -z "$opt_mode" && {
+  help="$generic_help"
+  func_fatal_help "you must specify a MODE"
+}
+
+test -z "$exec_cmd" && \
+  func_fatal_help "invalid operation mode \`$opt_mode'"
+
+if test -n "$exec_cmd"; then
+  eval exec "$exec_cmd"
+  exit $EXIT_FAILURE
+fi
+
+exit $exit_status
+
+
+# The TAGs below are defined such that we never get into a situation
+# in which we disable both kinds of libraries.  Given conflicting
+# choices, we go for a static library, that is the most portable,
+# since we can't tell whether shared libraries were disabled because
+# the user asked for that or because the platform doesn't support
+# them.  This is particularly important on AIX, because we don't
+# support having both static and shared libraries enabled at the same
+# time on that platform, so we default to a shared-only configuration.
+# If a disable-shared tag is given, we'll fallback to a static-only
+# configuration.  But we'll never go from static-only to shared-only.
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-shared
+build_libtool_libs=no
+build_old_libs=yes
+# ### END LIBTOOL TAG CONFIG: disable-shared
+
+# ### BEGIN LIBTOOL TAG CONFIG: disable-static
+build_old_libs=`case $build_libtool_libs in yes) echo no;; *) echo yes;; esac`
+# ### END LIBTOOL TAG CONFIG: disable-static
+
+# Local Variables:
+# mode:shell-script
+# sh-indentation:2
+# End:
+# vi:sw=2
+
diff --git a/zfs/config/ltoptions.m4 b/zfs/config/ltoptions.m4
new file mode 100644 (file)
index 0000000..5d9acd8
--- /dev/null
@@ -0,0 +1,384 @@
+# Helper functions for option handling.                    -*- Autoconf -*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
+#   Inc.
+#   Written by Gary V. Vaughan, 2004
+#
+# 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 7 ltoptions.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
+
+
+# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
+# ------------------------------------------
+m4_define([_LT_MANGLE_OPTION],
+[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
+
+
+# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
+# ---------------------------------------
+# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
+# matching handler defined, dispatch to it.  Other OPTION-NAMEs are
+# saved as a flag.
+m4_define([_LT_SET_OPTION],
+[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
+m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
+        _LT_MANGLE_DEFUN([$1], [$2]),
+    [m4_warning([Unknown $1 option `$2'])])[]dnl
+])
+
+
+# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
+# ------------------------------------------------------------
+# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
+m4_define([_LT_IF_OPTION],
+[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
+
+
+# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
+# -------------------------------------------------------
+# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
+# are set.
+m4_define([_LT_UNLESS_OPTIONS],
+[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+           [m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
+                     [m4_define([$0_found])])])[]dnl
+m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
+])[]dnl
+])
+
+
+# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
+# ----------------------------------------
+# OPTION-LIST is a space-separated list of Libtool options associated
+# with MACRO-NAME.  If any OPTION has a matching handler declared with
+# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
+# the unknown option and exit.
+m4_defun([_LT_SET_OPTIONS],
+[# Set options
+m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
+    [_LT_SET_OPTION([$1], _LT_Option)])
+
+m4_if([$1],[LT_INIT],[
+  dnl
+  dnl Simply set some default values (i.e off) if boolean options were not
+  dnl specified:
+  _LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
+  ])
+  _LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
+  ])
+  dnl
+  dnl If no reference was made to various pairs of opposing options, then
+  dnl we run the default mode handler for the pair.  For example, if neither
+  dnl `shared' nor `disable-shared' was passed, we enable building of shared
+  dnl archives by default:
+  _LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
+  _LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
+  _LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
+                  [_LT_ENABLE_FAST_INSTALL])
+  ])
+])# _LT_SET_OPTIONS
+
+
+## --------------------------------- ##
+## Macros to handle LT_INIT options. ##
+## --------------------------------- ##
+
+# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
+# -----------------------------------------
+m4_define([_LT_MANGLE_DEFUN],
+[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
+
+
+# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
+# -----------------------------------------------
+m4_define([LT_OPTION_DEFINE],
+[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
+])# LT_OPTION_DEFINE
+
+
+# dlopen
+# ------
+LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
+])
+
+AU_DEFUN([AC_LIBTOOL_DLOPEN],
+[_LT_SET_OPTION([LT_INIT], [dlopen])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `dlopen' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
+
+
+# win32-dll
+# ---------
+# Declare package support for building win32 dll's.
+LT_OPTION_DEFINE([LT_INIT], [win32-dll],
+[enable_win32_dll=yes
+
+case $host in
+*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
+  AC_CHECK_TOOL(AS, as, false)
+  AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+  AC_CHECK_TOOL(OBJDUMP, objdump, false)
+  ;;
+esac
+
+test -z "$AS" && AS=as
+_LT_DECL([], [AS],      [1], [Assembler program])dnl
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
+])# win32-dll
+
+AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+_LT_SET_OPTION([LT_INIT], [win32-dll])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `win32-dll' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
+
+
+# _LT_ENABLE_SHARED([DEFAULT])
+# ----------------------------
+# implement the --enable-shared flag, and supports the `shared' and
+# `disable-shared' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_SHARED],
+[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([shared],
+    [AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
+       [build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
+
+    _LT_DECL([build_libtool_libs], [enable_shared], [0],
+       [Whether or not to build shared libraries])
+])# _LT_ENABLE_SHARED
+
+LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
+])
+
+AC_DEFUN([AC_DISABLE_SHARED],
+[_LT_SET_OPTION([LT_INIT], [disable-shared])
+])
+
+AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
+AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_SHARED], [])
+dnl AC_DEFUN([AM_DISABLE_SHARED], [])
+
+
+
+# _LT_ENABLE_STATIC([DEFAULT])
+# ----------------------------
+# implement the --enable-static flag, and support the `static' and
+# `disable-static' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_STATIC],
+[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([static],
+    [AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
+       [build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_static=]_LT_ENABLE_STATIC_DEFAULT)
+
+    _LT_DECL([build_old_libs], [enable_static], [0],
+       [Whether or not to build static libraries])
+])# _LT_ENABLE_STATIC
+
+LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
+
+# Old names:
+AC_DEFUN([AC_ENABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
+])
+
+AC_DEFUN([AC_DISABLE_STATIC],
+[_LT_SET_OPTION([LT_INIT], [disable-static])
+])
+
+AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
+AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AM_ENABLE_STATIC], [])
+dnl AC_DEFUN([AM_DISABLE_STATIC], [])
+
+
+
+# _LT_ENABLE_FAST_INSTALL([DEFAULT])
+# ----------------------------------
+# implement the --enable-fast-install flag, and support the `fast-install'
+# and `disable-fast-install' LT_INIT options.
+# DEFAULT is either `yes' or `no'.  If omitted, it defaults to `yes'.
+m4_define([_LT_ENABLE_FAST_INSTALL],
+[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
+AC_ARG_ENABLE([fast-install],
+    [AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
+    [optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
+    [p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac],
+    [enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
+
+_LT_DECL([fast_install], [enable_fast_install], [0],
+        [Whether or not to optimize for fast installation])dnl
+])# _LT_ENABLE_FAST_INSTALL
+
+LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
+LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
+
+# Old names:
+AU_DEFUN([AC_ENABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `fast-install' option into LT_INIT's first parameter.])
+])
+
+AU_DEFUN([AC_DISABLE_FAST_INSTALL],
+[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you put
+the `disable-fast-install' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
+dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
+
+
+# _LT_WITH_PIC([MODE])
+# --------------------
+# implement the --with-pic flag, and support the `pic-only' and `no-pic'
+# LT_INIT options.
+# 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@<:@=PKGS@:>@],
+       [try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
+    [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])
+
+_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
+])# _LT_WITH_PIC
+
+LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
+LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
+
+# Old name:
+AU_DEFUN([AC_LIBTOOL_PICMODE],
+[_LT_SET_OPTION([LT_INIT], [pic-only])
+AC_DIAGNOSE([obsolete],
+[$0: Remove this warning and the call to _LT_SET_OPTION when you
+put the `pic-only' option into LT_INIT's first parameter.])
+])
+
+dnl aclocal-1.4 backwards compatibility:
+dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
+
+## ----------------- ##
+## LTDL_INIT Options ##
+## ----------------- ##
+
+m4_define([_LTDL_MODE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
+                [m4_define([_LTDL_MODE], [nonrecursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [recursive],
+                [m4_define([_LTDL_MODE], [recursive])])
+LT_OPTION_DEFINE([LTDL_INIT], [subproject],
+                [m4_define([_LTDL_MODE], [subproject])])
+
+m4_define([_LTDL_TYPE], [])
+LT_OPTION_DEFINE([LTDL_INIT], [installable],
+                [m4_define([_LTDL_TYPE], [installable])])
+LT_OPTION_DEFINE([LTDL_INIT], [convenience],
+                [m4_define([_LTDL_TYPE], [convenience])])
diff --git a/zfs/config/ltsugar.m4 b/zfs/config/ltsugar.m4
new file mode 100644 (file)
index 0000000..9000a05
--- /dev/null
@@ -0,0 +1,123 @@
+# ltsugar.m4 -- libtool m4 base layer.                         -*-Autoconf-*-
+#
+# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
+# Written by Gary V. Vaughan, 2004
+#
+# 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 ltsugar.m4
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
+
+
+# lt_join(SEP, ARG1, [ARG2...])
+# -----------------------------
+# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
+# associated separator.
+# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
+# versions in m4sugar had bugs.
+m4_define([lt_join],
+[m4_if([$#], [1], [],
+       [$#], [2], [[$2]],
+       [m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
+m4_define([_lt_join],
+[m4_if([$#$2], [2], [],
+       [m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
+
+
+# lt_car(LIST)
+# lt_cdr(LIST)
+# ------------
+# Manipulate m4 lists.
+# These macros are necessary as long as will still need to support
+# Autoconf-2.59 which quotes differently.
+m4_define([lt_car], [[$1]])
+m4_define([lt_cdr],
+[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
+       [$#], 1, [],
+       [m4_dquote(m4_shift($@))])])
+m4_define([lt_unquote], $1)
+
+
+# lt_append(MACRO-NAME, STRING, [SEPARATOR])
+# ------------------------------------------
+# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
+# Note that neither SEPARATOR nor STRING are expanded; they are appended
+# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
+# No SEPARATOR is output if MACRO-NAME was previously undefined (different
+# than defined and empty).
+#
+# This macro is needed until we can rely on Autoconf 2.62, since earlier
+# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
+m4_define([lt_append],
+[m4_define([$1],
+          m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
+
+
+
+# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
+# ----------------------------------------------------------
+# Produce a SEP delimited list of all paired combinations of elements of
+# PREFIX-LIST with SUFFIX1 through SUFFIXn.  Each element of the list
+# has the form PREFIXmINFIXSUFFIXn.
+# Needed until we can rely on m4_combine added in Autoconf 2.62.
+m4_define([lt_combine],
+[m4_if(m4_eval([$# > 3]), [1],
+       [m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
+[[m4_foreach([_Lt_prefix], [$2],
+            [m4_foreach([_Lt_suffix],
+               ]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
+       [_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
+
+
+# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
+# -----------------------------------------------------------------------
+# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
+# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
+m4_define([lt_if_append_uniq],
+[m4_ifdef([$1],
+         [m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
+                [lt_append([$1], [$2], [$3])$4],
+                [$5])],
+         [lt_append([$1], [$2], [$3])$4])])
+
+
+# lt_dict_add(DICT, KEY, VALUE)
+# -----------------------------
+m4_define([lt_dict_add],
+[m4_define([$1($2)], [$3])])
+
+
+# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
+# --------------------------------------------
+m4_define([lt_dict_add_subkey],
+[m4_define([$1($2:$3)], [$4])])
+
+
+# lt_dict_fetch(DICT, KEY, [SUBKEY])
+# ----------------------------------
+m4_define([lt_dict_fetch],
+[m4_ifval([$3],
+       m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
+    m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
+
+
+# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
+# -----------------------------------------------------------------
+m4_define([lt_if_dict_fetch],
+[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
+       [$5],
+    [$6])])
+
+
+# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
+# --------------------------------------------------------------
+m4_define([lt_dict_filter],
+[m4_if([$5], [], [],
+  [lt_join(m4_quote(m4_default([$4], [[, ]])),
+           lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
+                     [lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
+])
diff --git a/zfs/config/ltversion.m4 b/zfs/config/ltversion.m4
new file mode 100644 (file)
index 0000000..07a8602
--- /dev/null
@@ -0,0 +1,23 @@
+# ltversion.m4 -- version numbers                      -*- Autoconf -*-
+#
+#   Copyright (C) 2004 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004
+#
+# 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.
+
+# @configure_input@
+
+# serial 3337 ltversion.m4
+# This file is part of GNU Libtool
+
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
+
+AC_DEFUN([LTVERSION_VERSION],
+[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)
+])
diff --git a/zfs/config/lt~obsolete.m4 b/zfs/config/lt~obsolete.m4
new file mode 100644 (file)
index 0000000..c573da9
--- /dev/null
@@ -0,0 +1,98 @@
+# lt~obsolete.m4 -- aclocal satisfying obsolete definitions.    -*-Autoconf-*-
+#
+#   Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
+#   Written by Scott James Remnant, 2004.
+#
+# 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 lt~obsolete.m4
+
+# These exist entirely to fool aclocal when bootstrapping libtool.
+#
+# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
+# which have later been changed to m4_define as they aren't part of the
+# exported API, or moved to Autoconf or Automake where they belong.
+#
+# The trouble is, aclocal is a bit thick.  It'll see the old AC_DEFUN
+# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
+# using a macro with the same name in our local m4/libtool.m4 it'll
+# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
+# and doesn't know about Autoconf macros at all.)
+#
+# So we provide this file, which has a silly filename so it's always
+# included after everything else.  This provides aclocal with the
+# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
+# because those macros already exist, or will be overwritten later.
+# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6. 
+#
+# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
+# Yes, that means every name once taken will need to remain here until
+# we give up compatibility with versions before 1.7, at which point
+# we need to keep only those names which we still refer to.
+
+# This is to help aclocal find these macros, as it can't see m4_define.
+AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
+
+m4_ifndef([AC_LIBTOOL_LINKER_OPTION],  [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
+m4_ifndef([AC_PROG_EGREP],             [AC_DEFUN([AC_PROG_EGREP])])
+m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH],        [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_AC_SHELL_INIT],         [AC_DEFUN([_LT_AC_SHELL_INIT])])
+m4_ifndef([_LT_AC_SYS_LIBPATH_AIX],    [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
+m4_ifndef([_LT_PROG_LTMAIN],           [AC_DEFUN([_LT_PROG_LTMAIN])])
+m4_ifndef([_LT_AC_TAGVAR],             [AC_DEFUN([_LT_AC_TAGVAR])])
+m4_ifndef([AC_LTDL_ENABLE_INSTALL],    [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
+m4_ifndef([AC_LTDL_PREOPEN],           [AC_DEFUN([AC_LTDL_PREOPEN])])
+m4_ifndef([_LT_AC_SYS_COMPILER],       [AC_DEFUN([_LT_AC_SYS_COMPILER])])
+m4_ifndef([_LT_AC_LOCK],               [AC_DEFUN([_LT_AC_LOCK])])
+m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE],        [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
+m4_ifndef([_LT_AC_TRY_DLOPEN_SELF],    [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
+m4_ifndef([AC_LIBTOOL_PROG_CC_C_O],    [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
+m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
+m4_ifndef([AC_LIBTOOL_OBJDIR],         [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
+m4_ifndef([AC_LTDL_OBJDIR],            [AC_DEFUN([AC_LTDL_OBJDIR])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
+m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP],  [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
+m4_ifndef([AC_PATH_MAGIC],             [AC_DEFUN([AC_PATH_MAGIC])])
+m4_ifndef([AC_PROG_LD_GNU],            [AC_DEFUN([AC_PROG_LD_GNU])])
+m4_ifndef([AC_PROG_LD_RELOAD_FLAG],    [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
+m4_ifndef([AC_DEPLIBS_CHECK_METHOD],   [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
+m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
+m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
+m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
+m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
+m4_ifndef([LT_AC_PROG_EGREP],          [AC_DEFUN([LT_AC_PROG_EGREP])])
+m4_ifndef([LT_AC_PROG_SED],            [AC_DEFUN([LT_AC_PROG_SED])])
+m4_ifndef([_LT_CC_BASENAME],           [AC_DEFUN([_LT_CC_BASENAME])])
+m4_ifndef([_LT_COMPILER_BOILERPLATE],  [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
+m4_ifndef([_LT_LINKER_BOILERPLATE],    [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
+m4_ifndef([_AC_PROG_LIBTOOL],          [AC_DEFUN([_AC_PROG_LIBTOOL])])
+m4_ifndef([AC_LIBTOOL_SETUP],          [AC_DEFUN([AC_LIBTOOL_SETUP])])
+m4_ifndef([_LT_AC_CHECK_DLFCN],                [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
+m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER],     [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
+m4_ifndef([_LT_AC_TAGCONFIG],          [AC_DEFUN([_LT_AC_TAGCONFIG])])
+m4_ifndef([AC_DISABLE_FAST_INSTALL],   [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
+m4_ifndef([_LT_AC_LANG_CXX],           [AC_DEFUN([_LT_AC_LANG_CXX])])
+m4_ifndef([_LT_AC_LANG_F77],           [AC_DEFUN([_LT_AC_LANG_F77])])
+m4_ifndef([_LT_AC_LANG_GCJ],           [AC_DEFUN([_LT_AC_LANG_GCJ])])
+m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG],  [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
+m4_ifndef([_LT_AC_LANG_C_CONFIG],      [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
+m4_ifndef([_LT_AC_LANG_CXX_CONFIG],    [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
+m4_ifndef([_LT_AC_LANG_F77_CONFIG],    [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG],        [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
+m4_ifndef([_LT_AC_LANG_GCJ_CONFIG],    [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
+m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
+m4_ifndef([_LT_AC_LANG_RC_CONFIG],     [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
+m4_ifndef([AC_LIBTOOL_CONFIG],         [AC_DEFUN([AC_LIBTOOL_CONFIG])])
+m4_ifndef([_LT_AC_FILE_LTDLL_C],       [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
+m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS],        [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
+m4_ifndef([_LT_AC_PROG_CXXCPP],                [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
+m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS],        [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
+m4_ifndef([_LT_PROG_ECHO_BACKSLASH],   [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
+m4_ifndef([_LT_PROG_F77],              [AC_DEFUN([_LT_PROG_F77])])
+m4_ifndef([_LT_PROG_FC],               [AC_DEFUN([_LT_PROG_FC])])
+m4_ifndef([_LT_PROG_CXX],              [AC_DEFUN([_LT_PROG_CXX])])
diff --git a/zfs/config/missing b/zfs/config/missing
new file mode 100755 (executable)
index 0000000..f62bbae
--- /dev/null
@@ -0,0 +1,215 @@
+#! /bin/sh
+# Common wrapper for a few potentially missing GNU programs.
+
+scriptversion=2013-10-28.13; # UTC
+
+# Copyright (C) 1996-2014 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 'autom4te' 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:
diff --git a/zfs/config/suppressed-warnings.txt b/zfs/config/suppressed-warnings.txt
deleted file mode 100644 (file)
index 621e3cd..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-#
-# Expected warnings which should be suppressed by buildbot
-#
-None : ^libtool: install: warning: relinking `.*'$
-None : ^libtool: install: warning: remember to run `libtool --finish .*'$
-None : ^libtool: install: warning: `.*' has not been installed in `.*'$
-None : ^warning: File listed twice:.*
index 7f79420825645423613a3de472a73534522466c8..a86b5524a4e8a51e76da183c9f35f21548ee752a 100644 (file)
@@ -2,6 +2,7 @@ dnl #
 dnl # Default ZFS user configuration
 dnl #
 AC_DEFUN([ZFS_AC_CONFIG_USER], [
+       ZFS_AC_DKMS_INHIBIT
        ZFS_AC_CONFIG_USER_MOUNT_HELPER
        ZFS_AC_CONFIG_USER_UDEV
        ZFS_AC_CONFIG_USER_SYSTEMD
index f93c5b5d4ccad503c1dadd1b11e83e6106aec633..9eda5d9c34e0f56fd5a59a19f4bf82a1e9cbd351 100644 (file)
@@ -87,10 +87,10 @@ AC_DEFUN([ZFS_AC_CONFIG], [
        ZFS_AC_CONFIG_ALWAYS
 
        case "$ZFS_CONFIG" in
-               kernel) ZFS_AC_CONFIG_KERNEL ;;
                user)   ZFS_AC_CONFIG_USER   ;;
-               all)    ZFS_AC_CONFIG_KERNEL
-                       ZFS_AC_CONFIG_USER   ;;
+               kernel) ZFS_AC_CONFIG_KERNEL ;;
+               all)    ZFS_AC_CONFIG_USER
+                       ZFS_AC_CONFIG_KERNEL ;;
                srpm)                        ;;
                *)
                AC_MSG_RESULT([Error!])
index 7c92dd541e49e23bdef1b42a0bbd62fa9c0ea0c4..d174cccc7a1e98e501c7514ce00990e4ae20bbb6 100644 (file)
@@ -1,9 +1,10 @@
 dnl #
 dnl # DESCRIPTION:
-dnl # Read meta data from the META file.  When building from a git repository
-dnl # the ZFS_META_RELEASE field will be overwritten if there is an annotated
-dnl # tag matching the form ZFS_META_NAME-ZFS_META_VERSION-*.  This allows
-dnl # for working builds to be uniquely identified using the git commit hash.
+dnl # Read meta data from the META file or the debian/changelog file if it
+dnl # exists.  When building from a git repository the ZFS_META_RELEASE field
+dnl # will be overwritten if there is an annotated tag matching the form
+dnl # ZFS_META_NAME-ZFS_META_VERSION-*.  This allows for working builds to be
+dnl # uniquely identified using the git commit hash.
 dnl #
 dnl #    The META file format is as follows:
 dnl #      ^[ ]*KEY:[ \t]+VALUE$
@@ -49,6 +50,7 @@ AC_DEFUN([ZFS_AC_META], [
        _zfs_ac_meta_type="none"
        if test -f "$META"; then
                _zfs_ac_meta_type="META file"
+               _dpkg_parsechangelog=$(dpkg-parsechangelog 2>/dev/null)
 
                ZFS_META_NAME=_ZFS_AC_META_GETVAL([(Name|Project|Package)]);
                if test -n "$ZFS_META_NAME"; then
@@ -66,8 +68,30 @@ AC_DEFUN([ZFS_AC_META], [
                        AC_SUBST([ZFS_META_VERSION])
                fi
 
+               if test -n "${_dpkg_parsechangelog}"; then
+                       _dpkg_version=$(echo "${_dpkg_parsechangelog}" \
+                               | $AWK '$[]1 == "Version:" { print $[]2; }' \
+                               | cut -d- -f1)
+                       if test "${_dpkg_version}" != "$ZFS_META_VERSION"; then
+                               AC_MSG_ERROR([
+       *** Version $ZFS_META_VERSION in the META file is different than
+       *** version $_dpkg_version in the debian/changelog file. DKMS and DEB
+       *** packaging require that these files have the same version.
+                               ])
+                       fi
+               fi
+
                ZFS_META_RELEASE=_ZFS_AC_META_GETVAL([Release]);
-               if test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
+
+               if test -n "${_dpkg_parsechangelog}"; then
+                       _dpkg_release=$(echo "${_dpkg_parsechangelog}" \
+                               | $AWK '$[]1 == "Version:" { print $[]2; }' \
+                               | cut -d- -f2-)
+                       if test -n "${_dpkg_release}"; then
+                               ZFS_META_RELEASE=${_dpkg_release}
+                               _zfs_ac_meta_type="dpkg-parsechangelog"
+                       fi
+               elif test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
                        _match="${ZFS_META_NAME}-${ZFS_META_VERSION}"
                        _alias=$(git describe --match=${_match} 2>/dev/null)
                        _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')
diff --git a/zfs/configure b/zfs/configure
new file mode 100755 (executable)
index 0000000..fdbe862
--- /dev/null
@@ -0,0 +1,33227 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.69 for zfs 0.6.5.4.
+#
+#
+# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc.
+#
+#
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+# Use a proper internal environment variable to ensure we don't fall
+  # into an infinite loop, continuously re-executing ourselves.
+  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
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '\${1+\"\$@\"}'='\"\$@\"'
+  setopt NO_GLOB_SUBST
+else
+  case \`(set -o) 2>/dev/null\` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+"
+  as_required="as_fn_return () { (exit \$1); }
+as_fn_success () { as_fn_return 0; }
+as_fn_failure () { as_fn_return 1; }
+as_fn_ret_success () { return 0; }
+as_fn_ret_failure () { return 1; }
+
+exitcode=0
+as_fn_success || { exitcode=1; echo as_fn_success failed.; }
+as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; }
+as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; }
+as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; }
+if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then :
+
+else
+  exitcode=1; echo positional parameters were not saved.
+fi
+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'\" &&
+  test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1
+
+  test -n \"\${ZSH_VERSION+set}\${BASH_VERSION+set}\" || (
+    ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    ECHO=\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO\$ECHO
+    PATH=/empty FPATH=/empty; export PATH FPATH
+    test \"X\`printf %s \$ECHO\`\" = \"X\$ECHO\" \\
+      || test \"X\`print -r -- \$ECHO\`\" = \"X\$ECHO\" ) || exit 1
+test \$(( 1 + 1 )) = 2 || exit 1"
+  if (eval "$as_required") 2>/dev/null; then :
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+  if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then :
+
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+as_found=false
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  as_found=:
+  case $as_dir in #(
+        /*)
+          for as_base in sh bash ksh sh5; do
+            # Try only shells that exist, to save several forks.
+            as_shell=$as_dir/$as_base
+            if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+                   { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  CONFIG_SHELL=$as_shell as_have_required=yes
+                  if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then :
+  break 2
+fi
+fi
+          done;;
+       esac
+  as_found=false
+done
+$as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } &&
+             { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then :
+  CONFIG_SHELL=$SHELL as_have_required=yes
+fi; }
+IFS=$as_save_IFS
+
+
+      if test "x$CONFIG_SHELL" != x; then :
+  export CONFIG_SHELL
+             # We cannot yet assume a decent shell, so we have to provide a
+# neutralization value for shells without unset; and this also
+# 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 :
+  $as_echo "$0: This script requires a shell more modern than all"
+  $as_echo "$0: the shells that I found on your system."
+  if test x${ZSH_VERSION+set} = xset ; then
+    $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should"
+    $as_echo "$0: be upgraded to zsh 4.3.4 or later."
+  else
+    $as_echo "$0: Please tell bug-autoconf@gnu.org about your system,
+$0: including any error possibly output before this
+$0: message. Then install a modern shell, or manually run
+$0: the script under such a shell if you do have one."
+  fi
+  exit 1
+fi
+fi
+fi
+SHELL=${CONFIG_SHELL-/bin/sh}
+export SHELL
+# Unset more variables known to interfere with behavior of common tools.
+CLICOLOR_FORCE= GREP_OPTIONS=
+unset CLICOLOR_FORCE GREP_OPTIONS
+
+## --------------------- ##
+## M4sh Shell Functions. ##
+## --------------------- ##
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $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
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+
+  as_lineno_1=$LINENO as_lineno_1a=$LINENO
+  as_lineno_2=$LINENO as_lineno_2a=$LINENO
+  eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" &&
+  test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || {
+  # Blame Lee E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; }
+
+  # 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).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... 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 -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+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'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+
+test -n "$DJDIR" || exec 7<&0 </dev/null
+exec 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+
+# Identity of this package.
+PACKAGE_NAME='zfs'
+PACKAGE_TARNAME='zfs'
+PACKAGE_VERSION='0.6.5.4'
+PACKAGE_STRING='zfs 0.6.5.4'
+PACKAGE_BUGREPORT=''
+PACKAGE_URL=''
+
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='am__EXEEXT_FALSE
+am__EXEEXT_TRUE
+LTLIBOBJS
+LIBOBJS
+DEBUG_DMU_TX
+DEBUG_ZFS
+DEBUG_STACKFLAGS
+DEBUG_CFLAGS
+CONFIG_KERNEL_FALSE
+CONFIG_KERNEL_TRUE
+CONFIG_USER_FALSE
+CONFIG_USER_TRUE
+KERNELCPPFLAGS
+KERNELMAKE_PARAMS
+SPL_SYMBOLS
+SPL_VERSION
+SPL_OBJ
+SPL
+LINUX_SYMBOLS
+LINUX_VERSION
+LINUX_OBJ
+LINUX
+FRAME_LARGER_THAN
+LIBBLKID
+LIBUUID
+ZLIB
+dracutdir
+ZFS_INIT_SYSV
+modulesloaddir
+systemdpresetdir
+systemdunitdir
+ZFS_MODULE_LOAD
+ZFS_INIT_SYSTEMD
+udevruledir
+udevdir
+mounthelperdir
+NO_BOOL_COMPARE
+NO_UNUSED_BUT_SET_VARIABLE
+ZFS_CONFIG
+TARGET_ASM_DIR
+ALIEN_VERSION
+ALIEN
+HAVE_ALIEN
+DPKGBUILD_VERSION
+DPKGBUILD
+HAVE_DPKGBUILD
+DPKG_VERSION
+DPKG
+HAVE_DPKG
+SRPM_DEFINE_COMMON
+SRPM_DEFINE_DKMS
+SRPM_DEFINE_KMOD
+SRPM_DEFINE_UTIL
+RPM_DEFINE_COMMON
+RPM_DEFINE_DKMS
+RPM_DEFINE_KMOD
+RPM_DEFINE_UTIL
+RPM_SPEC_DIR
+RPMBUILD_VERSION
+RPMBUILD
+HAVE_RPMBUILD
+RPM_VERSION
+RPM
+HAVE_RPM
+DEFINE_INITRAMFS
+DEFAULT_INITCONF_DIR
+DEFAULT_INIT_SCRIPT
+DEFAULT_INIT_DIR
+DEFAULT_PACKAGE
+VENDOR
+am__fastdepCCAS_FALSE
+am__fastdepCCAS_TRUE
+CCASDEPMODE
+CCASFLAGS
+CCAS
+CPP
+OTOOL64
+OTOOL
+LIPO
+NMEDIT
+DSYMUTIL
+MANIFEST_TOOL
+RANLIB
+ac_ct_AR
+AR
+DLLTOOL
+OBJDUMP
+LN_S
+NM
+ac_ct_DUMPBIN
+DUMPBIN
+LD
+FGREP
+EGREP
+GREP
+SED
+LIBTOOL
+am__fastdepCC_FALSE
+am__fastdepCC_TRUE
+CCDEPMODE
+am__nodep
+AMDEPBACKSLASH
+AMDEP_FALSE
+AMDEP_TRUE
+am__quote
+am__include
+DEPDIR
+OBJEXT
+EXEEXT
+ac_ct_CC
+CPPFLAGS
+LDFLAGS
+CFLAGS
+CC
+am__untar
+am__tar
+AMTAR
+am__leading_dot
+SET_MAKE
+mkdir_p
+MKDIR_P
+INSTALL_STRIP_PROGRAM
+STRIP
+install_sh
+MAKEINFO
+AUTOHEADER
+AUTOMAKE
+AUTOCONF
+ACLOCAL
+VERSION
+PACKAGE
+CYGPATH_W
+am__isrc
+INSTALL_DATA
+INSTALL_SCRIPT
+INSTALL_PROGRAM
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
+MAINT
+MAINTAINER_MODE_FALSE
+MAINTAINER_MODE_TRUE
+target_os
+target_vendor
+target_cpu
+target
+host_os
+host_vendor
+host_cpu
+host
+build_os
+build_vendor
+build_cpu
+build
+ZFS_META_LT_AGE
+ZFS_META_LT_REVISION
+ZFS_META_LT_CURRENT
+ZFS_META_AUTHOR
+ZFS_META_DATA
+ZFS_META_ALIAS
+ZFS_META_LICENSE
+RELEASE
+ZFS_META_RELEASE
+ZFS_META_VERSION
+ZFS_META_NAME
+AWK
+target_alias
+host_alias
+build_alias
+LIBS
+ECHO_T
+ECHO_N
+ECHO_C
+DEFS
+mandir
+localedir
+libdir
+psdir
+pdfdir
+dvidir
+htmldir
+infodir
+docdir
+oldincludedir
+includedir
+runstatedir
+localstatedir
+sharedstatedir
+sysconfdir
+datadir
+datarootdir
+libexecdir
+sbindir
+bindir
+program_transform_name
+prefix
+exec_prefix
+PACKAGE_URL
+PACKAGE_BUGREPORT
+PACKAGE_STRING
+PACKAGE_VERSION
+PACKAGE_TARNAME
+PACKAGE_NAME
+PATH_SEPARATOR
+SHELL'
+ac_subst_files=''
+ac_user_opts='
+enable_option_checking
+enable_maintainer_mode
+enable_silent_rules
+enable_dependency_tracking
+enable_shared
+enable_static
+with_pic
+enable_fast_install
+with_gnu_ld
+with_sysroot
+enable_libtool_lock
+with_spec
+with_config
+enable_linux_builtin
+with_mounthelperdir
+with_udevdir
+with_udevruledir
+enable_systemd
+with_systemdunitdir
+with_systemdpresetdir
+with_systemdmodulesloaddir
+enable_sysvinit
+with_dracutdir
+with_blkid
+with_linux
+with_linux_obj
+with_spl
+with_spl_obj
+with_spl_timeout
+enable_debug
+enable_debug_dmu_tx
+'
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+CCAS
+CCASFLAGS'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+ac_unrecognized_opts=
+ac_unrecognized_sep=
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+runstatedir='${localstatedir}/run'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *=)   ac_optarg= ;;
+  *)    ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid feature name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"enable_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval enable_$ac_useropt=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -runstatedir | --runstatedir | --runstatedi | --runstated \
+  | --runstate | --runstat | --runsta | --runst | --runs \
+  | --run | --ru | --r)
+    ac_prev=runstatedir ;;
+  -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \
+  | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \
+  | --run=* | --ru=* | --r=*)
+    runstatedir=$ac_optarg ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null &&
+      as_fn_error $? "invalid package name: $ac_useropt"
+    ac_useropt_orig=$ac_useropt
+    ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'`
+    case $ac_user_opts in
+      *"
+"with_$ac_useropt"
+"*) ;;
+      *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig"
+        ac_unrecognized_sep=', ';;
+    esac
+    eval with_$ac_useropt=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) as_fn_error $? "unrecognized option: \`$ac_option'
+Try \`$0 --help' for more information"
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    case $ac_envvar in #(
+      '' | [0-9]* | *[!_$as_cr_alnum]* )
+      as_fn_error $? "invalid variable name: \`$ac_envvar'" ;;
+    esac
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}"
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  as_fn_error $? "missing argument to $ac_option"
+fi
+
+if test -n "$ac_unrecognized_opts"; then
+  case $enable_option_checking in
+    no) ;;
+    fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;;
+    *)     $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;;
+  esac
+fi
+
+# Check all directory arguments for consistency.
+for ac_var in  exec_prefix prefix bindir sbindir libexecdir datarootdir \
+               datadir sysconfdir sharedstatedir localstatedir includedir \
+               oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+               libdir localedir mandir runstatedir
+do
+  eval ac_val=\$$ac_var
+  # Remove trailing slashes.
+  case $ac_val in
+    */ )
+      ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'`
+      eval $ac_var=\$ac_val;;
+  esac
+  # Be sure to have absolute directory names.
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val"
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  as_fn_error $? "working directory cannot be determined"
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  as_fn_error $? "pwd does not report name of working directory"
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$as_myself" ||
+$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_myself" : 'X\(//\)[^/]' \| \
+        X"$as_myself" : 'X\(//\)$' \| \
+        X"$as_myself" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_myself" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir"
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+       cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg"
+       pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+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 zfs 0.6.5.4 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking ...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+                          [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+                          [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR            user executables [EPREFIX/bin]
+  --sbindir=DIR           system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR        program executables [EPREFIX/libexec]
+  --sysconfdir=DIR        read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR    modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR     modifiable single-machine data [PREFIX/var]
+  --runstatedir=DIR       modifiable per-process data [LOCALSTATEDIR/run]
+  --libdir=DIR            object code libraries [EPREFIX/lib]
+  --includedir=DIR        C header files [PREFIX/include]
+  --oldincludedir=DIR     C header files for non-gcc [/usr/include]
+  --datarootdir=DIR       read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR           read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR           info documentation [DATAROOTDIR/info]
+  --localedir=DIR         locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR            man documentation [DATAROOTDIR/man]
+  --docdir=DIR            documentation root [DATAROOTDIR/doc/zfs]
+  --htmldir=DIR           html documentation [DOCDIR]
+  --dvidir=DIR            dvi documentation [DOCDIR]
+  --pdfdir=DIR            pdf documentation [DOCDIR]
+  --psdir=DIR             ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+Program names:
+  --program-prefix=PREFIX            prepend PREFIX to installed program names
+  --program-suffix=SUFFIX            append SUFFIX to installed program names
+  --program-transform-name=PROGRAM   run sed PROGRAM on installed program names
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of zfs 0.6.5.4:";;
+   esac
+  cat <<\_ACEOF
+
+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-maintainer-mode
+                          enable make rules and dependencies not useful (and
+                          sometimes confusing) to the casual installer
+  --enable-silent-rules   less verbose build output (undo: "make V=1")
+  --disable-silent-rules  verbose build output (undo: "make V=0")
+  --enable-dependency-tracking
+                          do not reject slow dependency extractors
+  --disable-dependency-tracking
+                          speeds up one-time build
+  --enable-shared[=PKGS]  build shared libraries [default=yes]
+  --enable-static[=PKGS]  build static libraries [default=yes]
+  --enable-fast-install[=PKGS]
+                          optimize for fast installation [default=yes]
+  --disable-libtool-lock  avoid locking (might break parallel builds)
+  --enable-linux-builtin  Configure for builtin in-tree kernel modules
+                          [default=no]
+  --enable-systemd        install systemd unit/preset files [[default: yes]]
+  --enable-sysvinit       install SysV init scripts [default: yes]
+  --enable-debug          Enable generic debug support [default=no]
+  --enable-debug-dmu-tx   Enable dmu tx validation [default=no]
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --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
+                        (or the compiler's sysroot if not specified).
+  --with-spec=SPEC        Spec files 'generic|redhat'
+  --with-config=CONFIG    Config file 'kernel|user|all|srpm'
+  --with-mounthelperdir=DIR
+                          install mount.zfs in dir [[/sbin]]
+  --with-udevdir=DIR      install udev helpers [default=check]
+  --with-udevruledir=DIR  install udev rules [[UDEVDIR/rules.d]]
+  --with-systemdunitdir=DIR
+                          install systemd unit files in dir
+                          [[/usr/lib/systemd/system]]
+  --with-systemdpresetdir=DIR
+                          install systemd preset files in dir
+                          [[/usr/lib/systemd/system-preset]]
+  --with-systemdmodulesloaddir=DIR
+                          install systemd module load files into dir
+                          [[/usr/lib/modules-load.d]]
+  --with-dracutdir=DIR    install dracut helpers [default=check]
+  --with-blkid            support blkid caching [default=check]
+  --with-linux=PATH       Path to kernel source
+  --with-linux-obj=PATH   Path to kernel build objects
+  --with-spl=PATH         Path to spl source
+  --with-spl-obj=PATH     Path to spl build objects
+  --with-spl-timeout=SECS Wait SECS for SPL header and symver file [default=0]
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  CCAS        assembler compiler command (defaults to CC)
+  CCASFLAGS   assembler compiler flags (defaults to CFLAGS)
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to the package provider.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" ||
+      { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } ||
+      continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+zfs configure 0.6.5.4
+generated by GNU Autoconf 2.69
+
+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
+  exit
+fi
+
+## ------------------------ ##
+## Autoconf initialization. ##
+## ------------------------ ##
+
+# ac_fn_c_try_compile LINENO
+# --------------------------
+# Try to compile conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext
+  if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_compile
+
+# ac_fn_c_try_link LINENO
+# -----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_link ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  rm -f conftest.$ac_objext conftest$ac_exeext
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && {
+        test -z "$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       } && test -s conftest$ac_exeext && {
+        test "$cross_compiling" = yes ||
+        test -x conftest$ac_exeext
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=1
+fi
+  # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information
+  # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would
+  # interfere with the next link command; also delete a directory that is
+  # left behind by Apple's compiler.  We do this before executing the actions.
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_link
+
+# ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists and can be compiled using the include files in
+# INCLUDES, setting the cache variable VAR accordingly.
+ac_fn_c_check_header_compile ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_compile
+
+# ac_fn_c_try_cpp LINENO
+# ----------------------
+# Try to preprocess conftest.$ac_ext, and return whether this succeeded.
+ac_fn_c_try_cpp ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    grep -v '^ *+' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+    mv -f conftest.er1 conftest.err
+  fi
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } > conftest.i && {
+        test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+        test ! -s conftest.err
+       }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+    ac_retval=1
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_cpp
+
+# ac_fn_c_try_run LINENO
+# ----------------------
+# Try to link conftest.$ac_ext, and return whether this succeeded. Assumes
+# that executables *can* be run.
+ac_fn_c_try_run ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && { ac_try='./conftest$ac_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  ac_retval=0
+else
+  $as_echo "$as_me: program exited with status $ac_status" >&5
+       $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+       ac_retval=$ac_status
+fi
+  rm -rf conftest.dSYM conftest_ipa8_conftest.oo
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+  as_fn_set_status $ac_retval
+
+} # ac_fn_c_try_run
+
+# ac_fn_c_check_func LINENO FUNC VAR
+# ----------------------------------
+# Tests whether FUNC exists, setting the cache variable VAR accordingly
+ac_fn_c_check_func ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+/* Define $2 to an innocuous variant, in case <limits.h> declares $2.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $2 innocuous_$2
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $2 (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $2
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $2 ();
+/* The GNU C library defines this for functions which it implements
+    to always fail with ENOSYS.  Some functions are actually named
+    something starting with __ and the normal name is an alias.  */
+#if defined __stub_$2 || defined __stub___$2
+choke me
+#endif
+
+int
+main ()
+{
+return $2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  eval "$3=yes"
+else
+  eval "$3=no"
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_func
+
+# ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES
+# -------------------------------------------------------
+# Tests whether HEADER exists, giving a warning if it cannot be compiled using
+# the include files in INCLUDES and setting the cache variable VAR
+# accordingly.
+ac_fn_c_check_header_mongrel ()
+{
+  as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+  if eval \${$3+:} false; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5
+$as_echo_n "checking $2 usability... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+$4
+#include <$2>
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_header_compiler=yes
+else
+  ac_header_compiler=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5
+$as_echo "$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5
+$as_echo_n "checking $2 presence... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <$2>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  ac_header_preproc=yes
+else
+  ac_header_preproc=no
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5
+$as_echo "$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #((
+  yes:no: )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5
+$as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+  no:yes:* )
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5
+$as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     check for missing prerequisite headers?" >&5
+$as_echo "$as_me: WARNING: $2:     check for missing prerequisite headers?" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5
+$as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&5
+$as_echo "$as_me: WARNING: $2:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5
+$as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;}
+    ;;
+esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5
+$as_echo_n "checking for $2... " >&6; }
+if eval \${$3+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  eval "$3=\$ac_header_compiler"
+fi
+eval ac_res=\$$3
+              { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+fi
+  eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno
+
+} # ac_fn_c_check_header_mongrel
+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 zfs $as_me 0.6.5.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    $as_echo "PATH: $as_dir"
+  done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) as_fn_append ac_configure_args0 " '$ac_arg'" ;;
+    2)
+      as_fn_append ac_configure_args1 " '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+       ac_must_keep_next=false # Got value, back to normal.
+      else
+       case $ac_arg in
+         *=* | --config-cache | -C | -disable-* | --disable-* \
+         | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+         | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+         | -with-* | --with-* | -without-* | --without-* | --x)
+           case "$ac_configure_args0 " in
+             "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+           esac
+           ;;
+         -* ) ac_must_keep_next=true ;;
+       esac
+      fi
+      as_fn_append ac_configure_args " '$ac_arg'"
+      ;;
+    esac
+  done
+done
+{ ac_configure_args0=; unset ac_configure_args0;}
+{ ac_configure_args1=; unset ac_configure_args1;}
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    $as_echo "## ---------------- ##
+## Cache variables. ##
+## ---------------- ##"
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+       "s/'\''/'\''\\\\'\'''\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    $as_echo "## ----------------- ##
+## Output variables. ##
+## ----------------- ##"
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      $as_echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      $as_echo "## ------------------- ##
+## File substitutions. ##
+## ------------------- ##"
+      echo
+      for ac_var in $ac_subst_files
+      do
+       eval ac_val=\$$ac_var
+       case $ac_val in
+       *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+       esac
+       $as_echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      $as_echo "## ----------- ##
+## confdefs.h. ##
+## ----------- ##"
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      $as_echo "$as_me: caught signal $ac_signal"
+    $as_echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+$as_echo "/* confdefs.h */" > confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_URL "$PACKAGE_URL"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer an explicitly selected file to automatically selected ones.
+ac_site_file1=NONE
+ac_site_file2=NONE
+if test -n "$CONFIG_SITE"; then
+  # We do not want a PATH search for config.site.
+  case $CONFIG_SITE in #((
+    -*)  ac_site_file1=./$CONFIG_SITE;;
+    */*) ac_site_file1=$CONFIG_SITE;;
+    *)   ac_site_file1=./$CONFIG_SITE;;
+  esac
+elif test "x$prefix" != xNONE; then
+  ac_site_file1=$prefix/share/config.site
+  ac_site_file2=$prefix/etc/config.site
+else
+  ac_site_file1=$ac_default_prefix/share/config.site
+  ac_site_file2=$ac_default_prefix/etc/config.site
+fi
+for ac_site_file in "$ac_site_file1" "$ac_site_file2"
+do
+  test "x$ac_site_file" = xNONE && continue
+  if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5
+$as_echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file" \
+      || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "failed to load site script $ac_site_file
+See \`config.log' for more details" "$LINENO" 5; }
+  fi
+done
+
+if test -r "$cache_file"; then
+  # Some versions of bash will fail to source /dev/null (special files
+  # actually), so we avoid doing that.  DJGPP emulates it as a regular file.
+  if test /dev/null != "$cache_file" && test -f "$cache_file"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5
+$as_echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5
+$as_echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,set)
+      { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5
+$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;}
+      ac_cache_corrupted=: ;;
+    ,);;
+    *)
+      if test "x$ac_old_val" != "x$ac_new_val"; then
+       # differences in whitespace do not lead to failure.
+       ac_old_val_w=`echo x $ac_old_val`
+       ac_new_val_w=`echo x $ac_new_val`
+       if test "$ac_old_val_w" != "$ac_new_val_w"; then
+         { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5
+$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;}
+         ac_cache_corrupted=:
+       else
+         { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5
+$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;}
+         eval $ac_var=\$ac_old_val
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   former value:  \`$ac_old_val'" >&5
+$as_echo "$as_me:   former value:  \`$ac_old_val'" >&2;}
+       { $as_echo "$as_me:${as_lineno-$LINENO}:   current value: \`$ac_new_val'" >&5
+$as_echo "$as_me:   current value: \`$ac_new_val'" >&2;}
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) as_fn_append ac_configure_args " '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+  { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5
+$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;}
+  as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5
+fi
+## -------------------- ##
+## Main body of script. ##
+## -------------------- ##
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+
+
+
+       for ac_prog in gawk mawk nawk awk
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AWK+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AWK"; then
+  ac_cv_prog_AWK="$AWK" # 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_AWK="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AWK=$ac_cv_prog_AWK
+if test -n "$AWK"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5
+$as_echo "$AWK" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$AWK" && break
+done
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking metadata" >&5
+$as_echo_n "checking metadata... " >&6; }
+
+       META="$srcdir/META"
+       _zfs_ac_meta_type="none"
+       if test -f "$META"; then
+               _zfs_ac_meta_type="META file"
+               _dpkg_parsechangelog=$(dpkg-parsechangelog 2>/dev/null)
+
+               ZFS_META_NAME=`$AWK -F ':[ \t]+' '$1 ~ /^ *(Name|Project|Package)$/ { print $2; exit }' $META`;
+               if test -n "$ZFS_META_NAME"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_NAME "$ZFS_META_NAME"
+_ACEOF
+
+
+               fi
+
+               ZFS_META_VERSION=`$AWK -F ':[ \t]+' '$1 ~ /^ *Version$/ { print $2; exit }' $META`;
+               if test -n "$ZFS_META_VERSION"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_VERSION "$ZFS_META_VERSION"
+_ACEOF
+
+
+               fi
+
+               if test -n "${_dpkg_parsechangelog}"; then
+                       _dpkg_version=$(echo "${_dpkg_parsechangelog}" \
+                               | $AWK '$1 == "Version:" { print $2; }' \
+                               | cut -d- -f1)
+                       if test "${_dpkg_version}" != "$ZFS_META_VERSION"; then
+                               as_fn_error $? "
+       *** Version $ZFS_META_VERSION in the META file is different than
+       *** version $_dpkg_version in the debian/changelog file. DKMS and DEB
+       *** packaging require that these files have the same version.
+                               " "$LINENO" 5
+                       fi
+               fi
+
+               ZFS_META_RELEASE=`$AWK -F ':[ \t]+' '$1 ~ /^ *Release$/ { print $2; exit }' $META`;
+
+               if test -n "${_dpkg_parsechangelog}"; then
+                       _dpkg_release=$(echo "${_dpkg_parsechangelog}" \
+                               | $AWK '$1 == "Version:" { print $2; }' \
+                               | cut -d- -f2-)
+                       if test -n "${_dpkg_release}"; then
+                               ZFS_META_RELEASE=${_dpkg_release}
+                               _zfs_ac_meta_type="dpkg-parsechangelog"
+                       fi
+               elif test ! -f ".nogitrelease" && git rev-parse --git-dir > /dev/null 2>&1; then
+                       _match="${ZFS_META_NAME}-${ZFS_META_VERSION}"
+                       _alias=$(git describe --match=${_match} 2>/dev/null)
+                       _release=$(echo ${_alias}|cut -f3- -d'-'|sed 's/-/_/g')
+                       if test -n "${_release}"; then
+                               ZFS_META_RELEASE=${_release}
+                               _zfs_ac_meta_type="git describe"
+                       fi
+               fi
+
+               if test -n "$ZFS_META_RELEASE"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_RELEASE "$ZFS_META_RELEASE"
+_ACEOF
+
+
+
+                       RELEASE="$ZFS_META_RELEASE"
+
+               fi
+
+               ZFS_META_LICENSE=`$AWK -F ':[ \t]+' '$1 ~ /^ *License$/ { print $2; exit }' $META`;
+               if test -n "$ZFS_META_LICENSE"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_LICENSE "$ZFS_META_LICENSE"
+_ACEOF
+
+
+               fi
+
+               if test -n "$ZFS_META_NAME" -a -n "$ZFS_META_VERSION"; then
+                               ZFS_META_ALIAS="$ZFS_META_NAME-$ZFS_META_VERSION"
+                               test -n "$ZFS_META_RELEASE" &&
+                                       ZFS_META_ALIAS="$ZFS_META_ALIAS-$ZFS_META_RELEASE"
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_ALIAS "$ZFS_META_ALIAS"
+_ACEOF
+
+
+               fi
+
+               ZFS_META_DATA=`$AWK -F ':[ \t]+' '$1 ~ /^ *Date$/ { print $2; exit }' $META`;
+               if test -n "$ZFS_META_DATA"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_DATA "$ZFS_META_DATA"
+_ACEOF
+
+
+               fi
+
+               ZFS_META_AUTHOR=`$AWK -F ':[ \t]+' '$1 ~ /^ *Author$/ { print $2; exit }' $META`;
+               if test -n "$ZFS_META_AUTHOR"; then
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_AUTHOR "$ZFS_META_AUTHOR"
+_ACEOF
+
+
+               fi
+
+
+               ZFS_META_LT_CURRENT=`$AWK -F ':[ \t]+' '$1 ~ /^ *LT_Current$/ { print $2; exit }' $META`;
+               ZFS_META_LT_REVISION=`$AWK -F ':[ \t]+' '$1 ~ /^ *LT_Revision$/ { print $2; exit }' $META`;
+               ZFS_META_LT_AGE=`$AWK -F ':[ \t]+' '$1 ~ /^ *LT_Age$/ { print $2; exit }' $META`;
+               if test -n "$ZFS_META_LT_CURRENT" \
+                                -o -n "$ZFS_META_LT_REVISION" \
+                                -o -n "$ZFS_META_LT_AGE"; then
+                       test -n "$ZFS_META_LT_CURRENT" || ZFS_META_LT_CURRENT="0"
+                       test -n "$ZFS_META_LT_REVISION" || ZFS_META_LT_REVISION="0"
+                       test -n "$ZFS_META_LT_AGE" || ZFS_META_LT_AGE="0"
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_LT_CURRENT "$ZFS_META_LT_CURRENT"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_LT_REVISION "$ZFS_META_LT_REVISION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define ZFS_META_LT_AGE "$ZFS_META_LT_AGE"
+_ACEOF
+
+
+
+
+               fi
+       fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_zfs_ac_meta_type" >&5
+$as_echo "$_zfs_ac_meta_type" >&6; }
+
+
+ac_aux_dir=
+for ac_dir in config "$srcdir"/config; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  as_fn_error $? "cannot find install-sh, install.sh, or shtool in config \"$srcdir\"/config" "$LINENO" 5
+fi
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5
+$as_echo_n "checking build system type... " >&6; }
+if ${ac_cv_build+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5
+ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5
+$as_echo "$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5
+$as_echo_n "checking host system type... " >&6; }
+if ${ac_cv_host+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5
+$as_echo "$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking target system type" >&5
+$as_echo_n "checking target system type... " >&6; }
+if ${ac_cv_target+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    as_fn_error $? "$SHELL $ac_aux_dir/config.sub $target_alias failed" "$LINENO" 5
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_target" >&5
+$as_echo "$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) as_fn_error $? "invalid value of canonical target" "$LINENO" 5;;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5
+$as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; }
+    # Check whether --enable-maintainer-mode was given.
+if test "${enable_maintainer_mode+set}" = set; then :
+  enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval
+else
+  USE_MAINTAINER_MODE=no
+fi
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5
+$as_echo "$USE_MAINTAINER_MODE" >&6; }
+   if test $USE_MAINTAINER_MODE = yes; then
+  MAINTAINER_MODE_TRUE=
+  MAINTAINER_MODE_FALSE='#'
+else
+  MAINTAINER_MODE_TRUE='#'
+  MAINTAINER_MODE_FALSE=
+fi
+
+  MAINT=$MAINTAINER_MODE_TRUE
+
+
+# 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=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='\'
+
+am__api_version='1.15'
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+# Reject install programs that cannot install multiple files.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5
+$as_echo_n "checking for a BSD-compatible install... " >&6; }
+if test -z "$INSTALL"; then
+if ${ac_cv_path_install+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in #((
+  ./ | .// | /[cC]/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+       if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then
+         if 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.
+           :
+         elif test $ac_prog = install &&
+           grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+           # program-specific install script used by HP pwplus--don't use.
+           :
+         else
+           rm -rf conftest.one conftest.two conftest.dir
+           echo one > conftest.one
+           echo two > conftest.two
+           mkdir conftest.dir
+           if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" &&
+             test -s conftest.one && test -s conftest.two &&
+             test -s conftest.dir/conftest.one &&
+             test -s conftest.dir/conftest.two
+           then
+             ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+             break 3
+           fi
+         fi
+       fi
+      done
+    done
+    ;;
+esac
+
+  done
+IFS=$as_save_IFS
+
+rm -rf conftest.one conftest.two conftest.dir
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5
+$as_echo "$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
+$as_echo_n "checking whether build environment is sane... " >&6; }
+# Reject unsafe characters in $srcdir or the absolute working directory
+# name.  Accept space and tab only in the latter.
+am_lf='
+'
+case `pwd` in
+  *[\\\"\#\$\&\'\`$am_lf]*)
+    as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;;
+esac
+case $srcdir in
+  *[\\\"\#\$\&\'\`$am_lf\ \    ]*)
+    as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
+esac
+
+# 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 (
+   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
+   # Ok.
+   :
+else
+   as_fn_error $? "newly created file is older than distributed files!
+Check your system clock" "$LINENO" 5
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+# 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.
+test "$program_suffix" != NONE &&
+  program_transform_name="s&\$&$program_suffix&;$program_transform_name"
+# Double any \ or $.
+# By default was `s,x,x', remove it if useless.
+ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
+program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
+
+# Expand $ac_aux_dir to an absolute path.
+am_aux_dir=`cd "$ac_aux_dir" && pwd`
+
+if test x"${MISSING+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
+  *)
+    MISSING="\${SHELL} $am_aux_dir/missing" ;;
+  esac
+fi
+# Use eval to expand $SHELL
+if eval "$MISSING --is-lightweight"; then
+  am_missing_run="$MISSING "
+else
+  am_missing_run=
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
+fi
+
+if test x"${install_sh+set}" != xset; then
+  case $am_aux_dir in
+  *\ * | *\    *)
+    install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
+  *)
+    install_sh="\${SHELL} $am_aux_dir/install-sh"
+  esac
+fi
+
+# 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.
+if test "$cross_compiling" != no; then
+  if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
+    $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
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip"
+    $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_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  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
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+fi
+INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5
+$as_echo_n "checking for a thread-safe mkdir -p... " >&6; }
+if test -z "$MKDIR_P"; then
+  if ${ac_cv_path_mkdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in mkdir gmkdir; do
+        for ac_exec_ext in '' $ac_executable_extensions; do
+          as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue
+          case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #(
+            'mkdir (GNU coreutils) '* | \
+            'mkdir (coreutils) '* | \
+            'mkdir (fileutils) '4.1*)
+              ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext
+              break 3;;
+          esac
+        done
+       done
+  done
+IFS=$as_save_IFS
+
+fi
+
+  test -d ./--version && rmdir ./--version
+  if test "${ac_cv_path_mkdir+set}" = set; then
+    MKDIR_P="$ac_cv_path_mkdir -p"
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for MKDIR_P within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    MKDIR_P="$ac_install_sh -d"
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
+$as_echo "$MKDIR_P" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; }
+set x ${MAKE-make}
+ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+       @echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering ...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+  SET_MAKE=
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+rm -rf .tst 2>/dev/null
+mkdir .tst 2>/dev/null
+if test -d .tst; then
+  am__leading_dot=.
+else
+  am__leading_dot=_
+fi
+rmdir .tst 2>/dev/null
+
+if test "`cd $srcdir && pwd`" != "`pwd`"; then
+  # Use -I$(srcdir) only when $(srcdir) != ., so that make's output
+  # is not polluted with repeated "-I."
+  am__isrc=' -I$(srcdir)'
+  # test to see if srcdir already configured
+  if test -f $srcdir/config.status; then
+    as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5
+  fi
+fi
+
+# test whether we have cygpath
+if test -z "$CYGPATH_W"; then
+  if (cygpath --version) >/dev/null 2>/dev/null; then
+    CYGPATH_W='cygpath -w'
+  else
+    CYGPATH_W=echo
+  fi
+fi
+
+
+# Define the identity of the package.
+ PACKAGE='zfs'
+ VERSION='0.6.5.4'
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE "$PACKAGE"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define VERSION "$VERSION"
+_ACEOF
+
+# Some tools Automake needs.
+
+ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"}
+
+
+AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"}
+
+
+AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"}
+
+
+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 (and possibly the TAP driver).  The
+# system "awk" is bad on some platforms.
+# 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}'
+
+
+# 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 -'
+
+
+
+
+
+
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes.  So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+  cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present.  This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message.  This
+can help us improve future automake versions.
+
+END
+  if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+    echo 'Configuration will proceed anyway, since you have set the' >&2
+    echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+    echo >&2
+  else
+    cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+    as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+  fi
+fi
+
+ac_config_headers="$ac_config_headers zfs_config.h"
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="${ac_tool_prefix}gcc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_CC"; then
+  ac_ct_CC=$CC
+  # Extract the first word of "gcc", so it can be a program name with args.
+set dummy gcc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="gcc"
+    $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_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+if test -z "$CC"; then
+          if test -n "$ac_tool_prefix"; then
+    # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args.
+set dummy ${ac_tool_prefix}cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="${ac_tool_prefix}cc"
+    $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
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  fi
+fi
+if test -z "$CC"; then
+  # Extract the first word of "cc", so it can be a program name with args.
+set dummy cc; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+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
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5
+$as_echo "$CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_CC+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  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_CC="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5
+$as_echo "$ac_ct_CC" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  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
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "no acceptable C compiler found in \$PATH
+See \`config.log' for more details" "$LINENO" 5; }
+
+# Provide some information about the compiler.
+$as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5
+set X $ac_compile
+ac_compiler=$2
+for ac_option in --version -v -V -qversion; do
+  { { ac_try="$ac_compiler $ac_option >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compiler $ac_option >&5") 2>conftest.err
+  ac_status=$?
+  if test -s conftest.err; then
+    sed '10a\
+... rest of stderr output deleted ...
+         10q' conftest.err >conftest.er1
+    cat conftest.er1 >&5
+  fi
+  rm -f conftest.er1 conftest.err
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+done
+
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out"
+# Try to create an executable without -o first, disregard a.out.
+# It will help us diagnose broken compilers, and finding out an intuition
+# of exeext.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5
+$as_echo_n "checking whether the C compiler works... " >&6; }
+ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+
+# The possible output files:
+ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*"
+
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { { ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj )
+       ;;
+    [ab].out )
+       # We found the default executable, but exeext='' is most
+       # certainly right.
+       break;;
+    *.* )
+       if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+       then :; else
+          ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+       fi
+       # We set ac_cv_exeext here because the later test for it is not
+       # safe: cross compilers may not add the suffix if given an `-o'
+       # argument, so we may need to know it at that point already.
+       # Even if this section looks crufty: it has the advantage of
+       # actually working.
+       break;;
+    * )
+       break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+if test -z "$ac_file"; then :
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+$as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error 77 "C compiler cannot create executables
+See \`config.log' for more details" "$LINENO" 5; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5
+$as_echo_n "checking for C compiler default output file name... " >&6; }
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5
+$as_echo "$ac_file" >&6; }
+ac_exeext=$ac_cv_exeext
+
+rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5
+$as_echo_n "checking for suffix of executables... " >&6; }
+if { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  # If both `conftest.exe' and `conftest' are `present' (well, observable)
+# catch `conftest.exe'.  For instance with Cygwin, `ls conftest' will
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+         break;;
+    * ) break;;
+  esac
+done
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest conftest$ac_cv_exeext
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5
+$as_echo "$ac_cv_exeext" >&6; }
+
+rm -f conftest.$ac_ext
+EXEEXT=$ac_cv_exeext
+ac_exeext=$EXEEXT
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdio.h>
+int
+main ()
+{
+FILE *f = fopen ("conftest.out", "w");
+ return ferror (f) || fclose (f) != 0;
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files="$ac_clean_files conftest.out"
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5
+$as_echo_n "checking whether we are cross compiling... " >&6; }
+if test "$cross_compiling" != yes; then
+  { { ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+  if { ac_try='./conftest$ac_cv_exeext'
+  { { case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+       cross_compiling=yes
+    else
+       { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details" "$LINENO" 5; }
+    fi
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5
+$as_echo "$cross_compiling" >&6; }
+
+rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out
+ac_clean_files=$ac_clean_files_save
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5
+$as_echo_n "checking for suffix of object files... " >&6; }
+if ${ac_cv_objext+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { { ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
+$as_echo "$ac_try_echo"; } >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then :
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "cannot compute suffix of object files: cannot compile
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5
+$as_echo "$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5
+$as_echo_n "checking whether we are using the GNU C compiler... " >&6; }
+if ${ac_cv_c_compiler_gnu+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_compiler_gnu=yes
+else
+  ac_compiler_gnu=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5
+$as_echo "$ac_cv_c_compiler_gnu" >&6; }
+if test $ac_compiler_gnu = yes; then
+  GCC=yes
+else
+  GCC=
+fi
+ac_test_CFLAGS=${CFLAGS+set}
+ac_save_CFLAGS=$CFLAGS
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5
+$as_echo_n "checking whether $CC accepts -g... " >&6; }
+if ${ac_cv_prog_cc_g+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+else
+  CFLAGS=""
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+else
+  ac_c_werror_flag=$ac_save_c_werror_flag
+        CFLAGS="-g"
+        cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_g=yes
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5
+$as_echo "$ac_cv_prog_cc_g" >&6; }
+if test "$ac_test_CFLAGS" = set; then
+  CFLAGS=$ac_save_CFLAGS
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5
+$as_echo_n "checking for $CC option to accept ISO C89... " >&6; }
+if ${ac_cv_prog_cc_c89+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+struct stat;
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+       -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_prog_cc_c89=$ac_arg
+fi
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5
+$as_echo "none needed" >&6; } ;;
+  xno)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5
+$as_echo "unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5
+$as_echo "$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+if test "x$ac_cv_prog_cc_c89" != xno; then :
+
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+  # Make sure it works both with $CC and with simple cc.
+  # Following AC_PROG_CC_C_O, we do the test twice because some
+  # compilers refuse to overwrite an existing .o file with -o,
+  # though they will create one.
+  am_cv_prog_cc_c_o=yes
+  for am_i in 1 2; do
+    if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+   ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+   ac_status=$?
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   (exit $ac_status); } \
+         && test -f conftest2.$ac_objext; then
+      : OK
+    else
+      am_cv_prog_cc_c_o=no
+      break
+    fi
+  done
+  rm -f core conftest*
+  unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+   # Losing compiler, so override with the script.
+   # FIXME: It is wrong to rewrite CC.
+   # But if we don't then we get into trouble of one sort or another.
+   # A longer-term fix would be to have automake use am__CC in this case,
+   # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+   CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+DEPDIR="${am__leading_dot}deps"
+
+ac_config_commands="$ac_config_commands depfiles"
+
+
+am_make=${MAKE-make}
+cat > confinc << 'END'
+am__doit:
+       @echo this is the am__doit target
+.PHONY: am__doit
+END
+# If we don't find an include directive, just comment out the code.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5
+$as_echo_n "checking for style of include used by $am_make... " >&6; }
+am__include="#"
+am__quote=
+_am_result=none
+# First try GNU make style include.
+echo "include confinc" > confmf
+# Ignore all kinds of additional output from 'make'.
+case `$am_make -s -f confmf 2> /dev/null` in #(
+*the\ am__doit\ target*)
+  am__include=include
+  am__quote=
+  _am_result=GNU
+  ;;
+esac
+# Now try BSD make style include.
+if test "$am__include" = "#"; then
+   echo '.include "confinc"' > confmf
+   case `$am_make -s -f confmf 2> /dev/null` in #(
+   *the\ am__doit\ target*)
+     am__include=.include
+     am__quote="\""
+     _am_result=BSD
+     ;;
+   esac
+fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5
+$as_echo "$_am_result" >&6; }
+rm -f confinc confmf
+
+# Check whether --enable-dependency-tracking was given.
+if test "${enable_dependency_tracking+set}" = set; then :
+  enableval=$enable_dependency_tracking;
+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=
+  AMDEP_FALSE='#'
+else
+  AMDEP_TRUE='#'
+  AMDEP_FALSE=
+fi
+
+
+
+depcc="$CC"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CC_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CC_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+  case " $depcc " in #(
+     *\ -arch\ *\ -arch\ *) am__universal=true ;;
+     esac
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CC_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CC_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CC_dependencies_compiler_type" >&6; }
+CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then
+  am__fastdepCC_TRUE=
+  am__fastdepCC_FALSE='#'
+else
+  am__fastdepCC_TRUE='#'
+  am__fastdepCC_FALSE=
+fi
+
+
+case `pwd` in
+  *\ * | *\    *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&5
+$as_echo "$as_me: WARNING: Libtool does not cope well with whitespace in \`pwd\`" >&2;} ;;
+esac
+
+
+
+macro_version='2.4.2'
+macro_revision='1.3337'
+
+
+
+
+
+
+
+
+
+
+
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+# Backslashify metacharacters that are still active within
+# double-quoted strings.
+sed_quote_subst='s/\(["`$\\]\)/\\\1/g'
+
+# Same as above, but do not quote variable references.
+double_quote_subst='s/\(["`\\]\)/\\\1/g'
+
+# Sed substitution to delay expansion of an escaped shell variable in a
+# double_quote_subst'ed string.
+delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g'
+
+# Sed substitution to delay expansion of an escaped single quote.
+delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g'
+
+# Sed substitution to avoid accidental globbing in evaled expressions
+no_glob_subst='s/\*/\\\*/g'
+
+ECHO='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO
+ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
+$as_echo_n "checking how to print strings... " >&6; }
+# Test print first, because it will be a builtin if present.
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
+   test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='print -r --'
+elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
+  ECHO='printf %s\n'
+else
+  # Use this function as a fallback that always works.
+  func_fallback_echo ()
+  {
+    eval 'cat <<_LTECHO_EOF
+$1
+_LTECHO_EOF'
+  }
+  ECHO='func_fallback_echo'
+fi
+
+# func_echo_all arg...
+# Invoke $ECHO with all args, space-separated.
+func_echo_all ()
+{
+    $ECHO ""
+}
+
+case "$ECHO" in
+  printf*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: printf" >&5
+$as_echo "printf" >&6; } ;;
+  print*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: print -r" >&5
+$as_echo "print -r" >&6; } ;;
+  *) { $as_echo "$as_me:${as_lineno-$LINENO}: result: cat" >&5
+$as_echo "cat" >&6; } ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for a sed that does not truncate output" >&5
+$as_echo_n "checking for a sed that does not truncate output... " >&6; }
+if ${ac_cv_path_SED+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+            ac_script=s/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa/bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb/
+     for ac_i in 1 2 3 4 5 6 7; do
+       ac_script="$ac_script$as_nl$ac_script"
+     done
+     echo "$ac_script" 2>/dev/null | sed 99q >conftest.sed
+     { ac_script=; unset ac_script;}
+     if test -z "$SED"; then
+  ac_path_SED_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_prog in sed gsed; do
+    for ac_exec_ext in '' $ac_executable_extensions; do
+      ac_path_SED="$as_dir/$ac_prog$ac_exec_ext"
+      as_fn_executable_p "$ac_path_SED" || continue
+# Check for GNU ac_path_SED and select it if it is found.
+  # Check for GNU $ac_path_SED
+case `"$ac_path_SED" --version 2>&1` in
+*GNU*)
+  ac_cv_path_SED="$ac_path_SED" ac_path_SED_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo '' >> "conftest.nl"
+    "$ac_path_SED" -f conftest.sed < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_SED_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_SED="$ac_path_SED"
+      ac_path_SED_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_SED_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_SED"; then
+    as_fn_error $? "no acceptable sed could be found in \$PATH" "$LINENO" 5
+  fi
+else
+  ac_cv_path_SED=$SED
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_SED" >&5
+$as_echo "$ac_cv_path_SED" >&6; }
+ SED="$ac_cv_path_SED"
+  rm -f conftest.sed
+
+test -z "$SED" && SED=sed
+Xsed="$SED -e 1s/^X//"
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5
+$as_echo_n "checking for grep that handles long lines and -e... " >&6; }
+if ${ac_cv_path_GREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$GREP"; then
+  ac_path_GREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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"
+      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
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_GREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_GREP"; then
+    as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5
+$as_echo "$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5
+$as_echo_n "checking for egrep... " >&6; }
+if ${ac_cv_path_EGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     if test -z "$EGREP"; then
+  ac_path_EGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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"
+      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
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_EGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_EGREP"; then
+    as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5
+$as_echo "$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for fgrep" >&5
+$as_echo_n "checking for fgrep... " >&6; }
+if ${ac_cv_path_FGREP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1
+   then ac_cv_path_FGREP="$GREP -F"
+   else
+     if test -z "$FGREP"; then
+  ac_path_FGREP_found=false
+  # Loop through the user's path and test for each of PROGNAME-LIST
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    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"
+      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
+*GNU*)
+  ac_cv_path_FGREP="$ac_path_FGREP" ac_path_FGREP_found=:;;
+*)
+  ac_count=0
+  $as_echo_n 0123456789 >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    $as_echo 'FGREP' >> "conftest.nl"
+    "$ac_path_FGREP" FGREP < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    as_fn_arith $ac_count + 1 && ac_count=$as_val
+    if test $ac_count -gt ${ac_path_FGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_FGREP="$ac_path_FGREP"
+      ac_path_FGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+      $ac_path_FGREP_found && break 3
+    done
+  done
+  done
+IFS=$as_save_IFS
+  if test -z "$ac_cv_path_FGREP"; then
+    as_fn_error $? "no acceptable fgrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5
+  fi
+else
+  ac_cv_path_FGREP=$FGREP
+fi
+
+   fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_FGREP" >&5
+$as_echo "$ac_cv_path_FGREP" >&6; }
+ FGREP="$ac_cv_path_FGREP"
+
+
+test -z "$GREP" && GREP=grep
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# 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
+
+ac_prog=ld
+if test "$GCC" = yes; then
+  # Check if gcc -print-prog-name=ld gives a path.
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ld used by $CC" >&5
+$as_echo_n "checking for ld used by $CC... " >&6; }
+  case $host in
+  *-*-mingw*)
+    # gcc leaves a trailing carriage return which upsets mingw
+    ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;;
+  *)
+    ac_prog=`($CC -print-prog-name=ld) 2>&5` ;;
+  esac
+  case $ac_prog in
+    # Accept absolute paths.
+    [\\/]* | ?:[\\/]*)
+      re_direlt='/[^/][^/]*/\.\./'
+      # Canonicalize the pathname of ld
+      ac_prog=`$ECHO "$ac_prog"| $SED 's%\\\\%/%g'`
+      while $ECHO "$ac_prog" | $GREP "$re_direlt" > /dev/null 2>&1; do
+       ac_prog=`$ECHO $ac_prog| $SED "s%$re_direlt%/%"`
+      done
+      test -z "$LD" && LD="$ac_prog"
+      ;;
+  "")
+    # If it fails, then pretend we aren't using GCC.
+    ac_prog=ld
+    ;;
+  *)
+    # If it is relative, then search for the first ld in PATH.
+    with_gnu_ld=unknown
+    ;;
+  esac
+elif test "$with_gnu_ld" = yes; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for GNU ld" >&5
+$as_echo_n "checking for GNU ld... " >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for non-GNU ld" >&5
+$as_echo_n "checking for non-GNU ld... " >&6; }
+fi
+if ${lt_cv_path_LD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$LD"; then
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  for ac_dir in $PATH; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
+      lt_cv_path_LD="$ac_dir/$ac_prog"
+      # Check to see if the program is GNU ld.  I'd rather use --version,
+      # but apparently some variants of GNU ld only accept -v.
+      # Break only if it was the GNU/non-GNU ld that we prefer.
+      case `"$lt_cv_path_LD" -v 2>&1 </dev/null` in
+      *GNU* | *'with BFD'*)
+       test "$with_gnu_ld" != no && break
+       ;;
+      *)
+       test "$with_gnu_ld" != yes && break
+       ;;
+      esac
+    fi
+  done
+  IFS="$lt_save_ifs"
+else
+  lt_cv_path_LD="$LD" # Let the user override the test with a path.
+fi
+fi
+
+LD="$lt_cv_path_LD"
+if test -n "$LD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LD" >&5
+$as_echo "$LD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+test -z "$LD" && as_fn_error $? "no acceptable ld found in \$PATH" "$LINENO" 5
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if the linker ($LD) is GNU ld" >&5
+$as_echo_n "checking if the linker ($LD) is GNU ld... " >&6; }
+if ${lt_cv_prog_gnu_ld+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  # I'd rather use --version here, but apparently some GNU lds only accept -v.
+case `$LD -v 2>&1 </dev/null` in
+*GNU* | *'with BFD'*)
+  lt_cv_prog_gnu_ld=yes
+  ;;
+*)
+  lt_cv_prog_gnu_ld=no
+  ;;
+esac
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_gnu_ld" >&5
+$as_echo "$lt_cv_prog_gnu_ld" >&6; }
+with_gnu_ld=$lt_cv_prog_gnu_ld
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BSD- or MS-compatible name lister (nm)" >&5
+$as_echo_n "checking for BSD- or MS-compatible name lister (nm)... " >&6; }
+if ${lt_cv_path_NM+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NM"; then
+  # Let the user override the test.
+  lt_cv_path_NM="$NM"
+else
+  lt_nm_to_check="${ac_tool_prefix}nm"
+  if test -n "$ac_tool_prefix" && test "$build" = "$host"; then
+    lt_nm_to_check="$lt_nm_to_check nm"
+  fi
+  for lt_tmp_nm in $lt_nm_to_check; do
+    lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+    for ac_dir in $PATH /usr/ccs/bin/elf /usr/ccs/bin /usr/ucb /bin; do
+      IFS="$lt_save_ifs"
+      test -z "$ac_dir" && ac_dir=.
+      tmp_nm="$ac_dir/$lt_tmp_nm"
+      if test -f "$tmp_nm" || test -f "$tmp_nm$ac_exeext" ; then
+       # Check to see if the nm accepts a BSD-compat flag.
+       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
+       #   nm: unknown option "B" ignored
+       # Tru64's nm complains that /dev/null is an invalid object file
+       case `"$tmp_nm" -B /dev/null 2>&1 | sed '1q'` in
+       */dev/null* | *'Invalid file or object type'*)
+         lt_cv_path_NM="$tmp_nm -B"
+         break
+         ;;
+       *)
+         case `"$tmp_nm" -p /dev/null 2>&1 | sed '1q'` in
+         */dev/null*)
+           lt_cv_path_NM="$tmp_nm -p"
+           break
+           ;;
+         *)
+           lt_cv_path_NM=${lt_cv_path_NM="$tmp_nm"} # keep the first match, but
+           continue # so that we can try to find one that supports BSD flags
+           ;;
+         esac
+         ;;
+       esac
+      fi
+    done
+    IFS="$lt_save_ifs"
+  done
+  : ${lt_cv_path_NM=no}
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_NM" >&5
+$as_echo "$lt_cv_path_NM" >&6; }
+if test "$lt_cv_path_NM" != "no"; then
+  NM="$lt_cv_path_NM"
+else
+  # Didn't find any BSD compatible name lister, look for dumpbin.
+  if test -n "$DUMPBIN"; then :
+    # Let the user override the test.
+  else
+    if test -n "$ac_tool_prefix"; then
+  for ac_prog in dumpbin "link -dump"
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DUMPBIN"; then
+  ac_cv_prog_DUMPBIN="$DUMPBIN" # 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_DUMPBIN="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+DUMPBIN=$ac_cv_prog_DUMPBIN
+if test -n "$DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DUMPBIN" >&5
+$as_echo "$DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$DUMPBIN" && break
+  done
+fi
+if test -z "$DUMPBIN"; then
+  ac_ct_DUMPBIN=$DUMPBIN
+  for ac_prog in dumpbin "link -dump"
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DUMPBIN+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DUMPBIN"; then
+  ac_cv_prog_ac_ct_DUMPBIN="$ac_ct_DUMPBIN" # 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_DUMPBIN="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DUMPBIN=$ac_cv_prog_ac_ct_DUMPBIN
+if test -n "$ac_ct_DUMPBIN"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DUMPBIN" >&5
+$as_echo "$ac_ct_DUMPBIN" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_DUMPBIN" && break
+done
+
+  if test "x$ac_ct_DUMPBIN" = x; then
+    DUMPBIN=":"
+  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
+    DUMPBIN=$ac_ct_DUMPBIN
+  fi
+fi
+
+    case `$DUMPBIN -symbols /dev/null 2>&1 | sed '1q'` in
+    *COFF*)
+      DUMPBIN="$DUMPBIN -symbols"
+      ;;
+    *)
+      DUMPBIN=:
+      ;;
+    esac
+  fi
+
+  if test "$DUMPBIN" != ":"; then
+    NM="$DUMPBIN"
+  fi
+fi
+test -z "$NM" && NM=nm
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the name lister ($NM) interface" >&5
+$as_echo_n "checking the name lister ($NM) interface... " >&6; }
+if ${lt_cv_nm_interface+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_nm_interface="BSD nm"
+  echo "int some_variable = 0;" > conftest.$ac_ext
+  (eval echo "\"\$as_me:$LINENO: $ac_compile\"" >&5)
+  (eval "$ac_compile" 2>conftest.err)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
+  (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
+  cat conftest.err >&5
+  (eval echo "\"\$as_me:$LINENO: output\"" >&5)
+  cat conftest.out >&5
+  if $GREP 'External.*some_variable' conftest.out > /dev/null; then
+    lt_cv_nm_interface="MS dumpbin"
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_nm_interface" >&5
+$as_echo "$lt_cv_nm_interface" >&6; }
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ln -s works" >&5
+$as_echo_n "checking whether ln -s works... " >&6; }
+LN_S=$as_ln_s
+if test "$LN_S" = "ln -s"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no, using $LN_S" >&5
+$as_echo "no, using $LN_S" >&6; }
+fi
+
+# find the maximum length of command line arguments
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking the maximum length of command line arguments" >&5
+$as_echo_n "checking the maximum length of command line arguments... " >&6; }
+if ${lt_cv_sys_max_cmd_len+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+    i=0
+  teststring="ABCD"
+
+  case $build_os in
+  msdosdjgpp*)
+    # On DJGPP, this test can blow up pretty badly due to problems in libc
+    # (any single argument exceeding 2000 bytes causes a buffer overrun
+    # during glob expansion).  Even if it were fixed, the result of this
+    # check would be larger than it should be.
+    lt_cv_sys_max_cmd_len=12288;    # 12K is about right
+    ;;
+
+  gnu*)
+    # Under GNU Hurd, this test is not required because there is
+    # no limit to the length of command line arguments.
+    # Libtool will interpret -1 as no limit whatsoever
+    lt_cv_sys_max_cmd_len=-1;
+    ;;
+
+  cygwin* | mingw* | cegcc*)
+    # On Win9x/ME, this test blows up -- it succeeds, but takes
+    # about 5 minutes as the teststring grows exponentially.
+    # Worse, since 9x/ME are not pre-emptively multitasking,
+    # you end up with a "frozen" computer, even though with patience
+    # the test eventually succeeds (with a max line length of 256k).
+    # Instead, let's just punt: use the minimum linelength reported by
+    # all of the supported platforms: 8192 (on NT/2K/XP).
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  mint*)
+    # On MiNT this can take a long time and run out of memory.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  amigaos*)
+    # On AmigaOS with pdksh, this test takes hours, literally.
+    # So we just punt and use a minimum line length of 8192.
+    lt_cv_sys_max_cmd_len=8192;
+    ;;
+
+  netbsd* | freebsd* | openbsd* | darwin* | dragonfly*)
+    # This has been around since 386BSD, at least.  Likely further.
+    if test -x /sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax`
+    elif test -x /usr/sbin/sysctl; then
+      lt_cv_sys_max_cmd_len=`/usr/sbin/sysctl -n kern.argmax`
+    else
+      lt_cv_sys_max_cmd_len=65536      # usable default for all BSDs
+    fi
+    # And add a safety zone
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+    lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    ;;
+
+  interix*)
+    # We know the value 262144 and hardcode it with a safety zone (like BSD)
+    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
+    # nice to cause kernel panics so lets avoid the loop below.
+    # First set a reasonable default.
+    lt_cv_sys_max_cmd_len=16384
+    #
+    if test -x /sbin/sysconfig; then
+      case `/sbin/sysconfig -q proc exec_disable_arg_limit` in
+        *1*) lt_cv_sys_max_cmd_len=-1 ;;
+      esac
+    fi
+    ;;
+  sco3.2v5*)
+    lt_cv_sys_max_cmd_len=102400
+    ;;
+  sysv5* | sco5v6* | sysv4.2uw2*)
+    kargmax=`grep ARG_MAX /etc/conf/cf.d/stune 2>/dev/null`
+    if test -n "$kargmax"; then
+      lt_cv_sys_max_cmd_len=`echo $kargmax | sed 's/.*[         ]//'`
+    else
+      lt_cv_sys_max_cmd_len=32768
+    fi
+    ;;
+  *)
+    lt_cv_sys_max_cmd_len=`(getconf ARG_MAX) 2> /dev/null`
+    if test -n "$lt_cv_sys_max_cmd_len" && \
+       test undefined != "$lt_cv_sys_max_cmd_len"; then
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 4`
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \* 3`
+    else
+      # Make teststring a little bigger before we do anything with it.
+      # a 1K string should be a reasonable start.
+      for i in 1 2 3 4 5 6 7 8 ; do
+        teststring=$teststring$teststring
+      done
+      SHELL=${SHELL-${CONFIG_SHELL-/bin/sh}}
+      # 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"`env echo "$teststring$teststring" 2>/dev/null` \
+                = "X$teststring$teststring"; } >/dev/null 2>&1 &&
+             test $i != 17 # 1/2 MB should be enough
+      do
+        i=`expr $i + 1`
+        teststring=$teststring$teststring
+      done
+      # Only check the string length outside the loop.
+      lt_cv_sys_max_cmd_len=`expr "X$teststring" : ".*" 2>&1`
+      teststring=
+      # Add a significant safety factor because C++ compilers can tack on
+      # massive amounts of additional arguments before passing them to the
+      # linker.  It appears as though 1/2 is a usable value.
+      lt_cv_sys_max_cmd_len=`expr $lt_cv_sys_max_cmd_len \/ 2`
+    fi
+    ;;
+  esac
+
+fi
+
+if test -n $lt_cv_sys_max_cmd_len ; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_max_cmd_len" >&5
+$as_echo "$lt_cv_sys_max_cmd_len" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: none" >&5
+$as_echo "none" >&6; }
+fi
+max_cmd_len=$lt_cv_sys_max_cmd_len
+
+
+
+
+
+
+: ${CP="cp -f"}
+: ${MV="mv -f"}
+: ${RM="rm -f"}
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands some XSI constructs" >&5
+$as_echo_n "checking whether the shell understands some XSI constructs... " >&6; }
+# Try some XSI features
+xsi_shell=no
+( _lt_dummy="a/b/c"
+  test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+      = c,a/b,b/c, \
+    && eval 'test $(( 1 + 1 )) -eq 2 \
+    && test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
+  && xsi_shell=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $xsi_shell" >&5
+$as_echo "$xsi_shell" >&6; }
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the shell understands \"+=\"" >&5
+$as_echo_n "checking whether the shell understands \"+=\"... " >&6; }
+lt_shell_append=no
+( foo=bar; set foo baz; eval "$1+=\$2" && test "$foo" = barbaz ) \
+    >/dev/null 2>&1 \
+  && lt_shell_append=yes
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_shell_append" >&5
+$as_echo "$lt_shell_append" >&6; }
+
+
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  lt_unset=unset
+else
+  lt_unset=false
+fi
+
+
+
+
+
+# test EBCDIC or ASCII
+case `echo X|tr X '\101'` in
+ A) # ASCII based system
+    # \n is not interpreted correctly by Solaris 8 /usr/ucb/tr
+  lt_SP2NL='tr \040 \012'
+  lt_NL2SP='tr \015\012 \040\040'
+  ;;
+ *) # EBCDIC based system
+  lt_SP2NL='tr \100 \n'
+  lt_NL2SP='tr \r\n \100\100'
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+        ;;
+    esac
+    ;;
+  *-*-cygwin* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+        ;;
+      *-*-cygwin* )
+        lt_cv_to_host_file_cmd=func_convert_file_noop
+        ;;
+      * ) # otherwise, assume *nix
+        lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+        ;;
+    esac
+    ;;
+  * ) # unhandled hosts (and "normal" native builds)
+    lt_cv_to_host_file_cmd=func_convert_file_noop
+    ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+  *-*-mingw* )
+    case $build in
+      *-*-mingw* ) # actually msys
+        lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+        ;;
+    esac
+    ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
+$as_echo_n "checking for $LD option to reload object files... " >&6; }
+if ${lt_cv_ld_reload_flag+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_reload_flag='-r'
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_reload_flag" >&5
+$as_echo "$lt_cv_ld_reload_flag" >&6; }
+reload_flag=$lt_cv_ld_reload_flag
+case $reload_flag in
+"" | " "*) ;;
+*) reload_flag=" $reload_flag" ;;
+esac
+reload_cmds='$LD$reload_flag -o $output$reload_objs'
+case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    if test "$GCC" != yes; then
+      reload_cmds=false
+    fi
+    ;;
+  darwin*)
+    if test "$GCC" = yes; then
+      reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
+    else
+      reload_cmds='$LD$reload_flag -o $output$reload_objs'
+    fi
+    ;;
+esac
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}objdump", so it can be a program name with args.
+set dummy ${ac_tool_prefix}objdump; 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_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OBJDUMP"; then
+  ac_cv_prog_OBJDUMP="$OBJDUMP" # 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_OBJDUMP="${ac_tool_prefix}objdump"
+    $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
+OBJDUMP=$ac_cv_prog_OBJDUMP
+if test -n "$OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OBJDUMP" >&5
+$as_echo "$OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OBJDUMP"; then
+  ac_ct_OBJDUMP=$OBJDUMP
+  # Extract the first word of "objdump", so it can be a program name with args.
+set dummy objdump; 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_OBJDUMP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OBJDUMP"; then
+  ac_cv_prog_ac_ct_OBJDUMP="$ac_ct_OBJDUMP" # 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_OBJDUMP="objdump"
+    $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_OBJDUMP=$ac_cv_prog_ac_ct_OBJDUMP
+if test -n "$ac_ct_OBJDUMP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OBJDUMP" >&5
+$as_echo "$ac_ct_OBJDUMP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OBJDUMP" = x; then
+    OBJDUMP="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    OBJDUMP=$ac_ct_OBJDUMP
+  fi
+else
+  OBJDUMP="$ac_cv_prog_OBJDUMP"
+fi
+
+test -z "$OBJDUMP" && OBJDUMP=objdump
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to recognize dependent libraries" >&5
+$as_echo_n "checking how to recognize dependent libraries... " >&6; }
+if ${lt_cv_deplibs_check_method+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_file_magic_cmd='$MAGIC_CMD'
+lt_cv_file_magic_test_file=
+lt_cv_deplibs_check_method='unknown'
+# Need to set the preceding variable on all platforms that support
+# interlibrary dependencies.
+# 'none' -- dependencies not supported.
+# `unknown' -- same as none, but documents that we really don't know.
+# 'pass_all' -- all dependencies passed with no checks.
+# 'test_compile' -- check by making test program.
+# 'file_magic [[regex]]' -- check by looking for files in library path
+# which responds to the $file_magic_cmd with a given extended regex.
+# If you have `file' or equivalent on your system and you're not sure
+# whether `pass_all' will *always* work, you probably want this one.
+
+case $host_os in
+aix[4-9]*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+beos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+bsdi[45]*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib)'
+  lt_cv_file_magic_cmd='/usr/bin/file -L'
+  lt_cv_file_magic_test_file=/shlib/libc.so
+  ;;
+
+cygwin*)
+  # func_win32_libid is a shell function defined in ltmain.sh
+  lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+  lt_cv_file_magic_cmd='func_win32_libid'
+  ;;
+
+mingw* | pw32*)
+  # Base MSYS/MinGW do not provide the 'file' command needed by
+  # func_win32_libid shell function, so use a weaker test based on 'objdump',
+  # unless we find 'file', for example because we are cross-compiling.
+  # func_win32_libid assumes BSD nm, so disallow it if using MS dumpbin.
+  if ( test "$lt_cv_nm_interface" = "BSD nm" && file / ) >/dev/null 2>&1; then
+    lt_cv_deplibs_check_method='file_magic ^x86 archive import|^x86 DLL'
+    lt_cv_file_magic_cmd='func_win32_libid'
+  else
+    # Keep this pattern in sync with the one in func_win32_libid.
+    lt_cv_deplibs_check_method='file_magic file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)'
+    lt_cv_file_magic_cmd='$OBJDUMP -f'
+  fi
+  ;;
+
+cegcc*)
+  # use the weaker test based on 'objdump'. See mingw*.
+  lt_cv_deplibs_check_method='file_magic file format pe-arm-.*little(.*architecture: arm)?'
+  lt_cv_file_magic_cmd='$OBJDUMP -f'
+  ;;
+
+darwin* | rhapsody*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+freebsd* | dragonfly*)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    case $host_cpu in
+    i*86 )
+      # Not sure whether the presence of OpenBSD here was a mistake.
+      # Let's accept both of them until this is cleared up.
+      lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library'
+      lt_cv_file_magic_cmd=/usr/bin/file
+      lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*`
+      ;;
+    esac
+  else
+    lt_cv_deplibs_check_method=pass_all
+  fi
+  ;;
+
+haiku*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+hpux10.20* | hpux11*)
+  lt_cv_file_magic_cmd=/usr/bin/file
+  case $host_cpu in
+  ia64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64'
+    lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so
+    ;;
+  hppa*64*)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF[ -][0-9][0-9])(-bit)?( [LM]SB)? shared object( file)?[, -]* PA-RISC [0-9]\.[0-9]'
+    lt_cv_file_magic_test_file=/usr/lib/pa20_64/libc.sl
+    ;;
+  *)
+    lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9]\.[0-9]) shared library'
+    lt_cv_file_magic_test_file=/usr/lib/libc.sl
+    ;;
+  esac
+  ;;
+
+interix[3-9]*)
+  # PIC code is broken on Interix 3.x, that's why |\.a not |_pic\.a here
+  lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|\.a)$'
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $LD in
+  *-32|*"-32 ") libmagic=32-bit;;
+  *-n32|*"-n32 ") libmagic=N32;;
+  *-64|*"-64 ") libmagic=64-bit;;
+  *) libmagic=never-match;;
+  esac
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+netbsd* | netbsdelf*-gnu)
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so|_pic\.a)$'
+  fi
+  ;;
+
+newos6*)
+  lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (executable|dynamic lib)'
+  lt_cv_file_magic_cmd=/usr/bin/file
+  lt_cv_file_magic_test_file=/usr/lib/libnls.so
+  ;;
+
+*nto* | *qnx*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+openbsd*)
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|\.so|_pic\.a)$'
+  else
+    lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
+  fi
+  ;;
+
+osf3* | osf4* | osf5*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+rdos*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+solaris*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+
+sysv4 | sysv4.3*)
+  case $host_vendor in
+  motorola)
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [ML]SB (shared object|dynamic lib) M[0-9][0-9]* Version [0-9]'
+    lt_cv_file_magic_test_file=`echo /usr/lib/libc.so*`
+    ;;
+  ncr)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  sequent)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
+    ;;
+  sni)
+    lt_cv_file_magic_cmd='/bin/file'
+    lt_cv_deplibs_check_method="file_magic ELF [0-9][0-9]*-bit [LM]SB dynamic lib"
+    lt_cv_file_magic_test_file=/lib/libc.so
+    ;;
+  siemens)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  pc)
+    lt_cv_deplibs_check_method=pass_all
+    ;;
+  esac
+  ;;
+
+tpf*)
+  lt_cv_deplibs_check_method=pass_all
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
+$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+  case $host_os in
+  mingw* | pw32*)
+    if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+      want_nocaseglob=yes
+    else
+      file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+    fi
+    ;;
+  esac
+fi
+
+file_magic_cmd=$lt_cv_file_magic_cmd
+deplibs_check_method=$lt_cv_deplibs_check_method
+test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; 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_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DLLTOOL"; then
+  ac_cv_prog_DLLTOOL="$DLLTOOL" # 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_DLLTOOL="${ac_tool_prefix}dlltool"
+    $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
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+  ac_ct_DLLTOOL=$DLLTOOL
+  # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; 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_DLLTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DLLTOOL"; then
+  ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # 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_DLLTOOL="dlltool"
+    $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_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DLLTOOL" = x; then
+    DLLTOOL="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    DLLTOOL=$ac_ct_DLLTOOL
+  fi
+else
+  DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+  # two different shell functions defined in ltmain.sh
+  # decide which to use based on capabilities of $DLLTOOL
+  case `$DLLTOOL --help 2>&1` in
+  *--identify-strict*)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+    ;;
+  *)
+    lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+    ;;
+  esac
+  ;;
+*)
+  # fallback: assume linklib IS sharedlib
+  lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+  ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  for ac_prog in ar
+  do
+    # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$AR"; then
+  ac_cv_prog_AR="$AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+AR=$ac_cv_prog_AR
+if test -n "$AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AR" >&5
+$as_echo "$AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+    test -n "$AR" && break
+  done
+fi
+if test -z "$AR"; then
+  ac_ct_AR=$AR
+  for ac_prog in ar
+do
+  # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_AR+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_AR"; then
+  ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_prog_ac_ct_AR="$ac_prog"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_AR=$ac_cv_prog_ac_ct_AR
+if test -n "$ac_ct_AR"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_AR" >&5
+$as_echo "$ac_ct_AR" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  test -n "$ac_ct_AR" && break
+done
+
+  if test "x$ac_ct_AR" = x; then
+    AR="false"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+    AR=$ac_ct_AR
+  fi
+fi
+
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ar_at_file=no
+   cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  echo conftest.$ac_objext > conftest.lst
+      lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+      { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+      if test "$ac_status" -eq 0; then
+       # Ensure the archiver fails upon bogus file names.
+       rm -f conftest.$ac_objext libconftest.a
+       { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+  (eval $lt_ar_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+       if test "$ac_status" -ne 0; then
+          lt_cv_ar_at_file=@
+        fi
+      fi
+      rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+  archiver_list_spec=
+else
+  archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
+set dummy ${ac_tool_prefix}strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$STRIP"; then
+  ac_cv_prog_STRIP="$STRIP" # 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_STRIP="${ac_tool_prefix}strip"
+    $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
+STRIP=$ac_cv_prog_STRIP
+if test -n "$STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5
+$as_echo "$STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_STRIP"; then
+  ac_ct_STRIP=$STRIP
+  # Extract the first word of "strip", so it can be a program name with args.
+set dummy strip; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_STRIP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_STRIP"; then
+  ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # 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_STRIP="strip"
+    $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_STRIP=$ac_cv_prog_ac_ct_STRIP
+if test -n "$ac_ct_STRIP"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5
+$as_echo "$ac_ct_STRIP" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_STRIP" = x; then
+    STRIP=":"
+  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
+    STRIP=$ac_ct_STRIP
+  fi
+else
+  STRIP="$ac_cv_prog_STRIP"
+fi
+
+test -z "$STRIP" && STRIP=:
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
+set dummy ${ac_tool_prefix}ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # 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_RANLIB="${ac_tool_prefix}ranlib"
+    $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
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $RANLIB" >&5
+$as_echo "$RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_RANLIB"; then
+  ac_ct_RANLIB=$RANLIB
+  # Extract the first word of "ranlib", so it can be a program name with args.
+set dummy ranlib; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_RANLIB+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # 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_RANLIB="ranlib"
+    $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_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_RANLIB" >&5
+$as_echo "$ac_ct_RANLIB" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  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
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+test -z "$RANLIB" && RANLIB=:
+
+
+
+
+
+
+# Determine commands to create old-style static archives.
+old_archive_cmds='$AR $AR_FLAGS $oldlib$oldobjs'
+old_postinstall_cmds='chmod 644 $oldlib'
+old_postuninstall_cmds=
+
+if test -n "$RANLIB"; then
+  case $host_os in
+  openbsd*)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
+    ;;
+  *)
+    old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
+    ;;
+  esac
+  old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
+fi
+
+case $host_os in
+  darwin*)
+    lock_old_archive_extraction=yes ;;
+  *)
+    lock_old_archive_extraction=no ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+
+# Check for command to grab the raw symbol name followed by C symbol from nm.
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking command to parse $NM output from $compiler object" >&5
+$as_echo_n "checking command to parse $NM output from $compiler object... " >&6; }
+if ${lt_cv_sys_global_symbol_pipe+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+
+# These are sane defaults that work on at least a few old systems.
+# [They come from Ultrix.  What could be older than Ultrix?!! ;)]
+
+# Character class describing NM global symbol codes.
+symcode='[BCDEGRST]'
+
+# Regexp to match symbols that can be accessed directly from C.
+sympat='\([_A-Za-z][_A-Za-z0-9]*\)'
+
+# Define system-specific variables.
+case $host_os in
+aix*)
+  symcode='[BCDT]'
+  ;;
+cygwin* | mingw* | pw32* | cegcc*)
+  symcode='[ABCDGISTW]'
+  ;;
+hpux*)
+  if test "$host_cpu" = ia64; then
+    symcode='[ABCDEGRST]'
+  fi
+  ;;
+irix* | nonstopux*)
+  symcode='[BCDEGRST]'
+  ;;
+osf*)
+  symcode='[BCDEGQRST]'
+  ;;
+solaris*)
+  symcode='[BDRT]'
+  ;;
+sco3.2v5*)
+  symcode='[DT]'
+  ;;
+sysv4.2uw2*)
+  symcode='[DT]'
+  ;;
+sysv5* | sco5v6* | unixware* | OpenUNIX*)
+  symcode='[ABDT]'
+  ;;
+sysv4)
+  symcode='[DFNSTU]'
+  ;;
+esac
+
+# If we're using GNU nm, then use its standard symbol codes.
+case `$NM -V 2>&1` in
+*GNU* | *'with BFD'*)
+  symcode='[ABCDGIRSTW]' ;;
+esac
+
+# Transform an extracted symbol line into a proper C declaration.
+# Some systems (esp. on ia64) link data and code symbols differently,
+# so use this general approach.
+lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
+
+# Transform an extracted symbol line into symbol name and symbol address
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/  {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/  {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/  {\"lib\2\", (void *) \&\2},/p'"
+
+# Handle CRLF in mingw tool chain
+opt_cr=
+case $build_os in
+mingw*)
+  opt_cr=`$ECHO 'x\{0,1\}' | tr x '\015'` # option cr in regexp
+  ;;
+esac
+
+# Try without a prefix underscore, then with it.
+for ac_symprfx in "" "_"; do
+
+  # Transform symcode, sympat, and symprfx into a raw symbol and a C symbol.
+  symxfrm="\\1 $ac_symprfx\\2 \\2"
+
+  # Write the raw and C identifiers.
+  if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+    # Fake it for dumpbin and say T for any non-static function
+    # and D for any global variable.
+    # Also find C++ and __fastcall symbols from MSVC++,
+    # 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};"\
+"     {if(hide[section]) next};"\
+"     {f=0}; \$ 0~/\(\).*\|/{f=1}; {printf f ? \"T \" : \"D \"};"\
+"     {split(\$ 0, a, /\||\r/); split(a[2], s)};"\
+"     s[1]~/^[@?]/{print s[1], s[1]; next};"\
+"     s[1]~prfx {split(s[1],t,\"@\"); print t[1], substr(t[1],length(prfx))}"\
+"     ' prfx=^$ac_symprfx"
+  else
+    lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[     ]\($symcode$symcode*\)[         ][      ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
+  fi
+  lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
+
+  # Check to see that the pipe works correctly.
+  pipe_works=no
+
+  rm -f conftest*
+  cat > conftest.$ac_ext <<_LT_EOF
+#ifdef __cplusplus
+extern "C" {
+#endif
+char nm_test_var;
+void nm_test_func(void);
+void nm_test_func(void){}
+#ifdef __cplusplus
+}
+#endif
+int main(){nm_test_var='a';nm_test_func();return(0);}
+_LT_EOF
+
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    # Now try to grab the symbols.
+    nlist=conftest.nm
+    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist\""; } >&5
+  (eval $NM conftest.$ac_objext \| "$lt_cv_sys_global_symbol_pipe" \> $nlist) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s "$nlist"; then
+      # Try sorting and uniquifying the output.
+      if sort "$nlist" | uniq > "$nlist"T; then
+       mv -f "$nlist"T "$nlist"
+      else
+       rm -f "$nlist"T
+      fi
+
+      # Make sure that we snagged all the symbols we need.
+      if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
+       if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
+         cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests.  */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+   relocations are performed -- see ld's documentation on pseudo-relocs.  */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data.  */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+_LT_EOF
+         # Now generate the symbol file.
+         eval "$lt_cv_sys_global_symbol_to_cdecl"' < "$nlist" | $GREP -v main >> conftest.$ac_ext'
+
+         cat <<_LT_EOF >> conftest.$ac_ext
+
+/* The mapping between symbol names and symbols.  */
+LT_DLSYM_CONST struct {
+  const char *name;
+  void       *address;
+}
+lt__PROGRAM__LTX_preloaded_symbols[] =
+{
+  { "@PROGRAM@", (void *) 0 },
+_LT_EOF
+         $SED "s/^$symcode$symcode* \(.*\) \(.*\)$/  {\"\2\", (void *) \&\2},/" < "$nlist" | $GREP -v main >> conftest.$ac_ext
+         cat <<\_LT_EOF >> conftest.$ac_ext
+  {0, (void *) 0}
+};
+
+/* This works around a problem in FreeBSD linker */
+#ifdef FREEBSD_WORKAROUND
+static const void *lt_preloaded_setup() {
+  return lt__PROGRAM__LTX_preloaded_symbols;
+}
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+_LT_EOF
+         # Now try linking the two files.
+         mv conftest.$ac_objext conftstm.$ac_objext
+         lt_globsym_save_LIBS=$LIBS
+         lt_globsym_save_CFLAGS=$CFLAGS
+         LIBS="conftstm.$ac_objext"
+         CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
+         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
+           pipe_works=yes
+         fi
+         LIBS=$lt_globsym_save_LIBS
+         CFLAGS=$lt_globsym_save_CFLAGS
+       else
+         echo "cannot find nm_test_func in $nlist" >&5
+       fi
+      else
+       echo "cannot find nm_test_var in $nlist" >&5
+      fi
+    else
+      echo "cannot run $lt_cv_sys_global_symbol_pipe" >&5
+    fi
+  else
+    echo "$progname: failed program was:" >&5
+    cat conftest.$ac_ext >&5
+  fi
+  rm -rf conftest* conftst*
+
+  # Do not use the global_symbol_pipe unless it works.
+  if test "$pipe_works" = yes; then
+    break
+  else
+    lt_cv_sys_global_symbol_pipe=
+  fi
+done
+
+fi
+
+if test -z "$lt_cv_sys_global_symbol_pipe"; then
+  lt_cv_sys_global_symbol_to_cdecl=
+fi
+if test -z "$lt_cv_sys_global_symbol_pipe$lt_cv_sys_global_symbol_to_cdecl"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: failed" >&5
+$as_echo "failed" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: ok" >&5
+$as_echo "ok" >&6; }
+fi
+
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+  nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+  nm_file_list_spec='@'
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+  withval=$with_sysroot;
+else
+  with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+   if test "$GCC" = yes; then
+     lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+   fi
+   ;; #(
+ /*)
+   lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+   ;; #(
+ no|'')
+   ;; #(
+ *)
+   { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+   as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+   ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
+# Check whether --enable-libtool-lock was given.
+if test "${enable_libtool_lock+set}" = set; then :
+  enableval=$enable_libtool_lock;
+fi
+
+test "x$enable_libtool_lock" != xno && enable_libtool_lock=yes
+
+# Some flags need to be propagated to the compiler or linker for good
+# libtool support.
+case $host in
+ia64-*-hpux*)
+  # Find out which ABI we are using.
+  echo 'int i;' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.$ac_objext` in
+      *ELF-32*)
+       HPUX_IA64_MODE="32"
+       ;;
+      *ELF-64*)
+       HPUX_IA64_MODE="64"
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+*-*-irix6*)
+  # Find out which ABI we are using.
+  echo '#line '$LINENO' "configure"' > conftest.$ac_ext
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    if test "$lt_cv_prog_gnu_ld" = yes; then
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -melf32bsmip"
+         ;;
+       *N32*)
+         LD="${LD-ld} -melf32bmipn32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -melf64bmip"
+       ;;
+      esac
+    else
+      case `/usr/bin/file conftest.$ac_objext` in
+       *32-bit*)
+         LD="${LD-ld} -32"
+         ;;
+       *N32*)
+         LD="${LD-ld} -n32"
+         ;;
+       *64-bit*)
+         LD="${LD-ld} -64"
+         ;;
+      esac
+    fi
+  fi
+  rm -rf conftest*
+  ;;
+
+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
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+      *32-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_i386_fbsd"
+           ;;
+         x86_64-*linux*)
+           case `/usr/bin/file conftest.o` in
+             *x86-64*)
+               LD="${LD-ld} -m elf32_x86_64"
+               ;;
+             *)
+               LD="${LD-ld} -m elf_i386"
+               ;;
+           esac
+           ;;
+         powerpc64le-*)
+           LD="${LD-ld} -m elf32lppclinux"
+           ;;
+         powerpc64-*)
+           LD="${LD-ld} -m elf32ppclinux"
+           ;;
+         s390x-*linux*)
+           LD="${LD-ld} -m elf_s390"
+           ;;
+         sparc64-*linux*)
+           LD="${LD-ld} -m elf32_sparc"
+           ;;
+       esac
+       ;;
+      *64-bit*)
+       case $host in
+         x86_64-*kfreebsd*-gnu)
+           LD="${LD-ld} -m elf_x86_64_fbsd"
+           ;;
+         x86_64-*linux*)
+           LD="${LD-ld} -m elf_x86_64"
+           ;;
+         powerpcle-*)
+           LD="${LD-ld} -m elf64lppc"
+           ;;
+         powerpc-*)
+           LD="${LD-ld} -m elf64ppc"
+           ;;
+         s390*-*linux*|s390*-*tpf*)
+           LD="${LD-ld} -m elf64_s390"
+           ;;
+         sparc*-*linux*)
+           LD="${LD-ld} -m elf64_sparc"
+           ;;
+       esac
+       ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+
+*-*-sco3.2v5*)
+  # On SCO OpenServer 5, we need -belf to get full-featured binaries.
+  SAVE_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -belf"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler needs -belf" >&5
+$as_echo_n "checking whether the C compiler needs -belf... " >&6; }
+if ${lt_cv_cc_needs_belf+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+     cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_cc_needs_belf=yes
+else
+  lt_cv_cc_needs_belf=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+     ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_cc_needs_belf" >&5
+$as_echo "$lt_cv_cc_needs_belf" >&6; }
+  if test x"$lt_cv_cc_needs_belf" != x"yes"; then
+    # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
+    CFLAGS="$SAVE_CFLAGS"
+  fi
+  ;;
+*-*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
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+    case `/usr/bin/file conftest.o` in
+    *64-bit*)
+      case $lt_cv_prog_gnu_ld in
+      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"
+       fi
+       ;;
+      esac
+      ;;
+    esac
+  fi
+  rm -rf conftest*
+  ;;
+esac
+
+need_locks="$enable_libtool_lock"
+
+if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; 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_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$MANIFEST_TOOL"; then
+  ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # 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_MANIFEST_TOOL="${ac_tool_prefix}mt"
+    $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
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+  ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+  # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; 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_MANIFEST_TOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_MANIFEST_TOOL"; then
+  ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # 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_MANIFEST_TOOL="mt"
+    $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_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_MANIFEST_TOOL" = x; then
+    MANIFEST_TOOL=":"
+  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
+    MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+  fi
+else
+  MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_path_mainfest_tool=no
+  echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+  $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+  cat conftest.err >&5
+  if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+    lt_cv_path_mainfest_tool=yes
+  fi
+  rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+  MANIFEST_TOOL=:
+fi
+
+
+
+
+
+
+  case $host_os in
+    rhapsody* | darwin*)
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}dsymutil", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dsymutil; 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_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$DSYMUTIL"; then
+  ac_cv_prog_DSYMUTIL="$DSYMUTIL" # 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_DSYMUTIL="${ac_tool_prefix}dsymutil"
+    $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
+DSYMUTIL=$ac_cv_prog_DSYMUTIL
+if test -n "$DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DSYMUTIL" >&5
+$as_echo "$DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DSYMUTIL"; then
+  ac_ct_DSYMUTIL=$DSYMUTIL
+  # Extract the first word of "dsymutil", so it can be a program name with args.
+set dummy dsymutil; 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_DSYMUTIL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_DSYMUTIL"; then
+  ac_cv_prog_ac_ct_DSYMUTIL="$ac_ct_DSYMUTIL" # 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_DSYMUTIL="dsymutil"
+    $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_DSYMUTIL=$ac_cv_prog_ac_ct_DSYMUTIL
+if test -n "$ac_ct_DSYMUTIL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DSYMUTIL" >&5
+$as_echo "$ac_ct_DSYMUTIL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_DSYMUTIL" = x; then
+    DSYMUTIL=":"
+  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
+    DSYMUTIL=$ac_ct_DSYMUTIL
+  fi
+else
+  DSYMUTIL="$ac_cv_prog_DSYMUTIL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}nmedit", so it can be a program name with args.
+set dummy ${ac_tool_prefix}nmedit; 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_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$NMEDIT"; then
+  ac_cv_prog_NMEDIT="$NMEDIT" # 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_NMEDIT="${ac_tool_prefix}nmedit"
+    $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
+NMEDIT=$ac_cv_prog_NMEDIT
+if test -n "$NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $NMEDIT" >&5
+$as_echo "$NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_NMEDIT"; then
+  ac_ct_NMEDIT=$NMEDIT
+  # Extract the first word of "nmedit", so it can be a program name with args.
+set dummy nmedit; 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_NMEDIT+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_NMEDIT"; then
+  ac_cv_prog_ac_ct_NMEDIT="$ac_ct_NMEDIT" # 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_NMEDIT="nmedit"
+    $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_NMEDIT=$ac_cv_prog_ac_ct_NMEDIT
+if test -n "$ac_ct_NMEDIT"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_NMEDIT" >&5
+$as_echo "$ac_ct_NMEDIT" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_NMEDIT" = x; then
+    NMEDIT=":"
+  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
+    NMEDIT=$ac_ct_NMEDIT
+  fi
+else
+  NMEDIT="$ac_cv_prog_NMEDIT"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}lipo", so it can be a program name with args.
+set dummy ${ac_tool_prefix}lipo; 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_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$LIPO"; then
+  ac_cv_prog_LIPO="$LIPO" # 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_LIPO="${ac_tool_prefix}lipo"
+    $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
+LIPO=$ac_cv_prog_LIPO
+if test -n "$LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LIPO" >&5
+$as_echo "$LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_LIPO"; then
+  ac_ct_LIPO=$LIPO
+  # Extract the first word of "lipo", so it can be a program name with args.
+set dummy lipo; 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_LIPO+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_LIPO"; then
+  ac_cv_prog_ac_ct_LIPO="$ac_ct_LIPO" # 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_LIPO="lipo"
+    $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_LIPO=$ac_cv_prog_ac_ct_LIPO
+if test -n "$ac_ct_LIPO"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_LIPO" >&5
+$as_echo "$ac_ct_LIPO" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_LIPO" = x; then
+    LIPO=":"
+  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
+    LIPO=$ac_ct_LIPO
+  fi
+else
+  LIPO="$ac_cv_prog_LIPO"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool; 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_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL"; then
+  ac_cv_prog_OTOOL="$OTOOL" # 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_OTOOL="${ac_tool_prefix}otool"
+    $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
+OTOOL=$ac_cv_prog_OTOOL
+if test -n "$OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL" >&5
+$as_echo "$OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL"; then
+  ac_ct_OTOOL=$OTOOL
+  # Extract the first word of "otool", so it can be a program name with args.
+set dummy otool; 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_OTOOL+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL"; then
+  ac_cv_prog_ac_ct_OTOOL="$ac_ct_OTOOL" # 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_OTOOL="otool"
+    $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_OTOOL=$ac_cv_prog_ac_ct_OTOOL
+if test -n "$ac_ct_OTOOL"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL" >&5
+$as_echo "$ac_ct_OTOOL" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL" = x; then
+    OTOOL=":"
+  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
+    OTOOL=$ac_ct_OTOOL
+  fi
+else
+  OTOOL="$ac_cv_prog_OTOOL"
+fi
+
+    if test -n "$ac_tool_prefix"; then
+  # Extract the first word of "${ac_tool_prefix}otool64", so it can be a program name with args.
+set dummy ${ac_tool_prefix}otool64; 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_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$OTOOL64"; then
+  ac_cv_prog_OTOOL64="$OTOOL64" # 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_OTOOL64="${ac_tool_prefix}otool64"
+    $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
+OTOOL64=$ac_cv_prog_OTOOL64
+if test -n "$OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $OTOOL64" >&5
+$as_echo "$OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_OTOOL64"; then
+  ac_ct_OTOOL64=$OTOOL64
+  # Extract the first word of "otool64", so it can be a program name with args.
+set dummy otool64; 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_OTOOL64+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -n "$ac_ct_OTOOL64"; then
+  ac_cv_prog_ac_ct_OTOOL64="$ac_ct_OTOOL64" # 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_OTOOL64="otool64"
+    $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_OTOOL64=$ac_cv_prog_ac_ct_OTOOL64
+if test -n "$ac_ct_OTOOL64"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_OTOOL64" >&5
+$as_echo "$ac_ct_OTOOL64" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+  if test "x$ac_ct_OTOOL64" = x; then
+    OTOOL64=":"
+  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
+    OTOOL64=$ac_ct_OTOOL64
+  fi
+else
+  OTOOL64="$ac_cv_prog_OTOOL64"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -single_module linker flag" >&5
+$as_echo_n "checking for -single_module linker flag... " >&6; }
+if ${lt_cv_apple_cc_single_mod+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_apple_cc_single_mod=no
+      if test -z "${LT_MULTI_MODULE}"; then
+       # By default we will add the -single_module flag. You can override
+       # by either setting the environment variable LT_MULTI_MODULE
+       # non-empty at configure time, or by adding -multi_module to the
+       # link flags.
+       rm -rf libconftest.dylib*
+       echo "int foo(void){return 1;}" > conftest.c
+       echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+-dynamiclib -Wl,-single_module conftest.c" >&5
+       $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
+         -dynamiclib -Wl,-single_module conftest.c 2>conftest.err
+        _lt_result=$?
+       # 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
+       fi
+       rm -rf libconftest.dylib*
+       rm -f conftest.*
+      fi
+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 :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_exported_symbols_list=no
+      save_LDFLAGS=$LDFLAGS
+      echo "_main" > conftest.sym
+      LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym"
+      cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_ld_exported_symbols_list=yes
+else
+  lt_cv_ld_exported_symbols_list=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+       LDFLAGS="$save_LDFLAGS"
+
+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 :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_ld_force_load=no
+      cat > conftest.c << _LT_EOF
+int forced_loaded() { return 2;}
+_LT_EOF
+      echo "$LTCC $LTCFLAGS -c -o conftest.o conftest.c" >&5
+      $LTCC $LTCFLAGS -c -o conftest.o conftest.c 2>&5
+      echo "$AR cru libconftest.a conftest.o" >&5
+      $AR cru libconftest.a conftest.o 2>&5
+      echo "$RANLIB libconftest.a" >&5
+      $RANLIB libconftest.a 2>&5
+      cat > conftest.c << _LT_EOF
+int main() { return 0;}
+_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 -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
+      fi
+        rm -f conftest.err libconftest.a conftest conftest.c
+        rm -rf conftest.dSYM
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_force_load" >&5
+$as_echo "$lt_cv_ld_force_load" >&6; }
+    case $host_os in
+    rhapsody* | darwin1.[012])
+      _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;;
+    darwin1.*)
+      _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+    darwin*) # darwin 5.x on
+      # if running on 10.5 or later, the deployment target defaults
+      # to the OS version, if on x86, and 10.4, the deployment
+      # target defaults to 10.4. Don't you love it?
+      case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in
+       10.0,*86*-darwin8*|10.0,*-darwin[91]*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+       10.[012]*)
+         _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;;
+       10.*)
+         _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;;
+      esac
+    ;;
+  esac
+    if test "$lt_cv_apple_cc_single_mod" = "yes"; then
+      _lt_dar_single_mod='$single_module'
+    fi
+    if test "$lt_cv_ld_exported_symbols_list" = "yes"; then
+      _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym'
+    else
+      _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}'
+    fi
+    if test "$DSYMUTIL" != ":" && test "$lt_cv_ld_force_load" = "no"; then
+      _lt_dsymutil='~$DSYMUTIL $lib || :'
+    else
+      _lt_dsymutil=
+    fi
+    ;;
+  esac
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5
+$as_echo_n "checking how to run the C preprocessor... " >&6; }
+# On Suns, sometimes $CPP names a directory.
+if test -n "$CPP" && test -d "$CPP"; then
+  CPP=
+fi
+if test -z "$CPP"; then
+  if ${ac_cv_prog_CPP+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5
+$as_echo "$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # On the NeXT, cc -E runs the code through the compiler's parser,
+  # not just through cpp. "Syntax error" is here to catch this case.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+                    Syntax error
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+
+else
+  # Broken: fails on valid input.
+continue
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if ac_fn_c_try_cpp "$LINENO"; then :
+  # Broken: success on invalid input.
+continue
+else
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+rm -f conftest.err conftest.i conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.i conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5
+$as_echo_n "checking for ANSI C header files... " >&6; }
+if ${ac_cv_header_stdc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+  ac_cv_header_stdc=yes
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+if test $ac_cv_header_stdc = yes; then
+  # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then :
+  :
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+                  (('a' <= (c) && (c) <= 'i') \
+                    || ('j' <= (c) && (c) <= 'r') \
+                    || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+       || toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+else
+  ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5
+$as_echo "$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+$as_echo "#define STDC_HEADERS 1" >>confdefs.h
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
+                 inttypes.h stdint.h unistd.h
+do :
+  as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh`
+ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default
+"
+if eval test \"x\$"$as_ac_Header"\" = x"yes"; then :
+  cat >>confdefs.h <<_ACEOF
+#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+for ac_header in dlfcn.h
+do :
+  ac_fn_c_check_header_compile "$LINENO" "dlfcn.h" "ac_cv_header_dlfcn_h" "$ac_includes_default
+"
+if test "x$ac_cv_header_dlfcn_h" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_DLFCN_H 1
+_ACEOF
+
+fi
+
+done
+
+
+
+
+
+# Set options
+
+
+
+        enable_dlopen=no
+
+
+  enable_win32_dll=no
+
+
+            # Check whether --enable-shared was given.
+if test "${enable_shared+set}" = set; then :
+  enableval=$enable_shared; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_shared=yes ;;
+    no) enable_shared=no ;;
+    *)
+      enable_shared=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_shared=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_shared=yes
+fi
+
+
+
+
+
+
+
+
+
+  # Check whether --enable-static was given.
+if test "${enable_static+set}" = set; then :
+  enableval=$enable_static; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_static=yes ;;
+    no) enable_static=no ;;
+    *)
+     enable_static=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_static=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_static=yes
+fi
+
+
+
+
+
+
+
+
+
+
+# Check whether --with-pic was given.
+if test "${with_pic+set}" = set; then :
+  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
+
+
+test -z "$pic_mode" && pic_mode=default
+
+
+
+
+
+
+
+  # Check whether --enable-fast-install was given.
+if test "${enable_fast_install+set}" = set; then :
+  enableval=$enable_fast_install; p=${PACKAGE-default}
+    case $enableval in
+    yes) enable_fast_install=yes ;;
+    no) enable_fast_install=no ;;
+    *)
+      enable_fast_install=no
+      # Look at the argument we got.  We use all the common list separators.
+      lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+      for pkg in $enableval; do
+       IFS="$lt_save_ifs"
+       if test "X$pkg" = "X$p"; then
+         enable_fast_install=yes
+       fi
+      done
+      IFS="$lt_save_ifs"
+      ;;
+    esac
+else
+  enable_fast_install=yes
+fi
+
+
+
+
+
+
+
+
+
+
+
+# This can be used to rebuild libtool when needed
+LIBTOOL_DEPS="$ltmain"
+
+# Always use our own libtool.
+LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+test -z "$LN_S" && LN_S="ln -s"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+if test -n "${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for objdir" >&5
+$as_echo_n "checking for objdir... " >&6; }
+if ${lt_cv_objdir+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  rm -f .libs 2>/dev/null
+mkdir .libs 2>/dev/null
+if test -d .libs; then
+  lt_cv_objdir=.libs
+else
+  # MS-DOS does not allow filenames that begin with a dot.
+  lt_cv_objdir=_libs
+fi
+rmdir .libs 2>/dev/null
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_objdir" >&5
+$as_echo "$lt_cv_objdir" >&6; }
+objdir=$lt_cv_objdir
+
+
+
+
+
+cat >>confdefs.h <<_ACEOF
+#define LT_OBJDIR "$lt_cv_objdir/"
+_ACEOF
+
+
+
+
+case $host_os in
+aix3*)
+  # AIX sometimes has problems with the GCC collect2 program.  For some
+  # reason, if we set the COLLECT_NAMES environment variable, the problems
+  # vanish in a puff of smoke.
+  if test "X${COLLECT_NAMES+set}" != Xset; then
+    COLLECT_NAMES=
+    export COLLECT_NAMES
+  fi
+  ;;
+esac
+
+# Global variables:
+ofile=libtool
+can_build_shared=yes
+
+# All known linkers require a `.a' archive for static linking (except MSVC,
+# which needs '.lib').
+libext=a
+
+with_gnu_ld="$lt_cv_prog_gnu_ld"
+
+old_CC="$CC"
+old_CFLAGS="$CFLAGS"
+
+# Set sane defaults for various variables
+test -z "$CC" && CC=cc
+test -z "$LTCC" && LTCC=$CC
+test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS
+test -z "$LD" && LD=ld
+test -z "$ac_objext" && ac_objext=o
+
+for cc_temp in $compiler""; do
+  case $cc_temp in
+    compile | *[\\/]compile | ccache | *[\\/]ccache ) ;;
+    distcc | *[\\/]distcc | purify | *[\\/]purify ) ;;
+    \-*) ;;
+    *) break;;
+  esac
+done
+cc_basename=`$ECHO "$cc_temp" | $SED "s%.*/%%; s%^$host_alias-%%"`
+
+
+# Only perform the check for file, if the check method requires it
+test -z "$MAGIC_CMD" && MAGIC_CMD=file
+case $deplibs_check_method in
+file_magic*)
+  if test "$file_magic_cmd" = '$MAGIC_CMD'; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ${ac_tool_prefix}file" >&5
+$as_echo_n "checking for ${ac_tool_prefix}file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/${ac_tool_prefix}file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/${ac_tool_prefix}file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+
+
+if test -z "$lt_cv_path_MAGIC_CMD"; then
+  if test -n "$ac_tool_prefix"; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for file" >&5
+$as_echo_n "checking for file... " >&6; }
+if ${lt_cv_path_MAGIC_CMD+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $MAGIC_CMD in
+[\\/*] |  ?:[\\/]*)
+  lt_cv_path_MAGIC_CMD="$MAGIC_CMD" # Let the user override the test with a path.
+  ;;
+*)
+  lt_save_MAGIC_CMD="$MAGIC_CMD"
+  lt_save_ifs="$IFS"; IFS=$PATH_SEPARATOR
+  ac_dummy="/usr/bin$PATH_SEPARATOR$PATH"
+  for ac_dir in $ac_dummy; do
+    IFS="$lt_save_ifs"
+    test -z "$ac_dir" && ac_dir=.
+    if test -f $ac_dir/file; then
+      lt_cv_path_MAGIC_CMD="$ac_dir/file"
+      if test -n "$file_magic_test_file"; then
+       case $deplibs_check_method in
+       "file_magic "*)
+         file_magic_regex=`expr "$deplibs_check_method" : "file_magic \(.*\)"`
+         MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+         if eval $file_magic_cmd \$file_magic_test_file 2> /dev/null |
+           $EGREP "$file_magic_regex" > /dev/null; then
+           :
+         else
+           cat <<_LT_EOF 1>&2
+
+*** Warning: the command libtool uses to detect shared libraries,
+*** $file_magic_cmd, produces output that libtool cannot recognize.
+*** The result is that libtool may fail to recognize shared libraries
+*** as such.  This will affect the creation of libtool libraries that
+*** depend on shared libraries, but programs linked with such libtool
+*** libraries will work regardless of this problem.  Nevertheless, you
+*** may want to report the problem to your system manager and/or to
+*** bug-libtool@gnu.org
+
+_LT_EOF
+         fi ;;
+       esac
+      fi
+      break
+    fi
+  done
+  IFS="$lt_save_ifs"
+  MAGIC_CMD="$lt_save_MAGIC_CMD"
+  ;;
+esac
+fi
+
+MAGIC_CMD="$lt_cv_path_MAGIC_CMD"
+if test -n "$MAGIC_CMD"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MAGIC_CMD" >&5
+$as_echo "$MAGIC_CMD" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+  else
+    MAGIC_CMD=:
+  fi
+fi
+
+  fi
+  ;;
+esac
+
+# Use C for the default configuration in the libtool script
+
+lt_save_CC="$CC"
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
+# Source file extension for C test sources.
+ac_ext=c
+
+# Object file extension for compiled C test sources.
+objext=o
+objext=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="int some_variable = 0;"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='int main(){return(0);}'
+
+
+
+
+
+
+
+# If no C compiler was specified, use CC.
+LTCC=${LTCC-"$CC"}
+
+# If no C compiler flags were specified, use CFLAGS.
+LTCFLAGS=${LTCFLAGS-"$CFLAGS"}
+
+# Allow CC to be a program name with arguments.
+compiler=$CC
+
+# Save the default compiler, since it gets overwritten when the other
+# tags are being tested, and _LT_TAGVAR(compiler, []) is a NOP.
+compiler_DEFAULT=$CC
+
+# save warnings/boilerplate of simple test code
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_compile_test_code" >conftest.$ac_ext
+eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_compiler_boilerplate=`cat conftest.err`
+$RM conftest*
+
+ac_outfile=conftest.$ac_objext
+echo "$lt_simple_link_test_code" >conftest.$ac_ext
+eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err
+_lt_linker_boilerplate=`cat conftest.err`
+$RM -r conftest*
+
+
+## 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_prog_compiler_no_builtin_flag=
+
+if test "$GCC" = yes; then
+  case $cc_basename in
+  nvcc*)
+    lt_prog_compiler_no_builtin_flag=' -Xcompiler -fno-builtin' ;;
+  *)
+    lt_prog_compiler_no_builtin_flag=' -fno-builtin' ;;
+  esac
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -fno-rtti -fno-exceptions" >&5
+$as_echo_n "checking if $compiler supports -fno-rtti -fno-exceptions... " >&6; }
+if ${lt_cv_prog_compiler_rtti_exceptions+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_rtti_exceptions=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="-fno-rtti -fno-exceptions"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_rtti_exceptions=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_rtti_exceptions" >&5
+$as_echo "$lt_cv_prog_compiler_rtti_exceptions" >&6; }
+
+if test x"$lt_cv_prog_compiler_rtti_exceptions" = xyes; then
+    lt_prog_compiler_no_builtin_flag="$lt_prog_compiler_no_builtin_flag -fno-rtti -fno-exceptions"
+else
+    :
+fi
+
+fi
+
+
+
+
+
+
+  lt_prog_compiler_wl=
+lt_prog_compiler_pic=
+lt_prog_compiler_static=
+
+
+  if test "$GCC" = yes; then
+    lt_prog_compiler_wl='-Wl,'
+    lt_prog_compiler_static='-static'
+
+    case $host_os in
+      aix*)
+      # All AIX code is PIC.
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            lt_prog_compiler_pic='-fPIC'
+        ;;
+      m68k)
+            # FIXME: we need at least 68020 code to build shared libraries, but
+            # adding the `-m68020' flag to GCC prevents building anything better,
+            # like `-m68040'.
+            lt_prog_compiler_pic='-m68020 -resident32 -malways-restore-a4'
+        ;;
+      esac
+      ;;
+
+    beos* | irix5* | irix6* | nonstopux* | osf3* | osf4* | osf5*)
+      # PIC is the default for these OSes.
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      # Although the cygwin gcc ignores -fPIC, still need this for old-style
+      # (--disable-auto-import) libraries
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    darwin* | rhapsody*)
+      # PIC is the default on this platform
+      # Common symbols not allowed in MH_DYLIB files
+      lt_prog_compiler_pic='-fno-common'
+      ;;
+
+    haiku*)
+      # PIC is the default for Haiku.
+      # The "-static" flag exists, but is broken.
+      lt_prog_compiler_static=
+      ;;
+
+    hpux*)
+      # PIC is the default for 64-bit PA HP-UX, but not for 32-bit
+      # PA HP-UX.  On IA64 HP-UX, PIC is the default but the pic flag
+      # sets the default TLS model and affects inlining.
+      case $host_cpu in
+      hppa*64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='-fPIC'
+       ;;
+      esac
+      ;;
+
+    interix[3-9]*)
+      # Interix 3.x gcc -fpic/-fPIC options generate broken code.
+      # Instead, we relocate shared libraries at runtime.
+      ;;
+
+    msdosdjgpp*)
+      # Just because we use GCC doesn't mean we suddenly get shared libraries
+      # on systems that don't support them.
+      lt_prog_compiler_can_build_shared=no
+      enable_shared=no
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       lt_prog_compiler_pic=-Kconform_pic
+      fi
+      ;;
+
+    *)
+      lt_prog_compiler_pic='-fPIC'
+      ;;
+    esac
+
+    case $cc_basename in
+    nvcc*) # Cuda Compiler Driver 2.2
+      lt_prog_compiler_wl='-Xlinker '
+      if test -n "$lt_prog_compiler_pic"; then
+        lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+      fi
+      ;;
+    esac
+  else
+    # PORTME Check for flag to pass linker flags through the system compiler.
+    case $host_os in
+    aix*)
+      lt_prog_compiler_wl='-Wl,'
+      if test "$host_cpu" = ia64; then
+       # AIX 5 now supports IA64 processor
+       lt_prog_compiler_static='-Bstatic'
+      else
+       lt_prog_compiler_static='-bnso -bI:/lib/syscalls.exp'
+      fi
+      ;;
+
+    mingw* | cygwin* | pw32* | os2* | cegcc*)
+      # This hack is so that the source file can tell whether it is being
+      # built for inclusion in a dll (and should export symbols for example).
+      lt_prog_compiler_pic='-DDLL_EXPORT'
+      ;;
+
+    hpux9* | hpux10* | hpux11*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC is the default for IA64 HP-UX and 64-bit HP-UX, but
+      # not for PA HP-UX.
+      case $host_cpu in
+      hppa*64*|ia64*)
+       # +Z the default
+       ;;
+      *)
+       lt_prog_compiler_pic='+Z'
+       ;;
+      esac
+      # Is there a better lt_prog_compiler_static that works with the bundled CC?
+      lt_prog_compiler_static='${wl}-a ${wl}archive'
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      lt_prog_compiler_wl='-Wl,'
+      # PIC (with -KPIC) is the default.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+      case $cc_basename in
+      # old Intel for x86_64 which still supported -KPIC.
+      ecc*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-KPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # icc used to be incompatible with GCC.
+      # ICC 10 doesn't accept -KPIC any more.
+      icc* | ifort*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fPIC'
+       lt_prog_compiler_static='-static'
+        ;;
+      # Lahey Fortran 8.1.
+      lf95*)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='--shared'
+       lt_prog_compiler_static='--static'
+       ;;
+      nagfor*)
+       # NAG Fortran compiler
+       lt_prog_compiler_wl='-Wl,-Wl,,'
+       lt_prog_compiler_pic='-PIC'
+       lt_prog_compiler_static='-Bstatic'
+       ;;
+      pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
+        # Portland Group compilers (*not* the Pentium gcc compiler,
+       # which looks to be a dead project)
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-fpic'
+       lt_prog_compiler_static='-Bstatic'
+        ;;
+      ccc*)
+        lt_prog_compiler_wl='-Wl,'
+        # All Alpha code is PIC.
+        lt_prog_compiler_static='-non_shared'
+        ;;
+      xl* | bgxl* | bgf* | mpixl*)
+       # IBM XL C 8.0/Fortran 10.1, 11.1 on PPC and BlueGene
+       lt_prog_compiler_wl='-Wl,'
+       lt_prog_compiler_pic='-qpic'
+       lt_prog_compiler_static='-qstaticlink'
+       ;;
+      *)
+       case `$CC -V 2>&1 | sed 5q` in
+       *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
+      ;;
+
+    newsos6)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *nto* | *qnx*)
+      # QNX uses GNU C++, but need to define -shared option too, otherwise
+      # it will coredump.
+      lt_prog_compiler_pic='-fPIC -shared'
+      ;;
+
+    osf3* | osf4* | osf5*)
+      lt_prog_compiler_wl='-Wl,'
+      # All OSF/1 code is PIC.
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    rdos*)
+      lt_prog_compiler_static='-non_shared'
+      ;;
+
+    solaris*)
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      case $cc_basename in
+      f77* | f90* | f95* | sunf77* | sunf90* | sunf95*)
+       lt_prog_compiler_wl='-Qoption ld ';;
+      *)
+       lt_prog_compiler_wl='-Wl,';;
+      esac
+      ;;
+
+    sunos4*)
+      lt_prog_compiler_wl='-Qoption ld '
+      lt_prog_compiler_pic='-PIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4 | sysv4.2uw2* | sysv4.3*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec ;then
+       lt_prog_compiler_pic='-Kconform_pic'
+       lt_prog_compiler_static='-Bstatic'
+      fi
+      ;;
+
+    sysv5* | unixware* | sco3.2v5* | sco5v6* | OpenUNIX*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_pic='-KPIC'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    unicos*)
+      lt_prog_compiler_wl='-Wl,'
+      lt_prog_compiler_can_build_shared=no
+      ;;
+
+    uts4*)
+      lt_prog_compiler_pic='-pic'
+      lt_prog_compiler_static='-Bstatic'
+      ;;
+
+    *)
+      lt_prog_compiler_can_build_shared=no
+      ;;
+    esac
+  fi
+
+case $host_os in
+  # For platforms which do not support PIC, -DPIC is meaningless:
+  *djgpp*)
+    lt_prog_compiler_pic=
+    ;;
+  *)
+    lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
+    ;;
+esac
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
+
+#
+# Check to make sure the PIC flag actually works.
+#
+if test -n "$lt_prog_compiler_pic"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler PIC flag $lt_prog_compiler_pic works" >&5
+$as_echo_n "checking if $compiler PIC flag $lt_prog_compiler_pic works... " >&6; }
+if ${lt_cv_prog_compiler_pic_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_pic_works=no
+   ac_outfile=conftest.$ac_objext
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+   lt_compiler_flag="$lt_prog_compiler_pic -DPIC"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   # The option is referenced via a variable to avoid confusing sed.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>conftest.err)
+   ac_status=$?
+   cat conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s "$ac_outfile"; then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings other than the usual output.
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' >conftest.exp
+     $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+     if test ! -s conftest.er2 || diff conftest.exp conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_pic_works=yes
+     fi
+   fi
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic_works" >&5
+$as_echo "$lt_cv_prog_compiler_pic_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_pic_works" = xyes; then
+    case $lt_prog_compiler_pic in
+     "" | " "*) ;;
+     *) lt_prog_compiler_pic=" $lt_prog_compiler_pic" ;;
+     esac
+else
+    lt_prog_compiler_pic=
+     lt_prog_compiler_can_build_shared=no
+fi
+
+fi
+
+
+
+
+
+
+
+
+
+
+
+#
+# Check to make sure the static flag actually works.
+#
+wl=$lt_prog_compiler_wl eval lt_tmp_static_flag=\"$lt_prog_compiler_static\"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler static flag $lt_tmp_static_flag works" >&5
+$as_echo_n "checking if $compiler static flag $lt_tmp_static_flag works... " >&6; }
+if ${lt_cv_prog_compiler_static_works+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_static_works=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS $lt_tmp_static_flag"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler_static_works=yes
+       fi
+     else
+       lt_cv_prog_compiler_static_works=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_static_works" >&5
+$as_echo "$lt_cv_prog_compiler_static_works" >&6; }
+
+if test x"$lt_cv_prog_compiler_static_works" = xyes; then
+    :
+else
+    lt_prog_compiler_static=
+fi
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $compiler supports -c -o file.$ac_objext" >&5
+$as_echo_n "checking if $compiler supports -c -o file.$ac_objext... " >&6; }
+if ${lt_cv_prog_compiler_c_o+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler_c_o=no
+   $RM -r conftest 2>/dev/null
+   mkdir conftest
+   cd conftest
+   mkdir out
+   echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+   lt_compiler_flag="-o out/conftest2.$ac_objext"
+   # Insert the option either (1) after the last *FLAGS variable, or
+   # (2) before a word containing "conftest.", or (3) at the end.
+   # Note that $ac_compile itself does not contain backslashes and begins
+   # with a dollar sign (not a hyphen), so the echo should work correctly.
+   lt_compile=`echo "$ac_compile" | $SED \
+   -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
+   -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
+   -e 's:$: $lt_compiler_flag:'`
+   (eval echo "\"\$as_me:$LINENO: $lt_compile\"" >&5)
+   (eval "$lt_compile" 2>out/conftest.err)
+   ac_status=$?
+   cat out/conftest.err >&5
+   echo "$as_me:$LINENO: \$? = $ac_status" >&5
+   if (exit $ac_status) && test -s out/conftest2.$ac_objext
+   then
+     # The compiler can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     $ECHO "$_lt_compiler_boilerplate" | $SED '/^$/d' > out/conftest.exp
+     $SED '/^$/d; /^ *+/d' out/conftest.err >out/conftest.er2
+     if test ! -s out/conftest.er2 || diff out/conftest.exp out/conftest.er2 >/dev/null; then
+       lt_cv_prog_compiler_c_o=yes
+     fi
+   fi
+   chmod u+w . 2>&5
+   $RM conftest*
+   # SGI C++ compiler will create directory out/ii_files/ for
+   # template instantiation
+   test -d out/ii_files && $RM out/ii_files/* && rmdir out/ii_files
+   $RM out/* && rmdir out
+   cd ..
+   $RM -r conftest
+   $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_c_o" >&5
+$as_echo "$lt_cv_prog_compiler_c_o" >&6; }
+
+
+
+
+hard_links="nottested"
+if test "$lt_cv_prog_compiler_c_o" = no && test "$need_locks" != no; then
+  # do not overwrite the value of need_locks provided by the user
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if we can lock with hard links" >&5
+$as_echo_n "checking if we can lock with hard links... " >&6; }
+  hard_links=yes
+  $RM conftest*
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  touch conftest.a
+  ln conftest.a conftest.b 2>&5 || hard_links=no
+  ln conftest.a conftest.b 2>/dev/null && hard_links=no
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $hard_links" >&5
+$as_echo "$hard_links" >&6; }
+  if test "$hard_links" = no; then
+    { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&5
+$as_echo "$as_me: WARNING: \`$CC' does not support \`-c -o', so \`make -j' may be unsafe" >&2;}
+    need_locks=warn
+  fi
+else
+  need_locks=no
+fi
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $compiler linker ($LD) supports shared libraries" >&5
+$as_echo_n "checking whether the $compiler linker ($LD) supports shared libraries... " >&6; }
+
+  runpath_var=
+  allow_undefined_flag=
+  always_export_symbols=no
+  archive_cmds=
+  archive_expsym_cmds=
+  compiler_needs_object=no
+  enable_shared_with_static_runtimes=no
+  export_dynamic_flag_spec=
+  export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+  hardcode_automatic=no
+  hardcode_direct=no
+  hardcode_direct_absolute=no
+  hardcode_libdir_flag_spec=
+  hardcode_libdir_separator=
+  hardcode_minus_L=no
+  hardcode_shlibpath_var=unsupported
+  inherit_rpath=no
+  link_all_deplibs=unknown
+  module_cmds=
+  module_expsym_cmds=
+  old_archive_from_new_cmds=
+  old_archive_from_expsyms_cmds=
+  thread_safe_flag_spec=
+  whole_archive_flag_spec=
+  # include_expsyms should be a list of space-separated symbols to be *always*
+  # included in the symbol list
+  include_expsyms=
+  # exclude_expsyms can be an extended regexp of symbols to exclude
+  # it will be wrapped by ` (' and `)$', so one must not match beginning or
+  # end of line.  Example: `a|bc|.*d.*' will exclude the symbols `a' and `bc',
+  # as well as any symbol that contains `d'.
+  exclude_expsyms='_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*'
+  # Although _GLOBAL_OFFSET_TABLE_ is a valid symbol C name, most a.out
+  # platforms (ab)use it in PIC code, but their linkers get confused if
+  # the symbol is explicitly referenced.  Since portable code cannot
+  # rely on this symbol name, it's probably fine to never include it in
+  # preloaded symbol tables.
+  # Exclude shared library initialization/finalization symbols.
+  extract_expsyms_cmds=
+
+  case $host_os in
+  cygwin* | mingw* | pw32* | cegcc*)
+    # FIXME: the MSVC++ port hasn't been tested in a loooong time
+    # When not using gcc, we currently assume that we are using
+    # Microsoft Visual C++.
+    if test "$GCC" != yes; then
+      with_gnu_ld=no
+    fi
+    ;;
+  interix*)
+    # we just hope/assume this is gcc and not c89 (= MSVC++)
+    with_gnu_ld=yes
+    ;;
+  openbsd*)
+    with_gnu_ld=no
+    ;;
+  linux* | k*bsd*-gnu | gnu*)
+    link_all_deplibs=no
+    ;;
+  esac
+
+  ld_shlibs=yes
+
+  # On some targets, GNU ld is compatible enough with the native linker
+  # that we're better off using the native interface for both.
+  lt_use_gnu_ld_interface=no
+  if test "$with_gnu_ld" = yes; then
+    case $host_os in
+      aix*)
+       # The AIX port of GNU ld has always aspired to compatibility
+       # with the native linker.  However, as the warning in the GNU ld
+       # block says, versions before 2.19.5* couldn't really create working
+       # shared libraries, regardless of the interface used.
+       case `$LD -v 2>&1` in
+         *\ \(GNU\ Binutils\)\ 2.19.5*) ;;
+         *\ \(GNU\ Binutils\)\ 2.[2-9]*) ;;
+         *\ \(GNU\ Binutils\)\ [3-9]*) ;;
+         *)
+           lt_use_gnu_ld_interface=yes
+           ;;
+       esac
+       ;;
+      *)
+       lt_use_gnu_ld_interface=yes
+       ;;
+    esac
+  fi
+
+  if test "$lt_use_gnu_ld_interface" = yes; then
+    # If archive_cmds runs LD, not CC, wlarc should be empty
+    wlarc='${wl}'
+
+    # Set some defaults for GNU ld with shared library support. These
+    # are reset later if shared libraries are not supported. Putting them
+    # here allows them to be overridden if necessary.
+    runpath_var=LD_RUN_PATH
+    hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+    export_dynamic_flag_spec='${wl}--export-dynamic'
+    # ancient GNU ld didn't support --whole-archive et. al.
+    if $LD --help 2>&1 | $GREP 'no-whole-archive' > /dev/null; then
+      whole_archive_flag_spec="$wlarc"'--whole-archive$convenience '"$wlarc"'--no-whole-archive'
+    else
+      whole_archive_flag_spec=
+    fi
+    supports_anon_versioning=no
+    case `$LD -v 2>&1` in
+      *GNU\ gold*) supports_anon_versioning=yes ;;
+      *\ [01].* | *\ 2.[0-9].* | *\ 2.10.*) ;; # catch versions < 2.11
+      *\ 2.11.93.0.2\ *) supports_anon_versioning=yes ;; # RH7.3 ...
+      *\ 2.11.92.0.12\ *) supports_anon_versioning=yes ;; # Mandrake 8.2 ...
+      *\ 2.11.*) ;; # other 2.11 versions
+      *) supports_anon_versioning=yes ;;
+    esac
+
+    # See if GNU ld supports shared libraries.
+    case $host_os in
+    aix[3-9]*)
+      # On AIX/PPC, the GNU linker is very broken
+      if test "$host_cpu" != ia64; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: the GNU linker, at least up to release 2.19, is reported
+*** to be unable to reliably create shared libraries on AIX.
+*** Therefore, libtool is disabling shared libraries support.  If you
+*** really care for shared libraries, you may want to install binutils
+*** 2.20 or above, or modify your PATH so that a non-GNU linker is found.
+*** You will then need to restart the configuration process.
+
+_LT_EOF
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    beos*)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       allow_undefined_flag=unsupported
+       # Joseph Beckenbach <jrb3@best.com> says some releases of gcc
+       # support --undefined.  This deserves some investigation.  FIXME
+       archive_cmds='$CC -nostart $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # _LT_TAGVAR(hardcode_libdir_flag_spec, ) is actually meaningless,
+      # as there is no search path for DLLs.
+      hardcode_libdir_flag_spec='-L$libdir'
+      export_dynamic_flag_spec='${wl}--export-all-symbols'
+      allow_undefined_flag=unsupported
+      always_export_symbols=no
+      enable_shared_with_static_runtimes=yes
+      export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+      exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
+
+      if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+        archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+       # If the export-symbols file already is a .def file (1st line
+       # is EXPORTS), use it as is; otherwise, prepend...
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+         cp $export_symbols $output_objdir/$soname.def;
+       else
+         echo EXPORTS > $output_objdir/$soname.def;
+         cat $export_symbols >> $output_objdir/$soname.def;
+       fi~
+       $CC -shared $output_objdir/$soname.def $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    haiku*)
+      archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+      link_all_deplibs=yes
+      ;;
+
+    interix[3-9]*)
+      hardcode_direct=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+      export_dynamic_flag_spec='${wl}-E'
+      # Hack: On Interix 3.x, we cannot compile PIC because of a broken gcc.
+      # Instead, shared libraries are loaded at an image base (0x10000000 by
+      # default) and relocated if they conflict, which is a slow very memory
+      # consuming and fragmenting process.  To avoid this, we pick a random,
+      # 256 KiB-aligned image base between 0x50000000 and 0x6FFC0000 at link
+      # time.  Moving up from 0x10000000 also allows more sbrk(2) space.
+      archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      archive_expsym_cmds='sed "s,^,_," $export_symbols >$output_objdir/$soname.expsym~$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-h,$soname ${wl}--retain-symbols-file,$output_objdir/$soname.expsym ${wl}--image-base,`expr ${RANDOM-$$} % 4096 / 2 \* 262144 + 1342177280` -o $lib'
+      ;;
+
+    gnu* | linux* | tpf* | k*bsd*-gnu | kopensolaris*-gnu)
+      tmp_diet=no
+      if test "$host_os" = linux-dietlibc; then
+       case $cc_basename in
+         diet\ *) tmp_diet=yes;;       # linux-dietlibc with static linking (!diet-dyn)
+       esac
+      fi
+      if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
+        && test "$tmp_diet" = no
+      then
+       tmp_addflag=' $pic_flag'
+       tmp_sharedflag='-shared'
+       case $cc_basename,$host_cpu in
+        pgcc*)                         # Portland Group C compiler
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag'
+         ;;
+       pgf77* | pgf90* | pgf95* | pgfortran*)
+                                       # Portland Group f77 and f90 compilers
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         tmp_addflag=' $pic_flag -Mnomain' ;;
+       ecc*,ia64* | icc*,ia64*)        # Intel C compiler on ia64
+         tmp_addflag=' -i_dynamic' ;;
+       efc*,ia64* | ifort*,ia64*)      # Intel Fortran compiler on ia64
+         tmp_addflag=' -i_dynamic -nofor_main' ;;
+       ifc* | ifort*)                  # Intel Fortran compiler
+         tmp_addflag=' -nofor_main' ;;
+       lf95*)                          # Lahey Fortran 8.1
+         whole_archive_flag_spec=
+         tmp_sharedflag='--shared' ;;
+       xl[cC]* | bgxl[cC]* | mpixl[cC]*) # IBM XL C 8.0 on PPC (deal with xlf below)
+         tmp_sharedflag='-qmkshrobj'
+         tmp_addflag= ;;
+       nvcc*)  # Cuda Compiler Driver 2.2
+         whole_archive_flag_spec='${wl}--whole-archive`for conv in $convenience\"\"; do test  -n \"$conv\" && new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         ;;
+       esac
+       case `$CC -V 2>&1 | sed 5q` in
+       *Sun\ C*)                       # Sun C 5.9
+         whole_archive_flag_spec='${wl}--whole-archive`new_convenience=; for conv in $convenience\"\"; do test -z \"$conv\" || new_convenience=\"$new_convenience,$conv\"; done; func_echo_all \"$new_convenience\"` ${wl}--no-whole-archive'
+         compiler_needs_object=yes
+         tmp_sharedflag='-G' ;;
+       *Sun\ F*)                       # Sun Fortran 8.3
+         tmp_sharedflag='-G' ;;
+       esac
+       archive_cmds='$CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+
+        if test "x$supports_anon_versioning" = xyes; then
+          archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
+           cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+           echo "local: *; };" >> $output_objdir/$libname.ver~
+           $CC '"$tmp_sharedflag""$tmp_addflag"' $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script ${wl}$output_objdir/$libname.ver -o $lib'
+        fi
+
+       case $cc_basename in
+       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='${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~
+             cat $export_symbols | sed -e "s/\(.*\)/\1;/" >> $output_objdir/$libname.ver~
+             echo "local: *; };" >> $output_objdir/$libname.ver~
+             $LD -shared $libobjs $deplibs $linker_flags -soname $soname -version-script $output_objdir/$libname.ver -o $lib'
+         fi
+         ;;
+       esac
+      else
+        ld_shlibs=no
+      fi
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
+       wlarc=
+      else
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      fi
+      ;;
+
+    solaris*)
+      if $LD -v 2>&1 | $GREP 'BFD 2\.8' > /dev/null; then
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: The releases 2.8.* of the GNU linker cannot reliably
+*** create shared libraries on Solaris systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.9.1 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+      elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX*)
+      case `$LD -v 2>&1` in
+        *\ [01].* | *\ 2.[0-9].* | *\ 2.1[0-5].*)
+       ld_shlibs=no
+       cat <<_LT_EOF 1>&2
+
+*** Warning: Releases of the GNU linker prior to 2.16.91.0.3 can not
+*** reliably create shared libraries on SCO systems.  Therefore, libtool
+*** is disabling shared libraries support.  We urge you to upgrade GNU
+*** binutils to release 2.16.91.0.3 or newer.  Another option is to modify
+*** your PATH or compiler configuration so that the native linker is
+*** used, and then restart.
+
+_LT_EOF
+       ;;
+       *)
+         # For security reasons, it is highly recommended that you always
+         # use absolute paths for naming shared libraries, and exclude the
+         # DT_RUNPATH tag from executables and libraries.  But doing so
+         # requires that you compile everything twice, which is a pain.
+         if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+           hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+           archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+           archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+         else
+           ld_shlibs=no
+         fi
+       ;;
+      esac
+      ;;
+
+    sunos4*)
+      archive_cmds='$LD -assert pure-text -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      wlarc=
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+       archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+      else
+       ld_shlibs=no
+      fi
+      ;;
+    esac
+
+    if test "$ld_shlibs" = no; then
+      runpath_var=
+      hardcode_libdir_flag_spec=
+      export_dynamic_flag_spec=
+      whole_archive_flag_spec=
+    fi
+  else
+    # PORTME fill in a description of your system's linker (not GNU ld)
+    case $host_os in
+    aix3*)
+      allow_undefined_flag=unsupported
+      always_export_symbols=yes
+      archive_expsym_cmds='$LD -o $output_objdir/$soname $libobjs $deplibs $linker_flags -bE:$export_symbols -T512 -H512 -bM:SRE~$AR $AR_FLAGS $lib $output_objdir/$soname'
+      # Note: this linker hardcodes the directories in LIBPATH if there
+      # are no directories specified by -L.
+      hardcode_minus_L=yes
+      if test "$GCC" = yes && test -z "$lt_prog_compiler_static"; then
+       # Neither direct hardcoding nor static linking is supported with a
+       # broken collect2.
+       hardcode_direct=unsupported
+      fi
+      ;;
+
+    aix[4-9]*)
+      if test "$host_cpu" = ia64; then
+       # On IA64, the linker does run time linking by default, so we don't
+       # have to do anything special.
+       aix_use_runtimelinking=no
+       exp_sym_flag='-Bexport'
+       no_entry_flag=""
+      else
+       # If we're using GNU nm, then we don't want the "-C" option.
+       # -C means demangle to AIX nm, but means don't demangle with GNU nm
+       # Also, AIX nm treats weak defined symbols like other global
+       # defined symbols, whereas GNU nm marks them as "W".
+       if $NM -V 2>&1 | $GREP 'GNU' > /dev/null; then
+         export_symbols_cmds='$NM -Bpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B") || (\$ 2 == "W")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       else
+         export_symbols_cmds='$NM -BCpg $libobjs $convenience | awk '\''{ if (((\$ 2 == "T") || (\$ 2 == "D") || (\$ 2 == "B")) && (substr(\$ 3,1,1) != ".")) { print \$ 3 } }'\'' | sort -u > $export_symbols'
+       fi
+       aix_use_runtimelinking=no
+
+       # Test if we are trying to use run time linking or normal
+       # AIX style linking. If -brtl is somewhere in LDFLAGS, we
+       # need to do runtime linking.
+       case $host_os in aix4.[23]|aix4.[23].*|aix[5-9]*)
+         for ld_flag in $LDFLAGS; do
+         if (test $ld_flag = "-brtl" || test $ld_flag = "-Wl,-brtl"); then
+           aix_use_runtimelinking=yes
+           break
+         fi
+         done
+         ;;
+       esac
+
+       exp_sym_flag='-bexport'
+       no_entry_flag='-bnoentry'
+      fi
+
+      # When large executables or shared objects are built, AIX ld can
+      # have problems creating the table of contents.  If linking a library
+      # or program results in "error TOC overflow" add -mminimal-toc to
+      # CXXFLAGS/CFLAGS for g++/gcc.  In the cases where that is not
+      # enough to fix the problem, add -Wl,-bbigtoc to LDFLAGS.
+
+      archive_cmds=''
+      hardcode_direct=yes
+      hardcode_direct_absolute=yes
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      file_list_spec='${wl}-f,'
+
+      if test "$GCC" = yes; then
+       case $host_os in aix4.[012]|aix4.[012].*)
+       # We only want to do this on AIX 4.2 and lower, the check
+       # below for broken collect2 doesn't work under 4.3+
+         collect2name=`${CC} -print-prog-name=collect2`
+         if test -f "$collect2name" &&
+          strings "$collect2name" | $GREP resolve_lib_name >/dev/null
+         then
+         # We have reworked collect2
+         :
+         else
+         # We have old collect2
+         hardcode_direct=unsupported
+         # It fails to find uninstalled libraries when the uninstalled
+         # path is not listed in the libpath.  Setting hardcode_minus_L
+         # to unsupported forces relinking
+         hardcode_minus_L=yes
+         hardcode_libdir_flag_spec='-L$libdir'
+         hardcode_libdir_separator=
+         fi
+         ;;
+       esac
+       shared_flag='-shared'
+       if test "$aix_use_runtimelinking" = yes; then
+         shared_flag="$shared_flag "'${wl}-G'
+       fi
+       link_all_deplibs=no
+      else
+       # not using gcc
+       if test "$host_cpu" = ia64; then
+       # VisualAge C++, Version 5.5 for AIX 5L for IA-64, Beta 3 Release
+       # chokes on -Wl,-G. The following line is correct:
+         shared_flag='-G'
+       else
+         if test "$aix_use_runtimelinking" = yes; then
+           shared_flag='${wl}-G'
+         else
+           shared_flag='${wl}-bM:SRE'
+         fi
+       fi
+      fi
+
+      export_dynamic_flag_spec='${wl}-bexpall'
+      # It seems that -bexpall does not export symbols beginning with
+      # underscore (_), so it is better to generate a list of symbols to export.
+      always_export_symbols=yes
+      if test "$aix_use_runtimelinking" = yes; then
+       # Warning - without using the other runtime loading flags (-brtl),
+       # -berok will link without error, but may produce a broken library.
+       allow_undefined_flag='-berok'
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+        archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
+      else
+       if test "$host_cpu" = ia64; then
+         hardcode_libdir_flag_spec='${wl}-R $libdir:/usr/lib:/lib'
+         allow_undefined_flag="-z nodefs"
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags ${wl}${allow_undefined_flag} '"\${wl}$exp_sym_flag:\$export_symbols"
+       else
+        # Determine the default libpath from the value encoded in an
+        # empty executable.
+        if test "${lt_cv_aix_libpath+set}" = set; then
+  aix_libpath=$lt_cv_aix_libpath
+else
+  if ${lt_cv_aix_libpath_+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+
+  lt_aix_libpath_sed='
+      /Import File Strings/,/^$/ {
+         /^0/ {
+             s/^0  *\([^ ]*\) *$/\1/
+             p
+         }
+      }'
+  lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  # Check for a 64-bit object if we didn't find anything.
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+  fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+  if test -z "$lt_cv_aix_libpath_"; then
+    lt_cv_aix_libpath_="/usr/lib:/lib"
+  fi
+
+fi
+
+  aix_libpath=$lt_cv_aix_libpath_
+fi
+
+        hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
+         # Warning - without using the other run time loading flags,
+         # -berok will link without error, but may produce a broken library.
+         no_undefined_flag=' ${wl}-bernotok'
+         allow_undefined_flag=' ${wl}-berok'
+         if test "$with_gnu_ld" = yes; then
+           # We only use this code for GNU lds that support --whole-archive.
+           whole_archive_flag_spec='${wl}--whole-archive$convenience ${wl}--no-whole-archive'
+         else
+           # Exported symbols can be pulled into shared objects from archives
+           whole_archive_flag_spec='$convenience'
+         fi
+         archive_cmds_need_lc=yes
+         # This is similar to how AIX traditionally builds its shared libraries.
+         archive_expsym_cmds="\$CC $shared_flag"' -o $output_objdir/$soname $libobjs $deplibs ${wl}-bnoentry $compiler_flags ${wl}-bE:$export_symbols${allow_undefined_flag}~$AR $AR_FLAGS $output_objdir/$libname$release.a $output_objdir/$soname'
+       fi
+      fi
+      ;;
+
+    amigaos*)
+      case $host_cpu in
+      powerpc)
+            # see comment about AmigaOS4 .so support
+            archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+            archive_expsym_cmds=''
+        ;;
+      m68k)
+            archive_cmds='$RM $output_objdir/a2ixlibrary.data~$ECHO "#define NAME $libname" > $output_objdir/a2ixlibrary.data~$ECHO "#define LIBRARY_ID 1" >> $output_objdir/a2ixlibrary.data~$ECHO "#define VERSION $major" >> $output_objdir/a2ixlibrary.data~$ECHO "#define REVISION $revision" >> $output_objdir/a2ixlibrary.data~$AR $AR_FLAGS $lib $libobjs~$RANLIB $lib~(cd $output_objdir && a2ixlibrary -32)'
+            hardcode_libdir_flag_spec='-L$libdir'
+            hardcode_minus_L=yes
+        ;;
+      esac
+      ;;
+
+    bsdi[45]*)
+      export_dynamic_flag_spec=-rdynamic
+      ;;
+
+    cygwin* | mingw* | pw32* | cegcc*)
+      # When not using gcc, we currently assume that we are using
+      # Microsoft Visual C++.
+      # hardcode_libdir_flag_spec is actually meaningless, as there is
+      # no search path for DLLs.
+      case $cc_basename in
+      cl*)
+       # Native MSVC
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       always_export_symbols=yes
+       file_list_spec='@'
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+       archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+           sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+         else
+           sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+         fi~
+         $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+         linknames='
+       # 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'
+       postlink_cmds='lt_outputfile="@OUTPUT@"~
+         lt_tool_outputfile="@TOOL_OUTPUT@"~
+         case $lt_outputfile in
+           *.exe|*.EXE) ;;
+           *)
+             lt_outputfile="$lt_outputfile.exe"
+             lt_tool_outputfile="$lt_tool_outputfile.exe"
+             ;;
+         esac~
+         if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+           $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+           $RM "$lt_outputfile.manifest";
+         fi'
+       ;;
+      *)
+       # Assume MSVC wrapper
+       hardcode_libdir_flag_spec=' '
+       allow_undefined_flag=unsupported
+       # Tell ltmain to make .lib files, not .a files.
+       libext=lib
+       # Tell ltmain to make .dll files, not .so files.
+       shrext_cmds=".dll"
+       # FIXME: Setting linknames here is a bad hack.
+       archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+       # The linker will automatically build a .lib file if we build a DLL.
+       old_archive_from_new_cmds='true'
+       # FIXME: Should let the user specify the lib program.
+       old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+       enable_shared_with_static_runtimes=yes
+       ;;
+      esac
+      ;;
+
+    darwin* | rhapsody*)
+
+
+  archive_cmds_need_lc=no
+  hardcode_direct=no
+  hardcode_automatic=yes
+  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
+  link_all_deplibs=yes
+  allow_undefined_flag="$_lt_dar_allow_undefined"
+  case $cc_basename in
+     ifort*) _lt_dar_can_shared=yes ;;
+     *) _lt_dar_can_shared=$GCC ;;
+  esac
+  if test "$_lt_dar_can_shared" = "yes"; then
+    output_verbose_link_cmd=func_echo_all
+    archive_cmds="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}"
+    module_cmds="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}"
+    archive_expsym_cmds="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}"
+    module_expsym_cmds="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}"
+
+  else
+  ld_shlibs=no
+  fi
+
+      ;;
+
+    dgux*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=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
+    # extra space).
+    freebsd2.2*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags /usr/lib/c++rt0.o'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # Unfortunately, older versions of FreeBSD 2 do not have this feature.
+    freebsd2.*)
+      archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    # FreeBSD 3 and greater uses gcc -shared to do shared libraries.
+    freebsd* | dragonfly*)
+      archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    hpux9*)
+      if test "$GCC" = yes; then
+       archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      else
+       archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+      fi
+      hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_direct=yes
+
+      # hardcode_minus_L: Not really in the search PATH,
+      # but as the default location of the library.
+      hardcode_minus_L=yes
+      export_dynamic_flag_spec='${wl}-E'
+      ;;
+
+    hpux10*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+       hardcode_direct=yes
+       hardcode_direct_absolute=yes
+       export_dynamic_flag_spec='${wl}-E'
+       # hardcode_minus_L: Not really in the search PATH,
+       # but as the default location of the library.
+       hardcode_minus_L=yes
+      fi
+      ;;
+
+    hpux11*)
+      if test "$GCC" = yes && test "$with_gnu_ld" = no; then
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+         archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       esac
+      else
+       case $host_cpu in
+       hppa*64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       ia64*)
+         archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+         ;;
+       *)
+
+         # Older versions of the 11.00 compiler do not understand -b yet
+         # (HP92453-01 A.11.01.20 doesn't, HP92453-01 B.11.X.35175-35176.GP does)
+         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if $CC understands -b" >&5
+$as_echo_n "checking if $CC understands -b... " >&6; }
+if ${lt_cv_prog_compiler__b+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_prog_compiler__b=no
+   save_LDFLAGS="$LDFLAGS"
+   LDFLAGS="$LDFLAGS -b"
+   echo "$lt_simple_link_test_code" > conftest.$ac_ext
+   if (eval $ac_link 2>conftest.err) && test -s conftest$ac_exeext; then
+     # The linker can only warn and ignore the option if not recognized
+     # So say no if there are warnings
+     if test -s conftest.err; then
+       # Append any errors to the config.log.
+       cat conftest.err 1>&5
+       $ECHO "$_lt_linker_boilerplate" | $SED '/^$/d' > conftest.exp
+       $SED '/^$/d; /^ *+/d' conftest.err >conftest.er2
+       if diff conftest.exp conftest.er2 >/dev/null; then
+         lt_cv_prog_compiler__b=yes
+       fi
+     else
+       lt_cv_prog_compiler__b=yes
+     fi
+   fi
+   $RM -r conftest*
+   LDFLAGS="$save_LDFLAGS"
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler__b" >&5
+$as_echo "$lt_cv_prog_compiler__b" >&6; }
+
+if test x"$lt_cv_prog_compiler__b" = xyes; then
+    archive_cmds='$CC -b ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+else
+    archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
+fi
+
+         ;;
+       esac
+      fi
+      if test "$with_gnu_ld" = no; then
+       hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
+       hardcode_libdir_separator=:
+
+       case $host_cpu in
+       hppa*64*|ia64*)
+         hardcode_direct=no
+         hardcode_shlibpath_var=no
+         ;;
+       *)
+         hardcode_direct=yes
+         hardcode_direct_absolute=yes
+         export_dynamic_flag_spec='${wl}-E'
+
+         # hardcode_minus_L: Not really in the search PATH,
+         # but as the default location of the library.
+         hardcode_minus_L=yes
+         ;;
+       esac
+      fi
+      ;;
+
+    irix5* | irix6* | nonstopux*)
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       # Try to use the -exported_symbol ld option, if it does not
+       # work, assume that -exports_file does not work either and
+       # implicitly export all symbols.
+       # This should be the same for all languages, so no per-tag cache variable.
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  save_LDFLAGS="$LDFLAGS"
+          LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+          cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+int foo (void) { return 0; }
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  lt_cv_irix_exported_symbol=yes
+else
+  lt_cv_irix_exported_symbol=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+           LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+       if test "$lt_cv_irix_exported_symbol" = yes; then
+          archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+       fi
+      else
+       archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      inherit_rpath=yes
+      link_all_deplibs=yes
+      ;;
+
+    netbsd* | netbsdelf*-gnu)
+      if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+       archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'  # a.out
+      else
+       archive_cmds='$LD -shared -o $lib $libobjs $deplibs $linker_flags'      # ELF
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_direct=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    newsos6)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_direct=yes
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      hardcode_shlibpath_var=no
+      ;;
+
+    *nto* | *qnx*)
+      ;;
+
+    openbsd*)
+      if test -f /usr/libexec/ld.so; then
+       hardcode_direct=yes
+       hardcode_shlibpath_var=no
+       hardcode_direct_absolute=yes
+       if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+         archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols'
+         hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+         export_dynamic_flag_spec='${wl}-E'
+       else
+         case $host_os in
+          openbsd[01].* | openbsd2.[0-7] | openbsd2.[0-7].*)
+            archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
+            hardcode_libdir_flag_spec='-R$libdir'
+            ;;
+          *)
+            archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
+            hardcode_libdir_flag_spec='${wl}-rpath,$libdir'
+            ;;
+         esac
+       fi
+      else
+       ld_shlibs=no
+      fi
+      ;;
+
+    os2*)
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_minus_L=yes
+      allow_undefined_flag=unsupported
+      archive_cmds='$ECHO "LIBRARY $libname INITINSTANCE" > $output_objdir/$libname.def~$ECHO "DESCRIPTION \"$libname\"" >> $output_objdir/$libname.def~echo DATA >> $output_objdir/$libname.def~echo " SINGLE NONSHARED" >> $output_objdir/$libname.def~echo EXPORTS >> $output_objdir/$libname.def~emxexp $libobjs >> $output_objdir/$libname.def~$CC -Zdll -Zcrtdll -o $lib $libobjs $deplibs $compiler_flags $output_objdir/$libname.def'
+      old_archive_from_new_cmds='emximp -o $output_objdir/$libname.a $output_objdir/$libname.def'
+      ;;
+
+    osf3*)
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      hardcode_libdir_separator=:
+      ;;
+
+    osf4* | osf5*)     # as osf3* with the addition of -msym flag
+      if test "$GCC" = yes; then
+       allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+       hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
+      else
+       allow_undefined_flag=' -expect_unresolved \*'
+       archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags -msym -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
+       archive_expsym_cmds='for i in `cat $export_symbols`; do printf "%s %s\\n" -exported_symbol "\$i" >> $lib.exp; done; printf "%s\\n" "-hidden">> $lib.exp~
+       $CC -shared${allow_undefined_flag} ${wl}-input ${wl}$lib.exp $compiler_flags $libobjs $deplibs -soname $soname `test -n "$verstring" && $ECHO "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib~$RM $lib.exp'
+
+       # Both c and cxx compiler support -rpath directly
+       hardcode_libdir_flag_spec='-rpath $libdir'
+      fi
+      archive_cmds_need_lc='no'
+      hardcode_libdir_separator=:
+      ;;
+
+    solaris*)
+      no_undefined_flag=' -z defs'
+      if test "$GCC" = yes; then
+       wlarc='${wl}'
+       archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+      else
+       case `$CC -V 2>&1` in
+       *"Compilers 5.0"*)
+         wlarc=''
+         archive_cmds='$LD -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $LD -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $linker_flags~$RM $lib.exp'
+         ;;
+       *)
+         wlarc='${wl}'
+         archive_cmds='$CC -G${allow_undefined_flag} -h $soname -o $lib $libobjs $deplibs $compiler_flags'
+         archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
+         $CC -G${allow_undefined_flag} -M $lib.exp -h $soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+         ;;
+       esac
+      fi
+      hardcode_libdir_flag_spec='-R$libdir'
+      hardcode_shlibpath_var=no
+      case $host_os in
+      solaris2.[0-5] | solaris2.[0-5].*) ;;
+      *)
+       # The compiler driver will combine and reorder linker options,
+       # but understands `-z linker_flag'.  GCC discards it without `$wl',
+       # but is careful enough not to reorder.
+       # Supported since Solaris 2.6 (maybe 2.5.1?)
+       if test "$GCC" = yes; then
+         whole_archive_flag_spec='${wl}-z ${wl}allextract$convenience ${wl}-z ${wl}defaultextract'
+       else
+         whole_archive_flag_spec='-z allextract$convenience -z defaultextract'
+       fi
+       ;;
+      esac
+      link_all_deplibs=yes
+      ;;
+
+    sunos4*)
+      if test "x$host_vendor" = xsequent; then
+       # Use $CC to link under sequent, because it throws in some extra .o
+       # files that make .init and .fini sections work.
+       archive_cmds='$CC -G ${wl}-h $soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$LD -assert pure-text -Bstatic -o $lib $libobjs $deplibs $linker_flags'
+      fi
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_direct=yes
+      hardcode_minus_L=yes
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4)
+      case $host_vendor in
+       sni)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=yes # is this really true???
+       ;;
+       siemens)
+         ## LD is ld it makes a PLAMLIB
+         ## CC just makes a GrossModule.
+         archive_cmds='$LD -G -o $lib $libobjs $deplibs $linker_flags'
+         reload_cmds='$CC -r -o $output$reload_objs'
+         hardcode_direct=no
+        ;;
+       motorola)
+         archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+         hardcode_direct=no #Motorola manual says yes, but my tests say they lie
+       ;;
+      esac
+      runpath_var='LD_RUN_PATH'
+      hardcode_shlibpath_var=no
+      ;;
+
+    sysv4.3*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_shlibpath_var=no
+      export_dynamic_flag_spec='-Bexport'
+      ;;
+
+    sysv4*MP*)
+      if test -d /usr/nec; then
+       archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+       hardcode_shlibpath_var=no
+       runpath_var=LD_RUN_PATH
+       hardcode_runpath_var=yes
+       ld_shlibs=yes
+      fi
+      ;;
+
+    sysv4*uw2* | sysv5OpenUNIX* | sysv5UnixWare7.[01].[10]* | unixware7* | sco3.2v5.0.[024]*)
+      no_undefined_flag='${wl}-z,text'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    sysv5* | sco3.2v5* | sco5v6*)
+      # Note: We can NOT use -z defs as we might desire, because we do not
+      # link with -lc, and that would cause any symbols used from libc to
+      # always be unresolved, which means just about no library would
+      # ever link correctly.  If we're not using GNU ld we use -z text
+      # though, which does catch some bad symbols but isn't as heavy-handed
+      # as -z defs.
+      no_undefined_flag='${wl}-z,text'
+      allow_undefined_flag='${wl}-z,nodefs'
+      archive_cmds_need_lc=no
+      hardcode_shlibpath_var=no
+      hardcode_libdir_flag_spec='${wl}-R,$libdir'
+      hardcode_libdir_separator=':'
+      link_all_deplibs=yes
+      export_dynamic_flag_spec='${wl}-Bexport'
+      runpath_var='LD_RUN_PATH'
+
+      if test "$GCC" = yes; then
+       archive_cmds='$CC -shared ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -shared ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      else
+       archive_cmds='$CC -G ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+       archive_expsym_cmds='$CC -G ${wl}-Bexport:$export_symbols ${wl}-h,$soname -o $lib $libobjs $deplibs $compiler_flags'
+      fi
+      ;;
+
+    uts4*)
+      archive_cmds='$LD -G -h $soname -o $lib $libobjs $deplibs $linker_flags'
+      hardcode_libdir_flag_spec='-L$libdir'
+      hardcode_shlibpath_var=no
+      ;;
+
+    *)
+      ld_shlibs=no
+      ;;
+    esac
+
+    if test x$host_vendor = xsni; then
+      case $host in
+      sysv4 | sysv4.2uw2* | sysv4.3* | sysv5*)
+       export_dynamic_flag_spec='${wl}-Blargedynsym'
+       ;;
+      esac
+    fi
+  fi
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ld_shlibs" >&5
+$as_echo "$ld_shlibs" >&6; }
+test "$ld_shlibs" = no && can_build_shared=no
+
+with_gnu_ld=$with_gnu_ld
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+#
+# Do we need to explicitly link libc?
+#
+case "x$archive_cmds_need_lc" in
+x|xyes)
+  # Assume -lc should be added
+  archive_cmds_need_lc=yes
+
+  if test "$enable_shared" = yes && test "$GCC" = yes; then
+    case $archive_cmds in
+    *'~'*)
+      # FIXME: we may have to deal with multi-command sequences.
+      ;;
+    '$CC '*)
+      # Test whether the compiler implicitly links with -lc since on some
+      # systems, -lgcc has to come before -lc. If gcc already passes -lc
+      # to ld, don't add -lc before -lgcc.
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether -lc should be explicitly linked in" >&5
+$as_echo_n "checking whether -lc should be explicitly linked in... " >&6; }
+if ${lt_cv_archive_cmds_need_lc+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  $RM conftest*
+       echo "$lt_simple_compile_test_code" > conftest.$ac_ext
+
+       if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
+  (eval $ac_compile) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } 2>conftest.err; then
+         soname=conftest
+         lib=conftest
+         libobjs=conftest.$ac_objext
+         deplibs=
+         wl=$lt_prog_compiler_wl
+         pic_flag=$lt_prog_compiler_pic
+         compiler_flags=-v
+         linker_flags=-v
+         verstring=
+         output_objdir=.
+         libname=conftest
+         lt_save_allow_undefined_flag=$allow_undefined_flag
+         allow_undefined_flag=
+         if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1\""; } >&5
+  (eval $archive_cmds 2\>\&1 \| $GREP \" -lc \" \>/dev/null 2\>\&1) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }
+         then
+           lt_cv_archive_cmds_need_lc=no
+         else
+           lt_cv_archive_cmds_need_lc=yes
+         fi
+         allow_undefined_flag=$lt_save_allow_undefined_flag
+       else
+         cat conftest.err 1>&5
+       fi
+       $RM conftest*
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_archive_cmds_need_lc" >&5
+$as_echo "$lt_cv_archive_cmds_need_lc" >&6; }
+      archive_cmds_need_lc=$lt_cv_archive_cmds_need_lc
+      ;;
+    esac
+  fi
+  ;;
+esac
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
+$as_echo_n "checking dynamic linker characteristics... " >&6; }
+
+if test "$GCC" = yes; then
+  case $host_os in
+    darwin*) lt_awk_arg="/^libraries:/,/LR/" ;;
+    *) lt_awk_arg="/^libraries:/" ;;
+  esac
+  case $host_os in
+    mingw* | cegcc*) lt_sed_strip_eq="s,=\([A-Za-z]:\),\1,g" ;;
+    *) lt_sed_strip_eq="s,=/,/,g" ;;
+  esac
+  lt_search_path_spec=`$CC -print-search-dirs | awk $lt_awk_arg | $SED -e "s/^libraries://" -e $lt_sed_strip_eq`
+  case $lt_search_path_spec in
+  *\;*)
+    # if the path contains ";" then we assume it to be the separator
+    # otherwise default to the standard path separator (i.e. ":") - it is
+    # assumed that no part of a normal pathname contains ";" but that should
+    # okay in the real world where ";" in dirpaths is itself problematic.
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED 's/;/ /g'`
+    ;;
+  *)
+    lt_search_path_spec=`$ECHO "$lt_search_path_spec" | $SED "s/$PATH_SEPARATOR/ /g"`
+    ;;
+  esac
+  # Ok, now we have the path, separated by spaces, we can step through it
+  # and add multilib dir if necessary.
+  lt_tmp_lt_search_path_spec=
+  lt_multi_os_dir=`$CC $CPPFLAGS $CFLAGS $LDFLAGS -print-multi-os-directory 2>/dev/null`
+  for lt_sys_path in $lt_search_path_spec; do
+    if test -d "$lt_sys_path/$lt_multi_os_dir"; then
+      lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path/$lt_multi_os_dir"
+    else
+      test -d "$lt_sys_path" && \
+       lt_tmp_lt_search_path_spec="$lt_tmp_lt_search_path_spec $lt_sys_path"
+    fi
+  done
+  lt_search_path_spec=`$ECHO "$lt_tmp_lt_search_path_spec" | awk '
+BEGIN {RS=" "; FS="/|\n";} {
+  lt_foo="";
+  lt_count=0;
+  for (lt_i = NF; lt_i > 0; lt_i--) {
+    if ($lt_i != "" && $lt_i != ".") {
+      if ($lt_i == "..") {
+        lt_count++;
+      } else {
+        if (lt_count == 0) {
+          lt_foo="/" $lt_i lt_foo;
+        } else {
+          lt_count--;
+        }
+      }
+    }
+  }
+  if (lt_foo != "") { lt_freq[lt_foo]++; }
+  if (lt_freq[lt_foo] == 1) { print lt_foo; }
+}'`
+  # AWK program above erroneously prepends '/' to C:/dos/paths
+  # for these hosts.
+  case $host_os in
+    mingw* | cegcc*) lt_search_path_spec=`$ECHO "$lt_search_path_spec" |\
+      $SED 's,/\([A-Za-z]:\),\1,g'` ;;
+  esac
+  sys_lib_search_path_spec=`$ECHO "$lt_search_path_spec" | $lt_NL2SP`
+else
+  sys_lib_search_path_spec="/lib /usr/lib /usr/local/lib"
+fi
+library_names_spec=
+libname_spec='lib$name'
+soname_spec=
+shrext_cmds=".so"
+postinstall_cmds=
+postuninstall_cmds=
+finish_cmds=
+finish_eval=
+shlibpath_var=
+shlibpath_overrides_runpath=unknown
+version_type=none
+dynamic_linker="$host_os ld.so"
+sys_lib_dlsearch_path_spec="/lib /usr/lib"
+need_lib_prefix=unknown
+hardcode_into_libs=no
+
+# when you set need_version to no, make sure it does not cause -set_version
+# flags to be left without arguments
+need_version=unknown
+
+case $host_os in
+aix3*)
+  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
+
+  # AIX 3 has no versioning support, so we append a major version to the name.
+  soname_spec='${libname}${release}${shared_ext}$major'
+  ;;
+
+aix[4-9]*)
+  version_type=linux # correct to gnu/linux during the next big refactor
+  need_lib_prefix=no
+  need_version=no
+  hardcode_into_libs=yes
+  if test "$host_cpu" = ia64; then
+    # AIX 5 supports IA64
+    library_names_spec='${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext}$versuffix $libname${shared_ext}'
+    shlibpath_var=LD_LIBRARY_PATH
+  else
+    # With GCC up to 2.95.x, collect2 would create an import file
+    # for dependence libraries.  The import file would start with
+    # the line `#! .'.  This would cause the generated library to
+    # depend on `.', always an invalid library.  This was fixed in
+    # development snapshots of GCC prior to 3.0.
+    case $host_os in
+      aix4 | aix4.[01] | aix4.[01].*)
+      if { echo '#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 97)'
+          echo ' yes '
+          echo '#endif'; } | ${CC} -E - | $GREP yes > /dev/null; then
+       :
+      else
+       can_build_shared=no
+      fi
+      ;;
+    esac
+    # AIX (on Power*) has no versioning support, so currently we can not hardcode correct
+    # soname into executable. Probably we can add versioning support to
+    # collect2, so additional links can be useful in future.
+    if test "$aix_use_runtimelinking" = yes; then
+      # If using run time linking (on AIX 4.2 or later) use lib<name>.so
+      # instead of lib<name>.a to let people know that these are not
+      # typical AIX shared libraries.
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    else
+      # We preserve .a as extension for shared libraries through AIX4.2
+      # and later when we are not doing run time linking.
+      library_names_spec='${libname}${release}.a $libname.a'
+      soname_spec='${libname}${release}${shared_ext}$major'
+    fi
+    shlibpath_var=LIBPATH
+  fi
+  ;;
+
+amigaos*)
+  case $host_cpu in
+  powerpc)
+    # Since July 2007 AmigaOS4 officially supports .so libraries.
+    # When compiling the executable, add -use-dynld -Lsobjs: to the compileline.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    ;;
+  m68k)
+    library_names_spec='$libname.ixlibrary $libname.a'
+    # Create ${libname}_ixlibrary.a entries in /sys/libs.
+    finish_eval='for lib in `ls $libdir/*.ixlibrary 2>/dev/null`; do libname=`func_echo_all "$lib" | $SED '\''s%^.*/\([^/]*\)\.ixlibrary$%\1%'\''`; test $RM /sys/libs/${libname}_ixlibrary.a; $show "cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a"; cd /sys/libs && $LN_S $lib ${libname}_ixlibrary.a || exit 1; done'
+    ;;
+  esac
+  ;;
+
+beos*)
+  library_names_spec='${libname}${shared_ext}'
+  dynamic_linker="$host_os ld.so"
+  shlibpath_var=LIBRARY_PATH
+  ;;
+
+bsdi[45]*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/shlib /usr/lib /usr/X11/lib /usr/contrib/lib /lib /usr/local/lib"
+  sys_lib_dlsearch_path_spec="/shlib /usr/lib /usr/local/lib"
+  # the default ld.so.conf also contains /usr/contrib/lib and
+  # /usr/X11R6/lib (/usr/X11 is a link to /usr/X11R6), but let us allow
+  # libtool to hard-code these into programs
+  ;;
+
+cygwin* | mingw* | pw32* | cegcc*)
+  version_type=windows
+  shrext_cmds=".dll"
+  need_version=no
+  need_lib_prefix=no
+
+  case $GCC,$cc_basename in
+  yes,*)
+    # gcc
+    library_names_spec='$libname.dll.a'
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname~
+      chmod a+x \$dldir/$dlname~
+      if test -n '\''$stripme'\'' && test -n '\''$striplib'\''; then
+        eval '\''$striplib \$dldir/$dlname'\'' || exit \$?;
+      fi'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+
+    case $host_os in
+    cygwin*)
+      # Cygwin DLLs use 'cyg' prefix rather than 'lib'
+      soname_spec='`echo ${libname} | sed -e 's/^lib/cyg/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+
+      sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/lib/w32api"
+      ;;
+    mingw* | cegcc*)
+      # MinGW DLLs use traditional 'lib' prefix
+      soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    pw32*)
+      # pw32 DLLs use 'pw' prefix rather than 'lib'
+      library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+      ;;
+    esac
+    dynamic_linker='Win32 ld.exe'
+    ;;
+
+  *,cl*)
+    # Native MSVC
+    libname_spec='$name'
+    soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+    library_names_spec='${libname}.dll.lib'
+
+    case $build_os in
+    mingw*)
+      sys_lib_search_path_spec=
+      lt_save_ifs=$IFS
+      IFS=';'
+      for lt_path in $LIB
+      do
+        IFS=$lt_save_ifs
+        # Let DOS variable expansion print the short 8.3 style file name.
+        lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+        sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+      done
+      IFS=$lt_save_ifs
+      # Convert to MSYS style.
+      sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+      ;;
+    cygwin*)
+      # Convert to unix form, then to dos form, then back to unix form
+      # but this time dos style (no spaces!) so that the unix form looks
+      # like /cygdrive/c/PROGRA~1:/cygdr...
+      sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+      sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+      sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      ;;
+    *)
+      sys_lib_search_path_spec="$LIB"
+      if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+        # It is most probably a Windows format PATH.
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+      else
+        sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+      fi
+      # FIXME: find the short name or the path components, as spaces are
+      # common. (e.g. "Program Files" -> "PROGRA~1")
+      ;;
+    esac
+
+    # DLL is installed to $(libdir)/../bin by postinstall_cmds
+    postinstall_cmds='base_file=`basename \${file}`~
+      dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+      dldir=$destdir/`dirname \$dlpath`~
+      test -d \$dldir || mkdir -p \$dldir~
+      $install_prog $dir/$dlname \$dldir/$dlname'
+    postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+      dlpath=$dir/\$dldll~
+       $RM \$dlpath'
+    shlibpath_overrides_runpath=yes
+    dynamic_linker='Win32 link.exe'
+    ;;
+
+  *)
+    # Assume MSVC wrapper
+    library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+    dynamic_linker='Win32 ld.exe'
+    ;;
+  esac
+  # FIXME: first we should search . and the directory the executable is in
+  shlibpath_var=PATH
+  ;;
+
+darwin* | rhapsody*)
+  dynamic_linker="$host_os dyld"
+  version_type=darwin
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${major}$shared_ext ${libname}$shared_ext'
+  soname_spec='${libname}${release}${major}$shared_ext'
+  shlibpath_overrides_runpath=yes
+  shlibpath_var=DYLD_LIBRARY_PATH
+  shrext_cmds='`test .$module = .yes && echo .so || echo .dylib`'
+
+  sys_lib_search_path_spec="$sys_lib_search_path_spec /usr/local/lib"
+  sys_lib_dlsearch_path_spec='/usr/local/lib /lib /usr/lib'
+  ;;
+
+dgux*)
+  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
+  ;;
+
+freebsd* | dragonfly*)
+  # DragonFly does not have aout.  When/if they implement a new
+  # versioning mechanism, adjust this.
+  if test -x /usr/bin/objformat; then
+    objformat=`/usr/bin/objformat`
+  else
+    case $host_os in
+    freebsd[23].*) objformat=aout ;;
+    *) objformat=elf ;;
+    esac
+  fi
+  version_type=freebsd-$objformat
+  case $version_type in
+    freebsd-elf*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+      need_version=no
+      need_lib_prefix=no
+      ;;
+    freebsd-*)
+      library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix'
+      need_version=yes
+      ;;
+  esac
+  shlibpath_var=LD_LIBRARY_PATH
+  case $host_os in
+  freebsd2.*)
+    shlibpath_overrides_runpath=yes
+    ;;
+  freebsd3.[01]* | freebsdelf3.[01]*)
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  freebsd3.[2-9]* | freebsdelf3.[2-9]* | \
+  freebsd4.[0-5] | freebsdelf4.[0-5] | freebsd4.1.1 | freebsdelf4.1.1)
+    shlibpath_overrides_runpath=no
+    hardcode_into_libs=yes
+    ;;
+  *) # from 4.6 on, and DragonFly
+    shlibpath_overrides_runpath=yes
+    hardcode_into_libs=yes
+    ;;
+  esac
+  ;;
+
+haiku*)
+  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"
+  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=LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  sys_lib_dlsearch_path_spec='/boot/home/config/lib /boot/common/lib /boot/system/lib'
+  hardcode_into_libs=yes
+  ;;
+
+hpux9* | hpux10* | hpux11*)
+  # Give a soname corresponding to the major version so that dld.sl refuses to
+  # link against other versions.
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  case $host_cpu in
+  ia64*)
+    shrext_cmds='.so'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.so"
+    shlibpath_var=LD_LIBRARY_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    if test "X$HPUX_IA64_MODE" = X32; then
+      sys_lib_search_path_spec="/usr/lib/hpux32 /usr/local/lib/hpux32 /usr/local/lib"
+    else
+      sys_lib_search_path_spec="/usr/lib/hpux64 /usr/local/lib/hpux64"
+    fi
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  hppa*64*)
+    shrext_cmds='.sl'
+    hardcode_into_libs=yes
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=LD_LIBRARY_PATH # How should we handle SHLIB_PATH
+    shlibpath_overrides_runpath=yes # Unless +noenvvar is specified.
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    sys_lib_search_path_spec="/usr/lib/pa20_64 /usr/ccs/lib/pa20_64"
+    sys_lib_dlsearch_path_spec=$sys_lib_search_path_spec
+    ;;
+  *)
+    shrext_cmds='.sl'
+    dynamic_linker="$host_os dld.sl"
+    shlibpath_var=SHLIB_PATH
+    shlibpath_overrides_runpath=no # +s is required to enable SHLIB_PATH
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    ;;
+  esac
+  # HP-UX runs *really* slowly unless shared libraries are mode 555, ...
+  postinstall_cmds='chmod 555 $lib'
+  # or fails outright, so override atomically:
+  install_override_mode=555
+  ;;
+
+interix[3-9]*)
+  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'
+  dynamic_linker='Interix 3.x ld.so.1 (PE, like ELF)'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+irix5* | irix6* | nonstopux*)
+  case $host_os in
+    nonstopux*) version_type=nonstopux ;;
+    *)
+       if test "$lt_cv_prog_gnu_ld" = yes; then
+               version_type=linux # correct to gnu/linux during the next big refactor
+       else
+               version_type=irix
+       fi ;;
+  esac
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${release}${shared_ext} $libname${shared_ext}'
+  case $host_os in
+  irix5* | nonstopux*)
+    libsuff= shlibsuff=
+    ;;
+  *)
+    case $LD in # libtool.m4 will add one of these switches to LD
+    *-32|*"-32 "|*-melf32bsmip|*"-melf32bsmip ")
+      libsuff= shlibsuff= libmagic=32-bit;;
+    *-n32|*"-n32 "|*-melf32bmipn32|*"-melf32bmipn32 ")
+      libsuff=32 shlibsuff=N32 libmagic=N32;;
+    *-64|*"-64 "|*-melf64bmip|*"-melf64bmip ")
+      libsuff=64 shlibsuff=64 libmagic=64-bit;;
+    *) libsuff= shlibsuff= libmagic=never-match;;
+    esac
+    ;;
+  esac
+  shlibpath_var=LD_LIBRARY${shlibsuff}_PATH
+  shlibpath_overrides_runpath=no
+  sys_lib_search_path_spec="/usr/lib${libsuff} /lib${libsuff} /usr/local/lib${libsuff}"
+  sys_lib_dlsearch_path_spec="/usr/lib${libsuff} /lib${libsuff}"
+  hardcode_into_libs=yes
+  ;;
+
+# No shared lib support for Linux oldld, aout, or coff.
+linux*oldld* | linux*aout* | linux*coff*)
+  dynamic_linker=no
+  ;;
+
+# This must be glibc/ELF.
+linux* | k*bsd*-gnu | kopensolaris*-gnu | gnu*)
+  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'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+
+  # Some binutils ld are patched to set DT_RUNPATH
+  if ${lt_cv_shlibpath_overrides_runpath+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  lt_cv_shlibpath_overrides_runpath=no
+    save_LDFLAGS=$LDFLAGS
+    save_libdir=$libdir
+    eval "libdir=/foo; wl=\"$lt_prog_compiler_wl\"; \
+        LDFLAGS=\"\$LDFLAGS $hardcode_libdir_flag_spec\""
+    cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  if  ($OBJDUMP -p conftest$ac_exeext) 2>/dev/null | grep "RUNPATH.*$libdir" >/dev/null; then :
+  lt_cv_shlibpath_overrides_runpath=yes
+fi
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+    LDFLAGS=$save_LDFLAGS
+    libdir=$save_libdir
+
+fi
+
+  shlibpath_overrides_runpath=$lt_cv_shlibpath_overrides_runpath
+
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+
+  # Append ld.so.conf contents to the search path
+  if test -f /etc/ld.so.conf; then
+    lt_ld_extra=`awk '/^include / { system(sprintf("cd /etc; cat %s 2>/dev/null", \$2)); skip = 1; } { if (!skip) print \$0; skip = 0; }' < /etc/ld.so.conf | $SED -e 's/#.*//;/^[      ]*hwcap[        ]/d;s/[:,      ]/ /g;s/=[^=]*$//;s/=[^= ]* / /g;s/"//g;/^$/d' | tr '\n' ' '`
+    sys_lib_dlsearch_path_spec="/lib /usr/lib $lt_ld_extra"
+  fi
+
+  # We used to test for /lib/ld.so.1 and disable shared libraries on
+  # powerpc, because MkLinux only supported shared libraries with the
+  # GNU dynamic linker.  Since this was broken with cross compilers,
+  # most powerpc-linux boxes support dynamic linking these days and
+  # people can always --disable-shared, the test was removed, and we
+  # assume the GNU/Linux dynamic linker is in use.
+  dynamic_linker='GNU/Linux ld.so'
+  ;;
+
+netbsdelf*-gnu)
+  version_type=linux
+  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
+  dynamic_linker='NetBSD ld.elf_so'
+  ;;
+
+netbsd*)
+  version_type=sunos
+  need_lib_prefix=no
+  need_version=no
+  if echo __ELF__ | $CC -E - | $GREP __ELF__ >/dev/null; then
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+    finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+    dynamic_linker='NetBSD (a.out) ld.so'
+  else
+    library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
+    soname_spec='${libname}${release}${shared_ext}$major'
+    dynamic_linker='NetBSD ld.elf_so'
+  fi
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  ;;
+
+newsos6)
+  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
+  ;;
+
+*nto* | *qnx*)
+  version_type=qnx
+  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
+  dynamic_linker='ldqnx.so'
+  ;;
+
+openbsd*)
+  version_type=sunos
+  sys_lib_dlsearch_path_spec="/usr/lib"
+  need_lib_prefix=no
+  # Some older versions of OpenBSD (3.3 at least) *do* need versioned libs.
+  case $host_os in
+    openbsd3.3 | openbsd3.3.*) need_version=yes ;;
+    *)                         need_version=no  ;;
+  esac
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -m $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then
+    case $host_os in
+      openbsd2.[89] | openbsd2.[89].*)
+       shlibpath_overrides_runpath=no
+       ;;
+      *)
+       shlibpath_overrides_runpath=yes
+       ;;
+      esac
+  else
+    shlibpath_overrides_runpath=yes
+  fi
+  ;;
+
+os2*)
+  libname_spec='$name'
+  shrext_cmds=".dll"
+  need_lib_prefix=no
+  library_names_spec='$libname${shared_ext} $libname.a'
+  dynamic_linker='OS/2 ld.exe'
+  shlibpath_var=LIBPATH
+  ;;
+
+osf3* | osf4* | osf5*)
+  version_type=osf
+  need_lib_prefix=no
+  need_version=no
+  soname_spec='${libname}${release}${shared_ext}$major'
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
+  shlibpath_var=LD_LIBRARY_PATH
+  sys_lib_search_path_spec="/usr/shlib /usr/ccs/lib /usr/lib/cmplrs/cc /usr/lib /usr/local/lib /var/shlib"
+  sys_lib_dlsearch_path_spec="$sys_lib_search_path_spec"
+  ;;
+
+rdos*)
+  dynamic_linker=no
+  ;;
+
+solaris*)
+  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=yes
+  hardcode_into_libs=yes
+  # ldd complains unless libraries are executable
+  postinstall_cmds='chmod +x $lib'
+  ;;
+
+sunos4*)
+  version_type=sunos
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${shared_ext}$versuffix'
+  finish_cmds='PATH="\$PATH:/usr/etc" ldconfig $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  if test "$with_gnu_ld" = yes; then
+    need_lib_prefix=no
+  fi
+  need_version=yes
+  ;;
+
+sysv4 | sysv4.3*)
+  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
+  case $host_vendor in
+    sni)
+      shlibpath_overrides_runpath=no
+      need_lib_prefix=no
+      runpath_var=LD_RUN_PATH
+      ;;
+    siemens)
+      need_lib_prefix=no
+      ;;
+    motorola)
+      need_lib_prefix=no
+      need_version=no
+      shlibpath_overrides_runpath=no
+      sys_lib_search_path_spec='/lib /usr/lib /usr/ccs/lib'
+      ;;
+  esac
+  ;;
+
+sysv4*MP*)
+  if test -d /usr/nec ;then
+    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
+  fi
+  ;;
+
+sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
+  version_type=freebsd-elf
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}'
+  soname_spec='${libname}${release}${shared_ext}$major'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=yes
+  hardcode_into_libs=yes
+  if test "$with_gnu_ld" = yes; then
+    sys_lib_search_path_spec='/usr/local/lib /usr/gnu/lib /usr/ccs/lib /usr/lib /lib'
+  else
+    sys_lib_search_path_spec='/usr/ccs/lib /usr/lib'
+    case $host_os in
+      sco3.2v5*)
+        sys_lib_search_path_spec="$sys_lib_search_path_spec /lib"
+       ;;
+    esac
+  fi
+  sys_lib_dlsearch_path_spec='/usr/lib'
+  ;;
+
+tpf*)
+  # TPF is a cross-target only.  Preferred cross-host = GNU/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}'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  hardcode_into_libs=yes
+  ;;
+
+uts4*)
+  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
+  ;;
+
+*)
+  dynamic_linker=no
+  ;;
+esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $dynamic_linker" >&5
+$as_echo "$dynamic_linker" >&6; }
+test "$dynamic_linker" = no && can_build_shared=no
+
+variables_saved_for_relink="PATH $shlibpath_var $runpath_var"
+if test "$GCC" = yes; then
+  variables_saved_for_relink="$variables_saved_for_relink GCC_EXEC_PREFIX COMPILER_PATH LIBRARY_PATH"
+fi
+
+if test "${lt_cv_sys_lib_search_path_spec+set}" = set; then
+  sys_lib_search_path_spec="$lt_cv_sys_lib_search_path_spec"
+fi
+if test "${lt_cv_sys_lib_dlsearch_path_spec+set}" = set; then
+  sys_lib_dlsearch_path_spec="$lt_cv_sys_lib_dlsearch_path_spec"
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to hardcode library paths into programs" >&5
+$as_echo_n "checking how to hardcode library paths into programs... " >&6; }
+hardcode_action=
+if test -n "$hardcode_libdir_flag_spec" ||
+   test -n "$runpath_var" ||
+   test "X$hardcode_automatic" = "Xyes" ; then
+
+  # We can hardcode non-existent directories.
+  if test "$hardcode_direct" != no &&
+     # If the only mechanism to avoid hardcoding is shlibpath_var, we
+     # have to relink, otherwise we might link with an installed library
+     # when we should be linking with a yet-to-be-installed one
+     ## test "$_LT_TAGVAR(hardcode_shlibpath_var, )" != no &&
+     test "$hardcode_minus_L" != no; then
+    # Linking always hardcodes the temporary library directory.
+    hardcode_action=relink
+  else
+    # We can link without hardcoding, and we can hardcode nonexisting dirs.
+    hardcode_action=immediate
+  fi
+else
+  # We cannot hardcode anything, or else we can only hardcode existing
+  # directories.
+  hardcode_action=unsupported
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $hardcode_action" >&5
+$as_echo "$hardcode_action" >&6; }
+
+if test "$hardcode_action" = relink ||
+   test "$inherit_rpath" = yes; then
+  # Fast installation is not supported
+  enable_fast_install=no
+elif test "$shlibpath_overrides_runpath" = yes ||
+     test "$enable_shared" = no; then
+  # Fast installation is not necessary
+  enable_fast_install=needless
+fi
+
+
+
+
+
+
+  if test "x$enable_dlopen" != xyes; then
+  enable_dlopen=unknown
+  enable_dlopen_self=unknown
+  enable_dlopen_self_static=unknown
+else
+  lt_cv_dlopen=no
+  lt_cv_dlopen_libs=
+
+  case $host_os in
+  beos*)
+    lt_cv_dlopen="load_add_on"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+    ;;
+
+  mingw* | pw32* | cegcc*)
+    lt_cv_dlopen="LoadLibrary"
+    lt_cv_dlopen_libs=
+    ;;
+
+  cygwin*)
+    lt_cv_dlopen="dlopen"
+    lt_cv_dlopen_libs=
+    ;;
+
+  darwin*)
+  # if libdl is installed we need to link against it
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+
+    lt_cv_dlopen="dyld"
+    lt_cv_dlopen_libs=
+    lt_cv_dlopen_self=yes
+
+fi
+
+    ;;
+
+  *)
+    ac_fn_c_check_func "$LINENO" "shl_load" "ac_cv_func_shl_load"
+if test "x$ac_cv_func_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for shl_load in -ldld" >&5
+$as_echo_n "checking for shl_load in -ldld... " >&6; }
+if ${ac_cv_lib_dld_shl_load+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char shl_load ();
+int
+main ()
+{
+return shl_load ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_shl_load=yes
+else
+  ac_cv_lib_dld_shl_load=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_shl_load" >&5
+$as_echo "$ac_cv_lib_dld_shl_load" >&6; }
+if test "x$ac_cv_lib_dld_shl_load" = xyes; then :
+  lt_cv_dlopen="shl_load" lt_cv_dlopen_libs="-ldld"
+else
+  ac_fn_c_check_func "$LINENO" "dlopen" "ac_cv_func_dlopen"
+if test "x$ac_cv_func_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -ldl" >&5
+$as_echo_n "checking for dlopen in -ldl... " >&6; }
+if ${ac_cv_lib_dl_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldl  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dl_dlopen=yes
+else
+  ac_cv_lib_dl_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dl_dlopen" >&5
+$as_echo "$ac_cv_lib_dl_dlopen" >&6; }
+if test "x$ac_cv_lib_dl_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-ldl"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dlopen in -lsvld" >&5
+$as_echo_n "checking for dlopen in -lsvld... " >&6; }
+if ${ac_cv_lib_svld_dlopen+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lsvld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dlopen ();
+int
+main ()
+{
+return dlopen ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_svld_dlopen=yes
+else
+  ac_cv_lib_svld_dlopen=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_svld_dlopen" >&5
+$as_echo "$ac_cv_lib_svld_dlopen" >&6; }
+if test "x$ac_cv_lib_svld_dlopen" = xyes; then :
+  lt_cv_dlopen="dlopen" lt_cv_dlopen_libs="-lsvld"
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dld_link in -ldld" >&5
+$as_echo_n "checking for dld_link in -ldld... " >&6; }
+if ${ac_cv_lib_dld_dld_link+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldld  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char dld_link ();
+int
+main ()
+{
+return dld_link ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_dld_dld_link=yes
+else
+  ac_cv_lib_dld_dld_link=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dld_dld_link" >&5
+$as_echo "$ac_cv_lib_dld_dld_link" >&6; }
+if test "x$ac_cv_lib_dld_dld_link" = xyes; then :
+  lt_cv_dlopen="dld_link" lt_cv_dlopen_libs="-ldld"
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+
+fi
+
+    ;;
+  esac
+
+  if test "x$lt_cv_dlopen" != xno; then
+    enable_dlopen=yes
+  else
+    enable_dlopen=no
+  fi
+
+  case $lt_cv_dlopen in
+  dlopen)
+    save_CPPFLAGS="$CPPFLAGS"
+    test "x$ac_cv_header_dlfcn_h" = xyes && CPPFLAGS="$CPPFLAGS -DHAVE_DLFCN_H"
+
+    save_LDFLAGS="$LDFLAGS"
+    wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $export_dynamic_flag_spec\"
+
+    save_LIBS="$LIBS"
+    LIBS="$lt_cv_dlopen_libs $LIBS"
+
+    { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a program can dlopen itself" >&5
+$as_echo_n "checking whether a program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self" >&5
+$as_echo "$lt_cv_dlopen_self" >&6; }
+
+    if test "x$lt_cv_dlopen_self" = xyes; then
+      wl=$lt_prog_compiler_wl eval LDFLAGS=\"\$LDFLAGS $lt_prog_compiler_static\"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether a statically linked program can dlopen itself" >&5
+$as_echo_n "checking whether a statically linked program can dlopen itself... " >&6; }
+if ${lt_cv_dlopen_self_static+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+         if test "$cross_compiling" = yes; then :
+  lt_cv_dlopen_self_static=cross
+else
+  lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
+  lt_status=$lt_dlunknown
+  cat > conftest.$ac_ext <<_LT_EOF
+#line $LINENO "configure"
+#include "confdefs.h"
+
+#if HAVE_DLFCN_H
+#include <dlfcn.h>
+#endif
+
+#include <stdio.h>
+
+#ifdef RTLD_GLOBAL
+#  define LT_DLGLOBAL          RTLD_GLOBAL
+#else
+#  ifdef DL_GLOBAL
+#    define LT_DLGLOBAL                DL_GLOBAL
+#  else
+#    define LT_DLGLOBAL                0
+#  endif
+#endif
+
+/* We may have to define LT_DLLAZY_OR_NOW in the command line if we
+   find out it does not work in some platform. */
+#ifndef LT_DLLAZY_OR_NOW
+#  ifdef RTLD_LAZY
+#    define LT_DLLAZY_OR_NOW           RTLD_LAZY
+#  else
+#    ifdef DL_LAZY
+#      define LT_DLLAZY_OR_NOW         DL_LAZY
+#    else
+#      ifdef RTLD_NOW
+#        define LT_DLLAZY_OR_NOW       RTLD_NOW
+#      else
+#        ifdef DL_NOW
+#          define LT_DLLAZY_OR_NOW     DL_NOW
+#        else
+#          define LT_DLLAZY_OR_NOW     0
+#        endif
+#      endif
+#    endif
+#  endif
+#endif
+
+/* When -fvisbility=hidden is used, assume the code has been annotated
+   correspondingly for the symbols needed.  */
+#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
+int fnord () __attribute__((visibility("default")));
+#endif
+
+int fnord () { return 42; }
+int main ()
+{
+  void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
+  int status = $lt_dlunknown;
+
+  if (self)
+    {
+      if (dlsym (self,"fnord"))       status = $lt_dlno_uscore;
+      else
+        {
+         if (dlsym( self,"_fnord"))  status = $lt_dlneed_uscore;
+          else puts (dlerror ());
+       }
+      /* dlclose (self); */
+    }
+  else
+    puts (dlerror ());
+
+  return status;
+}
+_LT_EOF
+  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
+  (eval $ac_link) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; } && test -s conftest${ac_exeext} 2>/dev/null; then
+    (./conftest; exit; ) >&5 2>/dev/null
+    lt_status=$?
+    case x$lt_status in
+      x$lt_dlno_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlneed_uscore) lt_cv_dlopen_self_static=yes ;;
+      x$lt_dlunknown|x*) lt_cv_dlopen_self_static=no ;;
+    esac
+  else :
+    # compilation failed
+    lt_cv_dlopen_self_static=no
+  fi
+fi
+rm -fr conftest*
+
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_dlopen_self_static" >&5
+$as_echo "$lt_cv_dlopen_self_static" >&6; }
+    fi
+
+    CPPFLAGS="$save_CPPFLAGS"
+    LDFLAGS="$save_LDFLAGS"
+    LIBS="$save_LIBS"
+    ;;
+  esac
+
+  case $lt_cv_dlopen_self in
+  yes|no) enable_dlopen_self=$lt_cv_dlopen_self ;;
+  *) enable_dlopen_self=unknown ;;
+  esac
+
+  case $lt_cv_dlopen_self_static in
+  yes|no) enable_dlopen_self_static=$lt_cv_dlopen_self_static ;;
+  *) enable_dlopen_self_static=unknown ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+striplib=
+old_striplib=
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5
+$as_echo_n "checking whether stripping libraries is possible... " >&6; }
+if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then
+  test -z "$old_striplib" && old_striplib="$STRIP --strip-debug"
+  test -z "$striplib" && striplib="$STRIP --strip-unneeded"
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+else
+# FIXME - insert some real tests, host_os isn't really good enough
+  case $host_os in
+  darwin*)
+    if test -n "$STRIP" ; then
+      striplib="$STRIP -x"
+      old_striplib="$STRIP -S"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+    else
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    fi
+    ;;
+  *)
+    { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+    ;;
+  esac
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+  # Report which library types will actually be built
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking if libtool supports shared libraries" >&5
+$as_echo_n "checking if libtool supports shared libraries... " >&6; }
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $can_build_shared" >&5
+$as_echo "$can_build_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build shared libraries" >&5
+$as_echo_n "checking whether to build shared libraries... " >&6; }
+  test "$can_build_shared" = "no" && enable_shared=no
+
+  # On AIX, shared libraries and static libraries use the same namespace, and
+  # are all built from PIC.
+  case $host_os in
+  aix3*)
+    test "$enable_shared" = yes && enable_static=no
+    if test -n "$RANLIB"; then
+      archive_cmds="$archive_cmds~\$RANLIB \$lib"
+      postinstall_cmds='$RANLIB $lib'
+    fi
+    ;;
+
+  aix[4-9]*)
+    if test "$host_cpu" != ia64 && test "$aix_use_runtimelinking" = no ; then
+      test "$enable_shared" = yes && enable_static=no
+    fi
+    ;;
+  esac
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_shared" >&5
+$as_echo "$enable_shared" >&6; }
+
+  { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to build static libraries" >&5
+$as_echo_n "checking whether to build static libraries... " >&6; }
+  # Make sure either enable_shared or enable_static is yes.
+  test "$enable_shared" = yes || enable_static=yes
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_static" >&5
+$as_echo "$enable_static" >&6; }
+
+
+
+
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+CC="$lt_save_CC"
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+        ac_config_commands="$ac_config_commands libtool"
+
+
+
+
+# Only expand once:
+
+
+# By default we simply use the C compiler to build assembly code.
+
+test "${CCAS+set}" = set || CCAS=$CC
+test "${CCASFLAGS+set}" = set || CCASFLAGS=$CFLAGS
+
+
+
+depcc="$CCAS"   am_compiler_list=
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5
+$as_echo_n "checking dependency style of $depcc... " >&6; }
+if ${am_cv_CCAS_dependencies_compiler_type+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
+  # We make a subdir and do the tests there.  Otherwise we can end up
+  # making bogus files that we don't know about and never remove.  For
+  # instance it was reported that on HP-UX the gcc test will end up
+  # making a dummy file named 'D' -- because '-MD' means "put the output
+  # in D".
+  rm -rf conftest.dir
+  mkdir conftest.dir
+  # Copy depcomp to subdir because otherwise we won't find it if we're
+  # using a relative directory.
+  cp "$am_depcomp" conftest.dir
+  cd conftest.dir
+  # We will build objects and dependencies in a subdirectory because
+  # it helps to detect inapplicable dependency modes.  For instance
+  # both Tru64's cc and ICC support -MD to output dependencies as a
+  # side effect of compilation, but ICC will put the dependencies in
+  # the current directory while Tru64 will put them in the object
+  # directory.
+  mkdir sub
+
+  am_cv_CCAS_dependencies_compiler_type=none
+  if test "$am_compiler_list" = ""; then
+     am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp`
+  fi
+  am__universal=false
+
+
+  for depmode in $am_compiler_list; do
+    # Setup a source with many dependencies, because some compilers
+    # like to wrap large dependency lists on column 80 (with \), and
+    # we should not choose a depcomp mode which is confused by this.
+    #
+    # We need to recreate these files for each test, as the compiler may
+    # overwrite some of them when testing with obscure command lines.
+    # This happens at least with the AIX C compiler.
+    : > sub/conftest.c
+    for i in 1 2 3 4 5 6; do
+      echo '#include "conftst'$i'.h"' >> sub/conftest.c
+      # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+      # Solaris 10 /bin/sh.
+      echo '/* dummy */' > sub/conftst$i.h
+    done
+    echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
+
+    # We check with '-c' and '-o' for the sake of the "dashmstdout"
+    # mode.  It turns out that the SunPro C++ compiler does not properly
+    # handle '-M -o', and we need to detect this.  Also, some Intel
+    # versions had trouble with output in subdirs.
+    am__obj=sub/conftest.${OBJEXT-o}
+    am__minus_obj="-o $am__obj"
+    case $depmode in
+    gcc)
+      # This depmode causes a compiler race in universal mode.
+      test "$am__universal" = false || continue
+      ;;
+    nosideeffect)
+      # After this tag, mechanisms are not by side-effect, so they'll
+      # only be used when explicitly requested.
+      if test "x$enable_dependency_tracking" = xyes; then
+       continue
+      else
+       break
+      fi
+      ;;
+    msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+      # This compiler won't grok '-c -o', but also, the minuso test has
+      # not run yet.  These depmodes are late enough in the game, and
+      # so weak that their functioning should not be impacted.
+      am__obj=conftest.${OBJEXT-o}
+      am__minus_obj=
+      ;;
+    none) break ;;
+    esac
+    if depmode=$depmode \
+       source=sub/conftest.c object=$am__obj \
+       depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
+       $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
+         >/dev/null 2>conftest.err &&
+       grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
+       grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
+       ${MAKE-make} -s -f confmf > /dev/null 2>&1; then
+      # icc doesn't choke on unknown options, it will just issue warnings
+      # or remarks (even with -Werror).  So we grep stderr for any message
+      # that says an option was ignored or not supported.
+      # When given -MP, icc 7.0 and 7.1 complain thusly:
+      #   icc: Command line warning: ignoring option '-M'; no argument required
+      # The diagnosis changed in icc 8.0:
+      #   icc: Command line remark: option '-MP' not supported
+      if (grep 'ignoring option' conftest.err ||
+          grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
+        am_cv_CCAS_dependencies_compiler_type=$depmode
+        break
+      fi
+    fi
+  done
+
+  cd ..
+  rm -rf conftest.dir
+else
+  am_cv_CCAS_dependencies_compiler_type=none
+fi
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CCAS_dependencies_compiler_type" >&5
+$as_echo "$am_cv_CCAS_dependencies_compiler_type" >&6; }
+CCASDEPMODE=depmode=$am_cv_CCAS_dependencies_compiler_type
+
+ if
+  test "x$enable_dependency_tracking" != xno \
+  && test "$am_cv_CCAS_dependencies_compiler_type" = gcc3; then
+  am__fastdepCCAS_TRUE=
+  am__fastdepCCAS_FALSE='#'
+else
+  am__fastdepCCAS_TRUE='#'
+  am__fastdepCCAS_FALSE=
+fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking zfs author" >&5
+$as_echo_n "checking zfs author... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZFS_META_AUTHOR" >&5
+$as_echo "$ZFS_META_AUTHOR" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking zfs license" >&5
+$as_echo_n "checking zfs license... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZFS_META_LICENSE" >&5
+$as_echo "$ZFS_META_LICENSE" >&6; }
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking linux distribution" >&5
+$as_echo_n "checking linux distribution... " >&6; }
+       if test -f /etc/toss-release ; then
+               VENDOR=toss ;
+       elif test -f /etc/fedora-release ; then
+               VENDOR=fedora ;
+       elif test -f /etc/redhat-release ; then
+               VENDOR=redhat ;
+       elif test -f /etc/gentoo-release ; then
+               VENDOR=gentoo ;
+       elif test -f /etc/arch-release ; then
+               VENDOR=arch ;
+       elif test -f /etc/SuSE-release ; then
+               VENDOR=sles ;
+       elif test -f /etc/slackware-version ; then
+               VENDOR=slackware ;
+       elif test -f /etc/lunar.release ; then
+               VENDOR=lunar ;
+       elif test -f /etc/lsb-release ; then
+               VENDOR=ubuntu ;
+       elif test -f /etc/debian_version ; then
+               VENDOR=debian ;
+       else
+               VENDOR= ;
+       fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $VENDOR" >&5
+$as_echo "$VENDOR" >&6; }
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking default package type" >&5
+$as_echo_n "checking default package type... " >&6; }
+       case "$VENDOR" in
+               toss)       DEFAULT_PACKAGE=rpm  ;;
+               redhat)     DEFAULT_PACKAGE=rpm  ;;
+               fedora)     DEFAULT_PACKAGE=rpm  ;;
+               gentoo)     DEFAULT_PACKAGE=tgz  ;;
+               arch)       DEFAULT_PACKAGE=tgz  ;;
+               sles)       DEFAULT_PACKAGE=rpm  ;;
+               slackware)  DEFAULT_PACKAGE=tgz  ;;
+               lunar)      DEFAULT_PACKAGE=tgz  ;;
+               ubuntu)     DEFAULT_PACKAGE=deb  ;;
+               debian)     DEFAULT_PACKAGE=deb  ;;
+               *)          DEFAULT_PACKAGE=rpm  ;;
+       esac
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_PACKAGE" >&5
+$as_echo "$DEFAULT_PACKAGE" >&6; }
+
+
+       DEFAULT_INIT_DIR=$sysconfdir/init.d
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking default init directory" >&5
+$as_echo_n "checking default init directory... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_INIT_DIR" >&5
+$as_echo "$DEFAULT_INIT_DIR" >&6; }
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking default init script type" >&5
+$as_echo_n "checking default init script type... " >&6; }
+       case "$VENDOR" in
+               toss)       DEFAULT_INIT_SCRIPT=redhat ;;
+               redhat)     DEFAULT_INIT_SCRIPT=redhat ;;
+               fedora)     DEFAULT_INIT_SCRIPT=fedora ;;
+               gentoo)     DEFAULT_INIT_SCRIPT=gentoo ;;
+               arch)       DEFAULT_INIT_SCRIPT=lsb    ;;
+               sles)       DEFAULT_INIT_SCRIPT=lsb    ;;
+               slackware)  DEFAULT_INIT_SCRIPT=lsb    ;;
+               lunar)      DEFAULT_INIT_SCRIPT=lunar  ;;
+               ubuntu)     DEFAULT_INIT_SCRIPT=lsb    ;;
+               debian)     DEFAULT_INIT_SCRIPT=lsb    ;;
+               *)          DEFAULT_INIT_SCRIPT=lsb    ;;
+       esac
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_INIT_SCRIPT" >&5
+$as_echo "$DEFAULT_INIT_SCRIPT" >&6; }
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking default init config direectory" >&5
+$as_echo_n "checking default init config direectory... " >&6; }
+       case "$VENDOR" in
+               gentoo)     DEFAULT_INITCONF_DIR=/etc/conf.d    ;;
+               toss)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
+               redhat)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
+               fedora)     DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
+               sles)       DEFAULT_INITCONF_DIR=/etc/sysconfig ;;
+               ubuntu)     DEFAULT_INITCONF_DIR=/etc/default   ;;
+               debian)     DEFAULT_INITCONF_DIR=/etc/default   ;;
+               *)          DEFAULT_INITCONF_DIR=/etc/default   ;;
+       esac
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DEFAULT_INITCONF_DIR" >&5
+$as_echo "$DEFAULT_INITCONF_DIR" >&6; }
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether initramfs-tools is available" >&5
+$as_echo_n "checking whether initramfs-tools is available... " >&6; }
+       if test -d /usr/share/initramfs-tools ; then
+               DEFINE_INITRAMFS='--define "_initramfs 1"'
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+       else
+               DEFINE_INITRAMFS=''
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       fi
+
+
+
+       RPM=rpm
+       RPMBUILD=rpmbuild
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $RPM is available" >&5
+$as_echo_n "checking whether $RPM is available... " >&6; }
+       if tmp=$($RPM --version 2>/dev/null); then :
+
+               RPM_VERSION=$(echo $tmp | $AWK '/RPM/ { print $3 }')
+               HAVE_RPM=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPM ($RPM_VERSION)" >&5
+$as_echo "$HAVE_RPM ($RPM_VERSION)" >&6; }
+
+else
+
+               HAVE_RPM=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPM" >&5
+$as_echo "$HAVE_RPM" >&6; }
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $RPMBUILD is available" >&5
+$as_echo_n "checking whether $RPMBUILD is available... " >&6; }
+       if tmp=$($RPMBUILD --version 2>/dev/null); then :
+
+               RPMBUILD_VERSION=$(echo $tmp | $AWK '/RPM/ { print $3 }')
+               HAVE_RPMBUILD=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPMBUILD ($RPMBUILD_VERSION)" >&5
+$as_echo "$HAVE_RPMBUILD ($RPMBUILD_VERSION)" >&6; }
+
+else
+
+               HAVE_RPMBUILD=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_RPMBUILD" >&5
+$as_echo "$HAVE_RPMBUILD" >&6; }
+
+fi
+
+       RPM_DEFINE_COMMON='--define "$(DEBUG_ZFS) 1" --define "$(DEBUG_DMU_TX) 1"'
+       RPM_DEFINE_UTIL='--define "_dracutdir $(dracutdir)" --define "_udevdir $(udevdir)" --define "_udevruledir $(udevruledir)" --define "_initconfdir $(DEFAULT_INITCONF_DIR)" $(DEFINE_INITRAMFS)'
+       RPM_DEFINE_KMOD='--define "kernels $(LINUX_VERSION)" --define "require_spldir $(SPL)" --define "require_splobj $(SPL_OBJ)" --define "ksrc $(LINUX)" --define "kobj $(LINUX_OBJ)"'
+       RPM_DEFINE_DKMS=
+
+       SRPM_DEFINE_COMMON='--define "build_src_rpm 1"'
+       SRPM_DEFINE_UTIL=
+       SRPM_DEFINE_KMOD=
+       SRPM_DEFINE_DKMS=
+
+       RPM_SPEC_DIR="rpm/generic"
+
+# Check whether --with-spec was given.
+if test "${with_spec+set}" = set; then :
+  withval=$with_spec; RPM_SPEC_DIR="rpm/$withval"
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether spec files are available" >&5
+$as_echo_n "checking whether spec files are available... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes ($RPM_SPEC_DIR/*.spec.in)" >&5
+$as_echo "yes ($RPM_SPEC_DIR/*.spec.in)" >&6; }
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+       DPKG=dpkg
+       DPKGBUILD=dpkg-buildpackage
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $DPKG is available" >&5
+$as_echo_n "checking whether $DPKG is available... " >&6; }
+       if tmp=$($DPKG --version 2>/dev/null); then :
+
+               DPKG_VERSION=$(echo $tmp | $AWK '/Debian/ { print $7 }')
+               HAVE_DPKG=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKG ($DPKG_VERSION)" >&5
+$as_echo "$HAVE_DPKG ($DPKG_VERSION)" >&6; }
+
+else
+
+               HAVE_DPKG=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKG" >&5
+$as_echo "$HAVE_DPKG" >&6; }
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $DPKGBUILD is available" >&5
+$as_echo_n "checking whether $DPKGBUILD is available... " >&6; }
+       if tmp=$($DPKGBUILD --version 2>/dev/null); then :
+
+               DPKGBUILD_VERSION=$(echo $tmp | \
+                   $AWK '/Debian/ { print $4 }' | cut -f-4 -d'.')
+               HAVE_DPKGBUILD=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKGBUILD ($DPKGBUILD_VERSION)" >&5
+$as_echo "$HAVE_DPKGBUILD ($DPKGBUILD_VERSION)" >&6; }
+
+else
+
+               HAVE_DPKGBUILD=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_DPKGBUILD" >&5
+$as_echo "$HAVE_DPKGBUILD" >&6; }
+
+fi
+
+
+
+
+
+
+
+
+
+
+       ALIEN=alien
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $ALIEN is available" >&5
+$as_echo_n "checking whether $ALIEN is available... " >&6; }
+       if tmp=$($ALIEN --version 2>/dev/null); then :
+
+               ALIEN_VERSION=$(echo $tmp | $AWK '{ print $3 }')
+               HAVE_ALIEN=yes
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ALIEN ($ALIEN_VERSION)" >&5
+$as_echo "$HAVE_ALIEN ($ALIEN_VERSION)" >&6; }
+
+else
+
+               HAVE_ALIEN=no
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: $HAVE_ALIEN" >&5
+$as_echo "$HAVE_ALIEN" >&6; }
+
+fi
+
+
+
+
+
+
+
+       TARGET_ASM_DIR=asm-generic
+
+
+       ZFS_CONFIG=all
+
+# Check whether --with-config was given.
+if test "${with_config+set}" = set; then :
+  withval=$with_config; ZFS_CONFIG="$withval"
+fi
+
+       # Check whether --enable-linux-builtin was given.
+if test "${enable_linux_builtin+set}" = set; then :
+  enableval=$enable_linux_builtin;
+else
+  enable_linux_builtin=no
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking zfs config" >&5
+$as_echo_n "checking zfs config... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ZFS_CONFIG" >&5
+$as_echo "$ZFS_CONFIG" >&6; };
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wno-unused-but-set-variable support" >&5
+$as_echo_n "checking for -Wno-unused-but-set-variable support... " >&6; }
+
+       saved_flags="$CFLAGS"
+       CFLAGS="$CFLAGS -Wunused-but-set-variable"
+
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+               NO_UNUSED_BUT_SET_VARIABLE=-Wno-unused-but-set-variable
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+               NO_UNUSED_BUT_SET_VARIABLE=
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+       CFLAGS="$saved_flags"
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wno-bool-compare support" >&5
+$as_echo_n "checking for -Wno-bool-compare support... " >&6; }
+
+       saved_flags="$CFLAGS"
+       CFLAGS="$CFLAGS -Wbool-compare"
+
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+               NO_BOOL_COMPARE=-Wno-bool-compare
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+               NO_BOOL_COMPARE=
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+       CFLAGS="$saved_flags"
+
+
+
+
+       case "$ZFS_CONFIG" in
+               user)
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dkms.conf file" >&5
+$as_echo_n "checking for dkms.conf file... " >&6; }
+        if test -e dkms.conf; then :
+
+               as_fn_error $? "
+       *** ZFS should not be manually built in the DKMS source tree.
+       *** Remove all ZFS packages before compiling the ZoL sources.
+       *** Running \"make install\" breaks ZFS packages." "$LINENO" 5
+
+else
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+
+fi
+
+
+
+# Check whether --with-mounthelperdir was given.
+if test "${with_mounthelperdir+set}" = set; then :
+  withval=$with_mounthelperdir; mounthelperdir=$withval
+else
+  mounthelperdir=/sbin
+fi
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for udev directories" >&5
+$as_echo_n "checking for udev directories... " >&6; }
+
+# Check whether --with-udevdir was given.
+if test "${with_udevdir+set}" = set; then :
+  withval=$with_udevdir; udevdir=$withval
+else
+  udevdir=check
+fi
+
+
+       if test "x$udevdir" = xcheck; then :
+
+               path1=/lib/udev
+               path2=/usr/lib/udev
+               default=$path2
+
+               if test -d "$path1"; then :
+  udevdir="$path1"
+else
+
+                       if test -d "$path2"; then :
+  udevdir="$path2"
+else
+  udevdir="$default"
+fi
+
+fi
+
+fi
+
+
+# Check whether --with-udevruledir was given.
+if test "${with_udevruledir+set}" = set; then :
+  withval=$with_udevruledir; udevruledir=$withval
+else
+  udevruledir="${udevdir}/rules.d"
+fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $udevdir;$udevruledir" >&5
+$as_echo "$udevdir;$udevruledir" >&6; }
+
+
+       # Check whether --enable-systemd was given.
+if test "${enable_systemd+set}" = set; then :
+  enableval=$enable_systemd;
+else
+  enable_systemd=yes
+fi
+
+
+
+# Check whether --with-systemdunitdir was given.
+if test "${with_systemdunitdir+set}" = set; then :
+  withval=$with_systemdunitdir; systemdunitdir=$withval
+else
+  systemdunitdir=/usr/lib/systemd/system
+fi
+
+
+
+# Check whether --with-systemdpresetdir was given.
+if test "${with_systemdpresetdir+set}" = set; then :
+  withval=$with_systemdpresetdir; systemdpresetdir=$withval
+else
+  systemdpresetdir=/usr/lib/systemd/system-preset
+fi
+
+
+
+# Check whether --with-systemdmodulesloaddir was given.
+if test "${with_systemdmodulesloaddir+set}" = set; then :
+  withval=$with_systemdmodulesloaddir; systemdmoduleloaddir=$withval
+else
+  systemdmodulesloaddir=/usr/lib/modules-load.d
+fi
+
+
+
+       if test "x$enable_systemd" = xyes; then :
+
+               ZFS_INIT_SYSTEMD=systemd
+               ZFS_MODULE_LOAD=modules-load.d
+               modulesloaddir=$systemdmodulesloaddir
+
+fi
+
+
+
+
+
+
+
+
+       # Check whether --enable-sysvinit was given.
+if test "${enable_sysvinit+set}" = set; then :
+  enableval=$enable_sysvinit;
+else
+  enable_sysvinit=yes
+fi
+
+
+       if test "x$enable_sysvinit" = xyes; then :
+  ZFS_INIT_SYSV=init.d
+fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dracut directory" >&5
+$as_echo_n "checking for dracut directory... " >&6; }
+
+# Check whether --with-dracutdir was given.
+if test "${with_dracutdir+set}" = set; then :
+  withval=$with_dracutdir; dracutdir=$withval
+else
+  dracutdir=check
+fi
+
+
+       if test "x$dracutdir" = xcheck; then :
+
+               path1=/usr/share/dracut
+               path2=/usr/lib/dracut
+               default=$path2
+
+               if test -d "$path1"; then :
+  dracutdir="$path1"
+else
+
+                       if test -d "$path2"; then :
+  dracutdir="$path2"
+else
+  dracutdir="$default"
+fi
+
+fi
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dracutdir" >&5
+$as_echo "$dracutdir" >&6; }
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for target asm dir" >&5
+$as_echo_n "checking for target asm dir... " >&6; }
+       TARGET_ARCH=`echo ${target_cpu} | sed -e s/i.86/i386/`
+
+       case $TARGET_ARCH in
+       i386|x86_64)
+               TARGET_ASM_DIR=asm-${TARGET_ARCH}
+               ;;
+       *)
+               TARGET_ASM_DIR=asm-generic
+               ;;
+       esac
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TARGET_ASM_DIR" >&5
+$as_echo "$TARGET_ASM_DIR" >&6; }
+
+
+       ZLIB=
+
+       ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** zlib.h missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5
+$as_echo_n "checking for compress2 in -lz... " >&6; }
+if ${ac_cv_lib_z_compress2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char compress2 ();
+int
+main ()
+{
+return compress2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_compress2=yes
+else
+  ac_cv_lib_z_compress2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress2" >&5
+$as_echo "$ac_cv_lib_z_compress2" >&6; }
+if test "x$ac_cv_lib_z_compress2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** compress2() missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uncompress in -lz" >&5
+$as_echo_n "checking for uncompress in -lz... " >&6; }
+if ${ac_cv_lib_z_uncompress+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uncompress ();
+int
+main ()
+{
+return uncompress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_uncompress=yes
+else
+  ac_cv_lib_z_uncompress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_uncompress" >&5
+$as_echo "$ac_cv_lib_z_uncompress" >&6; }
+if test "x$ac_cv_lib_z_uncompress" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uncompress() missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crc32 in -lz" >&5
+$as_echo_n "checking for crc32 in -lz... " >&6; }
+if ${ac_cv_lib_z_crc32+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char crc32 ();
+int
+main ()
+{
+return crc32 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_crc32=yes
+else
+  ac_cv_lib_z_crc32=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_crc32" >&5
+$as_echo "$ac_cv_lib_z_crc32" >&6; }
+if test "x$ac_cv_lib_z_crc32" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** crc32() missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       ZLIB="-lz"
+
+
+$as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+
+
+
+       LIBUUID=
+
+       ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uuid/uuid.h missing, libuuid-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
+$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_generate ();
+int
+main ()
+{
+return uuid_generate ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uuid_uuid_generate=yes
+else
+  ac_cv_lib_uuid_uuid_generate=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUUID 1
+_ACEOF
+
+  LIBS="-luuid $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uuid_generate() missing, libuuid-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_is_null in -luuid" >&5
+$as_echo_n "checking for uuid_is_null in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_is_null+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_is_null ();
+int
+main ()
+{
+return uuid_is_null ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uuid_uuid_is_null=yes
+else
+  ac_cv_lib_uuid_uuid_is_null=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_is_null" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_is_null" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_is_null" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUUID 1
+_ACEOF
+
+  LIBS="-luuid $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uuid_is_null() missing, libuuid-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       LIBUUID="-luuid"
+
+
+$as_echo "#define HAVE_LIBUUID 1" >>confdefs.h
+
+
+
+
+# Check whether --with-blkid was given.
+if test "${with_blkid+set}" = set; then :
+  withval=$with_blkid;
+else
+  with_blkid=check
+fi
+
+
+       LIBBLKID=
+       if test "x$with_blkid" = xyes; then :
+
+               LIBBLKID="-lblkid"
+
+
+$as_echo "#define HAVE_LIBBLKID 1" >>confdefs.h
+
+
+fi
+
+       if test "x$with_blkid" = xcheck; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_get_cache in -lblkid" >&5
+$as_echo_n "checking for blkid_get_cache in -lblkid... " >&6; }
+if ${ac_cv_lib_blkid_blkid_get_cache+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blkid_get_cache ();
+int
+main ()
+{
+return blkid_get_cache ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blkid_blkid_get_cache=yes
+else
+  ac_cv_lib_blkid_blkid_get_cache=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_get_cache" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_get_cache" = xyes; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid zfs support" >&5
+$as_echo_n "checking for blkid zfs support... " >&6; }
+
+                       ZFS_DEV=`mktemp`
+                       truncate -s 64M $ZFS_DEV
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=128 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=132 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=136 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=140 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+
+                       saved_LIBS="$LIBS"
+                       LIBS="-lblkid"
+
+                       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 <stdio.h>
+                               #include <stdlib.h>
+                               #include <blkid/blkid.h>
+
+int
+main ()
+{
+
+                               blkid_cache cache;
+                               char *value;
+
+                               if (blkid_get_cache(&cache, NULL) < 0)
+                                       return 1;
+
+                               value = blkid_get_tag_value(cache, "TYPE",
+                                                           "$ZFS_DEV");
+                               if (!value) {
+                                       blkid_put_cache(cache);
+                                       return 2;
+                               }
+
+                               if (strcmp(value, "zfs_member")) {
+                                       free(value);
+                                       blkid_put_cache(cache);
+                                       return 0;
+                               }
+
+                               free(value);
+                               blkid_put_cache(cache);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+                               rm -f $ZFS_DEV
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                               LIBBLKID="-lblkid"
+
+
+$as_echo "#define HAVE_LIBBLKID 1" >>confdefs.h
+
+
+else
+
+                               rm -f $ZFS_DEV
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                               if test "x$with_blkid" != xcheck; 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 $? "--with-blkid given but unavailable
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+                       LIBS="$saved_LIBS"
+
+else
+
+                       if test "x$with_blkid" != xcheck; 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 $? "--with-blkid given but unavailable
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+fi
+
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wframe-larger-than=<size> support" >&5
+$as_echo_n "checking for -Wframe-larger-than=<size> support... " >&6; }
+
+       saved_flags="$CFLAGS"
+       CFLAGS="$CFLAGS -Wframe-larger-than=1024"
+
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+               FRAME_LARGER_THAN=-Wframe-larger-than=1024
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+               FRAME_LARGER_THAN=
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+       CFLAGS="$saved_flags"
+
+
+
+       if test "x$runstatedir" = x; then
+               runstatedir='${localstatedir}/run'
+
+       fi
+
+       for ac_func in mlockall
+do :
+  ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall"
+if test "x$ac_cv_func_mlockall" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MLOCKALL 1
+_ACEOF
+
+fi
+done
+
+   ;;
+               kernel)
+
+
+# Check whether --with-linux was given.
+if test "${with_linux+set}" = set; then :
+  withval=$with_linux; kernelsrc="$withval"
+fi
+
+
+
+# Check whether --with-linux-obj was given.
+if test "${with_linux_obj+set}" = set; then :
+  withval=$with_linux_obj; kernelbuild="$withval"
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source directory" >&5
+$as_echo_n "checking kernel source directory... " >&6; }
+       if test -z "$kernelsrc"; then :
+
+               if test -e "/lib/modules/$(uname -r)/source"; then :
+
+                       headersdir="/lib/modules/$(uname -r)/source"
+                       sourcelink=$(readlink -f "$headersdir")
+
+elif test -e "/lib/modules/$(uname -r)/build"; then :
+
+                       headersdir="/lib/modules/$(uname -r)/build"
+                       sourcelink=$(readlink -f "$headersdir")
+
+else
+
+                       sourcelink=$(ls -1d /usr/src/kernels/* \
+                                    /usr/src/linux-* \
+                                    2>/dev/null | grep -v obj | tail -1)
+
+fi
+
+               if test -n "$sourcelink" && test -e ${sourcelink}; then :
+
+                       kernelsrc=`readlink -f ${sourcelink}`
+
+else
+
+                       kernelsrc="Not found"
+
+fi
+
+else
+
+               if test "$kernelsrc" = "NONE"; then :
+
+                       kernsrcver=NONE
+
+fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelsrc" >&5
+$as_echo "$kernelsrc" >&6; }
+       if test ! -d "$kernelsrc"; then :
+
+               as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed and then try again.  If that fails, you can specify the
+       *** location of the kernel source with the '--with-linux=PATH' option." "$LINENO" 5
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel build directory" >&5
+$as_echo_n "checking kernel build directory... " >&6; }
+       if test -z "$kernelbuild"; then :
+
+               if test -e "/lib/modules/$(uname -r)/build"; then :
+
+                       kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then :
+
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/default; then :
+
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+
+elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then :
+
+                       kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
+
+else
+
+                       kernelbuild=${kernelsrc}
+
+fi
+
+fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelbuild" >&5
+$as_echo "$kernelbuild" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source version" >&5
+$as_echo_n "checking kernel source version... " >&6; }
+       utsrelease1=$kernelbuild/include/linux/version.h
+       utsrelease2=$kernelbuild/include/linux/utsrelease.h
+       utsrelease3=$kernelbuild/include/generated/utsrelease.h
+       if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then :
+
+               utsrelease=linux/version.h
+
+elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then :
+
+               utsrelease=linux/utsrelease.h
+
+elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then :
+
+               utsrelease=generated/utsrelease.h
+
+fi
+
+       if test "$utsrelease"; then :
+
+               kernsrcver=`(echo "#include <$utsrelease>";
+                            echo "kernsrcver=UTS_RELEASE") |
+                            cpp -I $kernelbuild/include |
+                            grep "^kernsrcver=" | cut -d \" -f 2`
+
+               if test -z "$kernsrcver"; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+                       as_fn_error $? "*** Cannot determine kernel version." "$LINENO" 5
+
+fi
+
+else
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Cannot find UTS_RELEASE definition." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Cannot find UTS_RELEASE definition.
+       *** Please run 'make prepare' inside the kernel source tree." "$LINENO" 5
+               fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernsrcver" >&5
+$as_echo "$kernsrcver" >&6; }
+
+       LINUX=${kernelsrc}
+       LINUX_OBJ=${kernelbuild}
+       LINUX_VERSION=${kernsrcver}
+
+
+
+
+
+
+       modpost=$LINUX/scripts/Makefile.modpost
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel file name for module symbols" >&5
+$as_echo_n "checking kernel file name for module symbols... " >&6; }
+       if test "x$enable_linux_builtin" != xyes -a -f "$modpost"; then :
+
+               if grep -q Modules.symvers $modpost; then :
+
+                       LINUX_SYMBOLS=Modules.symvers
+
+else
+
+                       LINUX_SYMBOLS=Module.symvers
+
+fi
+
+               if test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then :
+
+                       as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If you are building with a custom kernel, make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." "$LINENO" 5
+
+fi
+
+else
+
+               LINUX_SYMBOLS=NONE
+
+fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_SYMBOLS" >&5
+$as_echo "$LINUX_SYMBOLS" >&6; }
+
+
+
+
+
+# Check whether --with-spl was given.
+if test "${with_spl+set}" = set; then :
+  withval=$with_spl; splsrc="$withval"
+fi
+
+
+
+# Check whether --with-spl-obj was given.
+if test "${with_spl_obj+set}" = set; then :
+  withval=$with_spl_obj; splbuild="$withval"
+fi
+
+
+
+# Check whether --with-spl-timeout was given.
+if test "${with_spl_timeout+set}" = set; then :
+  withval=$with_spl_timeout; timeout="$withval"
+else
+  timeout=0
+fi
+
+
+                                       splsrc0="/var/lib/dkms/spl/${VERSION}/build"
+       splsrc1="/usr/local/src/spl-${VERSION}/${LINUX_VERSION}"
+       splsrc2="/usr/local/src/spl-${VERSION}"
+       splsrc3="/usr/src/spl-${VERSION}/${LINUX_VERSION}"
+       splsrc4="/usr/src/spl-${VERSION}"
+       splsrc5="../spl/"
+       splsrc6="$LINUX"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl source directory" >&5
+$as_echo_n "checking spl source directory... " >&6; }
+       if test -z "${splsrc}"; then :
+
+               if  test -e "${splsrc0}/spl.release.in"; then :
+
+                       splsrc=${splsrc0}
+
+elif  test -e "${splsrc1}/spl.release.in"; then :
+
+                       splsrc=${splsrc1}
+
+elif  test -e "${splsrc2}/spl.release.in"; then :
+
+                       splsrc=${splsrc2}
+
+elif  test -e "${splsrc3}/spl.release.in"; then :
+
+                       splsrc=$(readlink -f "${splsrc3}")
+
+elif  test -e "${splsrc4}/spl.release.in" ; then :
+
+                       splsrc=${splsrc4}
+
+elif  test -e "${splsrc5}/spl.release.in"; then :
+
+                       splsrc=$(readlink -f "${splsrc5}")
+
+elif  test -e "${splsrc6}/spl.release.in" ; then :
+
+                       splsrc=${splsrc6}
+
+else
+
+                       splsrc="Not found"
+
+fi
+
+else
+
+               if test "$splsrc" = "NONE"; then :
+
+                       splbuild=NONE
+                       splsrcver=NONE
+
+fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $splsrc" >&5
+$as_echo "$splsrc" >&6; }
+       if  test ! -e "$splsrc/spl.release.in"; then :
+
+               as_fn_error $? "
+       *** Please make sure the kmod spl devel package for your distribution
+       *** is installed then try again.  If that fails you can specify the
+       *** location of the spl source with the '--with-spl=PATH' option." "$LINENO" 5
+
+fi
+
+                                                                                                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl build directory" >&5
+$as_echo_n "checking spl build directory... " >&6; }
+       while true; do
+               if test -z "$splbuild"; then :
+
+                       if  test -e "${splsrc}/${LINUX_VERSION}/spl_config.h" ; then :
+
+                               splbuild="${splsrc}/${LINUX_VERSION}"
+
+elif  test -e "${splsrc}/spl_config.h" ; then :
+
+                               splbuild="${splsrc}"
+
+elif  find -L "${splsrc}" -name spl_config.h 2> /dev/null | grep -wq spl_config.h ; then :
+
+                               splbuild=$(find -L "${splsrc}" -name spl_config.h | sed 's,/spl_config.h,,')
+
+else
+
+                               splbuild="Not found"
+
+fi
+
+fi
+               if test -e "$splbuild/spl_config.h" -o $timeout -le 0; then :
+
+                       break;
+
+else
+
+                       sleep 1
+                       timeout=$((timeout-1))
+
+fi
+       done
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $splbuild" >&5
+$as_echo "$splbuild" >&6; }
+       if  ! test -e "$splbuild/spl_config.h"; then :
+
+               as_fn_error $? "
+       *** Please make sure the kmod spl devel <kernel> package for your
+       *** distribution is installed then try again.  If that fails you
+       *** can specify the location of the spl objects with the
+       *** '--with-spl-obj=PATH' option." "$LINENO" 5
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl source version" >&5
+$as_echo_n "checking spl source version... " >&6; }
+       if test -r $splbuild/spl_config.h &&
+               fgrep -q SPL_META_VERSION $splbuild/spl_config.h; then :
+
+
+               splsrcver=`(echo "#include <spl_config.h>";
+                           echo "splsrcver=SPL_META_VERSION-SPL_META_RELEASE") |
+                           cpp -I $splbuild |
+                           grep "^splsrcver=" | tr -d \" | cut -d= -f2`
+
+fi
+
+       if test -z "$splsrcver"; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+               as_fn_error $? "
+       *** Cannot determine the version of the spl source.
+       *** Please prepare the spl source before running this script" "$LINENO" 5
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $splsrcver" >&5
+$as_echo "$splsrcver" >&6; }
+
+       SPL=${splsrc}
+       SPL_OBJ=${splbuild}
+       SPL_VERSION=${splsrcver}
+
+
+
+
+
+                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl file name for module symbols" >&5
+$as_echo_n "checking spl file name for module symbols... " >&6; }
+       SPL_SYMBOLS=NONE
+
+       while true; do
+               if test -r $SPL_OBJ/Module.symvers; then :
+
+                       SPL_SYMBOLS=Module.symvers
+
+elif test -r $SPL_OBJ/Modules.symvers; then :
+
+                       SPL_SYMBOLS=Modules.symvers
+
+elif test -r $SPL_OBJ/module/Module.symvers; then :
+
+                       SPL_SYMBOLS=Module.symvers
+
+elif test -r $SPL_OBJ/module/Modules.symvers; then :
+
+                       SPL_SYMBOLS=Modules.symvers
+
+fi
+
+               if test $SPL_SYMBOLS != NONE -o $timeout -le 0; then :
+
+                       break;
+
+else
+
+                       sleep 1
+                       timeout=$((timeout-1))
+
+fi
+       done
+
+       if test "$SPL_SYMBOLS" = NONE; then :
+
+               SPL_SYMBOLS=$LINUX_SYMBOLS
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SPL_SYMBOLS" >&5
+$as_echo "$SPL_SYMBOLS" >&6; }
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modules can be built" >&5
+$as_echo_n "checking whether modules can be built... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Unable to build an empty module." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Unable to build an empty module.
+       *** Please run 'make scripts' inside the kernel source tree." "$LINENO" 5
+               fi
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       if test "x$cross_compiling" != xyes; 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 "$LINUX/include/linux/license.h"
+
+int
+main ()
+{
+
+                               return !license_is_gpl_compatible("$ZFS_META_LICENSE");
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+
+$as_echo "#define ZFS_IS_GPL_COMPATIBLE 1" >>confdefs.h
+
+
+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}: checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC" >&5
+$as_echo_n "checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/module.h>
+
+int
+main (void)
+{
+
+               #ifndef CONFIG_DEBUG_LOCK_ALLOC
+               #error CONFIG_DEBUG_LOCK_ALLOC not #defined
+               #endif
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mutex_lock() is GPL-only" >&5
+$as_echo_n "checking whether mutex_lock() is GPL-only... " >&6; }
+               tmp_flags="$EXTRA_KCFLAGS"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/module.h>
+                       #include <linux/mutex.h>
+
+                       MODULE_LICENSE("$ZFS_META_LICENSE");
+
+int
+main (void)
+{
+
+                       struct mutex lock;
+
+                       mutex_init(&lock);
+                       mutex_lock(&lock);
+                       mutex_unlock(&lock);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                       as_fn_error $? "
+       *** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is incompatible
+       *** with the CDDL license and will prevent the module linking stage
+       *** from succeeding.  You must rebuild your kernel without this
+       *** option enabled." "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+               EXTRA_KCFLAGS="$tmp_flags"
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-I\$(src)"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether DECLARE_EVENT_CLASS() is available" >&5
+$as_echo_n "checking whether DECLARE_EVENT_CLASS() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/module.h>
+               MODULE_LICENSE(ZFS_META_LICENSE);
+
+               #define CREATE_TRACE_POINTS
+               #include "conftest.h"
+
+int
+main (void)
+{
+
+               trace_zfs_autoconf_event_one(1UL);
+               trace_zfs_autoconf_event_two(2UL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+               #if !defined(_CONFTEST_H) || defined(TRACE_HEADER_MULTI_READ)
+               #define _CONFTEST_H
+
+               #undef  TRACE_SYSTEM
+               #define TRACE_SYSTEM zfs
+               #include <linux/tracepoint.h>
+
+               DECLARE_EVENT_CLASS(zfs_autoconf_event_class,
+                       TP_PROTO(unsigned long i),
+                       TP_ARGS(i),
+                       TP_STRUCT__entry(
+                               __field(unsigned long, i)
+                       ),
+                       TP_fast_assign(
+                               __entry->i = i;
+                       ),
+                       TP_printk("i = %lu", __entry->i)
+               );
+
+               #define DEFINE_AUTOCONF_EVENT(name) \
+               DEFINE_EVENT(zfs_autoconf_event_class, name, \
+                       TP_PROTO(unsigned long i), \
+                       TP_ARGS(i))
+               DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_one);
+               DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_two);
+
+               #endif /* _CONFTEST_H */
+
+               #undef  TRACE_INCLUDE_PATH
+               #define TRACE_INCLUDE_PATH .
+               #define TRACE_INCLUDE_FILE conftest
+               #include <trace/define_trace.h>
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DECLARE_EVENT_CLASS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether current->bio_tail exists" >&5
+$as_echo_n "checking whether current->bio_tail exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+
+int
+main (void)
+{
+
+               current->bio_tail = (struct bio **) NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CURRENT_BIO_TAIL 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether current->bio_list exists" >&5
+$as_echo_n "checking whether current->bio_list exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/sched.h>
+
+int
+main (void)
+{
+
+                       current->bio_list = (struct bio_list *) NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CURRENT_BIO_LIST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no - Please file a bug report at
+                           https://github.com/zfsonlinux/zfs/issues/new" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking block device operation prototypes" >&5
+$as_echo_n "checking block device operation prototypes... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+               int blk_open(struct block_device *bdev, fmode_t mode)
+                   { return 0; }
+               int blk_ioctl(struct block_device *bdev, fmode_t mode,
+                   unsigned x, unsigned long y) { return 0; }
+               int blk_compat_ioctl(struct block_device * bdev, fmode_t mode,
+                   unsigned x, unsigned long y) { return 0; }
+
+               static const struct block_device_operations
+                   bops __attribute__ ((unused)) = {
+                       .open           = blk_open,
+                       .release        = NULL,
+                       .ioctl          = blk_ioctl,
+                       .compat_ioctl   = blk_compat_ioctl,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: struct block_device" >&5
+$as_echo "struct block_device" >&6; }
+
+$as_echo "#define HAVE_BDEV_BLOCK_DEVICE_OPERATIONS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: struct inode" >&5
+$as_echo "struct inode" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether block_device_operations.release is void" >&5
+$as_echo_n "checking whether block_device_operations.release is void... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+               void blk_release(struct gendisk *g, fmode_t mode) { return; }
+
+               static const struct block_device_operations
+                   bops __attribute__ ((unused)) = {
+                       .open           = NULL,
+                       .release        = blk_release,
+                       .ioctl          = NULL,
+                       .compat_ioctl   = NULL,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: void" >&5
+$as_echo "void" >&6; }
+
+$as_echo "#define HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: int" >&5
+$as_echo "int" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines fmode_t" >&5
+$as_echo_n "checking whether kernel defines fmode_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/types.h>
+
+int
+main (void)
+{
+
+               fmode_t *ptr __attribute__ ((unused));
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FMODE_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines KOBJ_NAME_LEN" >&5
+$as_echo_n "checking whether kernel defines KOBJ_NAME_LEN... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/kobject.h>
+
+int
+main (void)
+{
+
+               int val __attribute__ ((unused));
+               val = KOBJ_NAME_LEN;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_KOBJ_NAME_LEN 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blkdev_get() wants 3 args" >&5
+$as_echo_n "checking whether blkdev_get() wants 3 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               (void) blkdev_get(bdev, 0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARG_BLKDEV_GET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blkdev_get_by_path() is available" >&5
+$as_echo_n "checking whether blkdev_get_by_path() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               blkdev_get_by_path(NULL, 0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]blkdev_get_by_path[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(blkdev_get_by_path)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLKDEV_GET_BY_PATH 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open_bdev_exclusive() is available" >&5
+$as_echo_n "checking whether open_bdev_exclusive() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               open_bdev_exclusive(NULL, 0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]open_bdev_exclusive[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(open_bdev_exclusive)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_OPEN_BDEV_EXCLUSIVE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lookup_bdev() is available" >&5
+$as_echo_n "checking whether lookup_bdev() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               lookup_bdev(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]lookup_bdev[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(lookup_bdev)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LOOKUP_BDEV 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether invalidate_bdev() wants 1 arg" >&5
+$as_echo_n "checking whether invalidate_bdev() wants 1 arg... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/buffer_head.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               invalidate_bdev(bdev);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_1ARG_INVALIDATE_BDEV 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdev_logical_block_size() is available" >&5
+$as_echo_n "checking whether bdev_logical_block_size() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               bdev_logical_block_size(bdev);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BDEV_LOGICAL_BLOCK_SIZE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdev_physical_block_size() is available" >&5
+$as_echo_n "checking whether bdev_physical_block_size() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               bdev_physical_block_size(bdev);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BDEV_PHYSICAL_BLOCK_SIZE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bio has bi_iter" >&5
+$as_echo_n "checking whether bio has bi_iter... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               struct bio bio;
+               bio.bi_iter.bi_sector = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_BVEC_ITER 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BIO_RW_FAILFAST_* are defined" >&5
+$as_echo_n "checking whether BIO_RW_FAILFAST_* are defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = ((1 << BIO_RW_FAILFAST_DEV) |
+                        (1 << BIO_RW_FAILFAST_TRANSPORT) |
+                        (1 << BIO_RW_FAILFAST_DRIVER));
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_RW_FAILFAST_DTD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether REQ_FAILFAST_MASK is defined" >&5
+$as_echo_n "checking whether REQ_FAILFAST_MASK is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = REQ_FAILFAST_MASK;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_REQ_FAILFAST_MASK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bio_end_io_t wants 1 arg" >&5
+$as_echo_n "checking whether bio_end_io_t wants 1 arg... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+               void wanted_end_io(struct bio *bio) { return; }
+
+               bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_1ARG_BIO_END_IO_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BIO_RW_BARRIER is defined" >&5
+$as_echo_n "checking whether BIO_RW_BARRIER is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = BIO_RW_BARRIER;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_RW_BARRIER 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BIO_RW_DISCARD is defined" >&5
+$as_echo_n "checking whether BIO_RW_DISCARD is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = BIO_RW_DISCARD;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_RW_DISCARD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_flush() is available" >&5
+$as_echo_n "checking whether blk_queue_flush() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_FLUSH 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_flush() is GPL-only" >&5
+$as_echo_n "checking whether blk_queue_flush() is GPL-only... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/module.h>
+               #include <linux/blkdev.h>
+
+               MODULE_LICENSE("$ZFS_META_LICENSE");
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_FLUSH_GPL_ONLY 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_max_hw_sectors() is available" >&5
+$as_echo_n "checking whether blk_queue_max_hw_sectors() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_MAX_HW_SECTORS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_max_segments() is available" >&5
+$as_echo_n "checking whether blk_queue_max_segments() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_MAX_SEGMENTS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether get_disk_ro() is available" >&5
+$as_echo_n "checking whether get_disk_ro() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct gendisk *disk = NULL;
+               (void) get_disk_ro(disk);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GET_DISK_RO 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether get_gendisk() is available" >&5
+$as_echo_n "checking whether get_gendisk() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/genhd.h>
+
+int
+main (void)
+{
+
+               get_gendisk(0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]get_gendisk[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in block/genhd.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(get_gendisk)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GET_GENDISK 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ql->discard_granularity is available" >&5
+$as_echo_n "checking whether ql->discard_granularity is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct queue_limits ql __attribute__ ((unused));
+
+               ql.discard_granularity = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DISCARD_GRANULARITY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block uses const struct xattr_hander" >&5
+$as_echo_n "checking whether super_block uses const struct xattr_hander... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/xattr.h>
+
+               const struct xattr_handler xattr_test_handler = {
+                       .prefix = "test",
+                       .get    = NULL,
+                       .set    = NULL,
+               };
+
+               const struct xattr_handler *xattr_handlers[] = {
+                       &xattr_test_handler,
+               };
+
+               const struct super_block sb __attribute__ ((unused)) = {
+                       .s_xattr = xattr_handlers,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CONST_XATTR_HANDLER 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->get() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->get() wants dentry... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/xattr.h>
+
+               int get(struct dentry *dentry, const char *name,
+                   void *buffer, size_t size, int handler_flags) { return 0; }
+               static const struct xattr_handler
+                   xops __attribute__ ((unused)) = {
+                       .get = get,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DENTRY_XATTR_GET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->get() wants xattr_handler" >&5
+$as_echo_n "checking whether xattr_handler->get() wants xattr_handler... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/xattr.h>
+
+                       int get(const struct xattr_handler *handler, struct dentry *dentry,
+                           const char *name, void *buffer, size_t size) { return 0; }
+                       static const struct xattr_handler
+                           xops __attribute__ ((unused)) = {
+                               .get = get,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_HANDLER_XATTR_GET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->set() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->set() wants dentry... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/xattr.h>
+
+               int set(struct dentry *dentry, const char *name,
+                   const void *buffer, size_t size, int flags,
+                   int handler_flags) { return 0; }
+               static const struct xattr_handler
+                   xops __attribute__ ((unused)) = {
+                       .set = set,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DENTRY_XATTR_SET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->set() wants xattr_handler" >&5
+$as_echo_n "checking whether xattr_handler->set() wants xattr_handler... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/xattr.h>
+
+                       int set(const struct xattr_handler *handler, struct dentry *dentry,
+                           const char *name, const void *buffer, size_t size, int flags) { return 0; }
+                       static const struct xattr_handler
+                           xops __attribute__ ((unused)) = {
+                               .set = set,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_HANDLER_XATTR_SET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->list() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->list() wants dentry... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/xattr.h>
+
+               size_t list(struct dentry *dentry, char *list, size_t list_size,
+                   const char *name, size_t name_len, int handler_flags)
+                   { return 0; }
+               static const struct xattr_handler
+                   xops __attribute__ ((unused)) = {
+                       .list = list,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DENTRY_XATTR_LIST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->list() wants xattr_handler" >&5
+$as_echo_n "checking whether xattr_handler->list() wants xattr_handler... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/xattr.h>
+
+                       size_t list(const struct xattr_handler *handler, struct dentry *dentry,
+                           char *list, size_t list_size, const char *name, size_t name_len) { return 0; }
+                       static const struct xattr_handler
+                           xops __attribute__ ((unused)) = {
+                               .list = list,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_HANDLER_XATTR_LIST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode_owner_or_capable() exists" >&5
+$as_echo_n "checking whether inode_owner_or_capable() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode *ip = NULL;
+               (void) inode_owner_or_capable(ip);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_OWNER_OR_CAPABLE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is_owner_or_cap() exists" >&5
+$as_echo_n "checking whether is_owner_or_cap() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+                       #include <linux/sched.h>
+
+int
+main (void)
+{
+
+                       struct inode *ip = NULL;
+                       (void) is_owner_or_cap(ip);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_IS_OWNER_OR_CAP 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no - Please file a bug report at
+                           https://github.com/zfsonlinux/zfs/issues/new" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_from_xattr() needs user_ns" >&5
+$as_echo_n "checking whether posix_acl_from_xattr() needs user_ns... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/cred.h>
+               #include <linux/fs.h>
+               #include <linux/posix_acl_xattr.h>
+
+int
+main (void)
+{
+
+               posix_acl_from_xattr(&init_user_ns, NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_FROM_XATTR_USERNS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_release() is available" >&5
+$as_echo_n "checking whether posix_acl_release() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/cred.h>
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               struct posix_acl* tmp = posix_acl_alloc(1, 0);
+               posix_acl_release(tmp);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_RELEASE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_release() is GPL-only" >&5
+$as_echo_n "checking whether posix_acl_release() is GPL-only... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/cred.h>
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+               MODULE_LICENSE("$ZFS_META_LICENSE");
+
+int
+main (void)
+{
+
+               struct posix_acl* tmp = posix_acl_alloc(1, 0);
+               posix_acl_release(tmp);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_RELEASE_GPL_ONLY 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_chmod exists" >&5
+$as_echo_n "checking whether posix_acl_chmod exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               posix_acl_chmod(NULL, 0, 0)
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_CHMOD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __posix_acl_chmod exists" >&5
+$as_echo_n "checking whether __posix_acl_chmod exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               __posix_acl_chmod(NULL, 0, 0)
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE___POSIX_ACL_CHMOD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode has i_acl and i_default_acl" >&5
+$as_echo_n "checking whether inode has i_acl and i_default_acl... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode ino;
+               ino.i_acl = NULL;
+               ino.i_default_acl = NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_CACHING 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_equiv_mode() wants umode_t" >&5
+$as_echo_n "checking whether posix_acl_equiv_mode() wants umode_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               umode_t tmp;
+               posix_acl_equiv_mode(NULL,&tmp);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->permission() exists" >&5
+$as_echo_n "checking whether iops->permission() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int permission_fn(struct inode *inode, int mask) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .permission = permission_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PERMISSION 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->permission() wants nameidata" >&5
+$as_echo_n "checking whether iops->permission() wants nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int permission_fn(struct inode *inode, int mask,
+                   struct nameidata *nd) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .permission = permission_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PERMISSION 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PERMISSION_WITH_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->check_acl() exists" >&5
+$as_echo_n "checking whether iops->check_acl() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int check_acl_fn(struct inode *inode, int mask) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .check_acl = check_acl_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CHECK_ACL 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->check_acl() wants flags" >&5
+$as_echo_n "checking whether iops->check_acl() wants flags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int check_acl_fn(struct inode *inode, int mask,
+                   unsigned int flags) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .check_acl = check_acl_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CHECK_ACL 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_CHECK_ACL_WITH_FLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->get_acl() exists" >&5
+$as_echo_n "checking whether iops->get_acl() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               struct posix_acl *get_acl_fn(struct inode *inode, int type)
+                   { return NULL; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .get_acl = get_acl_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GET_ACL 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether current_umask exists" >&5
+$as_echo_n "checking whether current_umask exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               current_umask();
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CURRENT_UMASK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->show_options() wants dentry" >&5
+$as_echo_n "checking whether sops->show_options() wants dentry... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int show_options (struct seq_file * x, struct dentry * y) { return 0; };
+               static struct super_operations sops __attribute__ ((unused)) = {
+                       .show_options = show_options,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SHOW_OPTIONS_WITH_DENTRY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether file_inode() is available" >&5
+$as_echo_n "checking whether file_inode() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *f = NULL;
+               file_inode(f);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_INODE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fsync() wants" >&5
+$as_echo_n "checking whether fops->fsync() wants... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int test_fsync(struct file *f, struct dentry *dentry, int x)
+                   { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fsync = test_fsync,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: dentry" >&5
+$as_echo "dentry" >&6; }
+
+$as_echo "#define HAVE_FSYNC_WITH_DENTRY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int test_fsync(struct file *f, int x) { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fsync = test_fsync,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no dentry" >&5
+$as_echo "no dentry" >&6; }
+
+$as_echo "#define HAVE_FSYNC_WITHOUT_DENTRY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int test_fsync(struct file *f, loff_t a, loff_t b, int c)
+                   { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fsync = test_fsync,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: range" >&5
+$as_echo "range" >&6; }
+
+$as_echo "#define HAVE_FSYNC_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->evict_inode() exists" >&5
+$as_echo_n "checking whether sops->evict_inode() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               void evict_inode (struct inode * t) { return; }
+               static struct super_operations sops __attribute__ ((unused)) = {
+                       .evict_inode = evict_inode,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_EVICT_INODE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->dirty_inode() wants flags" >&5
+$as_echo_n "checking whether sops->dirty_inode() wants flags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               void dirty_inode(struct inode *a, int b) { return; }
+
+               static const struct super_operations
+                   sops __attribute__ ((unused)) = {
+                       .dirty_inode = dirty_inode,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DIRTY_INODE_WITH_FLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->nr_cached_objects() exists" >&5
+$as_echo_n "checking whether sops->nr_cached_objects() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int nr_cached_objects(struct super_block *sb) { return 0; }
+
+               static const struct super_operations
+                   sops __attribute__ ((unused)) = {
+                       .nr_cached_objects = nr_cached_objects,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_NR_CACHED_OBJECTS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->free_cached_objects() exists" >&5
+$as_echo_n "checking whether sops->free_cached_objects() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               void free_cached_objects(struct super_block *sb, int x)
+                   { return; }
+
+               static const struct super_operations
+                   sops __attribute__ ((unused)) = {
+                       .free_cached_objects = free_cached_objects,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FREE_CACHED_OBJECTS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               long test_fallocate(struct file *file, int mode,
+                   loff_t offset, loff_t len) { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fallocate = test_fallocate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->fallocate() exists" >&5
+$as_echo_n "checking whether iops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               long test_fallocate(struct inode *inode, int mode,
+                   loff_t offset, loff_t len) { return 0; }
+
+               static const struct inode_operations
+                   fops __attribute__ ((unused)) = {
+                       .fallocate = test_fallocate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->create()/mkdir()/mknod() take umode_t" >&5
+$as_echo_n "checking whether iops->create()/mkdir()/mknod() take umode_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int mkdir(struct inode *inode, struct dentry *dentry,
+                   umode_t umode) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .mkdir = mkdir,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_MKDIR_UMODE_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->lookup() passes nameidata" >&5
+$as_echo_n "checking whether iops->lookup() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               struct dentry *inode_lookup(struct inode *inode,
+                   struct dentry *dentry, struct nameidata *nidata)
+                   { return NULL; }
+
+               static const struct inode_operations iops
+                   __attribute__ ((unused)) = {
+                       .lookup = inode_lookup,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LOOKUP_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->create() passes nameidata" >&5
+$as_echo_n "checking whether iops->create() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               #ifdef HAVE_MKDIR_UMODE_T
+               int inode_create(struct inode *inode ,struct dentry *dentry,
+                   umode_t umode, struct nameidata *nidata) { return 0; }
+               #else
+               int inode_create(struct inode *inode,struct dentry *dentry,
+                   int umode, struct nameidata * nidata) { return 0; }
+               #endif
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .create         = inode_create,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CREATE_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->follow_link() passes nameidata" >&5
+$as_echo_n "checking whether iops->follow_link() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               const char *follow_link(struct dentry *de, void **cookie)
+                   { return "symlink"; }
+               static struct inode_operations iops __attribute__ ((unused)) = {
+                       .follow_link = follow_link,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FOLLOW_LINK_NAMEIDATA 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->put_link() passes nameidata" >&5
+$as_echo_n "checking whether iops->put_link() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               void put_link(struct inode *ip, void *cookie) { return; }
+               static struct inode_operations iops __attribute__ ((unused)) = {
+                       .put_link = put_link,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PUT_LINK_NAMEIDATA 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->truncate_range() exists" >&5
+$as_echo_n "checking whether iops->truncate_range() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               void truncate_range(struct inode *inode, loff_t start,
+                                   loff_t end) { return; }
+               static struct inode_operations iops __attribute__ ((unused)) = {
+                       .truncate_range = truncate_range,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_TRUNCATE_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dops->d_automount() exists" >&5
+$as_echo_n "checking whether dops->d_automount() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+               struct vfsmount *d_automount(struct path *p) { return NULL; }
+               struct dentry_operations dops __attribute__ ((unused)) = {
+                       .d_automount = d_automount,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_AUTOMOUNT 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether eops->encode_fh() wants inode" >&5
+$as_echo_n "checking whether eops->encode_fh() wants inode... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/exportfs.h>
+               int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
+                             struct inode *parent) { return 0; }
+               static struct export_operations eops __attribute__ ((unused))={
+                       .encode_fh = encode_fh,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_ENCODE_FH_WITH_INODE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether eops->commit_metadata() exists" >&5
+$as_echo_n "checking whether eops->commit_metadata() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/exportfs.h>
+               int commit_metadata(struct inode *inode) { return 0; }
+               static struct export_operations eops __attribute__ ((unused))={
+                       .commit_metadata = commit_metadata,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_COMMIT_METADATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether clear_inode() is available" >&5
+$as_echo_n "checking whether clear_inode() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               clear_inode(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]clear_inode[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/inode.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(clear_inode)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CLEAR_INODE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether insert_inode_locked() is available" >&5
+$as_echo_n "checking whether insert_inode_locked() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               insert_inode_locked(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]insert_inode_locked[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/inode.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(insert_inode_locked)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INSERT_INODE_LOCKED 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_make_root() is available" >&5
+$as_echo_n "checking whether d_make_root() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               d_make_root(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_make_root[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_make_root)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_MAKE_ROOT 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_obtain_alias() is available" >&5
+$as_echo_n "checking whether d_obtain_alias() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               d_obtain_alias(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_obtain_alias[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_obtain_alias)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_OBTAIN_ALIAS 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_prune_aliases() is available" >&5
+$as_echo_n "checking whether d_prune_aliases() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               struct inode *ip = NULL;
+               d_prune_aliases(ip);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_prune_aliases[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_prune_aliases)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_PRUNE_ALIASES 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_set_d_op() is available" >&5
+$as_echo_n "checking whether d_set_d_op() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               d_set_d_op(NULL, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_set_d_op[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_set_d_op)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_SET_D_OP 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dops->d_revalidate() takes struct nameidata" >&5
+$as_echo_n "checking whether dops->d_revalidate() takes struct nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+               int revalidate (struct dentry *dentry,
+                   struct nameidata *nidata) { return 0; }
+
+               static const struct dentry_operations
+                   dops __attribute__ ((unused)) = {
+                       .d_revalidate   = revalidate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_REVALIDATE_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dentry uses const struct dentry_operations" >&5
+$as_echo_n "checking whether dentry uses const struct dentry_operations... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+               const struct dentry_operations test_d_op = {
+                       .d_revalidate = NULL,
+               };
+
+int
+main (void)
+{
+
+               struct dentry d __attribute__ ((unused));
+
+               d.d_op = &test_d_op;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CONST_DENTRY_OPERATIONS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether check_disk_size_change() is available" >&5
+$as_echo_n "checking whether check_disk_size_change() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               check_disk_size_change(NULL, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]check_disk_size_change[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(check_disk_size_change)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CHECK_DISK_SIZE_CHANGE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncate_setsize() is available" >&5
+$as_echo_n "checking whether truncate_setsize() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/mm.h>
+
+int
+main (void)
+{
+
+               truncate_setsize(NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]truncate_setsize[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/truncate.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(truncate_setsize)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_TRUNCATE_SETSIZE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether security_inode_init_security wants 6 args" >&5
+$as_echo_n "checking whether security_inode_init_security wants 6 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/security.h>
+
+int
+main (void)
+{
+
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               struct inode *dip __attribute__ ((unused)) = NULL;
+               const struct qstr *str __attribute__ ((unused)) = NULL;
+               char *name __attribute__ ((unused)) = NULL;
+               void *value __attribute__ ((unused)) = NULL;
+               size_t len __attribute__ ((unused)) = 0;
+
+               security_inode_init_security(ip, dip, str, &name, &value, &len);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether security_inode_init_security wants callback" >&5
+$as_echo_n "checking whether security_inode_init_security wants callback... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/security.h>
+
+int
+main (void)
+{
+
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               struct inode *dip __attribute__ ((unused)) = NULL;
+               const struct qstr *str __attribute__ ((unused)) = NULL;
+               initxattrs func __attribute__ ((unused)) = NULL;
+
+               security_inode_init_security(ip, dip, str, func, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mount_nodev() is available" >&5
+$as_echo_n "checking whether mount_nodev() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               mount_nodev(NULL, 0, NULL, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]mount_nodev[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/super.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(mount_nodev)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_MOUNT_NODEV 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block has s_shrink" >&5
+$as_echo_n "checking whether super_block has s_shrink... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int shrink(struct shrinker *s, struct shrink_control *sc)
+                   { return 0; }
+
+               static const struct super_block
+                   sb __attribute__ ((unused)) = {
+                       .s_shrink.shrink = shrink,
+                       .s_shrink.seeks = DEFAULT_SEEKS,
+                       .s_shrink.batch = 0,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SHRINK 1" >>confdefs.h
+
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether shrink_control has nid" >&5
+$as_echo_n "checking whether shrink_control has nid... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct shrink_control sc __attribute__ ((unused));
+               unsigned long scnidsize __attribute__ ((unused)) =
+                   sizeof(sc.nid);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define SHRINK_CONTROL_HAS_NID 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block has s_instances list_head" >&5
+$as_echo_n "checking whether super_block has s_instances list_head... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct super_block sb __attribute__ ((unused));
+
+               INIT_LIST_HEAD(&sb.s_instances);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_S_INSTANCES_LIST_HEAD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block has s_d_op" >&5
+$as_echo_n "checking whether super_block has s_d_op... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct super_block sb __attribute__ ((unused));
+               sb.s_d_op = NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_S_D_OP 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdi_setup_and_register() wants 2 args" >&5
+$as_echo_n "checking whether bdi_setup_and_register() wants 2 args... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/backing-dev.h>
+               struct backing_dev_info bdi;
+
+int
+main (void)
+{
+
+               char *name = "bdi";
+               int error __attribute__((unused)) =
+                   bdi_setup_and_register(&bdi, name);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdi_setup_and_register() wants 3 args" >&5
+$as_echo_n "checking whether bdi_setup_and_register() wants 3 args... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/backing-dev.h>
+                       struct backing_dev_info bdi;
+
+int
+main (void)
+{
+
+                       char *name = "bdi";
+                       unsigned int cap = BDI_CAP_MAP_COPY;
+                       int error __attribute__((unused)) =
+                           bdi_setup_and_register(&bdi, name, cap);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_BDI_SETUP_AND_REGISTER 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdi_setup_and_register() wants 3 args" >&5
+$as_echo_n "checking whether bdi_setup_and_register() wants 3 args... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/backing-dev.h>
+                       struct backing_dev_info bdi;
+
+int
+main (void)
+{
+
+                       char *name = "bdi";
+                       unsigned int cap = BDI_CAP_MAP_COPY;
+                       int error __attribute__((unused)) =
+                           bdi_setup_and_register(&bdi, name, cap);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_BDI_SETUP_AND_REGISTER 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_BDI_SETUP_AND_REGISTER 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether set_nlink() is available" >&5
+$as_echo_n "checking whether set_nlink() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode node;
+               unsigned int link = 0;
+               (void) set_nlink(&node, link);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SET_NLINK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether elevator_change() is available" >&5
+$as_echo_n "checking whether elevator_change() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+               #include <linux/elevator.h>
+
+int
+main (void)
+{
+
+               int ret;
+               struct request_queue *q = NULL;
+               char *elevator = NULL;
+               ret = elevator_change(q, elevator);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_ELEVATOR_CHANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sget() wants 5 args" >&5
+$as_echo_n "checking whether sget() wants 5 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file_system_type *type = NULL;
+               int (*test)(struct super_block *,void *) = NULL;
+               int (*set)(struct super_block *,void *) = NULL;
+               int flags = 0;
+               void *data = NULL;
+               (void) sget(type, test, set, flags, data);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_5ARG_SGET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek_execute() is available" >&5
+$as_echo_n "checking whether lseek_execute() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *fp __attribute__ ((unused)) = NULL;
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               loff_t offset __attribute__ ((unused)) = 0;
+               loff_t maxsize __attribute__ ((unused)) = 0;
+
+               lseek_execute(fp, ip, offset, maxsize);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]lseek_exclusive[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/read_write.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(lseek_exclusive)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LSEEK_EXECUTE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->iterate() is available" >&5
+$as_echo_n "checking whether fops->iterate() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               int iterate(struct file *filp, struct dir_context * context)
+                   { return 0; }
+
+               static const struct file_operations fops
+                   __attribute__ ((unused)) = {
+                       .iterate         = iterate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_VFS_ITERATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->readdir() is available" >&5
+$as_echo_n "checking whether fops->readdir() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+                       int readdir(struct file *filp, void *entry, filldir_t func)
+                           { return 0; }
+
+                       static const struct file_operations fops
+                           __attribute__ ((unused)) = {
+                               .readdir = readdir,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_VFS_READDIR 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no; file a bug report with ZFSOnLinux" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->read/write_iter() are available" >&5
+$as_echo_n "checking whether fops->read/write_iter() are available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               ssize_t test_read(struct kiocb *kiocb, struct iov_iter *to)
+                   { return 0; }
+               ssize_t test_write(struct kiocb *kiocb, struct iov_iter *from)
+                   { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                   .read_iter = test_read,
+                   .write_iter = test_write,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_VFS_RW_ITERATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kmap_atomic wants 1 args" >&5
+$as_echo_n "checking whether kmap_atomic wants 1 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/pagemap.h>
+
+int
+main (void)
+{
+
+               struct page page;
+               kmap_atomic(&page);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_1ARG_KMAP_ATOMIC 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether follow_down_one() is available" >&5
+$as_echo_n "checking whether follow_down_one() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/namei.h>
+
+int
+main (void)
+{
+
+               struct path *p = NULL;
+               follow_down_one(p);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FOLLOW_DOWN_ONE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make_request_fn() returns int" >&5
+$as_echo_n "checking whether make_request_fn() returns int... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+               int make_request(struct request_queue *q, struct bio *bio)
+               {
+                       return (0);
+               }
+
+int
+main (void)
+{
+
+               blk_queue_make_request(NULL, &make_request);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define MAKE_REQUEST_FN_RET int" >>confdefs.h
+
+
+$as_echo "#define HAVE_MAKE_REQUEST_FN_RET_INT 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make_request_fn() returns void" >&5
+$as_echo_n "checking whether make_request_fn() returns void... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/blkdev.h>
+
+                       void make_request(struct request_queue *q, struct bio *bio)
+                       {
+                               return;
+                       }
+
+int
+main (void)
+{
+
+                       blk_queue_make_request(NULL, &make_request);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define MAKE_REQUEST_FN_RET void" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make_request_fn() returns blk_qc_t" >&5
+$as_echo_n "checking whether make_request_fn() returns blk_qc_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                               #include <linux/blkdev.h>
+
+                               blk_qc_t make_request(struct request_queue *q, struct bio *bio)
+                               {
+                                       return (BLK_QC_T_NONE);
+                               }
+
+int
+main (void)
+{
+
+                               blk_queue_make_request(NULL, &make_request);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define MAKE_REQUEST_FN_RET blk_qc_t" >>confdefs.h
+
+
+$as_echo "#define HAVE_MAKE_REQUEST_FN_RET_QC 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                               as_fn_error $? "no - Please file a bug report at
+                                   https://github.com/zfsonlinux/zfs/issues/new" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether generic IO accounting symbols are avaliable" >&5
+$as_echo_n "checking whether generic IO accounting symbols are avaliable... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+               void (*generic_start_io_acct_f)(int, unsigned long,
+                   struct hd_struct *) = &generic_start_io_acct;
+               void (*generic_end_io_acct_f)(int, struct hd_struct *,
+                   unsigned long) = &generic_end_io_acct;
+
+int
+main (void)
+{
+
+               generic_start_io_acct(0, 0, NULL);
+               generic_end_io_acct(0, NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]generic_start_io_acct[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in block/bio.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(generic_start_io_acct)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GENERIC_IO_ACCT 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       if test "$LINUX_OBJ" != "$LINUX"; then :
+
+               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+
+fi
+
+
+
+                       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_BOOL_COMPARE"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
+
+
+ ;;
+               all)
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dkms.conf file" >&5
+$as_echo_n "checking for dkms.conf file... " >&6; }
+        if test -e dkms.conf; then :
+
+               as_fn_error $? "
+       *** ZFS should not be manually built in the DKMS source tree.
+       *** Remove all ZFS packages before compiling the ZoL sources.
+       *** Running \"make install\" breaks ZFS packages." "$LINENO" 5
+
+else
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
+$as_echo "not found" >&6; }
+
+fi
+
+
+
+# Check whether --with-mounthelperdir was given.
+if test "${with_mounthelperdir+set}" = set; then :
+  withval=$with_mounthelperdir; mounthelperdir=$withval
+else
+  mounthelperdir=/sbin
+fi
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for udev directories" >&5
+$as_echo_n "checking for udev directories... " >&6; }
+
+# Check whether --with-udevdir was given.
+if test "${with_udevdir+set}" = set; then :
+  withval=$with_udevdir; udevdir=$withval
+else
+  udevdir=check
+fi
+
+
+       if test "x$udevdir" = xcheck; then :
+
+               path1=/lib/udev
+               path2=/usr/lib/udev
+               default=$path2
+
+               if test -d "$path1"; then :
+  udevdir="$path1"
+else
+
+                       if test -d "$path2"; then :
+  udevdir="$path2"
+else
+  udevdir="$default"
+fi
+
+fi
+
+fi
+
+
+# Check whether --with-udevruledir was given.
+if test "${with_udevruledir+set}" = set; then :
+  withval=$with_udevruledir; udevruledir=$withval
+else
+  udevruledir="${udevdir}/rules.d"
+fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $udevdir;$udevruledir" >&5
+$as_echo "$udevdir;$udevruledir" >&6; }
+
+
+       # Check whether --enable-systemd was given.
+if test "${enable_systemd+set}" = set; then :
+  enableval=$enable_systemd;
+else
+  enable_systemd=yes
+fi
+
+
+
+# Check whether --with-systemdunitdir was given.
+if test "${with_systemdunitdir+set}" = set; then :
+  withval=$with_systemdunitdir; systemdunitdir=$withval
+else
+  systemdunitdir=/usr/lib/systemd/system
+fi
+
+
+
+# Check whether --with-systemdpresetdir was given.
+if test "${with_systemdpresetdir+set}" = set; then :
+  withval=$with_systemdpresetdir; systemdpresetdir=$withval
+else
+  systemdpresetdir=/usr/lib/systemd/system-preset
+fi
+
+
+
+# Check whether --with-systemdmodulesloaddir was given.
+if test "${with_systemdmodulesloaddir+set}" = set; then :
+  withval=$with_systemdmodulesloaddir; systemdmoduleloaddir=$withval
+else
+  systemdmodulesloaddir=/usr/lib/modules-load.d
+fi
+
+
+
+       if test "x$enable_systemd" = xyes; then :
+
+               ZFS_INIT_SYSTEMD=systemd
+               ZFS_MODULE_LOAD=modules-load.d
+               modulesloaddir=$systemdmodulesloaddir
+
+fi
+
+
+
+
+
+
+
+
+       # Check whether --enable-sysvinit was given.
+if test "${enable_sysvinit+set}" = set; then :
+  enableval=$enable_sysvinit;
+else
+  enable_sysvinit=yes
+fi
+
+
+       if test "x$enable_sysvinit" = xyes; then :
+  ZFS_INIT_SYSV=init.d
+fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for dracut directory" >&5
+$as_echo_n "checking for dracut directory... " >&6; }
+
+# Check whether --with-dracutdir was given.
+if test "${with_dracutdir+set}" = set; then :
+  withval=$with_dracutdir; dracutdir=$withval
+else
+  dracutdir=check
+fi
+
+
+       if test "x$dracutdir" = xcheck; then :
+
+               path1=/usr/share/dracut
+               path2=/usr/lib/dracut
+               default=$path2
+
+               if test -d "$path1"; then :
+  dracutdir="$path1"
+else
+
+                       if test -d "$path2"; then :
+  dracutdir="$path2"
+else
+  dracutdir="$default"
+fi
+
+fi
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $dracutdir" >&5
+$as_echo "$dracutdir" >&6; }
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for target asm dir" >&5
+$as_echo_n "checking for target asm dir... " >&6; }
+       TARGET_ARCH=`echo ${target_cpu} | sed -e s/i.86/i386/`
+
+       case $TARGET_ARCH in
+       i386|x86_64)
+               TARGET_ASM_DIR=asm-${TARGET_ARCH}
+               ;;
+       *)
+               TARGET_ASM_DIR=asm-generic
+               ;;
+       esac
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $TARGET_ASM_DIR" >&5
+$as_echo "$TARGET_ASM_DIR" >&6; }
+
+
+       ZLIB=
+
+       ac_fn_c_check_header_mongrel "$LINENO" "zlib.h" "ac_cv_header_zlib_h" "$ac_includes_default"
+if test "x$ac_cv_header_zlib_h" = xyes; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** zlib.h missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for compress2 in -lz" >&5
+$as_echo_n "checking for compress2 in -lz... " >&6; }
+if ${ac_cv_lib_z_compress2+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char compress2 ();
+int
+main ()
+{
+return compress2 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_compress2=yes
+else
+  ac_cv_lib_z_compress2=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_compress2" >&5
+$as_echo "$ac_cv_lib_z_compress2" >&6; }
+if test "x$ac_cv_lib_z_compress2" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** compress2() missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uncompress in -lz" >&5
+$as_echo_n "checking for uncompress in -lz... " >&6; }
+if ${ac_cv_lib_z_uncompress+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uncompress ();
+int
+main ()
+{
+return uncompress ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_uncompress=yes
+else
+  ac_cv_lib_z_uncompress=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_uncompress" >&5
+$as_echo "$ac_cv_lib_z_uncompress" >&6; }
+if test "x$ac_cv_lib_z_uncompress" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uncompress() missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for crc32 in -lz" >&5
+$as_echo_n "checking for crc32 in -lz... " >&6; }
+if ${ac_cv_lib_z_crc32+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lz  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char crc32 ();
+int
+main ()
+{
+return crc32 ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_z_crc32=yes
+else
+  ac_cv_lib_z_crc32=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_z_crc32" >&5
+$as_echo "$ac_cv_lib_z_crc32" >&6; }
+if test "x$ac_cv_lib_z_crc32" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBZ 1
+_ACEOF
+
+  LIBS="-lz $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** crc32() missing, zlib-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       ZLIB="-lz"
+
+
+$as_echo "#define HAVE_ZLIB 1" >>confdefs.h
+
+
+
+       LIBUUID=
+
+       ac_fn_c_check_header_mongrel "$LINENO" "uuid/uuid.h" "ac_cv_header_uuid_uuid_h" "$ac_includes_default"
+if test "x$ac_cv_header_uuid_uuid_h" = xyes; then :
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uuid/uuid.h missing, libuuid-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_generate in -luuid" >&5
+$as_echo_n "checking for uuid_generate in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_generate+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_generate ();
+int
+main ()
+{
+return uuid_generate ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uuid_uuid_generate=yes
+else
+  ac_cv_lib_uuid_uuid_generate=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_generate" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_generate" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_generate" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUUID 1
+_ACEOF
+
+  LIBS="-luuid $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uuid_generate() missing, libuuid-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uuid_is_null in -luuid" >&5
+$as_echo_n "checking for uuid_is_null in -luuid... " >&6; }
+if ${ac_cv_lib_uuid_uuid_is_null+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-luuid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char uuid_is_null ();
+int
+main ()
+{
+return uuid_is_null ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_uuid_uuid_is_null=yes
+else
+  ac_cv_lib_uuid_uuid_is_null=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_uuid_uuid_is_null" >&5
+$as_echo "$ac_cv_lib_uuid_uuid_is_null" >&6; }
+if test "x$ac_cv_lib_uuid_uuid_is_null" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBUUID 1
+_ACEOF
+
+  LIBS="-luuid $LIBS"
+
+else
+  { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
+$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
+as_fn_error $? "
+       *** uuid_is_null() missing, libuuid-devel package required
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+       LIBUUID="-luuid"
+
+
+$as_echo "#define HAVE_LIBUUID 1" >>confdefs.h
+
+
+
+
+# Check whether --with-blkid was given.
+if test "${with_blkid+set}" = set; then :
+  withval=$with_blkid;
+else
+  with_blkid=check
+fi
+
+
+       LIBBLKID=
+       if test "x$with_blkid" = xyes; then :
+
+               LIBBLKID="-lblkid"
+
+
+$as_echo "#define HAVE_LIBBLKID 1" >>confdefs.h
+
+
+fi
+
+       if test "x$with_blkid" = xcheck; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid_get_cache in -lblkid" >&5
+$as_echo_n "checking for blkid_get_cache in -lblkid... " >&6; }
+if ${ac_cv_lib_blkid_blkid_get_cache+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-lblkid  $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char blkid_get_cache ();
+int
+main ()
+{
+return blkid_get_cache ();
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+  ac_cv_lib_blkid_blkid_get_cache=yes
+else
+  ac_cv_lib_blkid_blkid_get_cache=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+    conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_blkid_blkid_get_cache" >&5
+$as_echo "$ac_cv_lib_blkid_blkid_get_cache" >&6; }
+if test "x$ac_cv_lib_blkid_blkid_get_cache" = xyes; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for blkid zfs support" >&5
+$as_echo_n "checking for blkid zfs support... " >&6; }
+
+                       ZFS_DEV=`mktemp`
+                       truncate -s 64M $ZFS_DEV
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=128 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=132 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=136 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+                       echo -en "\x0c\xb1\xba\0\0\0\0\0" | \
+                               dd of=$ZFS_DEV bs=1k count=8 \
+                               seek=140 conv=notrunc &>/dev/null \
+                               >/dev/null 2>/dev/null
+
+                       saved_LIBS="$LIBS"
+                       LIBS="-lblkid"
+
+                       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 <stdio.h>
+                               #include <stdlib.h>
+                               #include <blkid/blkid.h>
+
+int
+main ()
+{
+
+                               blkid_cache cache;
+                               char *value;
+
+                               if (blkid_get_cache(&cache, NULL) < 0)
+                                       return 1;
+
+                               value = blkid_get_tag_value(cache, "TYPE",
+                                                           "$ZFS_DEV");
+                               if (!value) {
+                                       blkid_put_cache(cache);
+                                       return 2;
+                               }
+
+                               if (strcmp(value, "zfs_member")) {
+                                       free(value);
+                                       blkid_put_cache(cache);
+                                       return 0;
+                               }
+
+                               free(value);
+                               blkid_put_cache(cache);
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+                               rm -f $ZFS_DEV
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                               LIBBLKID="-lblkid"
+
+
+$as_echo "#define HAVE_LIBBLKID 1" >>confdefs.h
+
+
+else
+
+                               rm -f $ZFS_DEV
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                               if test "x$with_blkid" != xcheck; 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 $? "--with-blkid given but unavailable
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
+  conftest.$ac_objext conftest.beam conftest.$ac_ext
+fi
+
+
+                       LIBS="$saved_LIBS"
+
+else
+
+                       if test "x$with_blkid" != xcheck; 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 $? "--with-blkid given but unavailable
+See \`config.log' for more details" "$LINENO" 5; }
+fi
+
+
+fi
+
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -Wframe-larger-than=<size> support" >&5
+$as_echo_n "checking for -Wframe-larger-than=<size> support... " >&6; }
+
+       saved_flags="$CFLAGS"
+       CFLAGS="$CFLAGS -Wframe-larger-than=1024"
+
+       cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+               FRAME_LARGER_THAN=-Wframe-larger-than=1024
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+               FRAME_LARGER_THAN=
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+       CFLAGS="$saved_flags"
+
+
+
+       if test "x$runstatedir" = x; then
+               runstatedir='${localstatedir}/run'
+
+       fi
+
+       for ac_func in mlockall
+do :
+  ac_fn_c_check_func "$LINENO" "mlockall" "ac_cv_func_mlockall"
+if test "x$ac_cv_func_mlockall" = xyes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_MLOCKALL 1
+_ACEOF
+
+fi
+done
+
+
+
+
+
+# Check whether --with-linux was given.
+if test "${with_linux+set}" = set; then :
+  withval=$with_linux; kernelsrc="$withval"
+fi
+
+
+
+# Check whether --with-linux-obj was given.
+if test "${with_linux_obj+set}" = set; then :
+  withval=$with_linux_obj; kernelbuild="$withval"
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source directory" >&5
+$as_echo_n "checking kernel source directory... " >&6; }
+       if test -z "$kernelsrc"; then :
+
+               if test -e "/lib/modules/$(uname -r)/source"; then :
+
+                       headersdir="/lib/modules/$(uname -r)/source"
+                       sourcelink=$(readlink -f "$headersdir")
+
+elif test -e "/lib/modules/$(uname -r)/build"; then :
+
+                       headersdir="/lib/modules/$(uname -r)/build"
+                       sourcelink=$(readlink -f "$headersdir")
+
+else
+
+                       sourcelink=$(ls -1d /usr/src/kernels/* \
+                                    /usr/src/linux-* \
+                                    2>/dev/null | grep -v obj | tail -1)
+
+fi
+
+               if test -n "$sourcelink" && test -e ${sourcelink}; then :
+
+                       kernelsrc=`readlink -f ${sourcelink}`
+
+else
+
+                       kernelsrc="Not found"
+
+fi
+
+else
+
+               if test "$kernelsrc" = "NONE"; then :
+
+                       kernsrcver=NONE
+
+fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelsrc" >&5
+$as_echo "$kernelsrc" >&6; }
+       if test ! -d "$kernelsrc"; then :
+
+               as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed and then try again.  If that fails, you can specify the
+       *** location of the kernel source with the '--with-linux=PATH' option." "$LINENO" 5
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel build directory" >&5
+$as_echo_n "checking kernel build directory... " >&6; }
+       if test -z "$kernelbuild"; then :
+
+               if test -e "/lib/modules/$(uname -r)/build"; then :
+
+                       kernelbuild=`readlink -f /lib/modules/$(uname -r)/build`
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/${target_cpu}; then :
+
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/${target_cpu}
+
+elif test -d ${kernelsrc}-obj/${target_cpu}/default; then :
+
+                       kernelbuild=${kernelsrc}-obj/${target_cpu}/default
+
+elif test -d `dirname ${kernelsrc}`/build-${target_cpu}; then :
+
+                       kernelbuild=`dirname ${kernelsrc}`/build-${target_cpu}
+
+else
+
+                       kernelbuild=${kernelsrc}
+
+fi
+
+fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernelbuild" >&5
+$as_echo "$kernelbuild" >&6; }
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel source version" >&5
+$as_echo_n "checking kernel source version... " >&6; }
+       utsrelease1=$kernelbuild/include/linux/version.h
+       utsrelease2=$kernelbuild/include/linux/utsrelease.h
+       utsrelease3=$kernelbuild/include/generated/utsrelease.h
+       if test -r $utsrelease1 && fgrep -q UTS_RELEASE $utsrelease1; then :
+
+               utsrelease=linux/version.h
+
+elif test -r $utsrelease2 && fgrep -q UTS_RELEASE $utsrelease2; then :
+
+               utsrelease=linux/utsrelease.h
+
+elif test -r $utsrelease3 && fgrep -q UTS_RELEASE $utsrelease3; then :
+
+               utsrelease=generated/utsrelease.h
+
+fi
+
+       if test "$utsrelease"; then :
+
+               kernsrcver=`(echo "#include <$utsrelease>";
+                            echo "kernsrcver=UTS_RELEASE") |
+                            cpp -I $kernelbuild/include |
+                            grep "^kernsrcver=" | cut -d \" -f 2`
+
+               if test -z "$kernsrcver"; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+                       as_fn_error $? "*** Cannot determine kernel version." "$LINENO" 5
+
+fi
+
+else
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Cannot find UTS_RELEASE definition." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Cannot find UTS_RELEASE definition.
+       *** Please run 'make prepare' inside the kernel source tree." "$LINENO" 5
+               fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $kernsrcver" >&5
+$as_echo "$kernsrcver" >&6; }
+
+       LINUX=${kernelsrc}
+       LINUX_OBJ=${kernelbuild}
+       LINUX_VERSION=${kernsrcver}
+
+
+
+
+
+
+       modpost=$LINUX/scripts/Makefile.modpost
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking kernel file name for module symbols" >&5
+$as_echo_n "checking kernel file name for module symbols... " >&6; }
+       if test "x$enable_linux_builtin" != xyes -a -f "$modpost"; then :
+
+               if grep -q Modules.symvers $modpost; then :
+
+                       LINUX_SYMBOLS=Modules.symvers
+
+else
+
+                       LINUX_SYMBOLS=Module.symvers
+
+fi
+
+               if test ! -f "$LINUX_OBJ/$LINUX_SYMBOLS"; then :
+
+                       as_fn_error $? "
+       *** Please make sure the kernel devel package for your distribution
+       *** is installed.  If you are building with a custom kernel, make sure the
+       *** kernel is configured, built, and the '--with-linux=PATH' configure
+       *** option refers to the location of the kernel source." "$LINENO" 5
+
+fi
+
+else
+
+               LINUX_SYMBOLS=NONE
+
+fi
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $LINUX_SYMBOLS" >&5
+$as_echo "$LINUX_SYMBOLS" >&6; }
+
+
+
+
+
+# Check whether --with-spl was given.
+if test "${with_spl+set}" = set; then :
+  withval=$with_spl; splsrc="$withval"
+fi
+
+
+
+# Check whether --with-spl-obj was given.
+if test "${with_spl_obj+set}" = set; then :
+  withval=$with_spl_obj; splbuild="$withval"
+fi
+
+
+
+# Check whether --with-spl-timeout was given.
+if test "${with_spl_timeout+set}" = set; then :
+  withval=$with_spl_timeout; timeout="$withval"
+else
+  timeout=0
+fi
+
+
+                                       splsrc0="/var/lib/dkms/spl/${VERSION}/build"
+       splsrc1="/usr/local/src/spl-${VERSION}/${LINUX_VERSION}"
+       splsrc2="/usr/local/src/spl-${VERSION}"
+       splsrc3="/usr/src/spl-${VERSION}/${LINUX_VERSION}"
+       splsrc4="/usr/src/spl-${VERSION}"
+       splsrc5="../spl/"
+       splsrc6="$LINUX"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl source directory" >&5
+$as_echo_n "checking spl source directory... " >&6; }
+       if test -z "${splsrc}"; then :
+
+               if  test -e "${splsrc0}/spl.release.in"; then :
+
+                       splsrc=${splsrc0}
+
+elif  test -e "${splsrc1}/spl.release.in"; then :
+
+                       splsrc=${splsrc1}
+
+elif  test -e "${splsrc2}/spl.release.in"; then :
+
+                       splsrc=${splsrc2}
+
+elif  test -e "${splsrc3}/spl.release.in"; then :
+
+                       splsrc=$(readlink -f "${splsrc3}")
+
+elif  test -e "${splsrc4}/spl.release.in" ; then :
+
+                       splsrc=${splsrc4}
+
+elif  test -e "${splsrc5}/spl.release.in"; then :
+
+                       splsrc=$(readlink -f "${splsrc5}")
+
+elif  test -e "${splsrc6}/spl.release.in" ; then :
+
+                       splsrc=${splsrc6}
+
+else
+
+                       splsrc="Not found"
+
+fi
+
+else
+
+               if test "$splsrc" = "NONE"; then :
+
+                       splbuild=NONE
+                       splsrcver=NONE
+
+fi
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $splsrc" >&5
+$as_echo "$splsrc" >&6; }
+       if  test ! -e "$splsrc/spl.release.in"; then :
+
+               as_fn_error $? "
+       *** Please make sure the kmod spl devel package for your distribution
+       *** is installed then try again.  If that fails you can specify the
+       *** location of the spl source with the '--with-spl=PATH' option." "$LINENO" 5
+
+fi
+
+                                                                                                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl build directory" >&5
+$as_echo_n "checking spl build directory... " >&6; }
+       while true; do
+               if test -z "$splbuild"; then :
+
+                       if  test -e "${splsrc}/${LINUX_VERSION}/spl_config.h" ; then :
+
+                               splbuild="${splsrc}/${LINUX_VERSION}"
+
+elif  test -e "${splsrc}/spl_config.h" ; then :
+
+                               splbuild="${splsrc}"
+
+elif  find -L "${splsrc}" -name spl_config.h 2> /dev/null | grep -wq spl_config.h ; then :
+
+                               splbuild=$(find -L "${splsrc}" -name spl_config.h | sed 's,/spl_config.h,,')
+
+else
+
+                               splbuild="Not found"
+
+fi
+
+fi
+               if test -e "$splbuild/spl_config.h" -o $timeout -le 0; then :
+
+                       break;
+
+else
+
+                       sleep 1
+                       timeout=$((timeout-1))
+
+fi
+       done
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $splbuild" >&5
+$as_echo "$splbuild" >&6; }
+       if  ! test -e "$splbuild/spl_config.h"; then :
+
+               as_fn_error $? "
+       *** Please make sure the kmod spl devel <kernel> package for your
+       *** distribution is installed then try again.  If that fails you
+       *** can specify the location of the spl objects with the
+       *** '--with-spl-obj=PATH' option." "$LINENO" 5
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl source version" >&5
+$as_echo_n "checking spl source version... " >&6; }
+       if test -r $splbuild/spl_config.h &&
+               fgrep -q SPL_META_VERSION $splbuild/spl_config.h; then :
+
+
+               splsrcver=`(echo "#include <spl_config.h>";
+                           echo "splsrcver=SPL_META_VERSION-SPL_META_RELEASE") |
+                           cpp -I $splbuild |
+                           grep "^splsrcver=" | tr -d \" | cut -d= -f2`
+
+fi
+
+       if test -z "$splsrcver"; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Not found" >&5
+$as_echo "Not found" >&6; }
+               as_fn_error $? "
+       *** Cannot determine the version of the spl source.
+       *** Please prepare the spl source before running this script" "$LINENO" 5
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $splsrcver" >&5
+$as_echo "$splsrcver" >&6; }
+
+       SPL=${splsrc}
+       SPL_OBJ=${splbuild}
+       SPL_VERSION=${splsrcver}
+
+
+
+
+
+                                                                                                               { $as_echo "$as_me:${as_lineno-$LINENO}: checking spl file name for module symbols" >&5
+$as_echo_n "checking spl file name for module symbols... " >&6; }
+       SPL_SYMBOLS=NONE
+
+       while true; do
+               if test -r $SPL_OBJ/Module.symvers; then :
+
+                       SPL_SYMBOLS=Module.symvers
+
+elif test -r $SPL_OBJ/Modules.symvers; then :
+
+                       SPL_SYMBOLS=Modules.symvers
+
+elif test -r $SPL_OBJ/module/Module.symvers; then :
+
+                       SPL_SYMBOLS=Module.symvers
+
+elif test -r $SPL_OBJ/module/Modules.symvers; then :
+
+                       SPL_SYMBOLS=Modules.symvers
+
+fi
+
+               if test $SPL_SYMBOLS != NONE -o $timeout -le 0; then :
+
+                       break;
+
+else
+
+                       sleep 1
+                       timeout=$((timeout-1))
+
+fi
+       done
+
+       if test "$SPL_SYMBOLS" = NONE; then :
+
+               SPL_SYMBOLS=$LINUX_SYMBOLS
+
+fi
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SPL_SYMBOLS" >&5
+$as_echo "$SPL_SYMBOLS" >&6; }
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether modules can be built" >&5
+$as_echo_n "checking whether modules can be built... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+int
+main (void)
+{
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               if test "x$enable_linux_builtin" != xyes; then
+                       as_fn_error $? "*** Unable to build an empty module." "$LINENO" 5
+               else
+                       as_fn_error $? "
+       *** Unable to build an empty module.
+       *** Please run 'make scripts' inside the kernel source tree." "$LINENO" 5
+               fi
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       if test "x$cross_compiling" != xyes; 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 "$LINUX/include/linux/license.h"
+
+int
+main ()
+{
+
+                               return !license_is_gpl_compatible("$ZFS_META_LICENSE");
+
+  ;
+  return 0;
+}
+
+_ACEOF
+if ac_fn_c_try_run "$LINENO"; then :
+
+
+$as_echo "#define ZFS_IS_GPL_COMPATIBLE 1" >>confdefs.h
+
+
+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}: checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC" >&5
+$as_echo_n "checking whether Linux was built with CONFIG_DEBUG_LOCK_ALLOC... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/module.h>
+
+int
+main (void)
+{
+
+               #ifndef CONFIG_DEBUG_LOCK_ALLOC
+               #error CONFIG_DEBUG_LOCK_ALLOC not #defined
+               #endif
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mutex_lock() is GPL-only" >&5
+$as_echo_n "checking whether mutex_lock() is GPL-only... " >&6; }
+               tmp_flags="$EXTRA_KCFLAGS"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/module.h>
+                       #include <linux/mutex.h>
+
+                       MODULE_LICENSE("$ZFS_META_LICENSE");
+
+int
+main (void)
+{
+
+                       struct mutex lock;
+
+                       mutex_init(&lock);
+                       mutex_lock(&lock);
+                       mutex_unlock(&lock);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+                       as_fn_error $? "
+       *** Kernel built with CONFIG_DEBUG_LOCK_ALLOC which is incompatible
+       *** with the CDDL license and will prevent the module linking stage
+       *** from succeeding.  You must rebuild your kernel without this
+       *** option enabled." "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+               EXTRA_KCFLAGS="$tmp_flags"
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="-I\$(src)"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether DECLARE_EVENT_CLASS() is available" >&5
+$as_echo_n "checking whether DECLARE_EVENT_CLASS() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/module.h>
+               MODULE_LICENSE(ZFS_META_LICENSE);
+
+               #define CREATE_TRACE_POINTS
+               #include "conftest.h"
+
+int
+main (void)
+{
+
+               trace_zfs_autoconf_event_one(1UL);
+               trace_zfs_autoconf_event_two(2UL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+               #if !defined(_CONFTEST_H) || defined(TRACE_HEADER_MULTI_READ)
+               #define _CONFTEST_H
+
+               #undef  TRACE_SYSTEM
+               #define TRACE_SYSTEM zfs
+               #include <linux/tracepoint.h>
+
+               DECLARE_EVENT_CLASS(zfs_autoconf_event_class,
+                       TP_PROTO(unsigned long i),
+                       TP_ARGS(i),
+                       TP_STRUCT__entry(
+                               __field(unsigned long, i)
+                       ),
+                       TP_fast_assign(
+                               __entry->i = i;
+                       ),
+                       TP_printk("i = %lu", __entry->i)
+               );
+
+               #define DEFINE_AUTOCONF_EVENT(name) \
+               DEFINE_EVENT(zfs_autoconf_event_class, name, \
+                       TP_PROTO(unsigned long i), \
+                       TP_ARGS(i))
+               DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_one);
+               DEFINE_AUTOCONF_EVENT(zfs_autoconf_event_two);
+
+               #endif /* _CONFTEST_H */
+
+               #undef  TRACE_INCLUDE_PATH
+               #define TRACE_INCLUDE_PATH .
+               #define TRACE_INCLUDE_FILE conftest
+               #include <trace/define_trace.h>
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DECLARE_EVENT_CLASS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether current->bio_tail exists" >&5
+$as_echo_n "checking whether current->bio_tail exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/sched.h>
+
+int
+main (void)
+{
+
+               current->bio_tail = (struct bio **) NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CURRENT_BIO_TAIL 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether current->bio_list exists" >&5
+$as_echo_n "checking whether current->bio_list exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/sched.h>
+
+int
+main (void)
+{
+
+                       current->bio_list = (struct bio_list *) NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CURRENT_BIO_LIST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no - Please file a bug report at
+                           https://github.com/zfsonlinux/zfs/issues/new" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking block device operation prototypes" >&5
+$as_echo_n "checking block device operation prototypes... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+               int blk_open(struct block_device *bdev, fmode_t mode)
+                   { return 0; }
+               int blk_ioctl(struct block_device *bdev, fmode_t mode,
+                   unsigned x, unsigned long y) { return 0; }
+               int blk_compat_ioctl(struct block_device * bdev, fmode_t mode,
+                   unsigned x, unsigned long y) { return 0; }
+
+               static const struct block_device_operations
+                   bops __attribute__ ((unused)) = {
+                       .open           = blk_open,
+                       .release        = NULL,
+                       .ioctl          = blk_ioctl,
+                       .compat_ioctl   = blk_compat_ioctl,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: struct block_device" >&5
+$as_echo "struct block_device" >&6; }
+
+$as_echo "#define HAVE_BDEV_BLOCK_DEVICE_OPERATIONS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: struct inode" >&5
+$as_echo "struct inode" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether block_device_operations.release is void" >&5
+$as_echo_n "checking whether block_device_operations.release is void... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+               void blk_release(struct gendisk *g, fmode_t mode) { return; }
+
+               static const struct block_device_operations
+                   bops __attribute__ ((unused)) = {
+                       .open           = NULL,
+                       .release        = blk_release,
+                       .ioctl          = NULL,
+                       .compat_ioctl   = NULL,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: void" >&5
+$as_echo "void" >&6; }
+
+$as_echo "#define HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: int" >&5
+$as_echo "int" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines fmode_t" >&5
+$as_echo_n "checking whether kernel defines fmode_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/types.h>
+
+int
+main (void)
+{
+
+               fmode_t *ptr __attribute__ ((unused));
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FMODE_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kernel defines KOBJ_NAME_LEN" >&5
+$as_echo_n "checking whether kernel defines KOBJ_NAME_LEN... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/kobject.h>
+
+int
+main (void)
+{
+
+               int val __attribute__ ((unused));
+               val = KOBJ_NAME_LEN;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_KOBJ_NAME_LEN 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blkdev_get() wants 3 args" >&5
+$as_echo_n "checking whether blkdev_get() wants 3 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               (void) blkdev_get(bdev, 0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARG_BLKDEV_GET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blkdev_get_by_path() is available" >&5
+$as_echo_n "checking whether blkdev_get_by_path() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               blkdev_get_by_path(NULL, 0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]blkdev_get_by_path[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(blkdev_get_by_path)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLKDEV_GET_BY_PATH 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether open_bdev_exclusive() is available" >&5
+$as_echo_n "checking whether open_bdev_exclusive() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               open_bdev_exclusive(NULL, 0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]open_bdev_exclusive[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(open_bdev_exclusive)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_OPEN_BDEV_EXCLUSIVE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lookup_bdev() is available" >&5
+$as_echo_n "checking whether lookup_bdev() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               lookup_bdev(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]lookup_bdev[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(lookup_bdev)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LOOKUP_BDEV 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether invalidate_bdev() wants 1 arg" >&5
+$as_echo_n "checking whether invalidate_bdev() wants 1 arg... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/buffer_head.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               invalidate_bdev(bdev);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_1ARG_INVALIDATE_BDEV 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdev_logical_block_size() is available" >&5
+$as_echo_n "checking whether bdev_logical_block_size() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               bdev_logical_block_size(bdev);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BDEV_LOGICAL_BLOCK_SIZE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdev_physical_block_size() is available" >&5
+$as_echo_n "checking whether bdev_physical_block_size() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct block_device *bdev = NULL;
+               bdev_physical_block_size(bdev);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BDEV_PHYSICAL_BLOCK_SIZE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bio has bi_iter" >&5
+$as_echo_n "checking whether bio has bi_iter... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               struct bio bio;
+               bio.bi_iter.bi_sector = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_BVEC_ITER 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BIO_RW_FAILFAST_* are defined" >&5
+$as_echo_n "checking whether BIO_RW_FAILFAST_* are defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = ((1 << BIO_RW_FAILFAST_DEV) |
+                        (1 << BIO_RW_FAILFAST_TRANSPORT) |
+                        (1 << BIO_RW_FAILFAST_DRIVER));
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_RW_FAILFAST_DTD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether REQ_FAILFAST_MASK is defined" >&5
+$as_echo_n "checking whether REQ_FAILFAST_MASK is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = REQ_FAILFAST_MASK;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_REQ_FAILFAST_MASK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bio_end_io_t wants 1 arg" >&5
+$as_echo_n "checking whether bio_end_io_t wants 1 arg... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+               void wanted_end_io(struct bio *bio) { return; }
+
+               bio_end_io_t *end_io __attribute__ ((unused)) = wanted_end_io;
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_1ARG_BIO_END_IO_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BIO_RW_BARRIER is defined" >&5
+$as_echo_n "checking whether BIO_RW_BARRIER is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = BIO_RW_BARRIER;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_RW_BARRIER 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether BIO_RW_DISCARD is defined" >&5
+$as_echo_n "checking whether BIO_RW_DISCARD is defined... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+int
+main (void)
+{
+
+               int flags __attribute__ ((unused));
+               flags = BIO_RW_DISCARD;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BIO_RW_DISCARD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_flush() is available" >&5
+$as_echo_n "checking whether blk_queue_flush() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_FLUSH 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_flush() is GPL-only" >&5
+$as_echo_n "checking whether blk_queue_flush() is GPL-only... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/module.h>
+               #include <linux/blkdev.h>
+
+               MODULE_LICENSE("$ZFS_META_LICENSE");
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_flush(q, REQ_FLUSH);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_FLUSH_GPL_ONLY 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_max_hw_sectors() is available" >&5
+$as_echo_n "checking whether blk_queue_max_hw_sectors() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_hw_sectors(q, BLK_SAFE_MAX_SECTORS);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_MAX_HW_SECTORS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether blk_queue_max_segments() is available" >&5
+$as_echo_n "checking whether blk_queue_max_segments() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct request_queue *q = NULL;
+               (void) blk_queue_max_segments(q, BLK_MAX_SEGMENTS);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_BLK_QUEUE_MAX_SEGMENTS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether get_disk_ro() is available" >&5
+$as_echo_n "checking whether get_disk_ro() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct gendisk *disk = NULL;
+               (void) get_disk_ro(disk);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GET_DISK_RO 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether get_gendisk() is available" >&5
+$as_echo_n "checking whether get_gendisk() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/genhd.h>
+
+int
+main (void)
+{
+
+               get_gendisk(0, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]get_gendisk[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in block/genhd.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(get_gendisk)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GET_GENDISK 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ql->discard_granularity is available" >&5
+$as_echo_n "checking whether ql->discard_granularity is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+int
+main (void)
+{
+
+               struct queue_limits ql __attribute__ ((unused));
+
+               ql.discard_granularity = 0;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DISCARD_GRANULARITY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block uses const struct xattr_hander" >&5
+$as_echo_n "checking whether super_block uses const struct xattr_hander... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/xattr.h>
+
+               const struct xattr_handler xattr_test_handler = {
+                       .prefix = "test",
+                       .get    = NULL,
+                       .set    = NULL,
+               };
+
+               const struct xattr_handler *xattr_handlers[] = {
+                       &xattr_test_handler,
+               };
+
+               const struct super_block sb __attribute__ ((unused)) = {
+                       .s_xattr = xattr_handlers,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CONST_XATTR_HANDLER 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->get() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->get() wants dentry... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/xattr.h>
+
+               int get(struct dentry *dentry, const char *name,
+                   void *buffer, size_t size, int handler_flags) { return 0; }
+               static const struct xattr_handler
+                   xops __attribute__ ((unused)) = {
+                       .get = get,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DENTRY_XATTR_GET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->get() wants xattr_handler" >&5
+$as_echo_n "checking whether xattr_handler->get() wants xattr_handler... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/xattr.h>
+
+                       int get(const struct xattr_handler *handler, struct dentry *dentry,
+                           const char *name, void *buffer, size_t size) { return 0; }
+                       static const struct xattr_handler
+                           xops __attribute__ ((unused)) = {
+                               .get = get,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_HANDLER_XATTR_GET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->set() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->set() wants dentry... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/xattr.h>
+
+               int set(struct dentry *dentry, const char *name,
+                   const void *buffer, size_t size, int flags,
+                   int handler_flags) { return 0; }
+               static const struct xattr_handler
+                   xops __attribute__ ((unused)) = {
+                       .set = set,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DENTRY_XATTR_SET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->set() wants xattr_handler" >&5
+$as_echo_n "checking whether xattr_handler->set() wants xattr_handler... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/xattr.h>
+
+                       int set(const struct xattr_handler *handler, struct dentry *dentry,
+                           const char *name, const void *buffer, size_t size, int flags) { return 0; }
+                       static const struct xattr_handler
+                           xops __attribute__ ((unused)) = {
+                               .set = set,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_HANDLER_XATTR_SET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->list() wants dentry" >&5
+$as_echo_n "checking whether xattr_handler->list() wants dentry... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/xattr.h>
+
+               size_t list(struct dentry *dentry, char *list, size_t list_size,
+                   const char *name, size_t name_len, int handler_flags)
+                   { return 0; }
+               static const struct xattr_handler
+                   xops __attribute__ ((unused)) = {
+                       .list = list,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DENTRY_XATTR_LIST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether xattr_handler->list() wants xattr_handler" >&5
+$as_echo_n "checking whether xattr_handler->list() wants xattr_handler... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/xattr.h>
+
+                       size_t list(const struct xattr_handler *handler, struct dentry *dentry,
+                           char *list, size_t list_size, const char *name, size_t name_len) { return 0; }
+                       static const struct xattr_handler
+                           xops __attribute__ ((unused)) = {
+                               .list = list,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_HANDLER_XATTR_LIST 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode_owner_or_capable() exists" >&5
+$as_echo_n "checking whether inode_owner_or_capable() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode *ip = NULL;
+               (void) inode_owner_or_capable(ip);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_OWNER_OR_CAPABLE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether is_owner_or_cap() exists" >&5
+$as_echo_n "checking whether is_owner_or_cap() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+                       #include <linux/sched.h>
+
+int
+main (void)
+{
+
+                       struct inode *ip = NULL;
+                       (void) is_owner_or_cap(ip);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_IS_OWNER_OR_CAP 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no - Please file a bug report at
+                           https://github.com/zfsonlinux/zfs/issues/new" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_from_xattr() needs user_ns" >&5
+$as_echo_n "checking whether posix_acl_from_xattr() needs user_ns... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/cred.h>
+               #include <linux/fs.h>
+               #include <linux/posix_acl_xattr.h>
+
+int
+main (void)
+{
+
+               posix_acl_from_xattr(&init_user_ns, NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_FROM_XATTR_USERNS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_release() is available" >&5
+$as_echo_n "checking whether posix_acl_release() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/cred.h>
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               struct posix_acl* tmp = posix_acl_alloc(1, 0);
+               posix_acl_release(tmp);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_RELEASE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_release() is GPL-only" >&5
+$as_echo_n "checking whether posix_acl_release() is GPL-only... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/cred.h>
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+               MODULE_LICENSE("$ZFS_META_LICENSE");
+
+int
+main (void)
+{
+
+               struct posix_acl* tmp = posix_acl_alloc(1, 0);
+               posix_acl_release(tmp);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_RELEASE_GPL_ONLY 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_chmod exists" >&5
+$as_echo_n "checking whether posix_acl_chmod exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               posix_acl_chmod(NULL, 0, 0)
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_CHMOD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether __posix_acl_chmod exists" >&5
+$as_echo_n "checking whether __posix_acl_chmod exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               __posix_acl_chmod(NULL, 0, 0)
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE___POSIX_ACL_CHMOD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether inode has i_acl and i_default_acl" >&5
+$as_echo_n "checking whether inode has i_acl and i_default_acl... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode ino;
+               ino.i_acl = NULL;
+               ino.i_default_acl = NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_CACHING 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether posix_acl_equiv_mode() wants umode_t" >&5
+$as_echo_n "checking whether posix_acl_equiv_mode() wants umode_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               #include <linux/posix_acl.h>
+
+int
+main (void)
+{
+
+               umode_t tmp;
+               posix_acl_equiv_mode(NULL,&tmp);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->permission() exists" >&5
+$as_echo_n "checking whether iops->permission() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int permission_fn(struct inode *inode, int mask) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .permission = permission_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PERMISSION 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->permission() wants nameidata" >&5
+$as_echo_n "checking whether iops->permission() wants nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int permission_fn(struct inode *inode, int mask,
+                   struct nameidata *nd) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .permission = permission_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PERMISSION 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_PERMISSION_WITH_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->check_acl() exists" >&5
+$as_echo_n "checking whether iops->check_acl() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int check_acl_fn(struct inode *inode, int mask) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .check_acl = check_acl_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CHECK_ACL 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->check_acl() wants flags" >&5
+$as_echo_n "checking whether iops->check_acl() wants flags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int check_acl_fn(struct inode *inode, int mask,
+                   unsigned int flags) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .check_acl = check_acl_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CHECK_ACL 1" >>confdefs.h
+
+
+$as_echo "#define HAVE_CHECK_ACL_WITH_FLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->get_acl() exists" >&5
+$as_echo_n "checking whether iops->get_acl() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               struct posix_acl *get_acl_fn(struct inode *inode, int type)
+                   { return NULL; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .get_acl = get_acl_fn,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GET_ACL 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether current_umask exists" >&5
+$as_echo_n "checking whether current_umask exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               current_umask();
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CURRENT_UMASK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->show_options() wants dentry" >&5
+$as_echo_n "checking whether sops->show_options() wants dentry... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int show_options (struct seq_file * x, struct dentry * y) { return 0; };
+               static struct super_operations sops __attribute__ ((unused)) = {
+                       .show_options = show_options,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SHOW_OPTIONS_WITH_DENTRY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether file_inode() is available" >&5
+$as_echo_n "checking whether file_inode() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *f = NULL;
+               file_inode(f);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_INODE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fsync() wants" >&5
+$as_echo_n "checking whether fops->fsync() wants... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int test_fsync(struct file *f, struct dentry *dentry, int x)
+                   { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fsync = test_fsync,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: dentry" >&5
+$as_echo "dentry" >&6; }
+
+$as_echo "#define HAVE_FSYNC_WITH_DENTRY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int test_fsync(struct file *f, int x) { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fsync = test_fsync,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no dentry" >&5
+$as_echo "no dentry" >&6; }
+
+$as_echo "#define HAVE_FSYNC_WITHOUT_DENTRY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int test_fsync(struct file *f, loff_t a, loff_t b, int c)
+                   { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fsync = test_fsync,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: range" >&5
+$as_echo "range" >&6; }
+
+$as_echo "#define HAVE_FSYNC_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->evict_inode() exists" >&5
+$as_echo_n "checking whether sops->evict_inode() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               void evict_inode (struct inode * t) { return; }
+               static struct super_operations sops __attribute__ ((unused)) = {
+                       .evict_inode = evict_inode,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_EVICT_INODE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->dirty_inode() wants flags" >&5
+$as_echo_n "checking whether sops->dirty_inode() wants flags... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               void dirty_inode(struct inode *a, int b) { return; }
+
+               static const struct super_operations
+                   sops __attribute__ ((unused)) = {
+                       .dirty_inode = dirty_inode,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_DIRTY_INODE_WITH_FLAGS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->nr_cached_objects() exists" >&5
+$as_echo_n "checking whether sops->nr_cached_objects() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int nr_cached_objects(struct super_block *sb) { return 0; }
+
+               static const struct super_operations
+                   sops __attribute__ ((unused)) = {
+                       .nr_cached_objects = nr_cached_objects,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_NR_CACHED_OBJECTS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sops->free_cached_objects() exists" >&5
+$as_echo_n "checking whether sops->free_cached_objects() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               void free_cached_objects(struct super_block *sb, int x)
+                   { return; }
+
+               static const struct super_operations
+                   sops __attribute__ ((unused)) = {
+                       .free_cached_objects = free_cached_objects,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FREE_CACHED_OBJECTS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->fallocate() exists" >&5
+$as_echo_n "checking whether fops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               long test_fallocate(struct file *file, int mode,
+                   loff_t offset, loff_t len) { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                       .fallocate = test_fallocate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FILE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->fallocate() exists" >&5
+$as_echo_n "checking whether iops->fallocate() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               long test_fallocate(struct inode *inode, int mode,
+                   loff_t offset, loff_t len) { return 0; }
+
+               static const struct inode_operations
+                   fops __attribute__ ((unused)) = {
+                       .fallocate = test_fallocate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_FALLOCATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->create()/mkdir()/mknod() take umode_t" >&5
+$as_echo_n "checking whether iops->create()/mkdir()/mknod() take umode_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int mkdir(struct inode *inode, struct dentry *dentry,
+                   umode_t umode) { return 0; }
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .mkdir = mkdir,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_MKDIR_UMODE_T 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->lookup() passes nameidata" >&5
+$as_echo_n "checking whether iops->lookup() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               struct dentry *inode_lookup(struct inode *inode,
+                   struct dentry *dentry, struct nameidata *nidata)
+                   { return NULL; }
+
+               static const struct inode_operations iops
+                   __attribute__ ((unused)) = {
+                       .lookup = inode_lookup,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LOOKUP_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->create() passes nameidata" >&5
+$as_echo_n "checking whether iops->create() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               #ifdef HAVE_MKDIR_UMODE_T
+               int inode_create(struct inode *inode ,struct dentry *dentry,
+                   umode_t umode, struct nameidata *nidata) { return 0; }
+               #else
+               int inode_create(struct inode *inode,struct dentry *dentry,
+                   int umode, struct nameidata * nidata) { return 0; }
+               #endif
+
+               static const struct inode_operations
+                   iops __attribute__ ((unused)) = {
+                       .create         = inode_create,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CREATE_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->follow_link() passes nameidata" >&5
+$as_echo_n "checking whether iops->follow_link() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               const char *follow_link(struct dentry *de, void **cookie)
+                   { return "symlink"; }
+               static struct inode_operations iops __attribute__ ((unused)) = {
+                       .follow_link = follow_link,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FOLLOW_LINK_NAMEIDATA 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->put_link() passes nameidata" >&5
+$as_echo_n "checking whether iops->put_link() passes nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               void put_link(struct inode *ip, void *cookie) { return; }
+               static struct inode_operations iops __attribute__ ((unused)) = {
+                       .put_link = put_link,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_PUT_LINK_NAMEIDATA 1" >>confdefs.h
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether iops->truncate_range() exists" >&5
+$as_echo_n "checking whether iops->truncate_range() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               void truncate_range(struct inode *inode, loff_t start,
+                                   loff_t end) { return; }
+               static struct inode_operations iops __attribute__ ((unused)) = {
+                       .truncate_range = truncate_range,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INODE_TRUNCATE_RANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dops->d_automount() exists" >&5
+$as_echo_n "checking whether dops->d_automount() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+               struct vfsmount *d_automount(struct path *p) { return NULL; }
+               struct dentry_operations dops __attribute__ ((unused)) = {
+                       .d_automount = d_automount,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_AUTOMOUNT 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether eops->encode_fh() wants inode" >&5
+$as_echo_n "checking whether eops->encode_fh() wants inode... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/exportfs.h>
+               int encode_fh(struct inode *inode, __u32 *fh, int *max_len,
+                             struct inode *parent) { return 0; }
+               static struct export_operations eops __attribute__ ((unused))={
+                       .encode_fh = encode_fh,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_ENCODE_FH_WITH_INODE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether eops->commit_metadata() exists" >&5
+$as_echo_n "checking whether eops->commit_metadata() exists... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/exportfs.h>
+               int commit_metadata(struct inode *inode) { return 0; }
+               static struct export_operations eops __attribute__ ((unused))={
+                       .commit_metadata = commit_metadata,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_COMMIT_METADATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether clear_inode() is available" >&5
+$as_echo_n "checking whether clear_inode() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               clear_inode(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]clear_inode[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/inode.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(clear_inode)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CLEAR_INODE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether insert_inode_locked() is available" >&5
+$as_echo_n "checking whether insert_inode_locked() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               insert_inode_locked(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]insert_inode_locked[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/inode.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(insert_inode_locked)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_INSERT_INODE_LOCKED 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_make_root() is available" >&5
+$as_echo_n "checking whether d_make_root() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               d_make_root(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_make_root[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_make_root)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_MAKE_ROOT 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_obtain_alias() is available" >&5
+$as_echo_n "checking whether d_obtain_alias() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               d_obtain_alias(NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_obtain_alias[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_obtain_alias)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_OBTAIN_ALIAS 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_prune_aliases() is available" >&5
+$as_echo_n "checking whether d_prune_aliases() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               struct inode *ip = NULL;
+               d_prune_aliases(ip);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_prune_aliases[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_prune_aliases)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_PRUNE_ALIASES 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether d_set_d_op() is available" >&5
+$as_echo_n "checking whether d_set_d_op() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+int
+main (void)
+{
+
+               d_set_d_op(NULL, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]d_set_d_op[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/dcache.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(d_set_d_op)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_SET_D_OP 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dops->d_revalidate() takes struct nameidata" >&5
+$as_echo_n "checking whether dops->d_revalidate() takes struct nameidata... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+               int revalidate (struct dentry *dentry,
+                   struct nameidata *nidata) { return 0; }
+
+               static const struct dentry_operations
+                   dops __attribute__ ((unused)) = {
+                       .d_revalidate   = revalidate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_D_REVALIDATE_NAMEIDATA 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dentry uses const struct dentry_operations" >&5
+$as_echo_n "checking whether dentry uses const struct dentry_operations... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/dcache.h>
+
+               const struct dentry_operations test_d_op = {
+                       .d_revalidate = NULL,
+               };
+
+int
+main (void)
+{
+
+               struct dentry d __attribute__ ((unused));
+
+               d.d_op = &test_d_op;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CONST_DENTRY_OPERATIONS 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether check_disk_size_change() is available" >&5
+$as_echo_n "checking whether check_disk_size_change() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               check_disk_size_change(NULL, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]check_disk_size_change[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/block_dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(check_disk_size_change)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CHECK_DISK_SIZE_CHANGE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether truncate_setsize() is available" >&5
+$as_echo_n "checking whether truncate_setsize() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/mm.h>
+
+int
+main (void)
+{
+
+               truncate_setsize(NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]truncate_setsize[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/truncate.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(truncate_setsize)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_TRUNCATE_SETSIZE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether security_inode_init_security wants 6 args" >&5
+$as_echo_n "checking whether security_inode_init_security wants 6 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/security.h>
+
+int
+main (void)
+{
+
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               struct inode *dip __attribute__ ((unused)) = NULL;
+               const struct qstr *str __attribute__ ((unused)) = NULL;
+               char *name __attribute__ ((unused)) = NULL;
+               void *value __attribute__ ((unused)) = NULL;
+               size_t len __attribute__ ((unused)) = 0;
+
+               security_inode_init_security(ip, dip, str, &name, &value, &len);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether security_inode_init_security wants callback" >&5
+$as_echo_n "checking whether security_inode_init_security wants callback... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/security.h>
+
+int
+main (void)
+{
+
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               struct inode *dip __attribute__ ((unused)) = NULL;
+               const struct qstr *str __attribute__ ((unused)) = NULL;
+               initxattrs func __attribute__ ((unused)) = NULL;
+
+               security_inode_init_security(ip, dip, str, func, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether mount_nodev() is available" >&5
+$as_echo_n "checking whether mount_nodev() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               mount_nodev(NULL, 0, NULL, NULL);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]mount_nodev[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/super.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(mount_nodev)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_MOUNT_NODEV 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block has s_shrink" >&5
+$as_echo_n "checking whether super_block has s_shrink... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               int shrink(struct shrinker *s, struct shrink_control *sc)
+                   { return 0; }
+
+               static const struct super_block
+                   sb __attribute__ ((unused)) = {
+                       .s_shrink.shrink = shrink,
+                       .s_shrink.seeks = DEFAULT_SEEKS,
+                       .s_shrink.batch = 0,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SHRINK 1" >>confdefs.h
+
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether shrink_control has nid" >&5
+$as_echo_n "checking whether shrink_control has nid... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct shrink_control sc __attribute__ ((unused));
+               unsigned long scnidsize __attribute__ ((unused)) =
+                   sizeof(sc.nid);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define SHRINK_CONTROL_HAS_NID 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block has s_instances list_head" >&5
+$as_echo_n "checking whether super_block has s_instances list_head... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct super_block sb __attribute__ ((unused));
+
+               INIT_LIST_HEAD(&sb.s_instances);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_S_INSTANCES_LIST_HEAD 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether super_block has s_d_op" >&5
+$as_echo_n "checking whether super_block has s_d_op... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct super_block sb __attribute__ ((unused));
+               sb.s_d_op = NULL;
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_S_D_OP 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdi_setup_and_register() wants 2 args" >&5
+$as_echo_n "checking whether bdi_setup_and_register() wants 2 args... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/backing-dev.h>
+               struct backing_dev_info bdi;
+
+int
+main (void)
+{
+
+               char *name = "bdi";
+               int error __attribute__((unused)) =
+                   bdi_setup_and_register(&bdi, name);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdi_setup_and_register() wants 3 args" >&5
+$as_echo_n "checking whether bdi_setup_and_register() wants 3 args... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/backing-dev.h>
+                       struct backing_dev_info bdi;
+
+int
+main (void)
+{
+
+                       char *name = "bdi";
+                       unsigned int cap = BDI_CAP_MAP_COPY;
+                       int error __attribute__((unused)) =
+                           bdi_setup_and_register(&bdi, name, cap);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_BDI_SETUP_AND_REGISTER 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether bdi_setup_and_register() wants 3 args" >&5
+$as_echo_n "checking whether bdi_setup_and_register() wants 3 args... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/backing-dev.h>
+                       struct backing_dev_info bdi;
+
+int
+main (void)
+{
+
+                       char *name = "bdi";
+                       unsigned int cap = BDI_CAP_MAP_COPY;
+                       int error __attribute__((unused)) =
+                           bdi_setup_and_register(&bdi, name, cap);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]bdi_setup_and_register[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in mm/backing-dev.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(bdi_setup_and_register)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_3ARGS_BDI_SETUP_AND_REGISTER 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_2ARGS_BDI_SETUP_AND_REGISTER 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether set_nlink() is available" >&5
+$as_echo_n "checking whether set_nlink() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct inode node;
+               unsigned int link = 0;
+               (void) set_nlink(&node, link);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_SET_NLINK 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether elevator_change() is available" >&5
+$as_echo_n "checking whether elevator_change() is available... " >&6; }
+       tmp_flags="$EXTRA_KCFLAGS"
+       EXTRA_KCFLAGS="${NO_UNUSED_BUT_SET_VARIABLE}"
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+               #include <linux/elevator.h>
+
+int
+main (void)
+{
+
+               int ret;
+               struct request_queue *q = NULL;
+               char *elevator = NULL;
+               ret = elevator_change(q, elevator);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_ELEVATOR_CHANGE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+       EXTRA_KCFLAGS="$tmp_flags"
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether sget() wants 5 args" >&5
+$as_echo_n "checking whether sget() wants 5 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file_system_type *type = NULL;
+               int (*test)(struct super_block *,void *) = NULL;
+               int (*set)(struct super_block *,void *) = NULL;
+               int flags = 0;
+               void *data = NULL;
+               (void) sget(type, test, set, flags, data);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_5ARG_SGET 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether lseek_execute() is available" >&5
+$as_echo_n "checking whether lseek_execute() is available... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+int
+main (void)
+{
+
+               struct file *fp __attribute__ ((unused)) = NULL;
+               struct inode *ip __attribute__ ((unused)) = NULL;
+               loff_t offset __attribute__ ((unused)) = 0;
+               loff_t maxsize __attribute__ ((unused)) = 0;
+
+               lseek_execute(fp, ip, offset, maxsize);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]lseek_exclusive[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in fs/read_write.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(lseek_exclusive)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LSEEK_EXECUTE 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->iterate() is available" >&5
+$as_echo_n "checking whether fops->iterate() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+               int iterate(struct file *filp, struct dir_context * context)
+                   { return 0; }
+
+               static const struct file_operations fops
+                   __attribute__ ((unused)) = {
+                       .iterate         = iterate,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_VFS_ITERATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->readdir() is available" >&5
+$as_echo_n "checking whether fops->readdir() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/fs.h>
+                       int readdir(struct file *filp, void *entry, filldir_t func)
+                           { return 0; }
+
+                       static const struct file_operations fops
+                           __attribute__ ((unused)) = {
+                               .readdir = readdir,
+                       };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_VFS_READDIR 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       as_fn_error $? "no; file a bug report with ZFSOnLinux" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether fops->read/write_iter() are available" >&5
+$as_echo_n "checking whether fops->read/write_iter() are available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/fs.h>
+
+               ssize_t test_read(struct kiocb *kiocb, struct iov_iter *to)
+                   { return 0; }
+               ssize_t test_write(struct kiocb *kiocb, struct iov_iter *from)
+                   { return 0; }
+
+               static const struct file_operations
+                   fops __attribute__ ((unused)) = {
+                   .read_iter = test_read,
+                   .write_iter = test_write,
+               };
+
+int
+main (void)
+{
+
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_VFS_RW_ITERATE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether kmap_atomic wants 1 args" >&5
+$as_echo_n "checking whether kmap_atomic wants 1 args... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/pagemap.h>
+
+int
+main (void)
+{
+
+               struct page page;
+               kmap_atomic(&page);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_1ARG_KMAP_ATOMIC 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether follow_down_one() is available" >&5
+$as_echo_n "checking whether follow_down_one() is available... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/namei.h>
+
+int
+main (void)
+{
+
+               struct path *p = NULL;
+               follow_down_one(p);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_FOLLOW_DOWN_ONE 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make_request_fn() returns int" >&5
+$as_echo_n "checking whether make_request_fn() returns int... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/blkdev.h>
+
+               int make_request(struct request_queue *q, struct bio *bio)
+               {
+                       return (0);
+               }
+
+int
+main (void)
+{
+
+               blk_queue_make_request(NULL, &make_request);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define MAKE_REQUEST_FN_RET int" >>confdefs.h
+
+
+$as_echo "#define HAVE_MAKE_REQUEST_FN_RET_INT 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+               { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make_request_fn() returns void" >&5
+$as_echo_n "checking whether make_request_fn() returns void... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                       #include <linux/blkdev.h>
+
+                       void make_request(struct request_queue *q, struct bio *bio)
+                       {
+                               return;
+                       }
+
+int
+main (void)
+{
+
+                       blk_queue_make_request(NULL, &make_request);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define MAKE_REQUEST_FN_RET void" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+                       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether make_request_fn() returns blk_qc_t" >&5
+$as_echo_n "checking whether make_request_fn() returns blk_qc_t... " >&6; }
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+                               #include <linux/blkdev.h>
+
+                               blk_qc_t make_request(struct request_queue *q, struct bio *bio)
+                               {
+                                       return (BLK_QC_T_NONE);
+                               }
+
+int
+main (void)
+{
+
+                               blk_queue_make_request(NULL, &make_request);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+
+                               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define MAKE_REQUEST_FN_RET blk_qc_t" >>confdefs.h
+
+
+$as_echo "#define HAVE_MAKE_REQUEST_FN_RET_QC 1" >>confdefs.h
+
+
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+                               as_fn_error $? "no - Please file a bug report at
+                                   https://github.com/zfsonlinux/zfs/issues/new" "$LINENO" 5
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+
+fi
+       rm -Rf build
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether generic IO accounting symbols are avaliable" >&5
+$as_echo_n "checking whether generic IO accounting symbols are avaliable... " >&6; }
+
+
+
+cat confdefs.h - <<_ACEOF >conftest.c
+
+
+               #include <linux/bio.h>
+
+               void (*generic_start_io_acct_f)(int, unsigned long,
+                   struct hd_struct *) = &generic_start_io_acct;
+               void (*generic_end_io_acct_f)(int, struct hd_struct *,
+                   unsigned long) = &generic_end_io_acct;
+
+int
+main (void)
+{
+
+               generic_start_io_acct(0, 0, NULL);
+               generic_end_io_acct(0, NULL, 0);
+
+  ;
+  return 0;
+}
+
+_ACEOF
+
+
+
+cat - <<_ACEOF >conftest.h
+
+_ACEOF
+
+
+       rm -Rf build && mkdir -p build && touch build/conftest.mod.c
+       echo "obj-m := conftest.o" >build/Makefile
+       modpost_flag=''
+       test "x$enable_linux_builtin" = xyes && modpost_flag='modpost=true' # fake modpost stage
+       if { ac_try='cp conftest.c conftest.h build && make modules -C $LINUX_OBJ EXTRA_CFLAGS="-Werror $EXTRA_KCFLAGS" $ARCH_UM M=$PWD/build $modpost_flag'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; } >/dev/null && { ac_try='test -s build/conftest.o'
+  { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_try\""; } >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; }; then :
+  rc=0
+else
+  $as_echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+ rc=1
+
+
+fi
+       rm -Rf build
+
+
+       if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+       else
+               if test "x$enable_linux_builtin" != xyes; then
+
+       grep -q -E '[[:space:]]generic_start_io_acct[[:space:]]' \
+               $LINUX_OBJ/$LINUX_SYMBOLS 2>/dev/null
+       rc=$?
+       if test $rc -ne 0; then
+               export=0
+               for file in block/bio.c; do
+                       grep -q -E "EXPORT_SYMBOL.*(generic_start_io_acct)" \
+                               "$LINUX/$file" 2>/dev/null
+                       rc=$?
+                       if test $rc -eq 0; then
+                               export=1
+                               break;
+                       fi
+               done
+               if test $export -eq 0; then :
+                       rc=1
+               else :
+                       rc=0
+               fi
+       else :
+               rc=0
+       fi
+
+               fi
+               if test $rc -ne 0; then :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+               else :
+
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_GENERIC_IO_ACCT 1" >>confdefs.h
+
+
+               fi
+       fi
+
+
+
+       if test "$LINUX_OBJ" != "$LINUX"; then :
+
+               KERNELMAKE_PARAMS="$KERNELMAKE_PARAMS O=$LINUX_OBJ"
+
+fi
+
+
+
+                       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_UNUSED_BUT_SET_VARIABLE"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS $NO_BOOL_COMPARE"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DHAVE_SPL -D_KERNEL"
+       KERNELCPPFLAGS="$KERNELCPPFLAGS -DTEXT_DOMAIN=\\\"zfs-linux-kernel\\\""
+
+
+ ;;
+               srpm)                        ;;
+               *)
+               { $as_echo "$as_me:${as_lineno-$LINENO}: result: Error!" >&5
+$as_echo "Error!" >&6; }
+               as_fn_error $? "Bad value \"$ZFS_CONFIG\" for --with-config,
+                             user kernel|user|all|srpm" "$LINENO" 5 ;;
+       esac
+
+        if test "$ZFS_CONFIG" = user -o "$ZFS_CONFIG" = all; then
+  CONFIG_USER_TRUE=
+  CONFIG_USER_FALSE='#'
+else
+  CONFIG_USER_TRUE='#'
+  CONFIG_USER_FALSE=
+fi
+
+        if test "$ZFS_CONFIG" = kernel -o "$ZFS_CONFIG" = all &&
+                      test "x$enable_linux_builtin" != xyes ; then
+  CONFIG_KERNEL_TRUE=
+  CONFIG_KERNEL_FALSE='#'
+else
+  CONFIG_KERNEL_TRUE='#'
+  CONFIG_KERNEL_FALSE=
+fi
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether debugging is enabled" >&5
+$as_echo_n "checking whether debugging is enabled... " >&6; }
+       # Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then :
+  enableval=$enable_debug;
+else
+  enable_debug=no
+fi
+
+
+       if test "x$enable_debug" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG -Werror"
+               HOSTCFLAGS="${HOSTCFLAGS} -DDEBUG -Werror"
+               DEBUG_CFLAGS="-DDEBUG -Werror"
+               DEBUG_STACKFLAGS="-fstack-check"
+               DEBUG_ZFS="_with_debug"
+
+$as_echo "#define ZFS_DEBUG 1" >>confdefs.h
+
+
+else
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DNDEBUG "
+               HOSTCFLAGS="${HOSTCFLAGS} -DNDEBUG "
+               DEBUG_CFLAGS="-DNDEBUG"
+               DEBUG_STACKFLAGS=""
+               DEBUG_ZFS="_without_debug"
+
+fi
+
+
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug" >&5
+$as_echo "$enable_debug" >&6; }
+
+
+       # Check whether --enable-debug-dmu-tx was given.
+if test "${enable_debug_dmu_tx+set}" = set; then :
+  enableval=$enable_debug_dmu_tx;
+else
+  enable_debug_dmu_tx=no
+fi
+
+
+       if test "x$enable_debug_dmu_tx" = xyes; then :
+
+               KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_DMU_TX"
+               DEBUG_DMU_TX="_with_debug_dmu_tx"
+
+$as_echo "#define DEBUG_DMU_TX 1" >>confdefs.h
+
+
+else
+
+               DEBUG_DMU_TX="_without_debug_dmu_tx"
+
+fi
+
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether dmu tx validation is enabled" >&5
+$as_echo_n "checking whether dmu tx validation is enabled... " >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: $enable_debug_dmu_tx" >&5
+$as_echo "$enable_debug_dmu_tx" >&6; }
+
+
+ac_config_files="$ac_config_files Makefile udev/Makefile udev/rules.d/Makefile etc/Makefile etc/init.d/Makefile etc/zfs/Makefile etc/systemd/Makefile etc/systemd/system/Makefile etc/modules-load.d/Makefile man/Makefile man/man1/Makefile man/man5/Makefile man/man8/Makefile lib/Makefile lib/libspl/Makefile lib/libspl/asm-generic/Makefile lib/libspl/asm-i386/Makefile lib/libspl/asm-x86_64/Makefile lib/libspl/include/Makefile lib/libspl/include/ia32/Makefile lib/libspl/include/ia32/sys/Makefile lib/libspl/include/rpc/Makefile lib/libspl/include/sys/Makefile lib/libspl/include/sys/sysevent/Makefile lib/libspl/include/sys/dktp/Makefile lib/libspl/include/util/Makefile lib/libavl/Makefile lib/libefi/Makefile lib/libnvpair/Makefile lib/libunicode/Makefile lib/libuutil/Makefile lib/libzpool/Makefile lib/libzfs/libzfs.pc lib/libzfs/libzfs_core.pc lib/libzfs/Makefile lib/libzfs_core/Makefile lib/libshare/Makefile cmd/Makefile cmd/zdb/Makefile cmd/zhack/Makefile cmd/zfs/Makefile cmd/zinject/Makefile cmd/zpool/Makefile cmd/zstreamdump/Makefile cmd/ztest/Makefile cmd/zpios/Makefile cmd/mount_zfs/Makefile cmd/fsck_zfs/Makefile cmd/zvol_id/Makefile cmd/vdev_id/Makefile cmd/arcstat/Makefile cmd/dbufstat/Makefile cmd/arc_summary/Makefile cmd/zed/Makefile contrib/Makefile contrib/bash_completion.d/Makefile contrib/dracut/Makefile contrib/dracut/90zfs/Makefile contrib/initramfs/Makefile module/Makefile module/avl/Makefile module/nvpair/Makefile module/unicode/Makefile module/zcommon/Makefile module/zfs/Makefile module/zpios/Makefile include/Makefile include/linux/Makefile include/sys/Makefile include/sys/fs/Makefile include/sys/fm/Makefile include/sys/fm/fs/Makefile scripts/Makefile scripts/zpios-profile/Makefile scripts/zpios-test/Makefile scripts/zpool-config/Makefile scripts/common.sh rpm/Makefile rpm/redhat/Makefile rpm/redhat/zfs.spec rpm/redhat/zfs-kmod.spec rpm/redhat/zfs-dkms.spec rpm/generic/Makefile rpm/generic/zfs.spec rpm/generic/zfs-kmod.spec rpm/generic/zfs-dkms.spec zfs-script-config.sh zfs.release"
+
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5
+$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #(
+      *) { eval $ac_var=; unset $ac_var;} ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes: double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \.
+      sed -n \
+       "s/'/'\\\\''/g;
+         s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    if test "x$cache_file" != "x/dev/null"; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5
+$as_echo "$as_me: updating cache $cache_file" >&6;}
+      if test ! -f "$cache_file" || test -h "$cache_file"; then
+       cat confcache >"$cache_file"
+      else
+        case $cache_file in #(
+        */* | ?:*)
+         mv -f confcache "$cache_file"$$ &&
+         mv -f "$cache_file"$$ "$cache_file" ;; #(
+        *)
+         mv -f confcache "$cache_file" ;;
+       esac
+      fi
+    fi
+  else
+    { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5
+$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+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$//'
+  ac_i=`$as_echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then
+  as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+{ $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='#'
+else
+  am__EXEEXT_TRUE='#'
+  am__EXEEXT_FALSE=
+fi
+
+if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
+  as_fn_error $? "conditional \"AMDEP\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCC\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${am__fastdepCCAS_TRUE}" && test -z "${am__fastdepCCAS_FALSE}"; then
+  as_fn_error $? "conditional \"am__fastdepCCAS\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CONFIG_USER_TRUE}" && test -z "${CONFIG_USER_FALSE}"; then
+  as_fn_error $? "conditional \"CONFIG_USER\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${CONFIG_KERNEL_TRUE}" && test -z "${CONFIG_KERNEL_FALSE}"; then
+  as_fn_error $? "conditional \"CONFIG_KERNEL\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+
+: "${CONFIG_STATUS=./config.status}"
+ac_write_fail=0
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5
+$as_echo "$as_me: creating $CONFIG_STATUS" >&6;}
+as_write_fail=0
+cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+
+SHELL=\${CONFIG_SHELL-$SHELL}
+export SHELL
+_ASEOF
+cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1
+## -------------------- ##
+## M4sh Initialization. ##
+## -------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then :
+  emulate sh
+  NULLCMD=:
+  # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in #(
+  *posix*) :
+    set -o posix ;; #(
+  *) :
+     ;;
+esac
+fi
+
+
+as_nl='
+'
+export as_nl
+# Printing a long string crashes Solaris 7 /usr/bin/printf.
+as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\'
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo
+as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo
+# Prefer a ksh shell builtin over an external printf program on Solaris,
+# but without wasting forks for bash or zsh.
+if test -z "$BASH_VERSION$ZSH_VERSION" \
+    && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='print -r --'
+  as_echo_n='print -rn --'
+elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then
+  as_echo='printf %s\n'
+  as_echo_n='printf %s'
+else
+  if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then
+    as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"'
+    as_echo_n='/usr/ucb/echo -n'
+  else
+    as_echo_body='eval expr "X$1" : "X\\(.*\\)"'
+    as_echo_n_body='eval
+      arg=$1;
+      case $arg in #(
+      *"$as_nl"*)
+       expr "X$arg" : "X\\(.*\\)$as_nl";
+       arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;;
+      esac;
+      expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl"
+    '
+    export as_echo_n_body
+    as_echo_n='sh -c $as_echo_n_body as_echo'
+  fi
+  export as_echo_body
+  as_echo='sh -c $as_echo_body as_echo'
+fi
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  PATH_SEPARATOR=:
+  (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && {
+    (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 ||
+      PATH_SEPARATOR=';'
+  }
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+IFS=" ""       $as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+as_myself=
+case $0 in #((
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+  done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  exit 1
+fi
+
+# Unset variables that we do not need and which cause bugs (e.g. in
+# pre-3.0 UWIN ksh).  But do not cause bugs in bash 2.01; the "|| exit 1"
+# suppresses any "Segmentation fault" message there.  '((' could
+# trigger a bug in pdksh 5.2.14.
+for as_var in BASH_ENV ENV MAIL MAILPATH
+do eval test x\${$as_var+set} = xset \
+  && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || :
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+LC_ALL=C
+export LC_ALL
+LANGUAGE=C
+export LANGUAGE
+
+# CDPATH.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+
+# as_fn_error STATUS ERROR [LINENO LOG_FD]
+# ----------------------------------------
+# Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are
+# provided, also output the error to LOG_FD, referencing LINENO. Then exit the
+# script with STATUS, using 1 if that was 0.
+as_fn_error ()
+{
+  as_status=$1; test $as_status -eq 0 && as_status=1
+  if test "$4"; then
+    as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack
+    $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4
+  fi
+  $as_echo "$as_me: error: $2" >&2
+  as_fn_exit $as_status
+} # as_fn_error
+
+
+# as_fn_set_status STATUS
+# -----------------------
+# Set $? to STATUS, without forking.
+as_fn_set_status ()
+{
+  return $1
+} # as_fn_set_status
+
+# as_fn_exit STATUS
+# -----------------
+# Exit the shell with STATUS, even in a "trap 0" or "set -e" context.
+as_fn_exit ()
+{
+  set +e
+  as_fn_set_status $1
+  exit $1
+} # as_fn_exit
+
+# as_fn_unset VAR
+# ---------------
+# Portably unset VAR.
+as_fn_unset ()
+{
+  { eval $1=; unset $1;}
+}
+as_unset=as_fn_unset
+# as_fn_append VAR VALUE
+# ----------------------
+# Append the text in VALUE to the end of the definition contained in VAR. Take
+# advantage of any shell optimizations that allow amortized linear growth over
+# repeated appends, instead of the typical quadratic growth present in naive
+# implementations.
+if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then :
+  eval 'as_fn_append ()
+  {
+    eval $1+=\$2
+  }'
+else
+  as_fn_append ()
+  {
+    eval $1=\$$1\$2
+  }
+fi # as_fn_append
+
+# as_fn_arith ARG...
+# ------------------
+# Perform arithmetic evaluation on the ARGs, and store the result in the
+# global $as_val. Take advantage of shells that can avoid forks. The arguments
+# must be portable across $(()) and expr.
+if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then :
+  eval 'as_fn_arith ()
+  {
+    as_val=$(( $* ))
+  }'
+else
+  as_fn_arith ()
+  {
+    as_val=`expr "$@" || test $? -eq 1`
+  }
+fi # as_fn_arith
+
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+        X"$0" : 'X\(//\)$' \| \
+        X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\/\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in #(((((
+-n*)
+  case `echo 'xy\c'` in
+  *c*) ECHO_T='        ';;     # ECHO_T is single tab character.
+  xy)  ECHO_C='\c';;
+  *)   echo `echo ksh88 bug on AIX 6.1` > /dev/null
+       ECHO_T='        ';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir 2>/dev/null
+fi
+if (echo >conf$$.file) 2>/dev/null; then
+  if ln -s conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s='ln -s'
+    # ... 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 -pR'.
+    ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+      as_ln_s='cp -pR'
+  elif ln conf$$.file conf$$ 2>/dev/null; then
+    as_ln_s=ln
+  else
+    as_ln_s='cp -pR'
+  fi
+else
+  as_ln_s='cp -pR'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+
+# as_fn_mkdir_p
+# -------------
+# Create "$as_dir" as a directory, including parents if necessary.
+as_fn_mkdir_p ()
+{
+
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || eval $as_mkdir_p || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$as_dir" : 'X\(//\)[^/]' \| \
+        X"$as_dir" : 'X\(//\)$' \| \
+        X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir"
+
+
+} # as_fn_mkdir_p
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p='mkdir -p "$as_dir"'
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+
+# 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'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+## ----------------------------------- ##
+## Main body of $CONFIG_STATUS script. ##
+## ----------------------------------- ##
+_ASEOF
+test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# Save the log message, to keep $0 and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by zfs $as_me 0.6.5.4, which was
+generated by GNU Autoconf 2.69.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+case $ac_config_files in *"
+"*) set x $ac_config_files; shift; ac_config_files=$*;;
+esac
+
+case $ac_config_headers in *"
+"*) set x $ac_config_headers; shift; ac_config_headers=$*;;
+esac
+
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+config_commands="$ac_config_commands"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+ac_cs_usage="\
+\`$as_me' instantiates files and other configuration actions
+from templates according to the current configuration.  Unless the files
+and actions are specified as TAGs, all are instantiated by default.
+
+Usage: $0 [OPTION]... [TAG]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+      --config     print configuration, then exit
+  -q, --quiet, --silent
+                   do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+      --file=FILE[:TEMPLATE]
+                   instantiate the configuration file FILE
+      --header=FILE[:TEMPLATE]
+                   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Configuration commands:
+$config_commands
+
+Report bugs to the package provider."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
+ac_cs_version="\\
+zfs config.status 0.6.5.4
+configured by $0, generated by GNU Autoconf 2.69,
+  with options \\"\$ac_cs_config\\"
+
+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."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+MKDIR_P='$MKDIR_P'
+AWK='$AWK'
+test -n "\$AWK" || AWK=awk
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# The default lists apply if the user does not specify any file.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=?*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  --*=)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    $as_echo "$ac_cs_version"; exit ;;
+  --config | --confi | --conf | --con | --co | --c )
+    $as_echo "$ac_cs_config"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    '') as_fn_error $? "missing file argument" ;;
+    esac
+    as_fn_append CONFIG_FILES " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    case $ac_optarg in
+    *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    as_fn_append CONFIG_HEADERS " '$ac_optarg'"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    as_fn_error $? "ambiguous option: \`$1'
+Try \`$0 --help' for more information.";;
+  --help | --hel | -h )
+    $as_echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) as_fn_error $? "unrecognized option: \`$1'
+Try \`$0 --help' for more information." ;;
+
+  *) as_fn_append ac_config_targets " $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+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
+  shift
+  \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6
+  CONFIG_SHELL='$SHELL'
+  export CONFIG_SHELL
+  exec "\$@"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  $as_echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+#
+# INIT-COMMANDS
+#
+AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"
+
+
+# The HP-UX ksh and POSIX shell print the target directory to stdout
+# if CDPATH is set.
+(unset CDPATH) >/dev/null 2>&1 && unset CDPATH
+
+sed_quote_subst='$sed_quote_subst'
+double_quote_subst='$double_quote_subst'
+delay_variable_subst='$delay_variable_subst'
+macro_version='`$ECHO "$macro_version" | $SED "$delay_single_quote_subst"`'
+macro_revision='`$ECHO "$macro_revision" | $SED "$delay_single_quote_subst"`'
+enable_shared='`$ECHO "$enable_shared" | $SED "$delay_single_quote_subst"`'
+enable_static='`$ECHO "$enable_static" | $SED "$delay_single_quote_subst"`'
+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"`'
+build_alias='`$ECHO "$build_alias" | $SED "$delay_single_quote_subst"`'
+build='`$ECHO "$build" | $SED "$delay_single_quote_subst"`'
+build_os='`$ECHO "$build_os" | $SED "$delay_single_quote_subst"`'
+SED='`$ECHO "$SED" | $SED "$delay_single_quote_subst"`'
+Xsed='`$ECHO "$Xsed" | $SED "$delay_single_quote_subst"`'
+GREP='`$ECHO "$GREP" | $SED "$delay_single_quote_subst"`'
+EGREP='`$ECHO "$EGREP" | $SED "$delay_single_quote_subst"`'
+FGREP='`$ECHO "$FGREP" | $SED "$delay_single_quote_subst"`'
+LD='`$ECHO "$LD" | $SED "$delay_single_quote_subst"`'
+NM='`$ECHO "$NM" | $SED "$delay_single_quote_subst"`'
+LN_S='`$ECHO "$LN_S" | $SED "$delay_single_quote_subst"`'
+max_cmd_len='`$ECHO "$max_cmd_len" | $SED "$delay_single_quote_subst"`'
+ac_objext='`$ECHO "$ac_objext" | $SED "$delay_single_quote_subst"`'
+exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
+lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
+lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
+lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
+reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
+reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
+OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
+deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
+file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
+AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
+AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
+STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
+RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
+old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_postuninstall_cmds='`$ECHO "$old_postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_cmds='`$ECHO "$old_archive_cmds" | $SED "$delay_single_quote_subst"`'
+lock_old_archive_extraction='`$ECHO "$lock_old_archive_extraction" | $SED "$delay_single_quote_subst"`'
+CC='`$ECHO "$CC" | $SED "$delay_single_quote_subst"`'
+CFLAGS='`$ECHO "$CFLAGS" | $SED "$delay_single_quote_subst"`'
+compiler='`$ECHO "$compiler" | $SED "$delay_single_quote_subst"`'
+GCC='`$ECHO "$GCC" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
+objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
+MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
+lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
+need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
+DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
+NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
+LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
+OTOOL='`$ECHO "$OTOOL" | $SED "$delay_single_quote_subst"`'
+OTOOL64='`$ECHO "$OTOOL64" | $SED "$delay_single_quote_subst"`'
+libext='`$ECHO "$libext" | $SED "$delay_single_quote_subst"`'
+shrext_cmds='`$ECHO "$shrext_cmds" | $SED "$delay_single_quote_subst"`'
+extract_expsyms_cmds='`$ECHO "$extract_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds_need_lc='`$ECHO "$archive_cmds_need_lc" | $SED "$delay_single_quote_subst"`'
+enable_shared_with_static_runtimes='`$ECHO "$enable_shared_with_static_runtimes" | $SED "$delay_single_quote_subst"`'
+export_dynamic_flag_spec='`$ECHO "$export_dynamic_flag_spec" | $SED "$delay_single_quote_subst"`'
+whole_archive_flag_spec='`$ECHO "$whole_archive_flag_spec" | $SED "$delay_single_quote_subst"`'
+compiler_needs_object='`$ECHO "$compiler_needs_object" | $SED "$delay_single_quote_subst"`'
+old_archive_from_new_cmds='`$ECHO "$old_archive_from_new_cmds" | $SED "$delay_single_quote_subst"`'
+old_archive_from_expsyms_cmds='`$ECHO "$old_archive_from_expsyms_cmds" | $SED "$delay_single_quote_subst"`'
+archive_cmds='`$ECHO "$archive_cmds" | $SED "$delay_single_quote_subst"`'
+archive_expsym_cmds='`$ECHO "$archive_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+module_cmds='`$ECHO "$module_cmds" | $SED "$delay_single_quote_subst"`'
+module_expsym_cmds='`$ECHO "$module_expsym_cmds" | $SED "$delay_single_quote_subst"`'
+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_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"`'
+hardcode_minus_L='`$ECHO "$hardcode_minus_L" | $SED "$delay_single_quote_subst"`'
+hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_quote_subst"`'
+hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
+inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
+link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
+always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
+export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
+exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
+include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
+prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
+file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
+variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
+need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
+need_version='`$ECHO "$need_version" | $SED "$delay_single_quote_subst"`'
+version_type='`$ECHO "$version_type" | $SED "$delay_single_quote_subst"`'
+runpath_var='`$ECHO "$runpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_var='`$ECHO "$shlibpath_var" | $SED "$delay_single_quote_subst"`'
+shlibpath_overrides_runpath='`$ECHO "$shlibpath_overrides_runpath" | $SED "$delay_single_quote_subst"`'
+libname_spec='`$ECHO "$libname_spec" | $SED "$delay_single_quote_subst"`'
+library_names_spec='`$ECHO "$library_names_spec" | $SED "$delay_single_quote_subst"`'
+soname_spec='`$ECHO "$soname_spec" | $SED "$delay_single_quote_subst"`'
+install_override_mode='`$ECHO "$install_override_mode" | $SED "$delay_single_quote_subst"`'
+postinstall_cmds='`$ECHO "$postinstall_cmds" | $SED "$delay_single_quote_subst"`'
+postuninstall_cmds='`$ECHO "$postuninstall_cmds" | $SED "$delay_single_quote_subst"`'
+finish_cmds='`$ECHO "$finish_cmds" | $SED "$delay_single_quote_subst"`'
+finish_eval='`$ECHO "$finish_eval" | $SED "$delay_single_quote_subst"`'
+hardcode_into_libs='`$ECHO "$hardcode_into_libs" | $SED "$delay_single_quote_subst"`'
+sys_lib_search_path_spec='`$ECHO "$sys_lib_search_path_spec" | $SED "$delay_single_quote_subst"`'
+sys_lib_dlsearch_path_spec='`$ECHO "$sys_lib_dlsearch_path_spec" | $SED "$delay_single_quote_subst"`'
+hardcode_action='`$ECHO "$hardcode_action" | $SED "$delay_single_quote_subst"`'
+enable_dlopen='`$ECHO "$enable_dlopen" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self='`$ECHO "$enable_dlopen_self" | $SED "$delay_single_quote_subst"`'
+enable_dlopen_self_static='`$ECHO "$enable_dlopen_self_static" | $SED "$delay_single_quote_subst"`'
+old_striplib='`$ECHO "$old_striplib" | $SED "$delay_single_quote_subst"`'
+striplib='`$ECHO "$striplib" | $SED "$delay_single_quote_subst"`'
+
+LTCC='$LTCC'
+LTCFLAGS='$LTCFLAGS'
+compiler='$compiler_DEFAULT'
+
+# A function that is used when there is no print builtin or printf.
+func_fallback_echo ()
+{
+  eval 'cat <<_LTECHO_EOF
+\$1
+_LTECHO_EOF'
+}
+
+# Quote evaled strings.
+for var in SHELL \
+ECHO \
+PATH_SEPARATOR \
+SED \
+GREP \
+EGREP \
+FGREP \
+LD \
+NM \
+LN_S \
+lt_SP2NL \
+lt_NL2SP \
+reload_flag \
+OBJDUMP \
+deplibs_check_method \
+file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
+AR \
+AR_FLAGS \
+archiver_list_spec \
+STRIP \
+RANLIB \
+CC \
+CFLAGS \
+compiler \
+lt_cv_sys_global_symbol_pipe \
+lt_cv_sys_global_symbol_to_cdecl \
+lt_cv_sys_global_symbol_to_c_name_address \
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
+lt_prog_compiler_no_builtin_flag \
+lt_prog_compiler_pic \
+lt_prog_compiler_wl \
+lt_prog_compiler_static \
+lt_cv_prog_compiler_c_o \
+need_locks \
+MANIFEST_TOOL \
+DSYMUTIL \
+NMEDIT \
+LIPO \
+OTOOL \
+OTOOL64 \
+shrext_cmds \
+export_dynamic_flag_spec \
+whole_archive_flag_spec \
+compiler_needs_object \
+with_gnu_ld \
+allow_undefined_flag \
+no_undefined_flag \
+hardcode_libdir_flag_spec \
+hardcode_libdir_separator \
+exclude_expsyms \
+include_expsyms \
+file_list_spec \
+variables_saved_for_relink \
+libname_spec \
+library_names_spec \
+soname_spec \
+install_override_mode \
+finish_eval \
+old_striplib \
+striplib; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED \\"\\\$sed_quote_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+# Double-quote double-evaled strings.
+for var in reload_cmds \
+old_postinstall_cmds \
+old_postuninstall_cmds \
+old_archive_cmds \
+extract_expsyms_cmds \
+old_archive_from_new_cmds \
+old_archive_from_expsyms_cmds \
+archive_cmds \
+archive_expsym_cmds \
+module_cmds \
+module_expsym_cmds \
+export_symbols_cmds \
+prelink_cmds \
+postlink_cmds \
+postinstall_cmds \
+postuninstall_cmds \
+finish_cmds \
+sys_lib_search_path_spec \
+sys_lib_dlsearch_path_spec; do
+    case \`eval \\\\\$ECHO \\\\""\\\\\$\$var"\\\\"\` in
+    *[\\\\\\\`\\"\\\$]*)
+      eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"\\\$\$var\\" | \\\$SED -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\""
+      ;;
+    *)
+      eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\""
+      ;;
+    esac
+done
+
+ac_aux_dir='$ac_aux_dir'
+xsi_shell='$xsi_shell'
+lt_shell_append='$lt_shell_append'
+
+# See if we are running on zsh, and set the options which allow our
+# commands through without removal of \ escapes INIT.
+if test -n "\${ZSH_VERSION+set}" ; then
+   setopt NO_GLOB_SUBST
+fi
+
+
+    PACKAGE='$PACKAGE'
+    VERSION='$VERSION'
+    TIMESTAMP='$TIMESTAMP'
+    RM='$RM'
+    ofile='$ofile'
+
+
+
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "zfs_config.h") CONFIG_HEADERS="$CONFIG_HEADERS zfs_config.h" ;;
+    "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;;
+    "libtool") CONFIG_COMMANDS="$CONFIG_COMMANDS libtool" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "udev/Makefile") CONFIG_FILES="$CONFIG_FILES udev/Makefile" ;;
+    "udev/rules.d/Makefile") CONFIG_FILES="$CONFIG_FILES udev/rules.d/Makefile" ;;
+    "etc/Makefile") CONFIG_FILES="$CONFIG_FILES etc/Makefile" ;;
+    "etc/init.d/Makefile") CONFIG_FILES="$CONFIG_FILES etc/init.d/Makefile" ;;
+    "etc/zfs/Makefile") CONFIG_FILES="$CONFIG_FILES etc/zfs/Makefile" ;;
+    "etc/systemd/Makefile") CONFIG_FILES="$CONFIG_FILES etc/systemd/Makefile" ;;
+    "etc/systemd/system/Makefile") CONFIG_FILES="$CONFIG_FILES etc/systemd/system/Makefile" ;;
+    "etc/modules-load.d/Makefile") CONFIG_FILES="$CONFIG_FILES etc/modules-load.d/Makefile" ;;
+    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
+    "man/man1/Makefile") CONFIG_FILES="$CONFIG_FILES man/man1/Makefile" ;;
+    "man/man5/Makefile") CONFIG_FILES="$CONFIG_FILES man/man5/Makefile" ;;
+    "man/man8/Makefile") CONFIG_FILES="$CONFIG_FILES man/man8/Makefile" ;;
+    "lib/Makefile") CONFIG_FILES="$CONFIG_FILES lib/Makefile" ;;
+    "lib/libspl/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/Makefile" ;;
+    "lib/libspl/asm-generic/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/asm-generic/Makefile" ;;
+    "lib/libspl/asm-i386/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/asm-i386/Makefile" ;;
+    "lib/libspl/asm-x86_64/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/asm-x86_64/Makefile" ;;
+    "lib/libspl/include/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/Makefile" ;;
+    "lib/libspl/include/ia32/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/ia32/Makefile" ;;
+    "lib/libspl/include/ia32/sys/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/ia32/sys/Makefile" ;;
+    "lib/libspl/include/rpc/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/rpc/Makefile" ;;
+    "lib/libspl/include/sys/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/sys/Makefile" ;;
+    "lib/libspl/include/sys/sysevent/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/sys/sysevent/Makefile" ;;
+    "lib/libspl/include/sys/dktp/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/sys/dktp/Makefile" ;;
+    "lib/libspl/include/util/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libspl/include/util/Makefile" ;;
+    "lib/libavl/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libavl/Makefile" ;;
+    "lib/libefi/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libefi/Makefile" ;;
+    "lib/libnvpair/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libnvpair/Makefile" ;;
+    "lib/libunicode/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libunicode/Makefile" ;;
+    "lib/libuutil/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libuutil/Makefile" ;;
+    "lib/libzpool/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libzpool/Makefile" ;;
+    "lib/libzfs/libzfs.pc") CONFIG_FILES="$CONFIG_FILES lib/libzfs/libzfs.pc" ;;
+    "lib/libzfs/libzfs_core.pc") CONFIG_FILES="$CONFIG_FILES lib/libzfs/libzfs_core.pc" ;;
+    "lib/libzfs/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libzfs/Makefile" ;;
+    "lib/libzfs_core/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libzfs_core/Makefile" ;;
+    "lib/libshare/Makefile") CONFIG_FILES="$CONFIG_FILES lib/libshare/Makefile" ;;
+    "cmd/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/Makefile" ;;
+    "cmd/zdb/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zdb/Makefile" ;;
+    "cmd/zhack/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zhack/Makefile" ;;
+    "cmd/zfs/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zfs/Makefile" ;;
+    "cmd/zinject/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zinject/Makefile" ;;
+    "cmd/zpool/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zpool/Makefile" ;;
+    "cmd/zstreamdump/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zstreamdump/Makefile" ;;
+    "cmd/ztest/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/ztest/Makefile" ;;
+    "cmd/zpios/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zpios/Makefile" ;;
+    "cmd/mount_zfs/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/mount_zfs/Makefile" ;;
+    "cmd/fsck_zfs/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/fsck_zfs/Makefile" ;;
+    "cmd/zvol_id/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zvol_id/Makefile" ;;
+    "cmd/vdev_id/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/vdev_id/Makefile" ;;
+    "cmd/arcstat/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/arcstat/Makefile" ;;
+    "cmd/dbufstat/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/dbufstat/Makefile" ;;
+    "cmd/arc_summary/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/arc_summary/Makefile" ;;
+    "cmd/zed/Makefile") CONFIG_FILES="$CONFIG_FILES cmd/zed/Makefile" ;;
+    "contrib/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/Makefile" ;;
+    "contrib/bash_completion.d/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/bash_completion.d/Makefile" ;;
+    "contrib/dracut/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/dracut/Makefile" ;;
+    "contrib/dracut/90zfs/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/dracut/90zfs/Makefile" ;;
+    "contrib/initramfs/Makefile") CONFIG_FILES="$CONFIG_FILES contrib/initramfs/Makefile" ;;
+    "module/Makefile") CONFIG_FILES="$CONFIG_FILES module/Makefile" ;;
+    "module/avl/Makefile") CONFIG_FILES="$CONFIG_FILES module/avl/Makefile" ;;
+    "module/nvpair/Makefile") CONFIG_FILES="$CONFIG_FILES module/nvpair/Makefile" ;;
+    "module/unicode/Makefile") CONFIG_FILES="$CONFIG_FILES module/unicode/Makefile" ;;
+    "module/zcommon/Makefile") CONFIG_FILES="$CONFIG_FILES module/zcommon/Makefile" ;;
+    "module/zfs/Makefile") CONFIG_FILES="$CONFIG_FILES module/zfs/Makefile" ;;
+    "module/zpios/Makefile") CONFIG_FILES="$CONFIG_FILES module/zpios/Makefile" ;;
+    "include/Makefile") CONFIG_FILES="$CONFIG_FILES include/Makefile" ;;
+    "include/linux/Makefile") CONFIG_FILES="$CONFIG_FILES include/linux/Makefile" ;;
+    "include/sys/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/Makefile" ;;
+    "include/sys/fs/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/fs/Makefile" ;;
+    "include/sys/fm/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/fm/Makefile" ;;
+    "include/sys/fm/fs/Makefile") CONFIG_FILES="$CONFIG_FILES include/sys/fm/fs/Makefile" ;;
+    "scripts/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/Makefile" ;;
+    "scripts/zpios-profile/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/zpios-profile/Makefile" ;;
+    "scripts/zpios-test/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/zpios-test/Makefile" ;;
+    "scripts/zpool-config/Makefile") CONFIG_FILES="$CONFIG_FILES scripts/zpool-config/Makefile" ;;
+    "scripts/common.sh") CONFIG_FILES="$CONFIG_FILES scripts/common.sh" ;;
+    "rpm/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/Makefile" ;;
+    "rpm/redhat/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/redhat/Makefile" ;;
+    "rpm/redhat/zfs.spec") CONFIG_FILES="$CONFIG_FILES rpm/redhat/zfs.spec" ;;
+    "rpm/redhat/zfs-kmod.spec") CONFIG_FILES="$CONFIG_FILES rpm/redhat/zfs-kmod.spec" ;;
+    "rpm/redhat/zfs-dkms.spec") CONFIG_FILES="$CONFIG_FILES rpm/redhat/zfs-dkms.spec" ;;
+    "rpm/generic/Makefile") CONFIG_FILES="$CONFIG_FILES rpm/generic/Makefile" ;;
+    "rpm/generic/zfs.spec") CONFIG_FILES="$CONFIG_FILES rpm/generic/zfs.spec" ;;
+    "rpm/generic/zfs-kmod.spec") CONFIG_FILES="$CONFIG_FILES rpm/generic/zfs-kmod.spec" ;;
+    "rpm/generic/zfs-dkms.spec") CONFIG_FILES="$CONFIG_FILES rpm/generic/zfs-dkms.spec" ;;
+    "zfs-script-config.sh") CONFIG_FILES="$CONFIG_FILES zfs-script-config.sh" ;;
+    "zfs.release") CONFIG_FILES="$CONFIG_FILES zfs.release" ;;
+
+  *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+  test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp= ac_tmp=
+  trap 'exit_status=$?
+  : "${ac_tmp:=$tmp}"
+  { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status
+' 0
+  trap 'as_fn_exit 1' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5
+ac_tmp=$tmp
+
+# Set up the scripts for CONFIG_FILES section.
+# No need to generate them if there are no CONFIG_FILES.
+# This happens for instance with `./config.status config.h'.
+if test -n "$CONFIG_FILES"; then
+
+
+ac_cr=`echo X | tr X '\015'`
+# On cygwin, bash can eat \r inside `` if the user requested igncr.
+# But we know of no other shell where ac_cr would be empty at this
+# point, so we can use a bashism as a fallback.
+if test "x$ac_cr" = x; then
+  eval ac_cr=\$\'\\r\'
+fi
+ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' </dev/null 2>/dev/null`
+if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then
+  ac_cs_awk_cr='\\r'
+else
+  ac_cs_awk_cr=$ac_cr
+fi
+
+echo 'BEGIN {' >"$ac_tmp/subs1.awk" &&
+_ACEOF
+
+
+{
+  echo "cat >conf$$subs.awk <<_ACEOF" &&
+  echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' &&
+  echo "_ACEOF"
+} >conf$$subs.sh ||
+  as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'`
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  . ./conf$$subs.sh ||
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+
+  ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X`
+  if test $ac_delim_n = $ac_delim_num; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+rm -f conf$$subs.sh
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK &&
+_ACEOF
+sed -n '
+h
+s/^/S["/; s/!.*/"]=/
+p
+g
+s/^[^!]*!//
+:repl
+t repl
+s/'"$ac_delim"'$//
+t delim
+:nl
+h
+s/\(.\{148\}\)..*/\1/
+t more1
+s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/
+p
+n
+b repl
+:more1
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t nl
+:delim
+h
+s/\(.\{148\}\)..*/\1/
+t more2
+s/["\\]/\\&/g; s/^/"/; s/$/"/
+p
+b
+:more2
+s/["\\]/\\&/g; s/^/"/; s/$/"\\/
+p
+g
+s/.\{148\}//
+t delim
+' <conf$$subs.awk | sed '
+/^[^""]/{
+  N
+  s/\n//
+}
+' >>$CONFIG_STATUS || ac_write_fail=1
+rm -f conf$$subs.awk
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+_ACAWK
+cat >>"\$ac_tmp/subs1.awk" <<_ACAWK &&
+  for (key in S) S_is_set[key] = 1
+  FS = "\a"
+
+}
+{
+  line = $ 0
+  nfields = split(line, field, "@")
+  substed = 0
+  len = length(field[1])
+  for (i = 2; i < nfields; i++) {
+    key = field[i]
+    keylen = length(key)
+    if (S_is_set[key]) {
+      value = S[key]
+      line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3)
+      len += length(value) + length(field[++i])
+      substed = 1
+    } else
+      len += 1 + keylen
+  }
+
+  print line
+}
+
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then
+  sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g"
+else
+  cat
+fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \
+  || as_fn_error $? "could not setup config files machinery" "$LINENO" 5
+_ACEOF
+
+# VPATH may cause trouble with some makes, so we remove sole $(srcdir),
+# ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[         ]*VPATH[        ]*=[    ]*/{
+h
+s///
+s/^/:/
+s/[     ]*$/:/
+s/:\$(srcdir):/:/g
+s/:\${srcdir}:/:/g
+s/:@srcdir@:/:/g
+s/^:*//
+s/:*$//
+x
+s/\(=[  ]*\).*/\1/
+G
+s/\n//
+s/^[^=]*=[      ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+fi # test -n "$CONFIG_FILES"
+
+# Set up the scripts for CONFIG_HEADERS section.
+# No need to generate them if there are no CONFIG_HEADERS.
+# This happens for instance with `./config.status Makefile'.
+if test -n "$CONFIG_HEADERS"; then
+cat >"$ac_tmp/defines.awk" <<\_ACAWK ||
+BEGIN {
+_ACEOF
+
+# Transform confdefs.h into an awk script `defines.awk', embedded as
+# here-document in config.status, that substitutes the proper values into
+# config.h.in to produce config.h.
+
+# Create a delimiter string that does not exist in confdefs.h, to ease
+# handling of long lines.
+ac_delim='%!_!# '
+for ac_last_try in false false :; do
+  ac_tt=`sed -n "/$ac_delim/p" confdefs.h`
+  if test -z "$ac_tt"; then
+    break
+  elif $ac_last_try; then
+    as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+# For the awk script, D is an array of macro values keyed by name,
+# likewise P contains macro parameters if any.  Preserve backslash
+# newline sequences.
+
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+sed -n '
+s/.\{148\}/&'"$ac_delim"'/g
+t rset
+:rset
+s/^[    ]*#[    ]*define[       ][      ]*/ /
+t def
+d
+:def
+s/\\$//
+t bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3"/p
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2"/p
+d
+:bsnl
+s/["\\]/\\&/g
+s/^ \('"$ac_word_re"'\)\(([^()]*)\)[    ]*\(.*\)/P["\1"]="\2"\
+D["\1"]=" \3\\\\\\n"\\/p
+t cont
+s/^ \('"$ac_word_re"'\)[        ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p
+t cont
+d
+:cont
+n
+s/.\{148\}/&'"$ac_delim"'/g
+t clear
+:clear
+s/\\$//
+t bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/"/p
+d
+:bsnlc
+s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p
+b cont
+' <confdefs.h | sed '
+s/'"$ac_delim"'/"\\\
+"/g' >>$CONFIG_STATUS || ac_write_fail=1
+
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  for (key in D) D_is_set[key] = 1
+  FS = "\a"
+}
+/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ {
+  line = \$ 0
+  split(line, arg, " ")
+  if (arg[1] == "#") {
+    defundef = arg[2]
+    mac1 = arg[3]
+  } else {
+    defundef = substr(arg[1], 2)
+    mac1 = arg[2]
+  }
+  split(mac1, mac2, "(") #)
+  macro = mac2[1]
+  prefix = substr(line, 1, index(line, defundef) - 1)
+  if (D_is_set[macro]) {
+    # Preserve the white space surrounding the "#".
+    print prefix "define", macro P[macro] D[macro]
+    next
+  } else {
+    # Replace #undef with comments.  This is necessary, for example,
+    # in the case of _POSIX_SOURCE, which is predefined and required
+    # on some systems where configure will not decide to define it.
+    if (defundef == "undef") {
+      print "/*", prefix defundef, macro, "*/"
+      next
+    }
+  }
+}
+{ print }
+_ACAWK
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+  as_fn_error $? "could not setup config headers machinery" "$LINENO" 5
+fi # test -n "$CONFIG_HEADERS"
+
+
+eval set X "  :F $CONFIG_FILES  :H $CONFIG_HEADERS    :C $CONFIG_COMMANDS"
+shift
+for ac_tag
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$ac_tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+        # (if the path is not absolute).  The absolute path cannot be DOS-style,
+        # because $ac_f cannot contain `:'.
+        test -f "$ac_f" ||
+          case $ac_f in
+          [\\/$]*) false;;
+          *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+          esac ||
+          as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;;
+      esac
+      case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac
+      as_fn_append ac_file_inputs " '$ac_f'"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input='Generated from '`
+         $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g'
+       `' by configure.'
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5
+$as_echo "$as_me: creating $ac_file" >&6;}
+    fi
+    # Neutralize special characters interpreted by sed in replacement strings.
+    case $configure_input in #(
+    *\&* | *\|* | *\\* )
+       ac_sed_conf_input=`$as_echo "$configure_input" |
+       sed 's/[\\\\&|]/\\\\&/g'`;; #(
+    *) ac_sed_conf_input=$configure_input;;
+    esac
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$ac_tmp/stdin" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$ac_file" : 'X\(//\)[^/]' \| \
+        X"$ac_file" : 'X\(//\)$' \| \
+        X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+  as_dir="$ac_dir"; as_fn_mkdir_p
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+  ac_MKDIR_P=$MKDIR_P
+  case $MKDIR_P in
+  [\\/$]* | ?:[\\/]* ) ;;
+  */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+ac_sed_dataroot='
+/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p'
+case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+  s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
+ac_sed_extra="$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s|@configure_input@|$ac_sed_conf_input|;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@top_build_prefix@&$ac_top_build_prefix&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+s&@MKDIR_P@&$ac_MKDIR_P&;t t
+$ac_datarootdir_hack
+"
+eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \
+  >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[         ]*datarootdir[  ]*:*=/p' \
+      "$ac_tmp/out"`; test -z "$ac_out"; } &&
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&5
+$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined" >&2;}
+
+  rm -f "$ac_tmp/stdin"
+  case $ac_file in
+  -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";;
+  *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";;
+  esac \
+  || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+  if test x"$ac_file" != x-; then
+    {
+      $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs"
+    } >"$ac_tmp/config.h" \
+      || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then
+      { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5
+$as_echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f "$ac_file"
+      mv "$ac_tmp/config.h" "$ac_file" \
+       || as_fn_error $? "could not create $ac_file" "$LINENO" 5
+    fi
+  else
+    $as_echo "/* $configure_input  */" \
+      && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \
+      || as_fn_error $? "could not create -" "$LINENO" 5
+  fi
+# Compute "$ac_file"'s index in $config_headers.
+_am_arg="$ac_file"
+_am_stamp_count=1
+for _am_header in $config_headers :; do
+  case $_am_header in
+    $_am_arg | $_am_arg:* )
+      break ;;
+    * )
+      _am_stamp_count=`expr $_am_stamp_count + 1` ;;
+  esac
+done
+echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" ||
+$as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$_am_arg" : 'X\(//\)[^/]' \| \
+        X"$_am_arg" : 'X\(//\)$' \| \
+        X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$_am_arg" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`/stamp-h$_am_stamp_count
+ ;;
+
+  :C)  { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
+$as_echo "$as_me: executing $ac_file commands" >&6;}
+ ;;
+  esac
+
+
+  case $ac_file$ac_mode in
+    "zfs_config.h":H)
+       (mv zfs_config.h zfs_config.h.tmp &&
+       awk -f ${ac_srcdir}/config/config.awk zfs_config.h.tmp >zfs_config.h &&
+       rm zfs_config.h.tmp) || exit 1 ;;
+    "depfiles":C) test x"$AMDEP_TRUE" != x"" || {
+  # Older Autoconf quotes --file arguments for eval, but not when files
+  # are listed without --file.  Let's play safe and only enable the eval
+  # if we detect the quoting.
+  case $CONFIG_FILES in
+  *\'*) eval set x "$CONFIG_FILES" ;;
+  *)   set x $CONFIG_FILES ;;
+  esac
+  shift
+  for mf
+  do
+    # Strip MF so we end up with the name of the file.
+    mf=`echo "$mf" | sed -e 's/:.*$//'`
+    # Check whether this is an Automake generated Makefile or not.
+    # We used to match only the files named 'Makefile.in', but
+    # some people rename them; so instead we look at the file content.
+    # Grep'ing the first line is not enough: some people post-process
+    # each Makefile.in and add a new line on top of each file to say so.
+    # Grep'ing the whole file is not good either: AIX grep has a line
+    # limit of 2048, but all sed's we know have understand at least 4000.
+    if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
+      dirpart=`$as_dirname -- "$mf" ||
+$as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$mf" : 'X\(//\)[^/]' \| \
+        X"$mf" : 'X\(//\)$' \| \
+        X"$mf" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$mf" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+    else
+      continue
+    fi
+    # Extract the definition of DEPDIR, am__include, and am__quote
+    # from the Makefile without running 'make'.
+    DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
+    test -z "$DEPDIR" && continue
+    am__include=`sed -n 's/^am__include = //p' < "$mf"`
+    test -z "$am__include" && continue
+    am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
+    # Find all dependency output files, they are included files with
+    # $(DEPDIR) in their names.  We invoke sed twice because it is the
+    # simplest approach to changing $(DEPDIR) to its actual value in the
+    # expansion.
+    for file in `sed -n "
+      s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
+        sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
+      # Make sure the directory exists.
+      test -f "$dirpart/$file" && continue
+      fdir=`$as_dirname -- "$file" ||
+$as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+        X"$file" : 'X\(//\)[^/]' \| \
+        X"$file" : 'X\(//\)$' \| \
+        X"$file" : 'X\(/\)' \| . 2>/dev/null ||
+$as_echo X"$file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)[^/].*/{
+           s//\1/
+           q
+         }
+         /^X\(\/\/\)$/{
+           s//\1/
+           q
+         }
+         /^X\(\/\).*/{
+           s//\1/
+           q
+         }
+         s/.*/./; q'`
+      as_dir=$dirpart/$fdir; as_fn_mkdir_p
+      # echo "creating $dirpart/$file"
+      echo '# dummy' > "$dirpart/$file"
+    done
+  done
+}
+ ;;
+    "libtool":C)
+
+    # See if we are running on zsh, and set the options which allow our
+    # commands through without removal of \ escapes.
+    if test -n "${ZSH_VERSION+set}" ; then
+      setopt NO_GLOB_SUBST
+    fi
+
+    cfgfile="${ofile}T"
+    trap "$RM \"$cfgfile\"; exit 1" 1 2 15
+    $RM "$cfgfile"
+
+    cat <<_LT_EOF >> "$cfgfile"
+#! $SHELL
+
+# `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services.
+# Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION
+# Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
+# 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, 2011 Free Software
+#                 Foundation, Inc.
+#   Written by Gordon Matzigkeit, 1996
+#
+#   This file is part of GNU Libtool.
+#
+# GNU Libtool is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# As a special exception to the GNU General Public License,
+# if you distribute this file as part of a program or library that
+# is built using GNU Libtool, you may include this file under the
+# same distribution terms that you use for the rest of that program.
+#
+# GNU Libtool is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with GNU Libtool; see the file COPYING.  If not, a copy
+# can be downloaded from http://www.gnu.org/licenses/gpl.html, or
+# obtained by writing to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+
+# The names of the tagged configurations supported by this script.
+available_tags=""
+
+# ### BEGIN LIBTOOL CONFIG
+
+# Which release of libtool.m4 was used?
+macro_version=$macro_version
+macro_revision=$macro_revision
+
+# Whether or not to build shared libraries.
+build_libtool_libs=$enable_shared
+
+# Whether or not to build static libraries.
+build_old_libs=$enable_static
+
+# What type of objects to build.
+pic_mode=$pic_mode
+
+# Whether or not to optimize for fast installation.
+fast_install=$enable_fast_install
+
+# Shell to use when invoking shell scripts.
+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
+host_os=$host_os
+
+# The build system.
+build_alias=$build_alias
+build=$build
+build_os=$build_os
+
+# A sed program that does not truncate output.
+SED=$lt_SED
+
+# Sed that helps us avoid accidentally triggering echo(1) options like -n.
+Xsed="\$SED -e 1s/^X//"
+
+# A grep program that handles long lines.
+GREP=$lt_GREP
+
+# An ERE matcher.
+EGREP=$lt_EGREP
+
+# A literal string matcher.
+FGREP=$lt_FGREP
+
+# A BSD- or MS-compatible name lister.
+NM=$lt_NM
+
+# Whether we need soft or hard links.
+LN_S=$lt_LN_S
+
+# What is the maximum length of a command?
+max_cmd_len=$max_cmd_len
+
+# Object file suffix (normally "o").
+objext=$ac_objext
+
+# Executable file suffix (normally "").
+exeext=$exeext
+
+# whether the shell understands "unset".
+lt_unset=$lt_unset
+
+# turn spaces into newlines.
+SP2NL=$lt_lt_SP2NL
+
+# turn newlines into spaces.
+NL2SP=$lt_lt_NL2SP
+
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
+# An object symbol dumper.
+OBJDUMP=$lt_OBJDUMP
+
+# Method to check whether dependent libraries are shared objects.
+deplibs_check_method=$lt_deplibs_check_method
+
+# Command to use when deplibs_check_method = "file_magic".
+file_magic_cmd=$lt_file_magic_cmd
+
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
+# The archiver.
+AR=$lt_AR
+
+# Flags to create an archive.
+AR_FLAGS=$lt_AR_FLAGS
+
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
+# A symbol stripping program.
+STRIP=$lt_STRIP
+
+# Commands used to install an old-style archive.
+RANLIB=$lt_RANLIB
+old_postinstall_cmds=$lt_old_postinstall_cmds
+old_postuninstall_cmds=$lt_old_postuninstall_cmds
+
+# Whether to use a lock for old archive extraction.
+lock_old_archive_extraction=$lock_old_archive_extraction
+
+# A C compiler.
+LTCC=$lt_CC
+
+# LTCC compiler flags.
+LTCFLAGS=$lt_CFLAGS
+
+# Take the output of nm and produce a listing of raw symbols and C names.
+global_symbol_pipe=$lt_lt_cv_sys_global_symbol_pipe
+
+# Transform the output of nm in a proper C declaration.
+global_symbol_to_cdecl=$lt_lt_cv_sys_global_symbol_to_cdecl
+
+# Transform the output of nm in a C name address pair.
+global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
+
+# Transform the output of nm in a C name address pair when lib prefix is needed.
+global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
+# The name of the directory that contains temporary libtool files.
+objdir=$objdir
+
+# Used to examine libraries when file_magic_cmd begins with "file".
+MAGIC_CMD=$MAGIC_CMD
+
+# Must we lock files when doing compilation?
+need_locks=$lt_need_locks
+
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
+# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
+DSYMUTIL=$lt_DSYMUTIL
+
+# Tool to change global to local symbols on Mac OS X.
+NMEDIT=$lt_NMEDIT
+
+# Tool to manipulate fat objects and archives on Mac OS X.
+LIPO=$lt_LIPO
+
+# ldd/readelf like tool for Mach-O binaries on Mac OS X.
+OTOOL=$lt_OTOOL
+
+# ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4.
+OTOOL64=$lt_OTOOL64
+
+# Old archive suffix (normally "a").
+libext=$libext
+
+# Shared library suffix (normally ".so").
+shrext_cmds=$lt_shrext_cmds
+
+# The commands to extract the exported symbol list from a shared archive.
+extract_expsyms_cmds=$lt_extract_expsyms_cmds
+
+# Variables whose values should be saved in libtool wrapper scripts and
+# restored at link time.
+variables_saved_for_relink=$lt_variables_saved_for_relink
+
+# Do we need the "lib" prefix for modules?
+need_lib_prefix=$need_lib_prefix
+
+# Do we need a version for libraries?
+need_version=$need_version
+
+# Library versioning type.
+version_type=$version_type
+
+# Shared library runtime path variable.
+runpath_var=$runpath_var
+
+# Shared library path variable.
+shlibpath_var=$shlibpath_var
+
+# Is shlibpath searched before the hard-coded library search path?
+shlibpath_overrides_runpath=$shlibpath_overrides_runpath
+
+# Format of library name prefix.
+libname_spec=$lt_libname_spec
+
+# List of archive names.  First name is the real one, the rest are links.
+# The last name is the one that the linker finds with -lNAME
+library_names_spec=$lt_library_names_spec
+
+# The coded name of the library, if different from the real name.
+soname_spec=$lt_soname_spec
+
+# Permission mode override for installation of shared libraries.
+install_override_mode=$lt_install_override_mode
+
+# Command to use after installation of a shared archive.
+postinstall_cmds=$lt_postinstall_cmds
+
+# Command to use after uninstallation of a shared archive.
+postuninstall_cmds=$lt_postuninstall_cmds
+
+# Commands used to finish a libtool library installation in a directory.
+finish_cmds=$lt_finish_cmds
+
+# As "finish_cmds", except a single script fragment to be evaled but
+# not shown.
+finish_eval=$lt_finish_eval
+
+# Whether we should hardcode library paths into libraries.
+hardcode_into_libs=$hardcode_into_libs
+
+# Compile-time system search path for libraries.
+sys_lib_search_path_spec=$lt_sys_lib_search_path_spec
+
+# Run-time system search path for libraries.
+sys_lib_dlsearch_path_spec=$lt_sys_lib_dlsearch_path_spec
+
+# Whether dlopen is supported.
+dlopen_support=$enable_dlopen
+
+# Whether dlopen of programs is supported.
+dlopen_self=$enable_dlopen_self
+
+# Whether dlopen of statically linked programs is supported.
+dlopen_self_static=$enable_dlopen_self_static
+
+# Commands to strip libraries.
+old_striplib=$lt_old_striplib
+striplib=$lt_striplib
+
+
+# The linker used to build libraries.
+LD=$lt_LD
+
+# How to create reloadable object files.
+reload_flag=$lt_reload_flag
+reload_cmds=$lt_reload_cmds
+
+# Commands used to build an old-style archive.
+old_archive_cmds=$lt_old_archive_cmds
+
+# A language specific compiler.
+CC=$lt_compiler
+
+# Is the compiler the GNU compiler?
+with_gcc=$GCC
+
+# Compiler flag to turn off builtin functions.
+no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
+
+# Additional compiler flags for building library objects.
+pic_flag=$lt_lt_prog_compiler_pic
+
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
+# Compiler flag to prevent dynamic linking.
+link_static_flag=$lt_lt_prog_compiler_static
+
+# Does compiler simultaneously support -c and -o options?
+compiler_c_o=$lt_lt_cv_prog_compiler_c_o
+
+# Whether or not to add -lc for building shared libraries.
+build_libtool_need_lc=$archive_cmds_need_lc
+
+# Whether or not to disallow shared libs when runtime libs are static.
+allow_libtool_libs_with_static_runtimes=$enable_shared_with_static_runtimes
+
+# Compiler flag to allow reflexive dlopens.
+export_dynamic_flag_spec=$lt_export_dynamic_flag_spec
+
+# Compiler flag to generate shared objects directly from archives.
+whole_archive_flag_spec=$lt_whole_archive_flag_spec
+
+# Whether the compiler copes with passing no objects directly.
+compiler_needs_object=$lt_compiler_needs_object
+
+# Create an old-style archive from a shared archive.
+old_archive_from_new_cmds=$lt_old_archive_from_new_cmds
+
+# Create a temporary old-style archive to link instead of a shared archive.
+old_archive_from_expsyms_cmds=$lt_old_archive_from_expsyms_cmds
+
+# Commands used to build a shared archive.
+archive_cmds=$lt_archive_cmds
+archive_expsym_cmds=$lt_archive_expsym_cmds
+
+# Commands used to build a loadable module if different from building
+# a shared archive.
+module_cmds=$lt_module_cmds
+module_expsym_cmds=$lt_module_expsym_cmds
+
+# Whether we are building with GNU ld or not.
+with_gnu_ld=$lt_with_gnu_ld
+
+# Flag that allows shared libraries with undefined symbols to be built.
+allow_undefined_flag=$lt_allow_undefined_flag
+
+# Flag that enforces no undefined symbols.
+no_undefined_flag=$lt_no_undefined_flag
+
+# Flag to hardcode \$libdir into a binary during linking.
+# This must work even if \$libdir does not exist
+hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
+
+# Whether we need a single "-rpath" flag with a separated argument.
+hardcode_libdir_separator=$lt_hardcode_libdir_separator
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary.
+hardcode_direct=$hardcode_direct
+
+# Set to "yes" if using DIR/libNAME\${shared_ext} during linking hardcodes
+# DIR into the resulting binary and the resulting library dependency is
+# "absolute",i.e impossible to change by setting \${shlibpath_var} if the
+# library is relocated.
+hardcode_direct_absolute=$hardcode_direct_absolute
+
+# Set to "yes" if using the -LDIR flag during linking hardcodes DIR
+# into the resulting binary.
+hardcode_minus_L=$hardcode_minus_L
+
+# Set to "yes" if using SHLIBPATH_VAR=DIR during linking hardcodes DIR
+# into the resulting binary.
+hardcode_shlibpath_var=$hardcode_shlibpath_var
+
+# Set to "yes" if building a shared library automatically hardcodes DIR
+# into the library and all subsequent libraries and executables linked
+# against it.
+hardcode_automatic=$hardcode_automatic
+
+# Set to yes if linker adds runtime paths of dependent libraries
+# to runtime path list.
+inherit_rpath=$inherit_rpath
+
+# Whether libtool must link a program against all its dependency libraries.
+link_all_deplibs=$link_all_deplibs
+
+# Set to "yes" if exported symbols are required.
+always_export_symbols=$always_export_symbols
+
+# The commands to list exported symbols.
+export_symbols_cmds=$lt_export_symbols_cmds
+
+# Symbols that should not be listed in the preloaded symbols.
+exclude_expsyms=$lt_exclude_expsyms
+
+# Symbols that must always be exported.
+include_expsyms=$lt_include_expsyms
+
+# Commands necessary for linking programs (against libraries) with templates.
+prelink_cmds=$lt_prelink_cmds
+
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
+# Specify filename containing input files.
+file_list_spec=$lt_file_list_spec
+
+# How to hardcode a shared library path into an executable.
+hardcode_action=$hardcode_action
+
+# ### END LIBTOOL CONFIG
+
+_LT_EOF
+
+  case $host_os in
+  aix3*)
+    cat <<\_LT_EOF >> "$cfgfile"
+# AIX sometimes has problems with the GCC collect2 program.  For some
+# reason, if we set the COLLECT_NAMES environment variable, the problems
+# vanish in a puff of smoke.
+if test "X${COLLECT_NAMES+set}" != Xset; then
+  COLLECT_NAMES=
+  export COLLECT_NAMES
+fi
+_LT_EOF
+    ;;
+  esac
+
+
+ltmain="$ac_aux_dir/ltmain.sh"
+
+
+  # We use sed instead of cat because bash on DJGPP gets confused if
+  # if finds mixed CR/LF and LF-only lines.  Since sed operates in
+  # text mode, it properly converts lines to CR/LF.  This bash problem
+  # is reportedly fixed, but why not run on old versions too?
+  sed '$q' "$ltmain" >> "$cfgfile" \
+     || (rm -f "$cfgfile"; exit 1)
+
+  if test x"$xsi_shell" = xyes; then
+  sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\    case ${1} in\
+\      */*) func_dirname_result="${1%/*}${2}" ;;\
+\      *  ) func_dirname_result="${3}" ;;\
+\    esac\
+\    func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\    # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\    # positional parameters, so assign one to ordinary parameter first.\
+\    func_stripname_result=${3}\
+\    func_stripname_result=${func_stripname_result#"${1}"}\
+\    func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\    func_split_long_opt_name=${1%%=*}\
+\    func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\    func_split_short_opt_arg=${1#??}\
+\    func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\    case ${1} in\
+\      *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\      *)    func_lo2o_result=${1} ;;\
+\    esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+    func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+    func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+    func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+  sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+    eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\    func_quote_for_eval "${2}"\
+\    eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+  && mv -f "$cfgfile.tmp" "$cfgfile" \
+    || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+  # Save a `func_append' function call where possible by direct use of '+='
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+else
+  # Save a `func_append' function call even when '+=' is not available
+  sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+    && mv -f "$cfgfile.tmp" "$cfgfile" \
+      || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+  test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+   mv -f "$cfgfile" "$ofile" ||
+    (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
+  chmod +x "$ofile"
+
+ ;;
+
+  esac
+done # for ac_tag
+
+
+as_fn_exit 0
+_ACEOF
+ac_clean_files=$ac_clean_files_save
+
+test $ac_write_fail = 0 ||
+  as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || as_fn_exit 1
+fi
+if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5
+$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
+fi
+
diff --git a/zfs/contrib/Makefile.in b/zfs/contrib/Makefile.in
new file mode 100644 (file)
index 0000000..a07a353
--- /dev/null
@@ -0,0 +1,778 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = contrib
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+SUBDIRS = bash_completion.d dracut initramfs
+DIST_SUBDIRS = bash_completion.d dracut initramfs
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu contrib/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/contrib/bash_completion.d/Makefile.in b/zfs/contrib/bash_completion.d/Makefile.in
new file mode 100644 (file)
index 0000000..814f9aa
--- /dev/null
@@ -0,0 +1,602 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = contrib/bash_completion.d
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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
+DATA = $(noinst_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+bashcompletiondir = $(sysconfdir)/bash_completion.d
+noinst_DATA = zfs
+EXTRA_DIST = $(noinst_DATA)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/bash_completion.d/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu contrib/bash_completion.d/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(DATA)
+installdirs:
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/contrib/dracut/90zfs/.gitignore b/zfs/contrib/dracut/90zfs/.gitignore
deleted file mode 100644 (file)
index 9502be9..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-export-zfs.sh
-module-setup.sh
-mount-zfs.sh
-parse-zfs.sh
-zfs-lib.sh
diff --git a/zfs/contrib/dracut/90zfs/Makefile.in b/zfs/contrib/dracut/90zfs/Makefile.in
new file mode 100644 (file)
index 0000000..a1f6d5c
--- /dev/null
@@ -0,0 +1,692 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = contrib/dracut/90zfs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(pkgdracutdir)"
+SCRIPTS = $(pkgdracut_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 = 
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+pkgdracutdir = $(dracutdir)/modules.d/90zfs
+pkgdracut_SCRIPTS = \
+       export-zfs.sh \
+       module-setup.sh \
+       mount-zfs.sh \
+       parse-zfs.sh \
+       zfs-lib.sh
+
+EXTRA_DIST = \
+       $(top_srcdir)/contrib/dracut/90zfs/export-zfs.sh.in \
+       $(top_srcdir)/contrib/dracut/90zfs/module-setup.sh.in \
+       $(top_srcdir)/contrib/dracut/90zfs/mount-zfs.sh.in \
+       $(top_srcdir)/contrib/dracut/90zfs/parse-zfs.sh.in \
+       $(top_srcdir)/contrib/dracut/90zfs/zfs-lib.sh.in
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/dracut/90zfs/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu contrib/dracut/90zfs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+install-pkgdracutSCRIPTS: $(pkgdracut_SCRIPTS)
+       @$(NORMAL_INSTALL)
+       @list='$(pkgdracut_SCRIPTS)'; test -n "$(pkgdracutdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(pkgdracutdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(pkgdracutdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         if test -f "$$d$$p"; then echo "$$d$$p"; echo "$$p"; else :; fi; \
+       done | \
+       sed -e 'p;s,.*/,,;n' \
+           -e 'h;s|.*|.|' \
+           -e 'p;x;s,.*/,,;$(transform)' | sed 'N;N;N;s,\n, ,g' | \
+       $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1; } \
+         { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \
+           if ($$2 == $$4) { files[d] = files[d] " " $$1; \
+             if (++n[d] == $(am__install_max)) { \
+               print "f", d, files[d]; n[d] = 0; files[d] = "" } } \
+           else { print "f", d "/" $$4, $$1 } } \
+         END { for (d in files) print "f", d, files[d] }' | \
+       while read type dir files; do \
+            if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \
+            test -z "$$files" || { \
+              echo " $(INSTALL_SCRIPT) $$files '$(DESTDIR)$(pkgdracutdir)$$dir'"; \
+              $(INSTALL_SCRIPT) $$files "$(DESTDIR)$(pkgdracutdir)$$dir" || exit $$?; \
+            } \
+       ; done
+
+uninstall-pkgdracutSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(pkgdracut_SCRIPTS)'; test -n "$(pkgdracutdir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       dir='$(DESTDIR)$(pkgdracutdir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+       for dir in "$(DESTDIR)$(pkgdracutdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-local
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-pkgdracutSCRIPTS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-pkgdracutSCRIPTS
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       cscopelist-am ctags-am distclean distclean-generic \
+       distclean-libtool distclean-local 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-pkgdracutSCRIPTS 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-pkgdracutSCRIPTS
+
+.PRECIOUS: Makefile
+
+
+$(pkgdracut_SCRIPTS):
+       -$(SED) -e 's,@bindir\@,$(bindir),g' \
+               -e 's,@sbindir\@,$(sbindir),g' \
+               -e 's,@udevdir\@,$(udevdir),g' \
+               -e 's,@udevruledir\@,$(udevruledir),g' \
+               -e 's,@sysconfdir\@,$(sysconfdir),g' \
+               "$(top_srcdir)/contrib/dracut/90zfs/$@.in" >'$@'
+
+distclean-local::
+       -$(RM) $(pkgdracut_SCRIPTS)
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/contrib/dracut/Makefile.in b/zfs/contrib/dracut/Makefile.in
new file mode 100644 (file)
index 0000000..7a1a9a1
--- /dev/null
@@ -0,0 +1,779 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = contrib/dracut
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+SUBDIRS = 90zfs
+EXTRA_DIST = README.dracut.markdown
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/dracut/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu contrib/dracut/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile
+installdirs: installdirs-recursive
+installdirs-am:
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am:
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am:
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-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
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/contrib/initramfs/Makefile.in b/zfs/contrib/initramfs/Makefile.in
new file mode 100644 (file)
index 0000000..8ead20e
--- /dev/null
@@ -0,0 +1,658 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = contrib/initramfs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(initrddir)"
+SCRIPTS = $(initrd_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 = 
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+initrddir = $(datarootdir)/initramfs-tools
+initrd_SCRIPTS = conf-hooks.d/zfs hooks/zfs scripts/zfs
+EXTRA_DIST = \
+       $(top_srcdir)/contrib/initramfs/conf-hooks.d/zfs \
+       $(top_srcdir)/contrib/initramfs/hooks/zfs \
+       $(top_srcdir)/contrib/initramfs/scripts/zfs \
+       $(top_srcdir)/contrib/initramfs/README.initramfs.markdown
+
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu contrib/initramfs/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu contrib/initramfs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+uninstall-initrdSCRIPTS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(initrd_SCRIPTS)'; test -n "$(initrddir)" || exit 0; \
+       files=`for p in $$list; do echo "$$p"; done | \
+              sed -e 's,.*/,,;$(transform)'`; \
+       dir='$(DESTDIR)$(initrddir)'; $(am__uninstall_files_from_dir)
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+tags TAGS:
+
+ctags CTAGS:
+
+cscope cscopelist:
+
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(SCRIPTS)
+installdirs:
+       for dir in "$(DESTDIR)$(initrddir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-initrdSCRIPTS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-initrdSCRIPTS
+
+.MAKE: install-am install-strip
+
+.PHONY: all all-am check check-am clean clean-generic clean-libtool \
+       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-initrdSCRIPTS 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 uninstall-initrdSCRIPTS
+
+.PRECIOUS: Makefile
+
+
+install-initrdSCRIPTS: $(EXTRA_DIST)
+       for d in conf-hooks.d hooks scripts; do \
+         $(MKDIR_P) $(DESTDIR)$(initrddir)/$$d; \
+         cp $(top_srcdir)/contrib/initramfs/$$d/zfs \
+           $(DESTDIR)$(initrddir)/$$d/; \
+       done
+       if [ -f etc/init.d/zfs ]; then \
+         $(MKDIR_P) $(DESTDIR)$(DEFAULT_INITCONF_DIR); \
+         cp $(top_srcdir)/etc/init.d/zfs \
+           $(DESTDIR)$(DEFAULT_INITCONF_DIR)/; \
+       fi
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index fbe20dda5fb273e22cc79799954e2bd95edf4467..762a34f9db18e9c623b11bb1dad21cebcd35b369 100755 (executable)
@@ -55,6 +55,8 @@ adjust_obj_paths()
 for MODULE in "${MODULES[@]}"
 do
        adjust_obj_paths "$KERNEL_DIR/fs/zfs/$MODULE/Makefile"
+       sed -i.bak '/obj =/d' "$KERNEL_DIR/fs/zfs/$MODULE/Makefile"
+       sed -i.bak '/src =/d' "$KERNEL_DIR/fs/zfs/$MODULE/Makefile"
 done
 
 cat > "$KERNEL_DIR/fs/zfs/Kconfig" <<"EOF"
diff --git a/zfs/cp b/zfs/cp
new file mode 100755 (executable)
index 0000000..46ff2c9
--- /dev/null
+++ b/zfs/cp
@@ -0,0 +1,2 @@
+#!/bin/sh
+cp "$@"
diff --git a/zfs/dkms.conf b/zfs/dkms.conf
new file mode 100644 (file)
index 0000000..de451b1
--- /dev/null
@@ -0,0 +1,88 @@
+BUILD_DEPENDS[0]="spl"
+AUTOINSTALL="yes"
+PACKAGE_NAME="zfs"
+PACKAGE_VERSION="0.6.5.4"
+PRE_BUILD="configure
+  --prefix=/usr
+  --with-config=kernel
+  --with-linux=$(
+    case `lsb_release -is` in
+      (Debian)
+        if [[ -e ${kernel_source_dir/%build/source} ]]
+        then
+          echo ${kernel_source_dir/%build/source}
+        else
+          # A kpkg exception for Proxmox 2.0
+          echo ${kernel_source_dir}
+        fi
+      ;;
+      (*)
+        echo ${kernel_source_dir}
+      ;;
+    esac
+  )
+  --with-linux-obj=${kernel_source_dir}
+  --with-spl=${source_tree}/spl-${PACKAGE_VERSION}
+  --with-spl-obj=${dkms_tree}/spl/${PACKAGE_VERSION}/${kernelver}/${arch}
+  $(
+    [[ -r /etc/default/zfs ]] \
+    && source /etc/default/zfs \
+    && shopt -q -s extglob \
+    && \
+    {
+      if [[ ${ZFS_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
+      then
+        echo --enable-debug
+      fi
+      if [[ ${ZFS_DKMS_ENABLE_DEBUG_DMU_TX,,} == @(y|yes) ]]
+      then
+        echo --enable-debug-dmu-tx
+      fi
+    }
+  )
+"
+POST_BUILD="cp
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/zfs_config.h
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/build/module/Module.symvers
+  ${dkms_tree}/${PACKAGE_NAME}/${PACKAGE_VERSION}/${kernelver}/${arch}/
+"
+REMAKE_INITRD="$(
+  if [ -e /usr/share/initramfs-tools/hooks/zfs \
+       -o -e /usr/share/dracut/modules.d/90zfs ]
+  then
+    echo -n yes
+  else
+    echo -n no
+  fi
+)"
+MAKE[0]="make"
+STRIP[0]="$(
+  [[ -r /etc/default/zfs ]] \
+  && source /etc/default/zfs \
+  && shopt -q -s extglob \
+  && [[ ${ZFS_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \
+  && echo -n no
+)"
+STRIP[1]="${STRIP[0]}"
+STRIP[2]="${STRIP[0]}"
+STRIP[3]="${STRIP[0]}"
+STRIP[4]="${STRIP[0]}"
+STRIP[5]="${STRIP[0]}"
+BUILT_MODULE_NAME[0]="zavl"
+BUILT_MODULE_LOCATION[0]="module/avl/"
+DEST_MODULE_LOCATION[0]="/extra/zfs/zavl"
+BUILT_MODULE_NAME[1]="zcommon"
+BUILT_MODULE_LOCATION[1]="module/zcommon/"
+DEST_MODULE_LOCATION[1]="/extra/zfs/zcommon"
+BUILT_MODULE_NAME[2]="znvpair"
+BUILT_MODULE_LOCATION[2]="module/nvpair/"
+DEST_MODULE_LOCATION[2]="/extra/zfs/znvpair"
+BUILT_MODULE_NAME[3]="zpios"
+BUILT_MODULE_LOCATION[3]="module/zpios/"
+DEST_MODULE_LOCATION[3]="/extra/zfs/zpios"
+BUILT_MODULE_NAME[4]="zunicode"
+BUILT_MODULE_LOCATION[4]="module/unicode/"
+DEST_MODULE_LOCATION[4]="/extra/zfs/zunicode"
+BUILT_MODULE_NAME[5]="zfs"
+BUILT_MODULE_LOCATION[5]="module/zfs/"
+DEST_MODULE_LOCATION[5]="/extra/zfs/zfs"
diff --git a/zfs/etc/Makefile.am b/zfs/etc/Makefile.am
deleted file mode 100644 (file)
index a62678b..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-SUBDIRS = zfs $(ZFS_INIT_SYSTEMD) $(ZFS_INIT_SYSV) $(ZFS_MODULE_LOAD)
-DIST_SUBDIRS = init.d zfs systemd modules-load.d
diff --git a/zfs/etc/Makefile.in b/zfs/etc/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/etc/init.d/.gitignore b/zfs/etc/init.d/.gitignore
deleted file mode 100644 (file)
index 3f16b08..0000000
+++ /dev/null
@@ -1,6 +0,0 @@
-zfs-functions
-zfs-import
-zfs-mount
-zfs-share
-zfs-zed
-zfs
diff --git a/zfs/etc/init.d/Makefile.am b/zfs/etc/init.d/Makefile.am
deleted file mode 100644 (file)
index 5f70fc6..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-initdir = $(DEFAULT_INIT_DIR)
-init_SCRIPTS = zfs-import zfs-mount zfs-share zfs-zed
-
-initcommondir = $(sysconfdir)/zfs
-initcommon_SCRIPTS = zfs-functions
-
-initconfdir = $(DEFAULT_INITCONF_DIR)
-initconf_SCRIPTS = zfs
-
-EXTRA_DIST = \
-       $(top_srcdir)/etc/init.d/zfs-functions.in \
-       $(top_srcdir)/etc/init.d/zfs-share.in \
-       $(top_srcdir)/etc/init.d/zfs-import.in \
-       $(top_srcdir)/etc/init.d/zfs-mount.in \
-       $(top_srcdir)/etc/init.d/zfs-zed.in \
-       $(top_srcdir)/etc/init.d/zfs.in
-
-$(init_SCRIPTS) $(initconf_SCRIPTS) $(initcommon_SCRIPTS): $(EXTRA_DIST)
-       -(if [ -e /etc/debian_version ]; then \
-               NFS_SRV=nfs-kernel-server; \
-         else \
-               NFS_SRV=nfs; \
-         fi; \
-         if [ -e /etc/gentoo-release ]; then \
-               SHELL=/sbin/runscript; \
-         else \
-               SHELL=/bin/sh; \
-         fi; \
-         $(SED) -e 's,@bindir\@,$(bindir),g' \
-                -e 's,@sbindir\@,$(sbindir),g' \
-                -e 's,@udevdir\@,$(udevdir),g' \
-                -e 's,@udevruledir\@,$(udevruledir),g' \
-                -e 's,@sysconfdir\@,$(sysconfdir),g' \
-                -e 's,@initconfdir\@,$(initconfdir),g' \
-                -e 's,@initdir\@,$(initdir),g' \
-                -e 's,@runstatedir\@,$(runstatedir),g' \
-                -e "s,@SHELL\@,$$SHELL,g" \
-                -e "s,@NFS_SRV\@,$$NFS_SRV,g" \
-                "$(top_srcdir)/etc/init.d/$@.in" >'$@'; \
-         [ '$@' = 'zfs-functions' -o '$@' = 'zfs' ] || \
-               chmod +x '$@')
-
-distclean-local::
-       -$(RM) $(init_SCRIPTS) $(initcommon_SCRIPTS) $(initconf_SCRIPTS)
diff --git a/zfs/etc/init.d/Makefile.in b/zfs/etc/init.d/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/etc/init.d/README.md b/zfs/etc/init.d/README.md
deleted file mode 100644 (file)
index 89edb1d..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-DESCRIPTION
-  These script were written with the primary intention of being portable and
-  usable on as many systems as possible.
-
-  This is, in practice, usually not possible. But the intention is there.
-  And it is a good one.
-
-  They have been tested successfully on:
-
-    * Debian GNU/Linux Wheezy
-    * Debian GNU/Linux Jessie
-    * Ubuntu Trusty
-    * CentOS 6.0
-    * CentOS 6.6
-    * Gentoo
-
-SUPPORT
-  If you find that they don't work for your platform, please report this
-  at the ZFS On Linux issue tracker at https://github.com/zfsonlinux/zfs/issues.
-
-  Please include:
-
-    * Distribution name
-    * Distribution version
-    * Where to find an install CD image
-    * Architecture
-
-  If you have code to share that fixes the problem, that is much better.
-  But please remember to try your best keep portability in mind. If you
-  suspect that what you're writing/modifying won't work on anything else
-  than your distribution, please make sure to put that code in appropriate
-  if/else/fi code.
-
-  It currently MUST be bash (or fully compatible) for this to work.
-
-  If you're making your own distribution and you want the scripts to
-  work on that, the biggest problem you'll (probably) have is the part
-  at the beginning of the "zfs-functions.in" file which sets up the
-  logging output.
-
-INSTALLING INIT SCRIPT LINKS
-  To setup the init script links in /etc/rc?.d manually on a Debian GNU/Linux
-  (or derived) system, run the following commands (the order is important!):
-
-    update-rc.d zfs-import start 07 S .       stop 07 0 1 6 .
-    update-rc.d zfs-mount  start 02 2 3 4 5 . stop 06 0 1 6 .
-    update-rc.d zfs-zed    start 07 2 3 4 5 . stop 08 0 1 6 .
-    update-rc.d zfs-share  start 27 2 3 4 5 . stop 05 0 1 6 .
-
-  To do the same on RedHat, Fedora and/or CentOS:
-
-    chkconfig zfs-import
-    chkconfig zfs-mount
-    chkconfig zfs-zed
-    chkconfig zfs-share
-
-  On Gentoo:
-
-    rc-update add zfs-import boot
-    rc-update add zfs-mount boot
-    rc-update add zfs-zed default
-    rc-update add zfs-share default
-
-  The idea here is to make sure all of the ZFS filesystems, including possibly
-  separate datasets like /var, are mounted before anything else is started.
-
-  Then, ZED, which depends on /var, can be started.  It will consume and act
-  on events that occurred before it started.  ZED may also play a role in
-  sharing filesystems in the future, so it is important to start before the
-  'share' service.
-
-  Finally, we share filesystems configured with the share\* property.
index acfdf99263d89c65e31eee482ed6748860d63799..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,429 +1,2 @@
-# This is a script with common functions etc used by zfs-import, zfs-mount,
-# zfs-share and zfs-zed.
-#
-# It is _NOT_ to be called independently
-#
-# Released under the 2-clause BSD license.
-#
-# The original script that acted as a template for this script came from
-# the Debian GNU/Linux kFreeBSD ZFS packages (which did not include a
-# licensing stansa) in the commit dated Mar 24, 2011:
-#   https://github.com/zfsonlinux/pkg-zfs/commit/80a3ae582b59c0250d7912ba794dca9e669e605a
-
-PATH=/sbin:/bin:/usr/bin:/usr/sbin
-
-# Source function library
-if [ -f /etc/rc.d/init.d/functions ]; then
-       # RedHat and derivates
-       . /etc/rc.d/init.d/functions
-elif [ -L /etc/init.d/functions.sh ]; then
-       # Gentoo
-       . /etc/init.d/functions.sh
-elif [ -f /lib/lsb/init-functions ]; then
-       # LSB, Debian GNU/Linux and derivates
-       . /lib/lsb/init-functions
-fi
-
-# Of course the functions we need are called differently
-# on different distributions - it would be way too easy
-# otherwise!!
-if type log_failure_msg > /dev/null 2>&1 ; then
-       # LSB functions - fall through
-       zfs_log_begin_msg() { log_begin_msg "$1"; }
-       zfs_log_end_msg() { log_end_msg "$1"; }
-       zfs_log_failure_msg() { log_failure_msg "$1"; }
-       zfs_log_progress_msg() { log_progress_msg "$1"; }
-elif type success > /dev/null 2>&1 ; then
-       # Fedora/RedHat functions
-       zfs_set_ifs() {
-               # For some reason, the init function library have a problem
-               # with a changed IFS, so this function goes around that.
-               local tIFS="$1"
-               if [ -n "$tIFS" ]
-               then
-                       TMP_IFS="$IFS"
-                       IFS="$tIFS"
-               fi
-       }
-
-       zfs_log_begin_msg() { echo -n "$1 "; }
-       zfs_log_end_msg() {
-               zfs_set_ifs "$OLD_IFS"
-               if [ "$1" -eq 0 ]; then
-                       success
-               else
-                       failure
-               fi
-               echo
-               zfs_set_ifs "$TMP_IFS"
-       }
-       zfs_log_failure_msg() {
-               zfs_set_ifs "$OLD_IFS"
-               failure
-               echo
-               zfs_set_ifs "$TMP_IFS"
-       }
-       zfs_log_progress_msg() { echo -n $"$1"; }
-elif type einfo > /dev/null 2>&1 ; then
-       # Gentoo functions
-       zfs_log_begin_msg() { ebegin "$1"; }
-       zfs_log_end_msg() { eend "$1"; }
-       zfs_log_failure_msg() { eend "$1"; }
-#      zfs_log_progress_msg() { echo -n "$1"; }
-       zfs_log_progress_msg() { echo -n; }
-else
-       # Unknown - simple substitues.
-       zfs_log_begin_msg() { echo -n "$1"; }
-       zfs_log_end_msg() {
-               ret=$1
-               if [ "$ret" -ge 1 ]; then
-                       echo " failed!"
-               else
-                       echo " success"
-               fi
-               return "$ret"
-       }
-       zfs_log_failure_msg() { echo "$1"; }
-       zfs_log_progress_msg() { echo -n "$1"; }
-fi
-
-# Paths to what we need
-ZFS="@sbindir@/zfs"
-ZED="@sbindir@/zed"
-ZPOOL="@sbindir@/zpool"
-ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
-
-# Sensible defaults
-ZFS_MOUNT='yes'
-ZFS_UNMOUNT='yes'
-
-export ZFS ZED ZPOOL ZPOOL_CACHE ZFS_MOUNT ZFS_UNMOUNT
-
-# Source zfs configuration, overriding the defaults
-if [ -f @initconfdir@/zfs ]; then
-       . @initconfdir@/zfs
-fi
-
-# ----------------------------------------------------
-
-zfs_action()
-{
-       local MSG="$1"; shift
-       local CMD="$*"
-       local ret
-
-       zfs_log_begin_msg "$MSG "
-       $CMD
-       ret=$?
-       if [ "$ret" -eq 0 ]; then
-               zfs_log_end_msg $ret
-       else
-               zfs_log_failure_msg $ret
-       fi
-
-       return $ret
-}
-
-# Returns
-#   0 if daemon has been started
-#   1 if daemon was already running
-#   2 if daemon could not be started
-#   3 if unsupported
-#
-zfs_daemon_start()
-{
-       local PIDFILE="$1";     shift
-       local DAEMON_BIN="$1";  shift
-       local DAEMON_ARGS="$*"
-
-       if type start-stop-daemon > /dev/null 2>&1 ; then
-               # LSB functions
-               start-stop-daemon --start --quiet --pidfile "$PIDFILE" \
-                   --exec "$DAEMON_BIN" --test > /dev/null || return 1
-
-               start-stop-daemon --start --quiet --exec "$DAEMON_BIN" -- \
-                   $DAEMON_ARGS || return 2
-
-               # On Debian GNU/Linux, there's a 'sendsigs' script that will
-               # kill basically everything quite early and zed is stopped
-               # much later than that. We don't want zed to be among them,
-               # so add the zed pid to list of pids to ignore.
-               if [ -f "$PIDFILE" -a -d /run/sendsigs.omit.d ]
-               then
-                       ln -sf "$PIDFILE" /run/sendsigs.omit.d/zed
-               fi
-       elif type daemon > /dev/null 2>&1 ; then
-               # Fedora/RedHat functions
-               daemon --pidfile "$PIDFILE" "$DAEMON_BIN" $DAEMON_ARGS
-               return $?
-       else
-               # Unsupported
-               return 3
-       fi
-
-       return 0
-}
-
-# Returns
-#   0 if daemon has been stopped
-#   1 if daemon was already stopped
-#   2 if daemon could not be stopped
-#   3 if unsupported
-#
-zfs_daemon_stop()
-{
-       local PIDFILE="$1"
-       local DAEMON_BIN="$2"
-       local DAEMON_NAME="$3"
-
-       if type start-stop-daemon > /dev/null 2>&1 ; then
-               # LSB functions
-               start-stop-daemon --stop --quiet --retry=TERM/30/KILL/5 \
-                   --pidfile "$PIDFILE" --name "$DAEMON_NAME"
-               [ "$?" = 0 ] && rm -f "$PIDFILE"
-
-               return $?
-       elif type killproc > /dev/null 2>&1 ; then
-               # Fedora/RedHat functions
-               killproc -p "$PIDFILE" "$DAEMON_NAME"
-               [ "$?" = 0 ] && rm -f "$PIDFILE"
-
-               return $?
-       else
-               # Unsupported
-               return 3
-       fi
-
-       return 0
-}
-
-# Returns status
-zfs_daemon_status()
-{
-       local PIDFILE="$1"
-       local DAEMON_BIN="$2"
-       local DAEMON_NAME="$3"
-
-       if type status_of_proc > /dev/null 2>&1 ; then
-               # LSB functions
-               status_of_proc "$DAEMON_NAME" "$DAEMON_BIN"
-               return $?
-       elif type status > /dev/null 2>&1 ; then
-               # Fedora/RedHat functions
-               status -p "$PIDFILE" "$DAEMON_NAME"
-               return $?
-       else
-               # Unsupported
-               return 3
-       fi
-
-       return 0
-}
-
-zfs_daemon_reload()
-{
-       local PIDFILE="$1"
-       local DAEMON_NAME="$2"
-
-       if type start-stop-daemon > /dev/null 2>&1 ; then
-               # LSB functions
-               start-stop-daemon --stop --signal 1 --quiet \
-                   --pidfile "$PIDFILE" --name "$DAEMON_NAME"
-               return $?
-       elif type killproc > /dev/null 2>&1 ; then
-               # Fedora/RedHat functions
-                killproc -p "$PIDFILE" "$DAEMON_NAME" -HUP
-               return $?
-       else
-               # Unsupported
-               return 3
-       fi
-
-       return 0
-}
-
-zfs_installed()
-{
-       if [ ! -x "$ZPOOL" ]; then
-               return 1
-       else
-               # Test if it works (will catch missing/broken libs etc)
-               "$ZPOOL" -? > /dev/null 2>&1
-               return $?
-       fi
-
-       if [ ! -x "$ZFS" ]; then
-               return 2
-       else
-               # Test if it works (will catch missing/broken libs etc)
-               "$ZFS" -? > /dev/null 2>&1
-               return $?
-       fi
-
-       return 0
-}
-
-# Trigger udev and wait for it to settle.
-udev_trigger()
-{
-       if [ -x /sbin/udevadm ]; then
-               /sbin/udevadm trigger --action=change --subsystem-match=block
-               /sbin/udevadm settle
-       elif [ -x /sbin/udevsettle ]; then
-               /sbin/udevtrigger
-               /sbin/udevsettle
-       fi
-}
-
-# Do a lot of checks to make sure it's 'safe' to continue with the import.
-checksystem()
-{
-       if grep -qiE '(^|[^\\](\\\\)* )zfs=(off|no|0)( |$)' /proc/cmdline;
-       then
-               # Called with zfs=(off|no|0) - bail because we don't
-               # want anything import, mounted or shared.
-               # HOWEVER, only do this if we're called at the boot up
-               # (from init), not if we're running interactivly (as in
-               # from the shell - we know what we're doing).
-               [ -n "$init" ] && exit 3
-       fi
-
-       # Check if ZFS is installed.
-       zfs_installed || return 5
-
-       # Just make sure that /dev/zfs is created.
-       udev_trigger
-
-       if ! [ "$(uname -m)" = "x86_64" ]; then
-               echo "Warning: You're not running 64bit. Currently native zfs in";
-               echo "         Linux is only supported and tested on 64bit.";
-               # should we break here? People doing this should know what they
-               # do, thus i'm not breaking here.
-       fi
-
-       return 0
-}
-
-get_root_pool()
-{
-       set -- $(mount | grep ' on / ')
-       [ "$5" = "zfs" ] && echo "${1%%/*}"
-}
-
-# Check if a variable is 'yes' (any case) or '1'
-# Returns TRUE if set.
-check_boolean()
-{
-       local var="$1"
-
-       echo "$var" | grep -Eiq "^yes$|^on$|^true$|^1$" && return 0 || return 1
-}
-
-check_module_loaded()
-{
-       module="$1"
-
-       [ -r "/sys/module/${module}/version" ] && return 0 || return 1
-}
-
-load_module()
-{
-       module="$1"
-
-       # Load the zfs module stack
-       if ! check_module_loaded "$module"; then
-               if ! /sbin/modprobe "$module"; then
-                       return 5
-               fi
-       fi
-       return 0
-}
-
-# first parameter is a regular expression that filters mtab
-read_mtab()
-{
-       local match="$1"
-       local fs mntpnt fstype opts rest TMPFILE
-
-       # Unset all MTAB_* variables
-       unset $(env | grep ^MTAB_ | sed 's,=.*,,')
-
-       while read -r fs mntpnt fstype opts rest; do
-               if echo "$fs $mntpnt $fstype $opts" | grep -qE "$match"; then
-                       # * Fix problems (!?) in the mounts file. It will record
-                       #   'rpool 1' as 'rpool\0401' instead of 'rpool\00401'
-                       #   which seems to be the correct (at least as far as
-                       #   'printf' is concerned).
-                       # * We need to use the external echo, because the
-                       #   internal one would interpret the backslash code
-                       #   (incorrectly), giving us a \ 1 instead.
-                       mntpnt=$(/bin/echo "$mntpnt" | sed "s,\\\0,\\\00,g")
-                       fs=$(/bin/echo "$fs" | sed "s,\\\0,\\\00,")
-
-                       # Remove 'unwanted' characters.
-                       mntpnt=$(printf '%b\n' "$mntpnt" | sed -e 's,/,,g' \
-                           -e 's,-,,g' -e 's,\.,,g' -e 's, ,,g')
-                       fs=$(printf '%b\n' "$fs")
-
-                       # Set the variable.
-                       eval export MTAB_$mntpnt=\"$fs\"
-               fi
-       done < /proc/mounts
-}
-
-in_mtab()
-{
-       local fs="$(echo "$1" | sed 's,/,_,g')"
-       local var
-
-       var="$(eval echo MTAB_$fs)"
-       [ "$(eval echo "$""$var")" != "" ]
-       return "$?"
-}
-
-# first parameter is a regular expression that filters fstab
-read_fstab()
-{
-       local match="$1"
-       local i var TMPFILE
-
-       # Unset all FSTAB_* variables
-       unset $(env | grep ^FSTAB_ | sed 's,=.*,,')
-
-       i=0
-       while read -r fs mntpnt fstype opts; do
-               echo "$fs" | egrep -qE '^#|^$' && continue
-
-               if echo "$fs $mntpnt $fstype $opts" | grep -qE "$match"; then
-                       eval export FSTAB_dev_$i="$fs"
-                       fs=$(printf '%b\n' "$fs" | sed 's,/,_,g')
-                       eval export FSTAB_$i="$mntpnt"
-
-                       i=$((i + 1))
-               fi
-       done < /etc/fstab
-}
-
-in_fstab()
-{
-       local var
-
-       var="$(eval echo FSTAB_$1)"
-       [ "${var}" != "" ]
-       return $?
-}
-
-is_mounted()
-{
-       local mntpt="$1"
-       local line
-
-       mount | \
-           while read line; do
-               if echo "$line" | grep -q " on $mntpt "; then
-                   return 0
-               fi
-           done
-
-       return 1
-}
+%:
+       #
old mode 100755 (executable)
new mode 100644 (file)
index 2258638..b3e8c13
@@ -1,339 +1,2 @@
-#!@SHELL@
-#
-# zfs-import    This script will import ZFS pools
-#
-# chkconfig:    2345 01 99
-# description:  This script will perform a verbatim import of ZFS pools
-#               during system boot.
-# probe: true
-#
-### BEGIN INIT INFO
-# Provides:          zfs-import
-# Required-Start:    mtab
-# Required-Stop:     $local_fs mtab
-# Default-Start:     S
-# Default-Stop:      0 1 6
-# X-Start-Before:    checkfs
-# X-Stop-After:      zfs-mount
-# Short-Description: Import ZFS pools
-# Description: Run the `zpool import` command.
-### END INIT INFO
-#
-# NOTE: Not having '$local_fs' on Required-Start but only on Required-Stop
-#       is on purpose. If we have '$local_fs' in both (and X-Start-Before=checkfs)
-#       we get conflicts - import needs to be started extremely early,
-#       but not stopped too late.
-#
-# Released under the 2-clause BSD license.
-#
-# The original script that acted as a template for this script came from
-# the Debian GNU/Linux kFreeBSD ZFS packages (which did not include a
-# licensing stansa) in the commit dated Mar 24, 2011:
-#   https://github.com/zfsonlinux/pkg-zfs/commit/80a3ae582b59c0250d7912ba794dca9e669e605a
-
-# Source the common init script
-. @sysconfdir@/zfs/zfs-functions
-
-# ----------------------------------------------------
-
-do_depend()
-{
-       after sysfs udev
-       keyword -lxc -openvz -prefix -vserver
-}
-
-# Use the zpool cache file to import pools
-do_verbatim_import()
-{
-       if [ -f "$ZPOOL_CACHE" ]
-       then
-               zfs_action "Importing ZFS pool(s)" \
-                       "$ZPOOL" import -c "$ZPOOL_CACHE" -N -a
-       fi
-}
-
-# Support function to get a list of all pools, separated with ';'
-find_pools()
-{
-       local CMD="$*"
-       local pools
-
-       pools=$($CMD 2> /dev/null | \
-               grep -E "pool:|^[a-zA-Z0-9]" | \
-               sed 's@.*: @@' | \
-               sort | \
-               while read pool; do \
-                   echo -n "$pool;"
-               done)
-
-       echo "${pools%%;}" # Return without the last ';'.
-}
-
-# Find and import all visible pools, even exported ones
-do_import_all_visible()
-{
-       local already_imported available_pools pool npools
-       local exception dir ZPOOL_IMPORT_PATH RET=0 r=1
-
-       # In case not shutdown cleanly.
-       [ -n "$init" ] && rm -f /etc/dfs/sharetab
-
-       # Just simplify code later on.
-       if [ -n "$USE_DISK_BY_ID" -a "$USE_DISK_BY_ID" != 'yes' ]
-       then
-               # It's something, but not 'yes' so it's no good to us.
-               unset USE_DISK_BY_ID
-       fi
-
-       # Find list of already imported pools.
-       already_imported=$(find_pools "$ZPOOL" list -H -oname)
-       available_pools=$(find_pools "$ZPOOL" import)
-
-       # Just in case - seen it happen (that a pool isn't visable/found
-       # with a simple "zpool import" but only when using the "-d"
-       # option or setting ZPOOL_IMPORT_PATH).
-       if [ -d "/dev/disk/by-id" ]
-       then
-               npools=$(find_pools "$ZPOOL" import -d /dev/disk/by-id)
-               if [ -n "$npools" ]
-               then
-                       # Because we have found extra pool(s) here, which wasn't
-                       # found 'normaly', we need to force USE_DISK_BY_ID to
-                       # make sure we're able to actually import it/them later.
-                       USE_DISK_BY_ID='yes'
-
-                       if [ -n "$available_pools" ]
-                       then
-                               # Filter out duplicates (pools found with the simpl
-                               # "zpool import" but which is also found with the
-                               # "zpool import -d ...").
-                               npools=$(echo "$npools" | sed "s,$available_pools,,")
-
-                               # Add the list to the existing list of
-                               # available pools
-                               available_pools="$available_pools;$npools"
-                       else
-                               available_pools="$npools"
-                       fi
-               fi
-       fi
-
-       # Filter out any exceptions...
-       if [ -n "$ZFS_POOL_EXCEPTIONS" ]
-       then
-               local found=""
-               local apools=""
-               OLD_IFS="$IFS" ; IFS=";"
-
-               for pool in $available_pools
-               do
-                       for exception in $ZFS_POOL_EXCEPTIONS
-                       do
-                               [ "$pool" = "$exception" ] && continue 2
-                               found="$pool"
-                       done
-
-                       if [ -n "$found" ]
-                       then
-                               if [ -n "$apools" ]
-                               then
-                                       apools="$apools;$pool"
-                               else
-                                       apools="$pool"
-                               fi
-                       fi
-               done
-
-               IFS="$OLD_IFS"
-               available_pools="$apools"
-       fi
-
-       # For backwards compability, make sure that ZPOOL_IMPORT_PATH is set
-       # to something we can use later with the real import(s). We want to
-       # make sure we find all by* dirs, BUT by-vdev should be first (if it
-       # exists).
-       if [ -n "$USE_DISK_BY_ID" -a -z "$ZPOOL_IMPORT_PATH" ]
-       then
-               local dirs
-               dirs="$(for dir in $(echo /dev/disk/by-*)
-               do
-                       # Ignore by-vdev here - we wan't it first!
-                       echo "$dir" | grep -q /by-vdev && continue
-                       [ ! -d "$dir" ] && continue
-
-                       echo -n "$dir:"
-               done | sed 's,:$,,g')"
-
-               if [ -d "/dev/disk/by-vdev" ]
-               then
-                       # Add by-vdev at the beginning.
-                       ZPOOL_IMPORT_PATH="/dev/disk/by-vdev:"
-               fi
-
-               # Help with getting LUKS partitions etc imported.
-               if [ -d "/dev/mapper" ]; then
-                       if [ -n "$ZPOOL_IMPORT_PATH" ]; then
-                               ZPOOL_IMPORT_PATH="$ZPOOL_IMPORT_PATH:/dev/mapper:"
-                       else
-                               ZPOOL_IMPORT_PATH="/dev/mapper:"
-                       fi
-               fi
-
-               # ... and /dev at the very end, just for good measure.
-               ZPOOL_IMPORT_PATH="$ZPOOL_IMPORT_PATH$dirs:/dev"
-       fi
-
-       # Needs to be exported for "zpool" to catch it.
-       [ -n "$ZPOOL_IMPORT_PATH" ] && export ZPOOL_IMPORT_PATH
-
-       # Mount all availible pools (except those set in ZFS_POOL_EXCEPTIONS.
+%:
        #
-       # If not interactive (run from init - variable init='/sbin/init')
-       # we get ONE line for all pools being imported, with just a dot
-       # as status for each pool.
-       # Example: Importing ZFS pool(s)...                             [OK]
-       #
-       # If it IS interactive (started from the shell manually), then we
-       # get one line per pool importing.
-       # Example: Importing ZFS pool pool1                             [OK]
-       #          Importing ZFS pool pool2                             [OK]
-       #          [etc]
-       [ -n "$init" ] && zfs_log_begin_msg "Importing ZFS pool(s)"
-       OLD_IFS="$IFS" ; IFS=";"
-       for pool in $available_pools
-       do
-               [ -z "$pool" ] && continue
-
-               # We have pools that haven't been imported - import them
-               if [ -n "$init" ]
-               then
-                       # Not interactive - a dot for each pool.
-                       # Except on Gentoo where this doesn't work.
-                       zfs_log_progress_msg "."
-               else
-                       # Interactive - one 'Importing ...' line per pool
-                       zfs_log_begin_msg "Importing ZFS pool $pool"
-               fi
-
-               # Import by using ZPOOL_IMPORT_PATH (either set above or in
-               # the config file) _or_ with the 'built in' default search
-               # paths. This is the prefered way.
-               "$ZPOOL" import -N ${ZPOOL_IMPORT_OPTS} "$pool" 2> /dev/null
-               r="$?" ; RET=$((RET + r))
-               if [ "$r" -eq 0 ]
-               then
-                       # Output success and process the next pool
-                       [ -z "$init" ] && zfs_log_end_msg 0
-                       continue
-               fi
-               # We don't want a fail msg here, we're going to try import
-               # using the cache file soon and that might succeed.
-               [ ! -f "$ZPOOL_CACHE" ] && zfs_log_end_msg "$RET"
-
-               if [ "$r" -gt 0 -a -f "$ZPOOL_CACHE" ]
-               then
-                       # Failed to import without a cache file. Try WITH...
-                       if [ -z "$init" ] && check_boolean "$VERBOSE_MOUNT"
-                       then
-                               # Interactive + Verbose = more information
-                               zfs_log_progress_msg " using cache file"
-                       fi
-
-                       "$ZPOOL" import -c "$ZPOOL_CACHE" -N ${ZPOOL_IMPORT_OPTS} \
-                               "$pool" 2> /dev/null
-                       r="$?" ; RET=$((RET + r))
-                       if [ "$r" -eq 0 ]
-                       then
-                               [ -z "$init" ] && zfs_log_end_msg 0
-                               continue 3 # Next pool
-                       fi
-                       zfs_log_end_msg "$RET"
-               fi
-       done
-       [ -n "$init" ] && zfs_log_end_msg "$RET"
-
-       IFS="$OLD_IFS"
-       [ -n "$already_imported" -a -z "$available_pools" ] && return 0
-
-       return "$RET"
-}
-
-do_import()
-{
-       if check_boolean "$ZPOOL_IMPORT_ALL_VISIBLE"
-       then
-               do_import_all_visible
-       else
-               # This is the default option
-               do_verbatim_import
-       fi
-}
-
-# Output the status and list of pools
-do_status()
-{
-       check_module_loaded "zfs" || exit 0
-
-       "$ZPOOL" status && echo "" && "$ZPOOL" list
-}
-
-do_start()
-{
-       if check_boolean "$VERBOSE_MOUNT"
-       then
-           zfs_log_begin_msg "Checking if ZFS userspace tools present"
-       fi
-
-       if checksystem
-       then
-               check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0
-
-               check_boolean "$VERBOSE_MOUNT" && \
-                       zfs_log_begin_msg "Loading kernel ZFS infrastructure"
-
-               if ! load_module "zfs"
-               then
-                       check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 1
-                       return 5
-               fi
-               check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0
-
-               do_import && udev_trigger # just to make sure we get zvols.
-
-               return 0
-       else
-               return 1
-       fi
-}
-
-# ----------------------------------------------------
-
-if [ ! -e /etc/gentoo-release ]
-then
-       case "$1" in
-               start)
-                       do_start
-                       ;;
-               stop)
-                       # no-op
-                       ;;
-               status)
-                       do_status
-                       ;;
-               force-reload|condrestart|reload|restart)
-                       # no-op
-                       ;;
-               *)
-                       [ -n "$1" ] && echo "Error: Unknown command $1."
-                       echo "Usage: $0 {start|status}"
-                       exit 3
-                       ;;
-       esac
-
-       exit $?
-else
-       # Create wrapper functions since Gentoo don't use the case part.
-       depend() { do_depend; }
-       start() { do_start; }
-       status() { do_status; }
-fi
old mode 100755 (executable)
new mode 100644 (file)
index 05cea9b..b3e8c13
@@ -1,227 +1,2 @@
-#!@SHELL@
-#
-# zfs-mount     This script will mount/umount the zfs filesystems.
-#
-# chkconfig:    2345 06 99
-# description:  This script will mount/umount the zfs filesystems during
-#               system boot/shutdown. Configuration of which filesystems
-#               should be mounted is handled by the zfs 'mountpoint' and
-#               'canmount' properties. See the zfs(8) man page for details.
-#               It is also responsible for all userspace zfs services.
-# probe: true
-#
-### BEGIN INIT INFO
-# Provides:          zfs-mount
-# Required-Start:    $local_fs zfs-import
-# Required-Stop:     $local_fs zfs-import
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# X-Stop-After:      zfs-zed
-# Short-Description: Mount ZFS filesystems and volumes
-# Description: Run the `zfs mount -a` or `zfs umount -a` commands.
-### END INIT INFO
-#
-# Released under the 2-clause BSD license.
-#
-# The original script that acted as a template for this script came from
-# the Debian GNU/Linux kFreeBSD ZFS packages (which did not include a
-# licensing stansa) in the commit dated Mar 24, 2011:
-#   https://github.com/zfsonlinux/pkg-zfs/commit/80a3ae582b59c0250d7912ba794dca9e669e605a
-
-# Source the common init script
-. @sysconfdir@/zfs/zfs-functions
-
-# ----------------------------------------------------
-
-chkroot() {
-       while read line; do
-               set -- $line
-               if [ "$2" = "/" ]; then
-                       return 0
-               fi
-       done < /etc/mtab
-
-       return 1
-}
-
-do_depend()
-{
-       # Try to allow people to mix and match fstab with ZFS in a way that makes sense.
-       if [ "$(mountinfo -s /)" = 'zfs' ]
-       then
-               before localmount
-       else
-               after localmount
-       fi
-
-       # bootmisc will log to /var which may be a different zfs than root.
-       before bootmisc logger
-
-       after zfs-import sysfs
-       use mtab
-       keyword -lxc -openvz -prefix -vserver
-}
-
-# Mount all datasets/filesystems
-do_mount()
-{
-       local verbose overlay i mntpt val
-
-       check_boolean "$VERBOSE_MOUNT" && verbose=v
-       check_boolean "$DO_OVERLAY_MOUNTS" && overlay=O
-
-       zfs_action "Mounting ZFS filesystem(s)" \
-           "$ZFS" mount -a$verbose$overlay "$MOUNT_EXTRA_OPTIONS"
-
-       # Require each volume/filesytem to have 'noauto' and no fsck
-       # option. This shouldn't really be necessary, as long as one
-       # can get zfs-import to run sufficiently early on in the boot
-       # process - before local mounts. This is just here in case/if
-       # this isn't possible.
-       check_boolean "$VERBOSE_MOUNT" && \
-           zfs_log_begin_msg "Mounting volumes and filesystems registered in fstab"
-
-       read_mtab  "^/dev/(zd|zvol)"
-       read_fstab "^/dev/(zd|zvol)"
-       i=0; var=$(eval echo FSTAB_$i)
-       while [ -n "$(eval echo "$""$var")" ]
-       do
-               mntpt=$(eval echo "$""$var")
-               dev=$(eval echo "$"FSTAB_dev_$i)
-               if ! in_mtab "$mntpt" && ! is_mounted "$mntpt" && [ -e "$dev" ]
-               then
-                       check_boolean "$VERBOSE_MOUNT" && \
-                               zfs_log_progress_msg "$mntpt "
-                       fsck "$dev" && mount "$mntpt"
-               fi
-
-               i=$((i + 1))
-               var=$(eval echo FSTAB_$i)
-       done
-
-       read_mtab  "[[:space:]]zfs[[:space:]]"
-       read_fstab "[[:space:]]zfs[[:space:]]"
-       i=0; var=$(eval echo FSTAB_$i)
-       while [ -n "$(eval echo "$""$var")" ]
-       do
-               mntpt=$(eval echo "$""$var")
-               if ! in_mtab "$mntpt" && ! is_mounted "$mntpt"
-               then
-                       check_boolean "$VERBOSE_MOUNT" && \
-                               zfs_log_progress_msg "$mntpt "
-                       mount "$mntpt"
-               fi
-
-               i=$((i + 1))
-               var=$(eval echo FSTAB_$i)
-       done
-       check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0
-
-       return 0
-}
-
-# Unmount all filesystems
-do_unmount()
-{
-       local i var mntpt
-
-       # This shouldn't really be necessary, as long as one can get
-       # zfs-import to run sufficiently late in the shutdown/reboot process
-       # - after unmounting local filesystems. This is just here in case/if
-       # this isn't possible.
-       zfs_action "Unmounting ZFS filesystems" "$ZFS" unmount -a
-
-       check_boolean "$VERBOSE_MOUNT" && \
-           zfs_log_begin_msg "Unmounting volumes and filesystems registered in fstab"
-
-       read_mtab  "^/dev/(zd|zvol)"
-       read_fstab "^/dev/(zd|zvol)"
-       i=0; var=$(eval echo FSTAB_$i)
-       while [ -n "$(eval echo "$""$var")" ]
-       do
-               mntpt=$(eval echo "$""$var")
-               dev=$(eval echo "$"FSTAB_dev_$i)
-               if in_mtab "$mntpt"
-               then
-                       check_boolean "$VERBOSE_MOUNT" && \
-                               zfs_log_progress_msg "$mntpt "
-                       umount "$mntpt"
-               fi
-
-               i=$((i + 1))
-               var=$(eval echo FSTAB_$i)
-       done
-
-       read_mtab  "[[:space:]]zfs[[:space:]]"
-       read_fstab "[[:space:]]zfs[[:space:]]"
-       i=0; var=$(eval echo FSTAB_$i)
-       while [ -n "$(eval echo "$""$var")" ]
-       do
-               mntpt=$(eval echo "$""$var")
-               if in_mtab "$mntpt"; then
-                       check_boolean "$VERBOSE_MOUNT" && \
-                           zfs_log_progress_msg "$mntpt "
-                       umount "$mntpt"
-               fi
-
-               i=$((i + 1))
-               var=$(eval echo FSTAB_$i)
-       done
-       check_boolean "$VERBOSE_MOUNT" && zfs_log_end_msg 0
-
-       return 0
-}
-
-do_start()
-{
-       check_boolean "$ZFS_MOUNT" || exit 0
-
-       check_module_loaded "zfs" || exit 0
-
-       # Ensure / exists in /etc/mtab, if not update mtab accordingly.
-       # This should be handled by rc.sysinit but lets be paranoid.
-       if ! chkroot
-       then
-               mount -f /
-       fi
-
-       do_mount
-}
-
-do_stop()
-{
-       check_boolean "$ZFS_UNMOUNT" || exit 0
-
-       check_module_loaded "zfs" || exit 0
-
-       do_unmount
-}
-
-# ----------------------------------------------------
-
-if [ ! -e /etc/gentoo-release ]
-then
-       case "$1" in
-               start)
-                       do_start
-                       ;;
-               stop)
-                       do_stop
-                       ;;
-               force-reload|condrestart|reload|restart|status)
-                       # no-op
-                       ;;
-               *)
-                       [ -n "$1" ] && echo "Error: Unknown command $1."
-                       echo "Usage: $0 {start|stop}"
-                       exit 3
-                       ;;
-       esac
-
-       exit $?
-else
-       # Create wrapper functions since Gentoo don't use the case part.
-       depend() { do_depend; }
-       start() { do_start; }
-       stop() { do_stop; }
-fi
+%:
+       #
old mode 100755 (executable)
new mode 100644 (file)
index 1b70da4..b3e8c13
@@ -1,85 +1,2 @@
-#!@SHELL@
-#
-# zfs-share     This script will network share zfs filesystems and volumes.
-#
-# chkconfig:    2345 30 99
-# description:  Run the `zfs share -a` or `zfs unshare -a` commands
-#               for controlling iSCSI, NFS, or CIFS network shares.
-# probe: true
-#
-### BEGIN INIT INFO
-# Provides:          zfs-share
-# Required-Start:    $local_fs $network $remote_fs zfs-mount zfs-zed
-# Required-Stop:     $local_fs $network $remote_fs zfs-mount zfs-zed
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# Should-Start:      iscsi iscsitarget istgt scst @NFS_SRV@ samba samba4 zfs-mount zfs-zed
-# Should-Stop:       iscsi iscsitarget istgt scst @NFS_SRV@ samba samba4 zfs-mount zfs-zed
-# Short-Description: Network share ZFS datasets and volumes.
-# Description:       Run the `zfs share -a` or `zfs unshare -a` commands
-#                    for controlling iSCSI, NFS, or CIFS network shares.
-### END INIT INFO
-#
-# Released under the 2-clause BSD license.
-#
-# The original script that acted as a template for this script came from
-# the Debian GNU/Linux kFreeBSD ZFS packages (which did not include a
-# licensing stansa) in the commit dated Mar 24, 2011:
-#   https://github.com/zfsonlinux/pkg-zfs/commit/80a3ae582b59c0250d7912ba794dca9e669e605a
-
-# Source the common init script
-. @sysconfdir@/zfs/zfs-functions
-
-# ----------------------------------------------------
-
-do_depend()
-{
-       after sysfs zfs-mount zfs-zed
-       keyword -lxc -openvz -prefix -vserver
-}
-
-do_start()
-{
-       check_boolean "$ZFS_SHARE" || exit 0
-
-       check_module_loaded "zfs" || exit 0
-
-       zfs_action "Sharing ZFS filesystems" "$ZFS" share -a
-}
-
-do_stop()
-{
-       check_boolean "$ZFS_UNSHARE" || exit 0
-
-       check_module_loaded "zfs" || exit 0
-
-       zfs_action "Unsharing ZFS filesystems" "$ZFS" unshare -a
-}
-
-# ----------------------------------------------------
-
-if [ ! -e /etc/gentoo-release ]; then
-       case "$1" in
-               start)
-                       do_start
-                       ;;
-               stop)
-                       do_stop
-                       ;;
-               force-reload|reload|restart|status)
-                       # no-op
-                       ;;
-               *)
-                       [ -n "$1" ] && echo "Error: Unknown command $1."
-                       echo "Usage: $0 {start|stop}"
-                       exit 3
-                       ;;
-       esac
-
-       exit $?
-else
-       # Create wrapper functions since Gentoo don't use the case part.
-       depend() { do_depend; }
-       start() { do_start; }
-       stop() { do_stop; }
-fi
+%:
+       #
old mode 100755 (executable)
new mode 100644 (file)
index 86e3185..b3e8c13
@@ -1,134 +1,2 @@
-#!@SHELL@
-#
-# zfs-zed
-#
-# chkconfig:    2345 29 99
-# description:  This script will start and stop the ZFS Event Daemon.
-# probe: true
-#
-### BEGIN INIT INFO
-# Provides:          zfs-zed
-# Required-Start:    zfs-mount
-# Required-Stop:     zfs-mount
-# Default-Start:     2 3 4 5
-# Default-Stop:      0 1 6
-# X-Stop-After:      zfs-share
-# Short-Description: ZFS Event Daemon
-# Description:       zed monitors ZFS events. When a zevent is posted, zed
-#                    will run any scripts that have been enabled for the
-#                    corresponding zevent class.
-### END INIT INFO
-#
-# Released under the 2-clause BSD license.
-#
-# The original script that acted as a template for this script came from
-# the Debian GNU/Linux kFreeBSD ZFS packages (which did not include a
-# licensing stansa) in the commit dated Mar 24, 2011:
-#   https://github.com/zfsonlinux/pkg-zfs/commit/80a3ae582b59c0250d7912ba794dca9e669e605a
-
-# Source the common init script
-. @sysconfdir@/zfs/zfs-functions
-
-ZED_NAME="zed"
-ZED_PIDFILE="@runstatedir@/$ZED_NAME.pid"
-
-extra_started_commands="reload"
-
-# Exit if the package is not installed
-[ -x "$ZED" ] || exit 0
-
-# ----------------------------------------------------
-
-do_depend()
-{
-       after zfs-mount localmount
-}
-
-do_start()
-{
-       check_module_loaded "zfs" || exit 0
-
-       ZED_ARGS="$ZED_ARGS -p $ZED_PIDFILE"
-
-       zfs_action "Starting ZFS Event Daemon" zfs_daemon_start \
-           "$ZED_PIDFILE" "$ZED" "$ZED_ARGS"
-       return "$?"
-}
-
-do_stop()
-{
-       local pools RET
-       check_module_loaded "zfs" || exit 0
-
-       zfs_action "Stopping ZFS Event Daemon" zfs_daemon_stop \
-          "$ZED_PIDFILE" "$ZED" "$ZED_NAME"
-       if [ "$?" -eq "0" ]
-       then
-               # Let's see if we have any pools imported
-               pools=$("$ZPOOL" list -H -oname)
-               if [ -z "$pools" ]
-               then
-                       # No pools imported, it is/should be safe/possible to
-                       # unload modules.
-                       zfs_action "Unloading modules" rmmod zfs zunicode \
-                           zavl zcommon znvpair spl
-                       return "$?"
-               fi
-       else
-               return "$?"
-       fi
-}
-
-do_status()
-{
-       check_module_loaded "zfs" || exit 0
-
-       zfs_daemon_status "$ZED_PIDFILE" "$ZED" "$ZED_NAME"
-       return "$?"
-}
-
-do_reload()
-{
-       check_module_loaded "zfs" || exit 0
-
-       zfs_action "Reloading ZFS Event Daemon" zfs_daemon_reload \
-           "$ZED_PIDFILE" "$ZED_NAME"
-       return "$?"
-}
-
-# ----------------------------------------------------
-
-if [ ! -e /etc/gentoo-release ]; then
-       case "$1" in
-               start)
-                       do_start
-                       ;;
-               stop)
-                       do_stop
-                       ;;
-               status)
-                       do_status
-                       ;;
-               reload|force-reload)
-                       do_reload
-                       ;;
-               restart)
-                       do_stop
-                       do_start
-                       ;;
-               *)
-                       [ -n "$1" ] && echo "Error: Unknown command $1."
-                       echo "Usage: $0 {start|stop|status|reload|restart}"
-                       exit 1
-                       ;;
-       esac
-
-       exit $?
-else
-       # Create wrapper functions since Gentoo don't use the case part.
-       depend() { do_depend; }
-       start() { do_start; }
-       stop() { do_stop; }
-       status() { do_status; }
-       reload() { do_reload; }
-fi
+%:
+       #
index d81ef22c807d5f1bc467948f79eac70b1e2b3edc..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,132 +1,2 @@
-# ZoL userland configuration.
-
-# To enable a boolean setting, set it to yes, on, true, or 1.
-# Anything else will be interpreted as unset.
-
-# Run `zfs mount -a` during system start?
-ZFS_MOUNT='yes'
-
-# Run `zfs unmount -a` during system stop?
-ZFS_UNMOUNT='yes'
-
-# Run `zfs share -a` during system start?
-# nb: The shareiscsi, sharenfs, and sharesmb dataset properties.
-ZFS_SHARE='yes'
-
-# Run `zfs unshare -a` during system stop?
-ZFS_UNSHARE='yes'
-
-# By default, a verbatim import of all pools is performed at boot based on the
-# contents of the default zpool cache file.  The contents of the cache are
-# managed automatically by the 'zpool import' and 'zpool export' commands.
-#
-# By setting this to 'yes', the system will instead search all devices for
-# pools and attempt to import them all at boot, even those that have been
-# exported.  Under this mode, the search path can be controlled by the
-# ZPOOL_IMPORT_PATH variable and a list of pools that should not be imported
-# can be listed in the ZFS_POOL_EXCEPTIONS variable.
-#
-# Note that importing all visible pools may include pools that you don't
-# expect, such as those on removable devices and SANs, and those pools may
-# proceed to mount themselves in places you do not want them to.  The results
-# can be unpredictable and possibly dangerous.  Only enable this option if you
-# understand this risk and have complete physical control over your system and
-# SAN to prevent the insertion of malicious pools.
-ZPOOL_IMPORT_ALL_VISIBLE='no'
-
-# Specify specific path(s) to look for device nodes and/or links for the
-# pool import(s). See zpool(8) for more information about this variable.
-# It supersedes the old USE_DISK_BY_ID which indicated that it would only
-# try '/dev/disk/by-id'.
-# The old variable will still work in the code, but is deprecated.
-#ZPOOL_IMPORT_PATH="/dev/disk/by-vdev:/dev/disk/by-id"
-
-# List of pools that should NOT be imported at boot
-# when ZPOOL_IMPORT_ALL_VISIBLE is 'yes'.
-# This is a space separated list.
-#ZFS_POOL_EXCEPTIONS="test2"
-
-# List of pools that SHOULD be imported at boot by the initramfs
-# instead of trying to import all available pools.  If this is set
-# then ZFS_POOL_EXCEPTIONS is ignored.
-# Only applicable for Debian GNU/Linux {dkms,initramfs}.
-# This is a semi-colon separated list.
-#ZFS_POOL_IMPORT="pool1;pool2"
-
-# Should the datasets be mounted verbosely?
-# A mount counter will be used when mounting if set to 'yes'.
-VERBOSE_MOUNT='no'
-
-# Should we allow overlay mounts?
-# This is standard in Linux, but not ZFS which comes from Solaris where this
-# is not allowed).
-DO_OVERLAY_MOUNTS='no'
-
-# Any additional option to the 'zfs import' commandline?
-# Include '-o' for each option wanted.
-# You don't need to put '-f' in here, unless you want it ALL the time.
-# Using the option 'zfsforce=1' on the grub/kernel command line will
-# do the same, but on a case-to-case basis.
-ZPOOL_IMPORT_OPTS=""
-
-# Full path to the ZFS cache file?
-# See "cachefile" in zpool(8).
-# The default is "@sysconfdir@/zfs/zpool.cache".
-#ZPOOL_CACHE="@sysconfdir@/zfs/zpool.cache"
-#
-# Setting ZPOOL_CACHE to an empty string ('') AND setting ZPOOL_IMPORT_OPTS to
-# "-c @sysconfdir@/zfs/zpool.cache" will _enforce_ the use of a cache file.
-# This is needed in some cases (extreme amounts of VDEVs, multipath etc).
-# Generally, the use of a cache file is usually not recommended on Linux
-# because it sometimes is more trouble than it's worth (laptops with external
-# devices or when/if device nodes changes names).
-#ZPOOL_IMPORT_OPTS="-c @sysconfdir@/zfs/zpool.cache"
-#ZPOOL_CACHE=""
-
-# Any additional option to the 'zfs mount' command line?
-# Include '-o' for each option wanted.
-MOUNT_EXTRA_OPTIONS=""
-
-# Build kernel modules with the --enable-debug switch?
-# Only applicable for Debian GNU/Linux {dkms,initramfs}.
-ZFS_DKMS_ENABLE_DEBUG='no'
-
-# Build kernel modules with the --enable-debug-dmu-tx switch?
-# Only applicable for Debian GNU/Linux {dkms,initramfs}.
-ZFS_DKMS_ENABLE_DEBUG_DMU_TX='no'
-
-# Keep debugging symbols in kernel modules?
-# Only applicable for Debian GNU/Linux {dkms,initramfs}.
-ZFS_DKMS_DISABLE_STRIP='no'
-
-# Wait for this many seconds in the initrd pre_mountroot?
-# This delays startup and should be '0' on most systems.
-# Only applicable for Debian GNU/Linux {dkms,initramfs}.
-ZFS_INITRD_PRE_MOUNTROOT_SLEEP='0'
-
-# Wait for this many seconds in the initrd mountroot?
-# This delays startup and should be '0' on most systems. This might help on
-# systems which have their ZFS root on a USB disk that takes just a little
-# longer to be available
-# Only applicable for Debian GNU/Linux {dkms,initramfs}.
-ZFS_INITRD_POST_MODPROBE_SLEEP='0'
-
-# List of additional datasets to mount after the root dataset is mounted?
-#
-# The init script will use the mountpoint specified in the 'mountpoint'
-# property value in the dataset to determine where it should be mounted.
-#
-# This is a space separated list, and will be mounted in the order specified,
-# so if one filesystem depends on a previous mountpoint, make sure to put
-# them in the right order.
-#
-# It is not necessary to add filesystems below the root fs here. It is
-# taken care of by the initrd script automatically. These are only for
-# additional filesystems needed. Such as /opt, /usr/local which is not
-# located under the root fs.
-# Example: If root FS is 'rpool/ROOT/rootfs', this would make sense.
-#ZFS_INITRD_ADDITIONAL_DATASETS="rpool/ROOT/usr rpool/ROOT/var"
-
-# Optional arguments for the ZFS Event Daemon (ZED).
-# See zed(8) for more information on available options.
-#ZED_ARGS="-M"
+%:
+       #
diff --git a/zfs/etc/modules-load.d/.gitignore b/zfs/etc/modules-load.d/.gitignore
deleted file mode 100644 (file)
index fee9217..0000000
+++ /dev/null
@@ -1 +0,0 @@
-*.conf
diff --git a/zfs/etc/modules-load.d/Makefile.am b/zfs/etc/modules-load.d/Makefile.am
deleted file mode 100644 (file)
index a6780e1..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-modulesload_DATA = \
-       zfs.conf
-
-EXTRA_DIST = \
-       $(top_srcdir)/etc/modules-load.d/zfs.conf.in
-
-$(modulesload_DATA):
-       -$(SED) \
-               -e '' \
-               "$(top_srcdir)/etc/modules-load.d/$@.in" >'$@'
-
-distclean-local::
-       -$(RM) $(modulesload_DATA)
diff --git a/zfs/etc/modules-load.d/Makefile.in b/zfs/etc/modules-load.d/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
index 73304bc2cd4a8147d54ecd9b7bc7fcc4222a1146..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1 +1,2 @@
-zfs
+%:
+       #
diff --git a/zfs/etc/systemd/Makefile.am b/zfs/etc/systemd/Makefile.am
deleted file mode 100644 (file)
index d4008c0..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = system
diff --git a/zfs/etc/systemd/Makefile.in b/zfs/etc/systemd/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/etc/systemd/system/.gitignore b/zfs/etc/systemd/system/.gitignore
deleted file mode 100644 (file)
index efada54..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-*.service
-*.target
-*.preset
index 4efdd7200655274106c77b8f0b6a1351dbeefec2..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,2 +1,2 @@
-# ZFS is enabled by default
-enable zfs.*
+%:
+       #
diff --git a/zfs/etc/systemd/system/Makefile.am b/zfs/etc/systemd/system/Makefile.am
deleted file mode 100644 (file)
index f7023df..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-systemdpreset_DATA = \
-       50-zfs.preset
-
-systemdunit_DATA = \
-       zfs-zed.service \
-       zfs-import-cache.service \
-       zfs-import-scan.service \
-       zfs-mount.service \
-       zfs-share.service \
-       zfs.target
-
-EXTRA_DIST = \
-       $(top_srcdir)/etc/systemd/system/zfs-zed.service.in \
-       $(top_srcdir)/etc/systemd/system/zfs-import-cache.service.in \
-       $(top_srcdir)/etc/systemd/system/zfs-import-scan.service.in \
-       $(top_srcdir)/etc/systemd/system/zfs-mount.service.in \
-       $(top_srcdir)/etc/systemd/system/zfs-share.service.in \
-       $(top_srcdir)/etc/systemd/system/zfs.target.in \
-       $(top_srcdir)/etc/systemd/system/50-zfs.preset.in
-
-$(systemdunit_DATA):
-       -$(SED) -e 's,@bindir\@,$(bindir),g' \
-               -e 's,@runstatedir\@,$(runstatedir),g' \
-               -e 's,@sbindir\@,$(sbindir),g' \
-               -e 's,@sysconfdir\@,$(sysconfdir),g' \
-               "$(top_srcdir)/etc/systemd/system/$@.in" >'$@'
-
-$(systemdpreset_DATA):
-       -$(SED) -e 's,@bindir\@,$(bindir),g' \
-               -e 's,@runstatedir\@,$(runstatedir),g' \
-               -e 's,@sbindir\@,$(sbindir),g' \
-               -e 's,@sysconfdir\@,$(sysconfdir),g' \
-               "$(top_srcdir)/etc/systemd/system/$@.in" >'$@'
-
-distclean-local::
-       -$(RM) $(systemdunit_DATA) $(systemdpreset_DATA)
diff --git a/zfs/etc/systemd/system/Makefile.in b/zfs/etc/systemd/system/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/etc/systemd/system/zed.service.in b/zfs/etc/systemd/system/zed.service.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
index b1deb6ed96307678462efd7a00d31ee0dfed4464..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,13 +1,2 @@
-[Unit]
-Description=Import ZFS pools by cache file
-DefaultDependencies=no
-Requires=systemd-udev-settle.service
-After=systemd-udev-settle.service
-After=cryptsetup.target
-ConditionPathExists=@sysconfdir@/zfs/zpool.cache
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStartPre=/sbin/modprobe zfs
-ExecStart=@sbindir@/zpool import -c @sysconfdir@/zfs/zpool.cache -aN
+%:
+       #
index 517e12e3a26e797c8a07b6f1ec697e2da64f3e5e..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,13 +1,2 @@
-[Unit]
-Description=Import ZFS pools by device scanning
-DefaultDependencies=no
-Requires=systemd-udev-settle.service
-After=systemd-udev-settle.service
-After=cryptsetup.target
-ConditionPathExists=!@sysconfdir@/zfs/zpool.cache
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStartPre=/sbin/modprobe zfs
-ExecStart=@sbindir@/zpool import -d /dev/disk/by-id -aN
+%:
+       #
index f1056af311cd87cbeb017ecd82b32c22bb5a9f85..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,15 +1,2 @@
-[Unit]
-Description=Mount ZFS filesystems
-DefaultDependencies=no
-Wants=zfs-import-cache.service
-Wants=zfs-import-scan.service
-Requires=systemd-udev-settle.service
-After=systemd-udev-settle.service
-After=zfs-import-cache.service
-After=zfs-import-scan.service
-Before=local-fs.target
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStart=@sbindir@/zfs mount -a
+%:
+       #
index c27bbf903ecbe7afac20f5a8ca05200cbb7149e1..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,14 +1,2 @@
-[Unit]
-Description=ZFS file system shares
-After=nfs-server.service
-After=smb.service
-After=zfs-mount.service
-Requires=zfs-mount.service
-PartOf=nfs-server.service
-PartOf=smb.service
-
-[Service]
-Type=oneshot
-RemainAfterExit=yes
-ExecStartPre=-@bindir@/rm /etc/dfs/sharetab
-ExecStart=@sbindir@/zfs share -a
+%:
+       #
diff --git a/zfs/etc/systemd/system/zfs-zed.service.in b/zfs/etc/systemd/system/zfs-zed.service.in
deleted file mode 100644 (file)
index 4d4c9d8..0000000
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=ZFS Event Daemon (zed)
-Documentation=man:zed(8)
-After=zfs-import-cache.service
-After=zfs-import-scan.service
-
-[Service]
-ExecStart=@sbindir@/zed -F
-Restart=on-abort
-
-[Install]
-Alias=zed.service
index ce110e573bacee55a9ca1d4e666d9ecdc8200d37..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,8 +1,2 @@
-[Unit]
-Description=ZFS startup target
-Requires=zfs-mount.service
-Requires=zfs-share.service
-Wants=zfs-zed.service
-
-[Install]
-WantedBy=multi-user.target
+%:
+       #
diff --git a/zfs/etc/zfs/Makefile.am b/zfs/etc/zfs/Makefile.am
deleted file mode 100644 (file)
index ff35469..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-pkgsysconfdir = $(sysconfdir)/zfs
-
-pkgsysconf_DATA = \
-       vdev_id.conf.alias.example \
-       vdev_id.conf.sas_direct.example \
-       vdev_id.conf.sas_switch.example \
-       vdev_id.conf.multipath.example
-
-EXTRA_DIST = $(pkgsysconf_DATA)
diff --git a/zfs/etc/zfs/Makefile.in b/zfs/etc/zfs/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/etc/zfs/vdev_id.conf.alias.example b/zfs/etc/zfs/vdev_id.conf.alias.example
deleted file mode 100644 (file)
index 33735b0..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-#     by-vdev
-#     name     fully qualified or base name of device link
-alias d1       /dev/disk/by-id/wwn-0x5000c5002de3b9ca
-alias d2       wwn-0x5000c5002def789e
diff --git a/zfs/etc/zfs/vdev_id.conf.multipath.example b/zfs/etc/zfs/vdev_id.conf.multipath.example
deleted file mode 100644 (file)
index c1359d3..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-multipath yes
-
-#       PCI_ID  HBA PORT  CHANNEL NAME
-channel 85:00.0 1         A
-channel 85:00.0 0         B
-channel 86:00.0 1         A
-channel 86:00.0 0         B
diff --git a/zfs/etc/zfs/vdev_id.conf.sas_direct.example b/zfs/etc/zfs/vdev_id.conf.sas_direct.example
deleted file mode 100644 (file)
index 115ebd8..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-multipath     no
-topology      sas_direct
-phys_per_port 4
-
-#       PCI_ID  HBA PORT  CHANNEL NAME
-channel 85:00.0 1         A
-channel 85:00.0 0         B
-channel 86:00.0 1         C
-channel 86:00.0 0         D
-
-
-# Custom mapping for Channel A
-
-#    Linux      Mapped
-#    Slot       Slot      Channel
-slot 1          7         A
-slot 2          10        A
-slot 3          3         A
-slot 4          6         A
-
-# Default mapping for B, C, and D
-slot 1          4
-slot 2          2
-slot 3          1
-slot 4          3
diff --git a/zfs/etc/zfs/vdev_id.conf.sas_switch.example b/zfs/etc/zfs/vdev_id.conf.sas_switch.example
deleted file mode 100644 (file)
index b87d655..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-topology      sas_switch
-
-#       SWITCH PORT  CHANNEL NAME
-channel 1            A
-channel 2            B
-channel 3            C
-channel 4            D
diff --git a/zfs/include/Makefile.in b/zfs/include/Makefile.in
new file mode 100644 (file)
index 0000000..4deef36
--- /dev/null
@@ -0,0 +1,904 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__libzfs_HEADERS_DIST) $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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__kernel_HEADERS_DIST = $(top_srcdir)/include/zfeature_common.h \
+       $(top_srcdir)/include/zfs_comutil.h \
+       $(top_srcdir)/include/zfs_deleg.h \
+       $(top_srcdir)/include/zfs_fletcher.h \
+       $(top_srcdir)/include/zfs_namecheck.h \
+       $(top_srcdir)/include/zfs_prop.h \
+       $(top_srcdir)/include/zpios-ctl.h \
+       $(top_srcdir)/include/zpios-internal.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"
+am__libzfs_HEADERS_DIST = $(top_srcdir)/include/zfeature_common.h \
+       $(top_srcdir)/include/zfs_comutil.h \
+       $(top_srcdir)/include/zfs_deleg.h \
+       $(top_srcdir)/include/zfs_fletcher.h \
+       $(top_srcdir)/include/zfs_namecheck.h \
+       $(top_srcdir)/include/zfs_prop.h \
+       $(top_srcdir)/include/zpios-ctl.h \
+       $(top_srcdir)/include/libnvpair.h \
+       $(top_srcdir)/include/libuutil_common.h \
+       $(top_srcdir)/include/libuutil.h \
+       $(top_srcdir)/include/libuutil_impl.h \
+       $(top_srcdir)/include/libzfs.h \
+       $(top_srcdir)/include/libzfs_core.h \
+       $(top_srcdir)/include/libzfs_impl.h
+HEADERS = $(kernel_HEADERS) $(libzfs_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+SUBDIRS = linux sys
+COMMON_H = \
+       $(top_srcdir)/include/zfeature_common.h \
+       $(top_srcdir)/include/zfs_comutil.h \
+       $(top_srcdir)/include/zfs_deleg.h \
+       $(top_srcdir)/include/zfs_fletcher.h \
+       $(top_srcdir)/include/zfs_namecheck.h \
+       $(top_srcdir)/include/zfs_prop.h \
+       $(top_srcdir)/include/zpios-ctl.h
+
+KERNEL_H = \
+       $(top_srcdir)/include/zpios-internal.h
+
+USER_H = \
+       $(top_srcdir)/include/libnvpair.h \
+       $(top_srcdir)/include/libuutil_common.h \
+       $(top_srcdir)/include/libuutil.h \
+       $(top_srcdir)/include/libuutil_impl.h \
+       $(top_srcdir)/include/libzfs.h \
+       $(top_srcdir)/include/libzfs_core.h \
+       $(top_srcdir)/include/libzfs_impl.h
+
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_USER_TRUE@libzfsdir = $(includedir)/libzfs
+@CONFIG_USER_TRUE@libzfs_HEADERS = $(COMMON_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/zfs-$(VERSION)/include
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(am__uninstall_files_from_dir)
+install-libzfsHEADERS: $(libzfs_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libzfsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libzfsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libzfsdir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(libzfsdir)" || exit $$?; \
+       done
+
+uninstall-libzfsHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libzfsdir)'; $(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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-kernelHEADERS install-libzfsHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-kernelHEADERS install-libzfsHEADERS install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/include/linux/Makefile.in b/zfs/include/linux/Makefile.in
new file mode 100644 (file)
index 0000000..1e7710a
--- /dev/null
@@ -0,0 +1,760 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/linux
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(libzfs_HEADERS) $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/linux/dcache_compat.h \
+       $(top_srcdir)/include/linux/xattr_compat.h \
+       $(top_srcdir)/include/linux/vfs_compat.h \
+       $(top_srcdir)/include/linux/blkdev_compat.h \
+       $(top_srcdir)/include/linux/utsname_compat.h \
+       $(top_srcdir)/include/linux/kmap_compat.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"
+HEADERS = $(kernel_HEADERS) $(libzfs_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+COMMON_H = 
+KERNEL_H = \
+       $(top_srcdir)/include/linux/dcache_compat.h \
+       $(top_srcdir)/include/linux/xattr_compat.h \
+       $(top_srcdir)/include/linux/vfs_compat.h \
+       $(top_srcdir)/include/linux/blkdev_compat.h \
+       $(top_srcdir)/include/linux/utsname_compat.h \
+       $(top_srcdir)/include/linux/kmap_compat.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_USER_TRUE@libzfsdir = $(includedir)/libzfs/linux
+@CONFIG_USER_TRUE@libzfs_HEADERS = $(COMMON_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/zfs-$(VERSION)/include/linux
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/linux/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/linux/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(am__uninstall_files_from_dir)
+install-libzfsHEADERS: $(libzfs_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libzfsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libzfsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libzfsdir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(libzfsdir)" || exit $$?; \
+       done
+
+uninstall-libzfsHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libzfsdir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS install-libzfsHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS \
+       install-libzfsHEADERS 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 tags-am uninstall \
+       uninstall-am uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/include/sys/Makefile.in b/zfs/include/sys/Makefile.in
new file mode 100644 (file)
index 0000000..d3abc39
--- /dev/null
@@ -0,0 +1,1162 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__libzfs_HEADERS_DIST) $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/arc.h \
+       $(top_srcdir)/include/sys/arc_impl.h \
+       $(top_srcdir)/include/sys/avl.h \
+       $(top_srcdir)/include/sys/avl_impl.h \
+       $(top_srcdir)/include/sys/blkptr.h \
+       $(top_srcdir)/include/sys/bplist.h \
+       $(top_srcdir)/include/sys/bpobj.h \
+       $(top_srcdir)/include/sys/bptree.h \
+       $(top_srcdir)/include/sys/dbuf.h \
+       $(top_srcdir)/include/sys/ddt.h \
+       $(top_srcdir)/include/sys/dmu.h \
+       $(top_srcdir)/include/sys/dmu_impl.h \
+       $(top_srcdir)/include/sys/dmu_objset.h \
+       $(top_srcdir)/include/sys/dmu_send.h \
+       $(top_srcdir)/include/sys/dmu_traverse.h \
+       $(top_srcdir)/include/sys/dmu_tx.h \
+       $(top_srcdir)/include/sys/dmu_zfetch.h \
+       $(top_srcdir)/include/sys/dnode.h \
+       $(top_srcdir)/include/sys/dsl_bookmark.h \
+       $(top_srcdir)/include/sys/dsl_dataset.h \
+       $(top_srcdir)/include/sys/dsl_deadlist.h \
+       $(top_srcdir)/include/sys/dsl_deleg.h \
+       $(top_srcdir)/include/sys/dsl_destroy.h \
+       $(top_srcdir)/include/sys/dsl_dir.h \
+       $(top_srcdir)/include/sys/dsl_pool.h \
+       $(top_srcdir)/include/sys/dsl_prop.h \
+       $(top_srcdir)/include/sys/dsl_scan.h \
+       $(top_srcdir)/include/sys/dsl_synctask.h \
+       $(top_srcdir)/include/sys/dsl_userhold.h \
+       $(top_srcdir)/include/sys/efi_partition.h \
+       $(top_srcdir)/include/sys/metaslab.h \
+       $(top_srcdir)/include/sys/metaslab_impl.h \
+       $(top_srcdir)/include/sys/mntent.h \
+       $(top_srcdir)/include/sys/multilist.h \
+       $(top_srcdir)/include/sys/nvpair.h \
+       $(top_srcdir)/include/sys/nvpair_impl.h \
+       $(top_srcdir)/include/sys/range_tree.h \
+       $(top_srcdir)/include/sys/refcount.h \
+       $(top_srcdir)/include/sys/rrwlock.h \
+       $(top_srcdir)/include/sys/sa.h \
+       $(top_srcdir)/include/sys/sa_impl.h \
+       $(top_srcdir)/include/sys/sdt.h \
+       $(top_srcdir)/include/sys/spa_boot.h \
+       $(top_srcdir)/include/sys/space_map.h \
+       $(top_srcdir)/include/sys/space_reftree.h \
+       $(top_srcdir)/include/sys/spa.h \
+       $(top_srcdir)/include/sys/spa_impl.h \
+       $(top_srcdir)/include/sys/trace.h \
+       $(top_srcdir)/include/sys/trace_acl.h \
+       $(top_srcdir)/include/sys/trace_arc.h \
+       $(top_srcdir)/include/sys/trace_dbgmsg.h \
+       $(top_srcdir)/include/sys/trace_dbuf.h \
+       $(top_srcdir)/include/sys/trace_dmu.h \
+       $(top_srcdir)/include/sys/trace_dnode.h \
+       $(top_srcdir)/include/sys/trace_multilist.h \
+       $(top_srcdir)/include/sys/trace_txg.h \
+       $(top_srcdir)/include/sys/trace_zil.h \
+       $(top_srcdir)/include/sys/trace_zrlock.h \
+       $(top_srcdir)/include/sys/txg.h \
+       $(top_srcdir)/include/sys/txg_impl.h \
+       $(top_srcdir)/include/sys/u8_textprep_data.h \
+       $(top_srcdir)/include/sys/u8_textprep.h \
+       $(top_srcdir)/include/sys/uberblock.h \
+       $(top_srcdir)/include/sys/uberblock_impl.h \
+       $(top_srcdir)/include/sys/uio_impl.h \
+       $(top_srcdir)/include/sys/unique.h \
+       $(top_srcdir)/include/sys/uuid.h \
+       $(top_srcdir)/include/sys/vdev_disk.h \
+       $(top_srcdir)/include/sys/vdev_file.h \
+       $(top_srcdir)/include/sys/vdev.h \
+       $(top_srcdir)/include/sys/vdev_impl.h \
+       $(top_srcdir)/include/sys/xvattr.h \
+       $(top_srcdir)/include/sys/zap.h \
+       $(top_srcdir)/include/sys/zap_impl.h \
+       $(top_srcdir)/include/sys/zap_leaf.h \
+       $(top_srcdir)/include/sys/zfeature.h \
+       $(top_srcdir)/include/sys/zfs_acl.h \
+       $(top_srcdir)/include/sys/zfs_context.h \
+       $(top_srcdir)/include/sys/zfs_ctldir.h \
+       $(top_srcdir)/include/sys/zfs_debug.h \
+       $(top_srcdir)/include/sys/zfs_delay.h \
+       $(top_srcdir)/include/sys/zfs_dir.h \
+       $(top_srcdir)/include/sys/zfs_fuid.h \
+       $(top_srcdir)/include/sys/zfs_rlock.h \
+       $(top_srcdir)/include/sys/zfs_sa.h \
+       $(top_srcdir)/include/sys/zfs_stat.h \
+       $(top_srcdir)/include/sys/zfs_vfsops.h \
+       $(top_srcdir)/include/sys/zfs_vnops.h \
+       $(top_srcdir)/include/sys/zfs_znode.h \
+       $(top_srcdir)/include/sys/zil.h \
+       $(top_srcdir)/include/sys/zil_impl.h \
+       $(top_srcdir)/include/sys/zio_checksum.h \
+       $(top_srcdir)/include/sys/zio_compress.h \
+       $(top_srcdir)/include/sys/zio.h \
+       $(top_srcdir)/include/sys/zio_impl.h \
+       $(top_srcdir)/include/sys/zrlock.h \
+       $(top_srcdir)/include/sys/zfs_ioctl.h \
+       $(top_srcdir)/include/sys/zfs_onexit.h \
+       ${top_srcdir}/include/sys/zpl.h \
+       $(top_srcdir)/include/sys/zvol.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"
+am__libzfs_HEADERS_DIST = $(top_srcdir)/include/sys/arc.h \
+       $(top_srcdir)/include/sys/arc_impl.h \
+       $(top_srcdir)/include/sys/avl.h \
+       $(top_srcdir)/include/sys/avl_impl.h \
+       $(top_srcdir)/include/sys/blkptr.h \
+       $(top_srcdir)/include/sys/bplist.h \
+       $(top_srcdir)/include/sys/bpobj.h \
+       $(top_srcdir)/include/sys/bptree.h \
+       $(top_srcdir)/include/sys/dbuf.h \
+       $(top_srcdir)/include/sys/ddt.h \
+       $(top_srcdir)/include/sys/dmu.h \
+       $(top_srcdir)/include/sys/dmu_impl.h \
+       $(top_srcdir)/include/sys/dmu_objset.h \
+       $(top_srcdir)/include/sys/dmu_send.h \
+       $(top_srcdir)/include/sys/dmu_traverse.h \
+       $(top_srcdir)/include/sys/dmu_tx.h \
+       $(top_srcdir)/include/sys/dmu_zfetch.h \
+       $(top_srcdir)/include/sys/dnode.h \
+       $(top_srcdir)/include/sys/dsl_bookmark.h \
+       $(top_srcdir)/include/sys/dsl_dataset.h \
+       $(top_srcdir)/include/sys/dsl_deadlist.h \
+       $(top_srcdir)/include/sys/dsl_deleg.h \
+       $(top_srcdir)/include/sys/dsl_destroy.h \
+       $(top_srcdir)/include/sys/dsl_dir.h \
+       $(top_srcdir)/include/sys/dsl_pool.h \
+       $(top_srcdir)/include/sys/dsl_prop.h \
+       $(top_srcdir)/include/sys/dsl_scan.h \
+       $(top_srcdir)/include/sys/dsl_synctask.h \
+       $(top_srcdir)/include/sys/dsl_userhold.h \
+       $(top_srcdir)/include/sys/efi_partition.h \
+       $(top_srcdir)/include/sys/metaslab.h \
+       $(top_srcdir)/include/sys/metaslab_impl.h \
+       $(top_srcdir)/include/sys/mntent.h \
+       $(top_srcdir)/include/sys/multilist.h \
+       $(top_srcdir)/include/sys/nvpair.h \
+       $(top_srcdir)/include/sys/nvpair_impl.h \
+       $(top_srcdir)/include/sys/range_tree.h \
+       $(top_srcdir)/include/sys/refcount.h \
+       $(top_srcdir)/include/sys/rrwlock.h \
+       $(top_srcdir)/include/sys/sa.h \
+       $(top_srcdir)/include/sys/sa_impl.h \
+       $(top_srcdir)/include/sys/sdt.h \
+       $(top_srcdir)/include/sys/spa_boot.h \
+       $(top_srcdir)/include/sys/space_map.h \
+       $(top_srcdir)/include/sys/space_reftree.h \
+       $(top_srcdir)/include/sys/spa.h \
+       $(top_srcdir)/include/sys/spa_impl.h \
+       $(top_srcdir)/include/sys/trace.h \
+       $(top_srcdir)/include/sys/trace_acl.h \
+       $(top_srcdir)/include/sys/trace_arc.h \
+       $(top_srcdir)/include/sys/trace_dbgmsg.h \
+       $(top_srcdir)/include/sys/trace_dbuf.h \
+       $(top_srcdir)/include/sys/trace_dmu.h \
+       $(top_srcdir)/include/sys/trace_dnode.h \
+       $(top_srcdir)/include/sys/trace_multilist.h \
+       $(top_srcdir)/include/sys/trace_txg.h \
+       $(top_srcdir)/include/sys/trace_zil.h \
+       $(top_srcdir)/include/sys/trace_zrlock.h \
+       $(top_srcdir)/include/sys/txg.h \
+       $(top_srcdir)/include/sys/txg_impl.h \
+       $(top_srcdir)/include/sys/u8_textprep_data.h \
+       $(top_srcdir)/include/sys/u8_textprep.h \
+       $(top_srcdir)/include/sys/uberblock.h \
+       $(top_srcdir)/include/sys/uberblock_impl.h \
+       $(top_srcdir)/include/sys/uio_impl.h \
+       $(top_srcdir)/include/sys/unique.h \
+       $(top_srcdir)/include/sys/uuid.h \
+       $(top_srcdir)/include/sys/vdev_disk.h \
+       $(top_srcdir)/include/sys/vdev_file.h \
+       $(top_srcdir)/include/sys/vdev.h \
+       $(top_srcdir)/include/sys/vdev_impl.h \
+       $(top_srcdir)/include/sys/xvattr.h \
+       $(top_srcdir)/include/sys/zap.h \
+       $(top_srcdir)/include/sys/zap_impl.h \
+       $(top_srcdir)/include/sys/zap_leaf.h \
+       $(top_srcdir)/include/sys/zfeature.h \
+       $(top_srcdir)/include/sys/zfs_acl.h \
+       $(top_srcdir)/include/sys/zfs_context.h \
+       $(top_srcdir)/include/sys/zfs_ctldir.h \
+       $(top_srcdir)/include/sys/zfs_debug.h \
+       $(top_srcdir)/include/sys/zfs_delay.h \
+       $(top_srcdir)/include/sys/zfs_dir.h \
+       $(top_srcdir)/include/sys/zfs_fuid.h \
+       $(top_srcdir)/include/sys/zfs_rlock.h \
+       $(top_srcdir)/include/sys/zfs_sa.h \
+       $(top_srcdir)/include/sys/zfs_stat.h \
+       $(top_srcdir)/include/sys/zfs_vfsops.h \
+       $(top_srcdir)/include/sys/zfs_vnops.h \
+       $(top_srcdir)/include/sys/zfs_znode.h \
+       $(top_srcdir)/include/sys/zil.h \
+       $(top_srcdir)/include/sys/zil_impl.h \
+       $(top_srcdir)/include/sys/zio_checksum.h \
+       $(top_srcdir)/include/sys/zio_compress.h \
+       $(top_srcdir)/include/sys/zio.h \
+       $(top_srcdir)/include/sys/zio_impl.h \
+       $(top_srcdir)/include/sys/zrlock.h
+HEADERS = $(kernel_HEADERS) $(libzfs_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+SUBDIRS = fm fs
+COMMON_H = \
+       $(top_srcdir)/include/sys/arc.h \
+       $(top_srcdir)/include/sys/arc_impl.h \
+       $(top_srcdir)/include/sys/avl.h \
+       $(top_srcdir)/include/sys/avl_impl.h \
+       $(top_srcdir)/include/sys/blkptr.h \
+       $(top_srcdir)/include/sys/bplist.h \
+       $(top_srcdir)/include/sys/bpobj.h \
+       $(top_srcdir)/include/sys/bptree.h \
+       $(top_srcdir)/include/sys/dbuf.h \
+       $(top_srcdir)/include/sys/ddt.h \
+       $(top_srcdir)/include/sys/dmu.h \
+       $(top_srcdir)/include/sys/dmu_impl.h \
+       $(top_srcdir)/include/sys/dmu_objset.h \
+       $(top_srcdir)/include/sys/dmu_send.h \
+       $(top_srcdir)/include/sys/dmu_traverse.h \
+       $(top_srcdir)/include/sys/dmu_tx.h \
+       $(top_srcdir)/include/sys/dmu_zfetch.h \
+       $(top_srcdir)/include/sys/dnode.h \
+       $(top_srcdir)/include/sys/dsl_bookmark.h \
+       $(top_srcdir)/include/sys/dsl_dataset.h \
+       $(top_srcdir)/include/sys/dsl_deadlist.h \
+       $(top_srcdir)/include/sys/dsl_deleg.h \
+       $(top_srcdir)/include/sys/dsl_destroy.h \
+       $(top_srcdir)/include/sys/dsl_dir.h \
+       $(top_srcdir)/include/sys/dsl_pool.h \
+       $(top_srcdir)/include/sys/dsl_prop.h \
+       $(top_srcdir)/include/sys/dsl_scan.h \
+       $(top_srcdir)/include/sys/dsl_synctask.h \
+       $(top_srcdir)/include/sys/dsl_userhold.h \
+       $(top_srcdir)/include/sys/efi_partition.h \
+       $(top_srcdir)/include/sys/metaslab.h \
+       $(top_srcdir)/include/sys/metaslab_impl.h \
+       $(top_srcdir)/include/sys/mntent.h \
+       $(top_srcdir)/include/sys/multilist.h \
+       $(top_srcdir)/include/sys/nvpair.h \
+       $(top_srcdir)/include/sys/nvpair_impl.h \
+       $(top_srcdir)/include/sys/range_tree.h \
+       $(top_srcdir)/include/sys/refcount.h \
+       $(top_srcdir)/include/sys/rrwlock.h \
+       $(top_srcdir)/include/sys/sa.h \
+       $(top_srcdir)/include/sys/sa_impl.h \
+       $(top_srcdir)/include/sys/sdt.h \
+       $(top_srcdir)/include/sys/spa_boot.h \
+       $(top_srcdir)/include/sys/space_map.h \
+       $(top_srcdir)/include/sys/space_reftree.h \
+       $(top_srcdir)/include/sys/spa.h \
+       $(top_srcdir)/include/sys/spa_impl.h \
+       $(top_srcdir)/include/sys/trace.h \
+       $(top_srcdir)/include/sys/trace_acl.h \
+       $(top_srcdir)/include/sys/trace_arc.h \
+       $(top_srcdir)/include/sys/trace_dbgmsg.h \
+       $(top_srcdir)/include/sys/trace_dbuf.h \
+       $(top_srcdir)/include/sys/trace_dmu.h \
+       $(top_srcdir)/include/sys/trace_dnode.h \
+       $(top_srcdir)/include/sys/trace_multilist.h \
+       $(top_srcdir)/include/sys/trace_txg.h \
+       $(top_srcdir)/include/sys/trace_zil.h \
+       $(top_srcdir)/include/sys/trace_zrlock.h \
+       $(top_srcdir)/include/sys/txg.h \
+       $(top_srcdir)/include/sys/txg_impl.h \
+       $(top_srcdir)/include/sys/u8_textprep_data.h \
+       $(top_srcdir)/include/sys/u8_textprep.h \
+       $(top_srcdir)/include/sys/uberblock.h \
+       $(top_srcdir)/include/sys/uberblock_impl.h \
+       $(top_srcdir)/include/sys/uio_impl.h \
+       $(top_srcdir)/include/sys/unique.h \
+       $(top_srcdir)/include/sys/uuid.h \
+       $(top_srcdir)/include/sys/vdev_disk.h \
+       $(top_srcdir)/include/sys/vdev_file.h \
+       $(top_srcdir)/include/sys/vdev.h \
+       $(top_srcdir)/include/sys/vdev_impl.h \
+       $(top_srcdir)/include/sys/xvattr.h \
+       $(top_srcdir)/include/sys/zap.h \
+       $(top_srcdir)/include/sys/zap_impl.h \
+       $(top_srcdir)/include/sys/zap_leaf.h \
+       $(top_srcdir)/include/sys/zfeature.h \
+       $(top_srcdir)/include/sys/zfs_acl.h \
+       $(top_srcdir)/include/sys/zfs_context.h \
+       $(top_srcdir)/include/sys/zfs_ctldir.h \
+       $(top_srcdir)/include/sys/zfs_debug.h \
+       $(top_srcdir)/include/sys/zfs_delay.h \
+       $(top_srcdir)/include/sys/zfs_dir.h \
+       $(top_srcdir)/include/sys/zfs_fuid.h \
+       $(top_srcdir)/include/sys/zfs_rlock.h \
+       $(top_srcdir)/include/sys/zfs_sa.h \
+       $(top_srcdir)/include/sys/zfs_stat.h \
+       $(top_srcdir)/include/sys/zfs_vfsops.h \
+       $(top_srcdir)/include/sys/zfs_vnops.h \
+       $(top_srcdir)/include/sys/zfs_znode.h \
+       $(top_srcdir)/include/sys/zil.h \
+       $(top_srcdir)/include/sys/zil_impl.h \
+       $(top_srcdir)/include/sys/zio_checksum.h \
+       $(top_srcdir)/include/sys/zio_compress.h \
+       $(top_srcdir)/include/sys/zio.h \
+       $(top_srcdir)/include/sys/zio_impl.h \
+       $(top_srcdir)/include/sys/zrlock.h
+
+KERNEL_H = \
+       $(top_srcdir)/include/sys/zfs_ioctl.h \
+       $(top_srcdir)/include/sys/zfs_onexit.h \
+       ${top_srcdir}/include/sys/zpl.h \
+       $(top_srcdir)/include/sys/zvol.h
+
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_USER_TRUE@libzfsdir = $(includedir)/libzfs/sys
+@CONFIG_USER_TRUE@libzfs_HEADERS = $(COMMON_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(am__uninstall_files_from_dir)
+install-libzfsHEADERS: $(libzfs_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libzfsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libzfsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libzfsdir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(libzfsdir)" || exit $$?; \
+       done
+
+uninstall-libzfsHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libzfsdir)'; $(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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-kernelHEADERS install-libzfsHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-kernelHEADERS install-libzfsHEADERS install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/include/sys/fm/Makefile.in b/zfs/include/sys/fm/Makefile.in
new file mode 100644 (file)
index 0000000..1f344e9
--- /dev/null
@@ -0,0 +1,871 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys/fm
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__libzfs_HEADERS_DIST) $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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 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__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/fm/protocol.h \
+       $(top_srcdir)/include/sys/fm/util.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"
+am__libzfs_HEADERS_DIST = $(top_srcdir)/include/sys/fm/protocol.h \
+       $(top_srcdir)/include/sys/fm/util.h
+HEADERS = $(kernel_HEADERS) $(libzfs_HEADERS)
+RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive        \
+  distclean-recursive maintainer-clean-recursive
+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)
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+am__relativize = \
+  dir0=`pwd`; \
+  sed_first='s,^\([^/]*\)/.*$$,\1,'; \
+  sed_rest='s,^[^/]*/*,,'; \
+  sed_last='s,^.*/\([^/]*\)$$,\1,'; \
+  sed_butlast='s,/*[^/]*$$,,'; \
+  while test -n "$$dir1"; do \
+    first=`echo "$$dir1" | sed -e "$$sed_first"`; \
+    if test "$$first" != "."; then \
+      if test "$$first" = ".."; then \
+        dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \
+        dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \
+      else \
+        first2=`echo "$$dir2" | sed -e "$$sed_first"`; \
+        if test "$$first2" = "$$first"; then \
+          dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \
+        else \
+          dir2="../$$dir2"; \
+        fi; \
+        dir0="$$dir0"/"$$first"; \
+      fi; \
+    fi; \
+    dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \
+  done; \
+  reldir="$$dir2"
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+SUBDIRS = fs
+COMMON_H = \
+       $(top_srcdir)/include/sys/fm/protocol.h \
+       $(top_srcdir)/include/sys/fm/util.h
+
+KERNEL_H = 
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_USER_TRUE@libzfsdir = $(includedir)/libzfs/sys/fm
+@CONFIG_USER_TRUE@libzfs_HEADERS = $(COMMON_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+all: all-recursive
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/fm/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/fm/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(am__uninstall_files_from_dir)
+install-libzfsHEADERS: $(libzfs_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libzfsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libzfsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libzfsdir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(libzfsdir)" || exit $$?; \
+       done
+
+uninstall-libzfsHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libzfsdir)'; $(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.
+$(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//`; \
+       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; \
+           local_target="$$target-am"; \
+         else \
+           local_target="$$target"; \
+         fi; \
+         ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
+         || eval $$failcom; \
+       done; \
+       if test "$$dot_seen" = "no"; then \
+         $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
+       fi; test -z "$$fail"
+
+ID: $(am__tagged_files)
+       $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-recursive
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+       set x; \
+       here=`pwd`; \
+       if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
+         include_option=--etags-include; \
+         empty_fix=.; \
+       else \
+         include_option=--include; \
+         empty_fix=; \
+       fi; \
+       list='$(SUBDIRS)'; for subdir in $$list; do \
+         if test "$$subdir" = .; then :; else \
+           test ! -f $$subdir/TAGS || \
+             set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
+         fi; \
+       done; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || 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; \
+           dir1=$$subdir; dir2="$(top_distdir)"; \
+           $(am__relativize); \
+           new_top_distdir=$$reldir; \
+           echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \
+           echo "     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \
+           ($(am__cd) $$subdir && \
+             $(MAKE) $(AM_MAKEFLAGS) \
+               top_distdir="$$new_top_distdir" \
+               distdir="$$new_distdir" \
+               am__remove_distdir=: \
+               am__skip_length_check=: \
+               am__skip_mode_fix=: \
+               distdir) \
+             || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-recursive
+all-am: Makefile $(HEADERS)
+installdirs: installdirs-recursive
+installdirs-am:
+       for dir in "$(DESTDIR)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-recursive
+install-exec: install-exec-recursive
+install-data: install-data-recursive
+uninstall: uninstall-recursive
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-recursive
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-recursive
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-recursive
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-recursive
+
+dvi-am:
+
+html: html-recursive
+
+html-am:
+
+info: info-recursive
+
+info-am:
+
+install-data-am: install-kernelHEADERS install-libzfsHEADERS
+
+install-dvi: install-dvi-recursive
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-recursive
+
+install-html-am:
+
+install-info: install-info-recursive
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-recursive
+
+install-pdf-am:
+
+install-ps: install-ps-recursive
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-recursive
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-recursive
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-recursive
+
+pdf-am:
+
+ps: ps-recursive
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.MAKE: $(am__recursive_targets) install-am install-strip
+
+.PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am check \
+       check-am clean clean-generic clean-libtool 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-kernelHEADERS install-libzfsHEADERS install-man \
+       install-pdf install-pdf-am install-ps install-ps-am \
+       install-strip installcheck installcheck-am installdirs \
+       installdirs-am maintainer-clean maintainer-clean-generic \
+       mostlyclean mostlyclean-generic mostlyclean-libtool pdf pdf-am \
+       ps ps-am tags tags-am uninstall uninstall-am \
+       uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/include/sys/fm/fs/Makefile.in b/zfs/include/sys/fm/fs/Makefile.in
new file mode 100644 (file)
index 0000000..58330de
--- /dev/null
@@ -0,0 +1,751 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys/fm/fs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__libzfs_HEADERS_DIST) $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/fm/fs/zfs.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"
+am__libzfs_HEADERS_DIST = $(top_srcdir)/include/sys/fm/fs/zfs.h
+HEADERS = $(kernel_HEADERS) $(libzfs_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+COMMON_H = \
+       $(top_srcdir)/include/sys/fm/fs/zfs.h
+
+KERNEL_H = 
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_USER_TRUE@libzfsdir = $(includedir)/libzfs/sys/fm/fs
+@CONFIG_USER_TRUE@libzfs_HEADERS = $(COMMON_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fm/fs
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/fm/fs/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/fm/fs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(am__uninstall_files_from_dir)
+install-libzfsHEADERS: $(libzfs_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libzfsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libzfsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libzfsdir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(libzfsdir)" || exit $$?; \
+       done
+
+uninstall-libzfsHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libzfsdir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS install-libzfsHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS \
+       install-libzfsHEADERS 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 tags-am uninstall \
+       uninstall-am uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
diff --git a/zfs/include/sys/fs/Makefile.in b/zfs/include/sys/fs/Makefile.in
new file mode 100644 (file)
index 0000000..17b07a3
--- /dev/null
@@ -0,0 +1,751 @@
+# Makefile.in generated by automake 1.15 from Makefile.am.
+# @configure_input@
+
+# Copyright (C) 1994-2014 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.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+# PARTICULAR PURPOSE.
+
+@SET_MAKE@
+
+VPATH = @srcdir@
+am__is_gnu_make = { \
+  if test -z '$(MAKELEVEL)'; then \
+    false; \
+  elif test -n '$(MAKE_HOST)'; then \
+    true; \
+  elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \
+    true; \
+  else \
+    false; \
+  fi; \
+}
+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@
+pkglibexecdir = $(libexecdir)/@PACKAGE@
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
+install_sh_DATA = $(install_sh) -c -m 644
+install_sh_PROGRAM = $(install_sh) -c
+install_sh_SCRIPT = $(install_sh) -c
+INSTALL_HEADER = $(INSTALL_DATA)
+transform = $(program_transform_name)
+NORMAL_INSTALL = :
+PRE_INSTALL = :
+POST_INSTALL = :
+NORMAL_UNINSTALL = :
+PRE_UNINSTALL = :
+POST_UNINSTALL = :
+build_triplet = @build@
+host_triplet = @host@
+target_triplet = @target@
+subdir = include/sys/fs
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
+am__aclocal_m4_deps = $(top_srcdir)/config/always-no-bool-compare.m4 \
+       $(top_srcdir)/config/always-no-unused-but-set-variable.m4 \
+       $(top_srcdir)/config/dkms.m4 \
+       $(top_srcdir)/config/kernel-acl.m4 \
+       $(top_srcdir)/config/kernel-automount.m4 \
+       $(top_srcdir)/config/kernel-bdev-block-device-operations.m4 \
+       $(top_srcdir)/config/kernel-bdev-logical-size.m4 \
+       $(top_srcdir)/config/kernel-bdev-physical-size.m4 \
+       $(top_srcdir)/config/kernel-bdi-setup-and-register.m4 \
+       $(top_srcdir)/config/kernel-bio-bvec-iter.m4 \
+       $(top_srcdir)/config/kernel-bio-end-io-t-args.m4 \
+       $(top_srcdir)/config/kernel-bio-failfast.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-barrier.m4 \
+       $(top_srcdir)/config/kernel-bio-rw-discard.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-flush.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-hw-sectors.m4 \
+       $(top_srcdir)/config/kernel-blk-queue-max-segments.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get-by-path.m4 \
+       $(top_srcdir)/config/kernel-blkdev-get.m4 \
+       $(top_srcdir)/config/kernel-block-device-operations-release-void.m4 \
+       $(top_srcdir)/config/kernel-check-disk-size-change.m4 \
+       $(top_srcdir)/config/kernel-clear-inode.m4 \
+       $(top_srcdir)/config/kernel-commit-metadata.m4 \
+       $(top_srcdir)/config/kernel-create-nameidata.m4 \
+       $(top_srcdir)/config/kernel-current_bio_tail.m4 \
+       $(top_srcdir)/config/kernel-d-make-root.m4 \
+       $(top_srcdir)/config/kernel-d-obtain-alias.m4 \
+       $(top_srcdir)/config/kernel-d-prune-aliases.m4 \
+       $(top_srcdir)/config/kernel-declare-event-class.m4 \
+       $(top_srcdir)/config/kernel-dentry-operations.m4 \
+       $(top_srcdir)/config/kernel-dirty-inode.m4 \
+       $(top_srcdir)/config/kernel-discard-granularity.m4 \
+       $(top_srcdir)/config/kernel-elevator-change.m4 \
+       $(top_srcdir)/config/kernel-encode-fh-inode.m4 \
+       $(top_srcdir)/config/kernel-evict-inode.m4 \
+       $(top_srcdir)/config/kernel-fallocate.m4 \
+       $(top_srcdir)/config/kernel-file-inode.m4 \
+       $(top_srcdir)/config/kernel-fmode-t.m4 \
+       $(top_srcdir)/config/kernel-follow-down-one.m4 \
+       $(top_srcdir)/config/kernel-follow-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-fsync.m4 \
+       $(top_srcdir)/config/kernel-generic_io_acct.m4 \
+       $(top_srcdir)/config/kernel-get-disk-ro.m4 \
+       $(top_srcdir)/config/kernel-get-gendisk.m4 \
+       $(top_srcdir)/config/kernel-insert-inode-locked.m4 \
+       $(top_srcdir)/config/kernel-invalidate-bdev-args.m4 \
+       $(top_srcdir)/config/kernel-is_owner_or_cap.m4 \
+       $(top_srcdir)/config/kernel-kmap-atomic-args.m4 \
+       $(top_srcdir)/config/kernel-kobj-name-len.m4 \
+       $(top_srcdir)/config/kernel-lookup-bdev.m4 \
+       $(top_srcdir)/config/kernel-lookup-nameidata.m4 \
+       $(top_srcdir)/config/kernel-lseek-execute.m4 \
+       $(top_srcdir)/config/kernel-mk-request-fn.m4 \
+       $(top_srcdir)/config/kernel-mkdir-umode-t.m4 \
+       $(top_srcdir)/config/kernel-mount-nodev.m4 \
+       $(top_srcdir)/config/kernel-open-bdev-exclusive.m4 \
+       $(top_srcdir)/config/kernel-put-link-nameidata.m4 \
+       $(top_srcdir)/config/kernel-security-inode-init.m4 \
+       $(top_srcdir)/config/kernel-set-nlink.m4 \
+       $(top_srcdir)/config/kernel-sget-args.m4 \
+       $(top_srcdir)/config/kernel-show-options.m4 \
+       $(top_srcdir)/config/kernel-shrink.m4 \
+       $(top_srcdir)/config/kernel-truncate-range.m4 \
+       $(top_srcdir)/config/kernel-truncate-setsize.m4 \
+       $(top_srcdir)/config/kernel-vfs-iterate.m4 \
+       $(top_srcdir)/config/kernel-vfs-rw-iterate.m4 \
+       $(top_srcdir)/config/kernel-xattr-handler.m4 \
+       $(top_srcdir)/config/kernel.m4 $(top_srcdir)/config/libtool.m4 \
+       $(top_srcdir)/config/ltoptions.m4 \
+       $(top_srcdir)/config/ltsugar.m4 \
+       $(top_srcdir)/config/ltversion.m4 \
+       $(top_srcdir)/config/lt~obsolete.m4 \
+       $(top_srcdir)/config/mount-helper.m4 \
+       $(top_srcdir)/config/user-arch.m4 \
+       $(top_srcdir)/config/user-dracut.m4 \
+       $(top_srcdir)/config/user-frame-larger-than.m4 \
+       $(top_srcdir)/config/user-libblkid.m4 \
+       $(top_srcdir)/config/user-libuuid.m4 \
+       $(top_srcdir)/config/user-runstatedir.m4 \
+       $(top_srcdir)/config/user-systemd.m4 \
+       $(top_srcdir)/config/user-sysvinit.m4 \
+       $(top_srcdir)/config/user-udev.m4 \
+       $(top_srcdir)/config/user-zlib.m4 $(top_srcdir)/config/user.m4 \
+       $(top_srcdir)/config/zfs-build.m4 \
+       $(top_srcdir)/config/zfs-meta.m4 $(top_srcdir)/configure.ac
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
+       $(ACLOCAL_M4)
+DIST_COMMON = $(srcdir)/Makefile.am $(am__kernel_HEADERS_DIST) \
+       $(am__libzfs_HEADERS_DIST) $(am__DIST_COMMON)
+mkinstalldirs = $(install_sh) -d
+CONFIG_HEADER = $(top_builddir)/zfs_config.h
+CONFIG_CLEAN_FILES =
+CONFIG_CLEAN_VPATH_FILES =
+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__kernel_HEADERS_DIST = $(top_srcdir)/include/sys/fs/zfs.h
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
+am__vpath_adj = case $$p in \
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
+    *) f=$$p;; \
+  esac;
+am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
+am__install_max = 40
+am__nobase_strip_setup = \
+  srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
+am__nobase_strip = \
+  for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
+am__nobase_list = $(am__nobase_strip_setup); \
+  for p in $$list; do echo "$$p $$p"; done | \
+  sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
+  $(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
+    if (++n[$$2] == $(am__install_max)) \
+      { print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
+    END { for (dir in files) print dir, files[dir] }'
+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)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"
+am__libzfs_HEADERS_DIST = $(top_srcdir)/include/sys/fs/zfs.h
+HEADERS = $(kernel_HEADERS) $(libzfs_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
+am__DIST_COMMON = $(srcdir)/Makefile.in
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
+ACLOCAL = @ACLOCAL@
+ALIEN = @ALIEN@
+ALIEN_VERSION = @ALIEN_VERSION@
+AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
+AR = @AR@
+AUTOCONF = @AUTOCONF@
+AUTOHEADER = @AUTOHEADER@
+AUTOMAKE = @AUTOMAKE@
+AWK = @AWK@
+CC = @CC@
+CCAS = @CCAS@
+CCASDEPMODE = @CCASDEPMODE@
+CCASFLAGS = @CCASFLAGS@
+CCDEPMODE = @CCDEPMODE@
+CFLAGS = @CFLAGS@
+CPP = @CPP@
+CPPFLAGS = @CPPFLAGS@
+CYGPATH_W = @CYGPATH_W@
+DEBUG_CFLAGS = @DEBUG_CFLAGS@
+DEBUG_DMU_TX = @DEBUG_DMU_TX@
+DEBUG_STACKFLAGS = @DEBUG_STACKFLAGS@
+DEBUG_ZFS = @DEBUG_ZFS@
+DEFAULT_INITCONF_DIR = @DEFAULT_INITCONF_DIR@
+DEFAULT_INIT_DIR = @DEFAULT_INIT_DIR@
+DEFAULT_INIT_SCRIPT = @DEFAULT_INIT_SCRIPT@
+DEFAULT_PACKAGE = @DEFAULT_PACKAGE@
+DEFINE_INITRAMFS = @DEFINE_INITRAMFS@
+DEFS = @DEFS@
+DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
+DPKG = @DPKG@
+DPKGBUILD = @DPKGBUILD@
+DPKGBUILD_VERSION = @DPKGBUILD_VERSION@
+DPKG_VERSION = @DPKG_VERSION@
+DSYMUTIL = @DSYMUTIL@
+DUMPBIN = @DUMPBIN@
+ECHO_C = @ECHO_C@
+ECHO_N = @ECHO_N@
+ECHO_T = @ECHO_T@
+EGREP = @EGREP@
+EXEEXT = @EXEEXT@
+FGREP = @FGREP@
+FRAME_LARGER_THAN = @FRAME_LARGER_THAN@
+GREP = @GREP@
+HAVE_ALIEN = @HAVE_ALIEN@
+HAVE_DPKG = @HAVE_DPKG@
+HAVE_DPKGBUILD = @HAVE_DPKGBUILD@
+HAVE_RPM = @HAVE_RPM@
+HAVE_RPMBUILD = @HAVE_RPMBUILD@
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_SCRIPT = @INSTALL_SCRIPT@
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
+KERNELCPPFLAGS = @KERNELCPPFLAGS@
+KERNELMAKE_PARAMS = @KERNELMAKE_PARAMS@
+LD = @LD@
+LDFLAGS = @LDFLAGS@
+LIBBLKID = @LIBBLKID@
+LIBOBJS = @LIBOBJS@
+LIBS = @LIBS@
+LIBTOOL = @LIBTOOL@
+LIBUUID = @LIBUUID@
+LINUX = @LINUX@
+LINUX_OBJ = @LINUX_OBJ@
+LINUX_SYMBOLS = @LINUX_SYMBOLS@
+LINUX_VERSION = @LINUX_VERSION@
+LIPO = @LIPO@
+LN_S = @LN_S@
+LTLIBOBJS = @LTLIBOBJS@
+MAINT = @MAINT@
+MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
+MKDIR_P = @MKDIR_P@
+NM = @NM@
+NMEDIT = @NMEDIT@
+NO_BOOL_COMPARE = @NO_BOOL_COMPARE@
+NO_UNUSED_BUT_SET_VARIABLE = @NO_UNUSED_BUT_SET_VARIABLE@
+OBJDUMP = @OBJDUMP@
+OBJEXT = @OBJEXT@
+OTOOL = @OTOOL@
+OTOOL64 = @OTOOL64@
+PACKAGE = @PACKAGE@
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
+PACKAGE_NAME = @PACKAGE_NAME@
+PACKAGE_STRING = @PACKAGE_STRING@
+PACKAGE_TARNAME = @PACKAGE_TARNAME@
+PACKAGE_URL = @PACKAGE_URL@
+PACKAGE_VERSION = @PACKAGE_VERSION@
+PATH_SEPARATOR = @PATH_SEPARATOR@
+RANLIB = @RANLIB@
+RELEASE = @RELEASE@
+RPM = @RPM@
+RPMBUILD = @RPMBUILD@
+RPMBUILD_VERSION = @RPMBUILD_VERSION@
+RPM_DEFINE_COMMON = @RPM_DEFINE_COMMON@
+RPM_DEFINE_DKMS = @RPM_DEFINE_DKMS@
+RPM_DEFINE_KMOD = @RPM_DEFINE_KMOD@
+RPM_DEFINE_UTIL = @RPM_DEFINE_UTIL@
+RPM_SPEC_DIR = @RPM_SPEC_DIR@
+RPM_VERSION = @RPM_VERSION@
+SED = @SED@
+SET_MAKE = @SET_MAKE@
+SHELL = @SHELL@
+SPL = @SPL@
+SPL_OBJ = @SPL_OBJ@
+SPL_SYMBOLS = @SPL_SYMBOLS@
+SPL_VERSION = @SPL_VERSION@
+SRPM_DEFINE_COMMON = @SRPM_DEFINE_COMMON@
+SRPM_DEFINE_DKMS = @SRPM_DEFINE_DKMS@
+SRPM_DEFINE_KMOD = @SRPM_DEFINE_KMOD@
+SRPM_DEFINE_UTIL = @SRPM_DEFINE_UTIL@
+STRIP = @STRIP@
+TARGET_ASM_DIR = @TARGET_ASM_DIR@
+VENDOR = @VENDOR@
+VERSION = @VERSION@
+ZFS_CONFIG = @ZFS_CONFIG@
+ZFS_INIT_SYSTEMD = @ZFS_INIT_SYSTEMD@
+ZFS_INIT_SYSV = @ZFS_INIT_SYSV@
+ZFS_META_ALIAS = @ZFS_META_ALIAS@
+ZFS_META_AUTHOR = @ZFS_META_AUTHOR@
+ZFS_META_DATA = @ZFS_META_DATA@
+ZFS_META_LICENSE = @ZFS_META_LICENSE@
+ZFS_META_LT_AGE = @ZFS_META_LT_AGE@
+ZFS_META_LT_CURRENT = @ZFS_META_LT_CURRENT@
+ZFS_META_LT_REVISION = @ZFS_META_LT_REVISION@
+ZFS_META_NAME = @ZFS_META_NAME@
+ZFS_META_RELEASE = @ZFS_META_RELEASE@
+ZFS_META_VERSION = @ZFS_META_VERSION@
+ZFS_MODULE_LOAD = @ZFS_MODULE_LOAD@
+ZLIB = @ZLIB@
+abs_builddir = @abs_builddir@
+abs_srcdir = @abs_srcdir@
+abs_top_builddir = @abs_top_builddir@
+abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
+ac_ct_CC = @ac_ct_CC@
+ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
+am__include = @am__include@
+am__leading_dot = @am__leading_dot@
+am__quote = @am__quote@
+am__tar = @am__tar@
+am__untar = @am__untar@
+bindir = @bindir@
+build = @build@
+build_alias = @build_alias@
+build_cpu = @build_cpu@
+build_os = @build_os@
+build_vendor = @build_vendor@
+builddir = @builddir@
+datadir = @datadir@
+datarootdir = @datarootdir@
+docdir = @docdir@
+dracutdir = @dracutdir@
+dvidir = @dvidir@
+exec_prefix = @exec_prefix@
+host = @host@
+host_alias = @host_alias@
+host_cpu = @host_cpu@
+host_os = @host_os@
+host_vendor = @host_vendor@
+htmldir = @htmldir@
+includedir = @includedir@
+infodir = @infodir@
+install_sh = @install_sh@
+libdir = @libdir@
+libexecdir = @libexecdir@
+localedir = @localedir@
+localstatedir = @localstatedir@
+mandir = @mandir@
+mkdir_p = @mkdir_p@
+modulesloaddir = @modulesloaddir@
+mounthelperdir = @mounthelperdir@
+oldincludedir = @oldincludedir@
+pdfdir = @pdfdir@
+prefix = @prefix@
+program_transform_name = @program_transform_name@
+psdir = @psdir@
+runstatedir = @runstatedir@
+sbindir = @sbindir@
+sharedstatedir = @sharedstatedir@
+srcdir = @srcdir@
+sysconfdir = @sysconfdir@
+systemdpresetdir = @systemdpresetdir@
+systemdunitdir = @systemdunitdir@
+target = @target@
+target_alias = @target_alias@
+target_cpu = @target_cpu@
+target_os = @target_os@
+target_vendor = @target_vendor@
+top_build_prefix = @top_build_prefix@
+top_builddir = @top_builddir@
+top_srcdir = @top_srcdir@
+udevdir = @udevdir@
+udevruledir = @udevruledir@
+COMMON_H = \
+       $(top_srcdir)/include/sys/fs/zfs.h
+
+KERNEL_H = 
+USER_H = 
+EXTRA_DIST = $(COMMON_H) $(KERNEL_H) $(USER_H)
+@CONFIG_USER_TRUE@libzfsdir = $(includedir)/libzfs/sys/fs
+@CONFIG_USER_TRUE@libzfs_HEADERS = $(COMMON_H) $(USER_H)
+@CONFIG_KERNEL_TRUE@kerneldir = @prefix@/src/zfs-$(VERSION)/include/sys/fs
+@CONFIG_KERNEL_TRUE@kernel_HEADERS = $(COMMON_H) $(KERNEL_H)
+all: all-am
+
+.SUFFIXES:
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)
+       @for dep in $?; do \
+         case '$(am__configure_deps)' in \
+           *$$dep*) \
+             ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
+               && { if test -f $@; then exit 0; else break; fi; }; \
+             exit 1;; \
+         esac; \
+       done; \
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --gnu include/sys/fs/Makefile'; \
+       $(am__cd) $(top_srcdir) && \
+         $(AUTOMAKE) --gnu include/sys/fs/Makefile
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
+       @case '$?' in \
+         *config.status*) \
+           cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
+         *) \
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
+           cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
+       esac;
+
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
+       cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
+$(am__aclocal_m4_deps):
+
+mostlyclean-libtool:
+       -rm -f *.lo
+
+clean-libtool:
+       -rm -rf .libs _libs
+install-kernelHEADERS: $(kernel_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(kerneldir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(kerneldir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(kerneldir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(kerneldir)" || exit $$?; \
+       done
+
+uninstall-kernelHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(kernel_HEADERS)'; test -n "$(kerneldir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(kerneldir)'; $(am__uninstall_files_from_dir)
+install-libzfsHEADERS: $(libzfs_HEADERS)
+       @$(NORMAL_INSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       if test -n "$$list"; then \
+         echo " $(MKDIR_P) '$(DESTDIR)$(libzfsdir)'"; \
+         $(MKDIR_P) "$(DESTDIR)$(libzfsdir)" || exit 1; \
+       fi; \
+       for p in $$list; do \
+         if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
+         echo "$$d$$p"; \
+       done | $(am__base_list) | \
+       while read files; do \
+         echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(libzfsdir)'"; \
+         $(INSTALL_HEADER) $$files "$(DESTDIR)$(libzfsdir)" || exit $$?; \
+       done
+
+uninstall-libzfsHEADERS:
+       @$(NORMAL_UNINSTALL)
+       @list='$(libzfs_HEADERS)'; test -n "$(libzfsdir)" || list=; \
+       files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
+       dir='$(DESTDIR)$(libzfsdir)'; $(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`; \
+       $(am__define_uniq_tagged_files); \
+       shift; \
+       if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
+         test -n "$$unique" || unique=$$empty_fix; \
+         if test $$# -gt 0; then \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             "$$@" $$unique; \
+         else \
+           $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
+             $$unique; \
+         fi; \
+       fi
+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
+
+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
+
+distdir: $(DISTFILES)
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
+       list='$(DISTFILES)'; \
+         dist_files=`for file in $$list; do echo $$file; done | \
+         sed -e "s|^$$srcdirstrip/||;t" \
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \
+       case $$dist_files in \
+         */*) $(MKDIR_P) `echo "$$dist_files" | \
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \
+                          sort -u` ;; \
+       esac; \
+       for file in $$dist_files; do \
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \
+         if test -d $$d/$$file; then \
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \
+           if test -d "$(distdir)/$$file"; then \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \
+             cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \
+             find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \
+           fi; \
+           cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \
+         else \
+           test -f "$(distdir)/$$file" \
+           || cp -p $$d/$$file "$(distdir)/$$file" \
+           || exit 1; \
+         fi; \
+       done
+check-am: all-am
+check: check-am
+all-am: Makefile $(HEADERS)
+installdirs:
+       for dir in "$(DESTDIR)$(kerneldir)" "$(DESTDIR)$(libzfsdir)"; do \
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \
+       done
+install: install-am
+install-exec: install-exec-am
+install-data: install-data-am
+uninstall: uninstall-am
+
+install-am: all-am
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
+
+installcheck: installcheck-am
+install-strip:
+       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:
+
+distclean-generic:
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
+       -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+
+maintainer-clean-generic:
+       @echo "This command is intended for maintainers to use"
+       @echo "it deletes files that may require special tools to rebuild."
+clean: clean-am
+
+clean-am: clean-generic clean-libtool mostlyclean-am
+
+distclean: distclean-am
+       -rm -f Makefile
+distclean-am: clean-am distclean-generic distclean-tags
+
+dvi: dvi-am
+
+dvi-am:
+
+html: html-am
+
+html-am:
+
+info: info-am
+
+info-am:
+
+install-data-am: install-kernelHEADERS install-libzfsHEADERS
+
+install-dvi: install-dvi-am
+
+install-dvi-am:
+
+install-exec-am:
+
+install-html: install-html-am
+
+install-html-am:
+
+install-info: install-info-am
+
+install-info-am:
+
+install-man:
+
+install-pdf: install-pdf-am
+
+install-pdf-am:
+
+install-ps: install-ps-am
+
+install-ps-am:
+
+installcheck-am:
+
+maintainer-clean: maintainer-clean-am
+       -rm -f Makefile
+maintainer-clean-am: distclean-am maintainer-clean-generic
+
+mostlyclean: mostlyclean-am
+
+mostlyclean-am: mostlyclean-generic mostlyclean-libtool
+
+pdf: pdf-am
+
+pdf-am:
+
+ps: ps-am
+
+ps-am:
+
+uninstall-am: uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.MAKE: install-am install-strip
+
+.PHONY: CTAGS GTAGS TAGS all all-am check check-am clean clean-generic \
+       clean-libtool 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-kernelHEADERS \
+       install-libzfsHEADERS 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 tags-am uninstall \
+       uninstall-am uninstall-kernelHEADERS uninstall-libzfsHEADERS
+
+.PRECIOUS: Makefile
+
+
+# Tell versions [3.59,3.63) of GNU make to not export all variables.
+# Otherwise a system limit (for SysV at least) may be exceeded.
+.NOEXPORT:
index bc15237bfca2863f4974a6c491b7466311638356..ed60b86dbd71b900955e0a5e1ae1dc85b1ada283 100644 (file)
@@ -213,6 +213,7 @@ int zap_lookup_norm(objset_t *ds, uint64_t zapobj, const char *name,
 int zap_lookup_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
     int key_numints, uint64_t integer_size, uint64_t num_integers, void *buf);
 int zap_contains(objset_t *ds, uint64_t zapobj, const char *name);
+int zap_prefetch(objset_t *os, uint64_t zapobj, const char *name);
 int zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
     int key_numints);
 
index 960a9a6291463706cbd41fe15107926c703c3577..65c44f3cca549017bd8d7ba591915810189189a8 100644 (file)
@@ -77,7 +77,8 @@ extern int zfsctl_snapdir_mkdir(struct inode *dip, char *dirname, vattr_t *vap,
 extern void zfsctl_snapdir_inactive(struct inode *ip);
 extern int zfsctl_snapshot_mount(struct path *path, int flags);
 extern int zfsctl_snapshot_unmount(char *snapname, int flags);
-extern int zfsctl_snapshot_unmount_delay(uint64_t objsetid, int delay);
+extern int zfsctl_snapshot_unmount_delay(spa_t *spa, uint64_t objsetid,
+    int delay);
 extern int zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid,
     zfs_sb_t **zsb);
 
index 278b6e0868a9038fa27afc1aee185229bc4b071c..4916d87249eaa668fca4024953dc569362dc7314 100644 (file)
@@ -525,6 +525,7 @@ extern void *zio_buf_alloc(size_t size);
 extern void zio_buf_free(void *buf, size_t size);
 extern void *zio_data_buf_alloc(size_t size);
 extern void zio_data_buf_free(void *buf, size_t size);
+extern void *zio_buf_alloc_flags(size_t size, int flags);
 
 extern void zio_resubmit_stage_async(void *);
 
index aee4f0a50125ac02fe29b1800c26940cc9f4aee2..9a47ff91d55c037ed5694ddb0d989e5a7f72d7c6 100644 (file)
@@ -29,8 +29,6 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with ZPIOS.  If not, see <http://www.gnu.org/licenses/>.
- *
- *  Copyright (c) 2015, Intel Corporation.
  */
 
 #ifndef _ZPIOS_CTL_H
@@ -118,7 +116,6 @@ typedef struct zpios_cmd {
        uint32_t cmd_chunk_noise;       /* Chunk noise */
        uint32_t cmd_thread_delay;      /* Thread delay */
        uint32_t cmd_flags;             /* Test flags */
-       uint32_t cmd_block_size;        /* ZFS block size */
        char cmd_pre[ZPIOS_PATH_SIZE];  /* Pre-exec hook */
        char cmd_post[ZPIOS_PATH_SIZE]; /* Post-exec hook */
        char cmd_log[ZPIOS_PATH_SIZE];  /* Requested log dir */
index dd2bd2343a42ed3f11babba942ab0b298ca172a2..4b99b4ce31f37a3c72f7768ea1e4989d5542311b 100644 (file)
@@ -29,8 +29,6 @@
  *
  *  You should have received a copy of the GNU General Public License along
  *  with ZPIOS.  If not, see <http://www.gnu.org/licenses/>.
- *
- *  Copyright (c) 2015, Intel Corporation.
  */
 
 #ifndef _ZPIOS_INTERNAL_H
@@ -81,7 +79,6 @@ typedef struct run_args {
        __u32 chunk_noise;
        __u32 thread_delay;
        __u32 flags;
-       __u32 block_size;
        char pre[ZPIOS_PATH_SIZE];
        char post[ZPIOS_PATH_SIZE];
        char log[ZPIOS_PATH_SIZE];
diff --git a/zfs/lib/Makefile.am b/zfs/lib/Makefile.am
deleted file mode 100644 (file)
index 8e7caf2..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-# NB: GNU Automake Manual, Chapter 8.3.5: Libtool Convenience Libraries
-# These five libraries are intermediary build components.
-SUBDIRS = libspl libavl libefi libshare libunicode
-
-# These four libraries, which are installed as the final build product,
-# incorporate the five convenience libraries given above.
-SUBDIRS += libuutil libnvpair libzpool libzfs_core libzfs
diff --git a/zfs/lib/Makefile.in b/zfs/lib/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libavl/Makefile.am b/zfs/lib/libavl/Makefile.am
deleted file mode 100644 (file)
index 6a42649..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-VPATH = $(top_srcdir)/module/avl/
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-noinst_LTLIBRARIES = libavl.la
-
-USER_C =
-
-KERNEL_C = \
-       avl.c
-
-nodist_libavl_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libavl/Makefile.in b/zfs/lib/libavl/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libefi/Makefile.am b/zfs/lib/libefi/Makefile.am
deleted file mode 100644 (file)
index 60863a8..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-noinst_LTLIBRARIES = libefi.la
-
-USER_C = \
-       rdwr_efi.c
-
-KERNEL_C =
-
-nodist_libefi_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-libefi_la_LIBADD = $(LIBUUID) $(ZLIB)
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libefi/Makefile.in b/zfs/lib/libefi/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libefi/rdwr_efi.c b/zfs/lib/libefi/rdwr_efi.c
deleted file mode 100644 (file)
index 785cfe6..0000000
+++ /dev/null
@@ -1,1504 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <strings.h>
-#include <unistd.h>
-#include <uuid/uuid.h>
-#include <zlib.h>
-#include <libintl.h>
-#include <sys/types.h>
-#include <sys/dkio.h>
-#include <sys/vtoc.h>
-#include <sys/mhd.h>
-#include <sys/param.h>
-#include <sys/dktp/fdisk.h>
-#include <sys/efi_partition.h>
-#include <sys/byteorder.h>
-#if defined(__linux__)
-#include <linux/fs.h>
-#endif
-
-static struct uuid_to_ptag {
-       struct uuid     uuid;
-} conversion_array[] = {
-       { EFI_UNUSED },
-       { EFI_BOOT },
-       { EFI_ROOT },
-       { EFI_SWAP },
-       { EFI_USR },
-       { EFI_BACKUP },
-       { EFI_UNUSED },         /* STAND is never used */
-       { EFI_VAR },
-       { EFI_HOME },
-       { EFI_ALTSCTR },
-       { EFI_UNUSED },         /* CACHE (cachefs) is never used */
-       { EFI_RESERVED },
-       { EFI_SYSTEM },
-       { EFI_LEGACY_MBR },
-       { EFI_SYMC_PUB },
-       { EFI_SYMC_CDS },
-       { EFI_MSFT_RESV },
-       { EFI_DELL_BASIC },
-       { EFI_DELL_RAID },
-       { EFI_DELL_SWAP },
-       { EFI_DELL_LVM },
-       { EFI_DELL_RESV },
-       { EFI_AAPL_HFS },
-       { EFI_AAPL_UFS }
-};
-
-/*
- * Default vtoc information for non-SVr4 partitions
- */
-struct dk_map2  default_vtoc_map[NDKMAP] = {
-       {       V_ROOT,         0       },              /* a - 0 */
-       {       V_SWAP,         V_UNMNT },              /* b - 1 */
-       {       V_BACKUP,       V_UNMNT },              /* c - 2 */
-       {       V_UNASSIGNED,   0       },              /* d - 3 */
-       {       V_UNASSIGNED,   0       },              /* e - 4 */
-       {       V_UNASSIGNED,   0       },              /* f - 5 */
-       {       V_USR,          0       },              /* g - 6 */
-       {       V_UNASSIGNED,   0       },              /* h - 7 */
-
-#if defined(_SUNOS_VTOC_16)
-
-#if defined(i386) || defined(__amd64) || defined(__arm) || \
-    defined(__powerpc) || defined(__sparc)
-       {       V_BOOT,         V_UNMNT },              /* i - 8 */
-       {       V_ALTSCTR,      0       },              /* j - 9 */
-
-#else
-#error No VTOC format defined.
-#endif                 /* defined(i386) */
-
-       {       V_UNASSIGNED,   0       },              /* k - 10 */
-       {       V_UNASSIGNED,   0       },              /* l - 11 */
-       {       V_UNASSIGNED,   0       },              /* m - 12 */
-       {       V_UNASSIGNED,   0       },              /* n - 13 */
-       {       V_UNASSIGNED,   0       },              /* o - 14 */
-       {       V_UNASSIGNED,   0       },              /* p - 15 */
-#endif                 /* defined(_SUNOS_VTOC_16) */
-};
-
-#ifdef DEBUG
-int efi_debug = 1;
-#else
-int efi_debug = 0;
-#endif
-
-static int efi_read(int, struct dk_gpt *);
-
-/*
- * Return a 32-bit CRC of the contents of the buffer.  Pre-and-post
- * one's conditioning will be handled by crc32() internally.
- */
-static uint32_t
-efi_crc32(const unsigned char *buf, unsigned int size)
-{
-       uint32_t crc = crc32(0, Z_NULL, 0);
-
-       crc = crc32(crc, buf, size);
-
-       return (crc);
-}
-
-static int
-read_disk_info(int fd, diskaddr_t *capacity, uint_t *lbsize)
-{
-       int sector_size;
-       unsigned long long capacity_size;
-
-       if (ioctl(fd, BLKSSZGET, &sector_size) < 0)
-               return (-1);
-
-       if (ioctl(fd, BLKGETSIZE64, &capacity_size) < 0)
-               return (-1);
-
-       *lbsize = (uint_t)sector_size;
-       *capacity = (diskaddr_t)(capacity_size / sector_size);
-
-       return (0);
-}
-
-static int
-efi_get_info(int fd, struct dk_cinfo *dki_info)
-{
-#if defined(__linux__)
-       char *path;
-       char *dev_path;
-       int rval = 0;
-
-       memset(dki_info, 0, sizeof (*dki_info));
-
-       path = calloc(PATH_MAX, 1);
-       if (path == NULL)
-               goto error;
-
-       /*
-        * The simplest way to get the partition number under linux is
-        * to parse it out of the /dev/<disk><parition> block device name.
-        * The kernel creates this using the partition number when it
-        * populates /dev/ so it may be trusted.  The tricky bit here is
-        * that the naming convention is based on the block device type.
-        * So we need to take this in to account when parsing out the
-        * partition information.  Another issue is that the libefi API
-        * API only provides the open fd and not the file path.  To handle
-        * this realpath(3) is used to resolve the block device name from
-        * /proc/self/fd/<fd>.  Aside from the partition number we collect
-        * some additional device info.
-        */
-       (void) sprintf(path, "/proc/self/fd/%d", fd);
-       dev_path = realpath(path, NULL);
-       free(path);
-
-       if (dev_path == NULL)
-               goto error;
-
-       if ((strncmp(dev_path, "/dev/sd", 7) == 0)) {
-               strcpy(dki_info->dki_cname, "sd");
-               dki_info->dki_ctype = DKC_SCSI_CCS;
-               rval = sscanf(dev_path, "/dev/%[a-zA-Z]%hu",
-                   dki_info->dki_dname,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/hd", 7) == 0)) {
-               strcpy(dki_info->dki_cname, "hd");
-               dki_info->dki_ctype = DKC_DIRECT;
-               rval = sscanf(dev_path, "/dev/%[a-zA-Z]%hu",
-                   dki_info->dki_dname,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/md", 7) == 0)) {
-               strcpy(dki_info->dki_cname, "pseudo");
-               dki_info->dki_ctype = DKC_MD;
-               strcpy(dki_info->dki_dname, "md");
-               rval = sscanf(dev_path, "/dev/md%[0-9]p%hu",
-                   dki_info->dki_dname + 2,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/vd", 7) == 0)) {
-               strcpy(dki_info->dki_cname, "vd");
-               dki_info->dki_ctype = DKC_MD;
-               rval = sscanf(dev_path, "/dev/%[a-zA-Z]%hu",
-                   dki_info->dki_dname,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/xvd", 8) == 0)) {
-               strcpy(dki_info->dki_cname, "xvd");
-               dki_info->dki_ctype = DKC_MD;
-               rval = sscanf(dev_path, "/dev/%[a-zA-Z]%hu",
-                   dki_info->dki_dname,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/zd", 7) == 0)) {
-               strcpy(dki_info->dki_cname, "zd");
-               dki_info->dki_ctype = DKC_MD;
-               rval = sscanf(dev_path, "/dev/%[a-zA-Z]%hu",
-                   dki_info->dki_dname,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/dm-", 8) == 0)) {
-               strcpy(dki_info->dki_cname, "pseudo");
-               dki_info->dki_ctype = DKC_VBD;
-               strcpy(dki_info->dki_dname, "dm-");
-               rval = sscanf(dev_path, "/dev/dm-%[0-9]p%hu",
-                   dki_info->dki_dname + 3,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/ram", 8) == 0)) {
-               strcpy(dki_info->dki_cname, "pseudo");
-               dki_info->dki_ctype = DKC_PCMCIA_MEM;
-               strcpy(dki_info->dki_dname, "ram");
-               rval = sscanf(dev_path, "/dev/ram%[0-9]p%hu",
-                   dki_info->dki_dname + 3,
-                   &dki_info->dki_partition);
-       } else if ((strncmp(dev_path, "/dev/loop", 9) == 0)) {
-               strcpy(dki_info->dki_cname, "pseudo");
-               dki_info->dki_ctype = DKC_VBD;
-               strcpy(dki_info->dki_dname, "loop");
-               rval = sscanf(dev_path, "/dev/loop%[0-9]p%hu",
-                   dki_info->dki_dname + 4,
-                   &dki_info->dki_partition);
-       } else {
-               strcpy(dki_info->dki_dname, "unknown");
-               strcpy(dki_info->dki_cname, "unknown");
-               dki_info->dki_ctype = DKC_UNKNOWN;
-       }
-
-       switch (rval) {
-       case 0:
-               errno = EINVAL;
-               goto error;
-       case 1:
-               dki_info->dki_partition = 0;
-       }
-
-       free(dev_path);
-#else
-       if (ioctl(fd, DKIOCINFO, (caddr_t)dki_info) == -1)
-               goto error;
-#endif
-       return (0);
-error:
-       if (efi_debug)
-               (void) fprintf(stderr, "DKIOCINFO errno 0x%x\n", errno);
-
-       switch (errno) {
-       case EIO:
-               return (VT_EIO);
-       case EINVAL:
-               return (VT_EINVAL);
-       default:
-               return (VT_ERROR);
-       }
-}
-
-/*
- * the number of blocks the EFI label takes up (round up to nearest
- * block)
- */
-#define        NBLOCKS(p, l)   (1 + ((((p) * (int)sizeof (efi_gpe_t))  + \
-                               ((l) - 1)) / (l)))
-/* number of partitions -- limited by what we can malloc */
-#define        MAX_PARTS       ((4294967295UL - sizeof (struct dk_gpt)) / \
-                           sizeof (struct dk_part))
-
-int
-efi_alloc_and_init(int fd, uint32_t nparts, struct dk_gpt **vtoc)
-{
-       diskaddr_t      capacity = 0;
-       uint_t          lbsize = 0;
-       uint_t          nblocks;
-       size_t          length;
-       struct dk_gpt   *vptr;
-       struct uuid     uuid;
-       struct dk_cinfo dki_info;
-
-       if (read_disk_info(fd, &capacity, &lbsize) != 0)
-               return (-1);
-
-#if defined(__linux__)
-       if (efi_get_info(fd, &dki_info) != 0)
-               return (-1);
-
-       if (dki_info.dki_partition != 0)
-               return (-1);
-
-       if ((dki_info.dki_ctype == DKC_PCMCIA_MEM) ||
-           (dki_info.dki_ctype == DKC_VBD) ||
-           (dki_info.dki_ctype == DKC_UNKNOWN))
-               return (-1);
-#endif
-
-       nblocks = NBLOCKS(nparts, lbsize);
-       if ((nblocks * lbsize) < EFI_MIN_ARRAY_SIZE + lbsize) {
-               /* 16K plus one block for the GPT */
-               nblocks = EFI_MIN_ARRAY_SIZE / lbsize + 1;
-       }
-
-       if (nparts > MAX_PARTS) {
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                       "the maximum number of partitions supported is %lu\n",
-                           MAX_PARTS);
-               }
-               return (-1);
-       }
-
-       length = sizeof (struct dk_gpt) +
-           sizeof (struct dk_part) * (nparts - 1);
-
-       if ((*vtoc = calloc(length, 1)) == NULL)
-               return (-1);
-
-       vptr = *vtoc;
-
-       vptr->efi_version = EFI_VERSION_CURRENT;
-       vptr->efi_lbasize = lbsize;
-       vptr->efi_nparts = nparts;
-       /*
-        * add one block here for the PMBR; on disks with a 512 byte
-        * block size and 128 or fewer partitions, efi_first_u_lba
-        * should work out to "34"
-        */
-       vptr->efi_first_u_lba = nblocks + 1;
-       vptr->efi_last_lba = capacity - 1;
-       vptr->efi_altern_lba = capacity -1;
-       vptr->efi_last_u_lba = vptr->efi_last_lba - nblocks;
-
-       (void) uuid_generate((uchar_t *)&uuid);
-       UUID_LE_CONVERT(vptr->efi_disk_uguid, uuid);
-       return (0);
-}
-
-/*
- * Read EFI - return partition number upon success.
- */
-int
-efi_alloc_and_read(int fd, struct dk_gpt **vtoc)
-{
-       int                     rval;
-       uint32_t                nparts;
-       int                     length;
-
-       /* figure out the number of entries that would fit into 16K */
-       nparts = EFI_MIN_ARRAY_SIZE / sizeof (efi_gpe_t);
-       length = (int) sizeof (struct dk_gpt) +
-           (int) sizeof (struct dk_part) * (nparts - 1);
-       if ((*vtoc = calloc(length, 1)) == NULL)
-               return (VT_ERROR);
-
-       (*vtoc)->efi_nparts = nparts;
-       rval = efi_read(fd, *vtoc);
-
-       if ((rval == VT_EINVAL) && (*vtoc)->efi_nparts > nparts) {
-               void *tmp;
-               length = (int) sizeof (struct dk_gpt) +
-                   (int) sizeof (struct dk_part) *
-                   ((*vtoc)->efi_nparts - 1);
-               nparts = (*vtoc)->efi_nparts;
-               if ((tmp = realloc(*vtoc, length)) == NULL) {
-                       free (*vtoc);
-                       *vtoc = NULL;
-                       return (VT_ERROR);
-               } else {
-                       *vtoc = tmp;
-                       rval = efi_read(fd, *vtoc);
-               }
-       }
-
-       if (rval < 0) {
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                           "read of EFI table failed, rval=%d\n", rval);
-               }
-               free (*vtoc);
-               *vtoc = NULL;
-       }
-
-       return (rval);
-}
-
-static int
-efi_ioctl(int fd, int cmd, dk_efi_t *dk_ioc)
-{
-       void *data = dk_ioc->dki_data;
-       int error;
-#if defined(__linux__)
-       diskaddr_t capacity;
-       uint_t lbsize;
-
-       /*
-        * When the IO is not being performed in kernel as an ioctl we need
-        * to know the sector size so we can seek to the proper byte offset.
-        */
-       if (read_disk_info(fd, &capacity, &lbsize) == -1) {
-               if (efi_debug)
-                       fprintf(stderr, "unable to read disk info: %d", errno);
-
-               errno = EIO;
-               return (-1);
-       }
-
-       switch (cmd) {
-       case DKIOCGETEFI:
-               if (lbsize == 0) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCGETEFI assuming "
-                                   "LBA %d bytes\n", DEV_BSIZE);
-
-                       lbsize = DEV_BSIZE;
-               }
-
-               error = lseek(fd, dk_ioc->dki_lba * lbsize, SEEK_SET);
-               if (error == -1) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCGETEFI lseek "
-                                   "error: %d\n", errno);
-                       return (error);
-               }
-
-               error = read(fd, data, dk_ioc->dki_length);
-               if (error == -1) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCGETEFI read "
-                                   "error: %d\n", errno);
-                       return (error);
-               }
-
-               if (error != dk_ioc->dki_length) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCGETEFI short "
-                                   "read of %d bytes\n", error);
-                       errno = EIO;
-                       return (-1);
-               }
-               error = 0;
-               break;
-
-       case DKIOCSETEFI:
-               if (lbsize == 0) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCSETEFI unknown "
-                                   "LBA size\n");
-                       errno = EIO;
-                       return (-1);
-               }
-
-               error = lseek(fd, dk_ioc->dki_lba * lbsize, SEEK_SET);
-               if (error == -1) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCSETEFI lseek "
-                                   "error: %d\n", errno);
-                       return (error);
-               }
-
-               error = write(fd, data, dk_ioc->dki_length);
-               if (error == -1) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCSETEFI write "
-                                   "error: %d\n", errno);
-                       return (error);
-               }
-
-               if (error != dk_ioc->dki_length) {
-                       if (efi_debug)
-                               (void) fprintf(stderr, "DKIOCSETEFI short "
-                                   "write of %d bytes\n", error);
-                       errno = EIO;
-                       return (-1);
-               }
-
-               /* Sync the new EFI table to disk */
-               error = fsync(fd);
-               if (error == -1)
-                       return (error);
-
-               /* Ensure any local disk cache is also flushed */
-               if (ioctl(fd, BLKFLSBUF, 0) == -1)
-                       return (error);
-
-               error = 0;
-               break;
-
-       default:
-               if (efi_debug)
-                       (void) fprintf(stderr, "unsupported ioctl()\n");
-
-               errno = EIO;
-               return (-1);
-       }
-#else
-       dk_ioc->dki_data_64 = (uint64_t)(uintptr_t)data;
-       error = ioctl(fd, cmd, (void *)dk_ioc);
-       dk_ioc->dki_data = data;
-#endif
-       return (error);
-}
-
-int
-efi_rescan(int fd)
-{
-#if defined(__linux__)
-       int retry = 10;
-       int error;
-
-       /* Notify the kernel a devices partition table has been updated */
-       while ((error = ioctl(fd, BLKRRPART)) != 0) {
-               if ((--retry == 0) || (errno != EBUSY)) {
-                       (void) fprintf(stderr, "the kernel failed to rescan "
-                           "the partition table: %d\n", errno);
-                       return (-1);
-               }
-               usleep(50000);
-       }
-#endif
-
-       return (0);
-}
-
-static int
-check_label(int fd, dk_efi_t *dk_ioc)
-{
-       efi_gpt_t               *efi;
-       uint_t                  crc;
-
-       if (efi_ioctl(fd, DKIOCGETEFI, dk_ioc) == -1) {
-               switch (errno) {
-               case EIO:
-                       return (VT_EIO);
-               default:
-                       return (VT_ERROR);
-               }
-       }
-       efi = dk_ioc->dki_data;
-       if (efi->efi_gpt_Signature != LE_64(EFI_SIGNATURE)) {
-               if (efi_debug)
-                       (void) fprintf(stderr,
-                           "Bad EFI signature: 0x%llx != 0x%llx\n",
-                           (long long)efi->efi_gpt_Signature,
-                           (long long)LE_64(EFI_SIGNATURE));
-               return (VT_EINVAL);
-       }
-
-       /*
-        * check CRC of the header; the size of the header should
-        * never be larger than one block
-        */
-       crc = efi->efi_gpt_HeaderCRC32;
-       efi->efi_gpt_HeaderCRC32 = 0;
-       len_t headerSize = (len_t)LE_32(efi->efi_gpt_HeaderSize);
-
-       if (headerSize < EFI_MIN_LABEL_SIZE || headerSize > EFI_LABEL_SIZE) {
-               if (efi_debug)
-                       (void) fprintf(stderr,
-                               "Invalid EFI HeaderSize %llu.  Assuming %d.\n",
-                               headerSize, EFI_MIN_LABEL_SIZE);
-       }
-
-       if ((headerSize > dk_ioc->dki_length) ||
-           crc != LE_32(efi_crc32((unsigned char *)efi, headerSize))) {
-               if (efi_debug)
-                       (void) fprintf(stderr,
-                           "Bad EFI CRC: 0x%x != 0x%x\n",
-                           crc, LE_32(efi_crc32((unsigned char *)efi,
-                           headerSize)));
-               return (VT_EINVAL);
-       }
-
-       return (0);
-}
-
-static int
-efi_read(int fd, struct dk_gpt *vtoc)
-{
-       int                     i, j;
-       int                     label_len;
-       int                     rval = 0;
-       int                     md_flag = 0;
-       int                     vdc_flag = 0;
-       diskaddr_t              capacity = 0;
-       uint_t                  lbsize = 0;
-       struct dk_minfo         disk_info;
-       dk_efi_t                dk_ioc;
-       efi_gpt_t               *efi;
-       efi_gpe_t               *efi_parts;
-       struct dk_cinfo         dki_info;
-       uint32_t                user_length;
-       boolean_t               legacy_label = B_FALSE;
-
-       /*
-        * get the partition number for this file descriptor.
-        */
-       if ((rval = efi_get_info(fd, &dki_info)) != 0)
-               return (rval);
-
-       if ((strncmp(dki_info.dki_cname, "pseudo", 7) == 0) &&
-           (strncmp(dki_info.dki_dname, "md", 3) == 0)) {
-               md_flag++;
-       } else if ((strncmp(dki_info.dki_cname, "vdc", 4) == 0) &&
-           (strncmp(dki_info.dki_dname, "vdc", 4) == 0)) {
-               /*
-                * The controller and drive name "vdc" (virtual disk client)
-                * indicates a LDoms virtual disk.
-                */
-               vdc_flag++;
-       }
-
-       /* get the LBA size */
-       if (read_disk_info(fd, &capacity, &lbsize) == -1) {
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                           "unable to read disk info: %d",
-                           errno);
-               }
-               return (VT_EINVAL);
-       }
-
-       disk_info.dki_lbsize = lbsize;
-       disk_info.dki_capacity = capacity;
-
-       if (disk_info.dki_lbsize == 0) {
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                           "efi_read: assuming LBA 512 bytes\n");
-               }
-               disk_info.dki_lbsize = DEV_BSIZE;
-       }
-       /*
-        * Read the EFI GPT to figure out how many partitions we need
-        * to deal with.
-        */
-       dk_ioc.dki_lba = 1;
-       if (NBLOCKS(vtoc->efi_nparts, disk_info.dki_lbsize) < 34) {
-               label_len = EFI_MIN_ARRAY_SIZE + disk_info.dki_lbsize;
-       } else {
-               label_len = vtoc->efi_nparts * (int) sizeof (efi_gpe_t) +
-                   disk_info.dki_lbsize;
-               if (label_len % disk_info.dki_lbsize) {
-                       /* pad to physical sector size */
-                       label_len += disk_info.dki_lbsize;
-                       label_len &= ~(disk_info.dki_lbsize - 1);
-               }
-       }
-
-       if (posix_memalign((void **)&dk_ioc.dki_data,
-           disk_info.dki_lbsize, label_len))
-               return (VT_ERROR);
-
-       memset(dk_ioc.dki_data, 0, label_len);
-       dk_ioc.dki_length = disk_info.dki_lbsize;
-       user_length = vtoc->efi_nparts;
-       efi = dk_ioc.dki_data;
-       if (md_flag) {
-               dk_ioc.dki_length = label_len;
-               if (efi_ioctl(fd, DKIOCGETEFI, &dk_ioc) == -1) {
-                       switch (errno) {
-                       case EIO:
-                               return (VT_EIO);
-                       default:
-                               return (VT_ERROR);
-                       }
-               }
-       } else if ((rval = check_label(fd, &dk_ioc)) == VT_EINVAL) {
-               /*
-                * No valid label here; try the alternate. Note that here
-                * we just read GPT header and save it into dk_ioc.data,
-                * Later, we will read GUID partition entry array if we
-                * can get valid GPT header.
-                */
-
-               /*
-                * This is a workaround for legacy systems. In the past, the
-                * last sector of SCSI disk was invisible on x86 platform. At
-                * that time, backup label was saved on the next to the last
-                * sector. It is possible for users to move a disk from previous
-                * solaris system to present system. Here, we attempt to search
-                * legacy backup EFI label first.
-                */
-               dk_ioc.dki_lba = disk_info.dki_capacity - 2;
-               dk_ioc.dki_length = disk_info.dki_lbsize;
-               rval = check_label(fd, &dk_ioc);
-               if (rval == VT_EINVAL) {
-                       /*
-                        * we didn't find legacy backup EFI label, try to
-                        * search backup EFI label in the last block.
-                        */
-                       dk_ioc.dki_lba = disk_info.dki_capacity - 1;
-                       dk_ioc.dki_length = disk_info.dki_lbsize;
-                       rval = check_label(fd, &dk_ioc);
-                       if (rval == 0) {
-                               legacy_label = B_TRUE;
-                               if (efi_debug)
-                                       (void) fprintf(stderr,
-                                           "efi_read: primary label corrupt; "
-                                           "using EFI backup label located on"
-                                           " the last block\n");
-                       }
-               } else {
-                       if ((efi_debug) && (rval == 0))
-                               (void) fprintf(stderr, "efi_read: primary label"
-                                   " corrupt; using legacy EFI backup label "
-                                   " located on the next to last block\n");
-               }
-
-               if (rval == 0) {
-                       dk_ioc.dki_lba = LE_64(efi->efi_gpt_PartitionEntryLBA);
-                       vtoc->efi_flags |= EFI_GPT_PRIMARY_CORRUPT;
-                       vtoc->efi_nparts =
-                           LE_32(efi->efi_gpt_NumberOfPartitionEntries);
-                       /*
-                        * Partition tables are between backup GPT header
-                        * table and ParitionEntryLBA (the starting LBA of
-                        * the GUID partition entries array). Now that we
-                        * already got valid GPT header and saved it in
-                        * dk_ioc.dki_data, we try to get GUID partition
-                        * entry array here.
-                        */
-                       /* LINTED */
-                       dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data
-                           + disk_info.dki_lbsize);
-                       if (legacy_label)
-                               dk_ioc.dki_length = disk_info.dki_capacity - 1 -
-                                   dk_ioc.dki_lba;
-                       else
-                               dk_ioc.dki_length = disk_info.dki_capacity - 2 -
-                                   dk_ioc.dki_lba;
-                       dk_ioc.dki_length *= disk_info.dki_lbsize;
-                       if (dk_ioc.dki_length >
-                           ((len_t)label_len - sizeof (*dk_ioc.dki_data))) {
-                               rval = VT_EINVAL;
-                       } else {
-                               /*
-                                * read GUID partition entry array
-                                */
-                               rval = efi_ioctl(fd, DKIOCGETEFI, &dk_ioc);
-                       }
-               }
-
-       } else if (rval == 0) {
-
-               dk_ioc.dki_lba = LE_64(efi->efi_gpt_PartitionEntryLBA);
-               /* LINTED */
-               dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data
-                   + disk_info.dki_lbsize);
-               dk_ioc.dki_length = label_len - disk_info.dki_lbsize;
-               rval = efi_ioctl(fd, DKIOCGETEFI, &dk_ioc);
-
-       } else if (vdc_flag && rval == VT_ERROR && errno == EINVAL) {
-               /*
-                * When the device is a LDoms virtual disk, the DKIOCGETEFI
-                * ioctl can fail with EINVAL if the virtual disk backend
-                * is a ZFS volume serviced by a domain running an old version
-                * of Solaris. This is because the DKIOCGETEFI ioctl was
-                * initially incorrectly implemented for a ZFS volume and it
-                * expected the GPT and GPE to be retrieved with a single ioctl.
-                * So we try to read the GPT and the GPE using that old style
-                * ioctl.
-                */
-               dk_ioc.dki_lba = 1;
-               dk_ioc.dki_length = label_len;
-               rval = check_label(fd, &dk_ioc);
-       }
-
-       if (rval < 0) {
-               free(efi);
-               return (rval);
-       }
-
-       /* LINTED -- always longlong aligned */
-       efi_parts = (efi_gpe_t *)(((char *)efi) + disk_info.dki_lbsize);
-
-       /*
-        * Assemble this into a "dk_gpt" struct for easier
-        * digestibility by applications.
-        */
-       vtoc->efi_version = LE_32(efi->efi_gpt_Revision);
-       vtoc->efi_nparts = LE_32(efi->efi_gpt_NumberOfPartitionEntries);
-       vtoc->efi_part_size = LE_32(efi->efi_gpt_SizeOfPartitionEntry);
-       vtoc->efi_lbasize = disk_info.dki_lbsize;
-       vtoc->efi_last_lba = disk_info.dki_capacity - 1;
-       vtoc->efi_first_u_lba = LE_64(efi->efi_gpt_FirstUsableLBA);
-       vtoc->efi_last_u_lba = LE_64(efi->efi_gpt_LastUsableLBA);
-       vtoc->efi_altern_lba = LE_64(efi->efi_gpt_AlternateLBA);
-       UUID_LE_CONVERT(vtoc->efi_disk_uguid, efi->efi_gpt_DiskGUID);
-
-       /*
-        * If the array the user passed in is too small, set the length
-        * to what it needs to be and return
-        */
-       if (user_length < vtoc->efi_nparts) {
-               return (VT_EINVAL);
-       }
-
-       for (i = 0; i < vtoc->efi_nparts; i++) {
-
-               UUID_LE_CONVERT(vtoc->efi_parts[i].p_guid,
-                   efi_parts[i].efi_gpe_PartitionTypeGUID);
-
-               for (j = 0;
-                   j < sizeof (conversion_array)
-                   / sizeof (struct uuid_to_ptag); j++) {
-
-                       if (bcmp(&vtoc->efi_parts[i].p_guid,
-                           &conversion_array[j].uuid,
-                           sizeof (struct uuid)) == 0) {
-                               vtoc->efi_parts[i].p_tag = j;
-                               break;
-                       }
-               }
-               if (vtoc->efi_parts[i].p_tag == V_UNASSIGNED)
-                       continue;
-               vtoc->efi_parts[i].p_flag =
-                   LE_16(efi_parts[i].efi_gpe_Attributes.PartitionAttrs);
-               vtoc->efi_parts[i].p_start =
-                   LE_64(efi_parts[i].efi_gpe_StartingLBA);
-               vtoc->efi_parts[i].p_size =
-                   LE_64(efi_parts[i].efi_gpe_EndingLBA) -
-                   vtoc->efi_parts[i].p_start + 1;
-               for (j = 0; j < EFI_PART_NAME_LEN; j++) {
-                       vtoc->efi_parts[i].p_name[j] =
-                           (uchar_t)LE_16(
-                           efi_parts[i].efi_gpe_PartitionName[j]);
-               }
-
-               UUID_LE_CONVERT(vtoc->efi_parts[i].p_uguid,
-                   efi_parts[i].efi_gpe_UniquePartitionGUID);
-       }
-       free(efi);
-
-       return (dki_info.dki_partition);
-}
-
-/* writes a "protective" MBR */
-static int
-write_pmbr(int fd, struct dk_gpt *vtoc)
-{
-       dk_efi_t        dk_ioc;
-       struct mboot    mb;
-       uchar_t         *cp;
-       diskaddr_t      size_in_lba;
-       uchar_t         *buf;
-       int             len;
-
-       len = (vtoc->efi_lbasize == 0) ? sizeof (mb) : vtoc->efi_lbasize;
-       if (posix_memalign((void **)&buf, len, len))
-               return (VT_ERROR);
-
-       /*
-        * Preserve any boot code and disk signature if the first block is
-        * already an MBR.
-        */
-       memset(buf, 0, len);
-       dk_ioc.dki_lba = 0;
-       dk_ioc.dki_length = len;
-       /* LINTED -- always longlong aligned */
-       dk_ioc.dki_data = (efi_gpt_t *)buf;
-       if (efi_ioctl(fd, DKIOCGETEFI, &dk_ioc) == -1) {
-               (void) memcpy(&mb, buf, sizeof (mb));
-               bzero(&mb, sizeof (mb));
-               mb.signature = LE_16(MBB_MAGIC);
-       } else {
-               (void) memcpy(&mb, buf, sizeof (mb));
-               if (mb.signature != LE_16(MBB_MAGIC)) {
-                       bzero(&mb, sizeof (mb));
-                       mb.signature = LE_16(MBB_MAGIC);
-               }
-       }
-
-       bzero(&mb.parts, sizeof (mb.parts));
-       cp = (uchar_t *)&mb.parts[0];
-       /* bootable or not */
-       *cp++ = 0;
-       /* beginning CHS; 0xffffff if not representable */
-       *cp++ = 0xff;
-       *cp++ = 0xff;
-       *cp++ = 0xff;
-       /* OS type */
-       *cp++ = EFI_PMBR;
-       /* ending CHS; 0xffffff if not representable */
-       *cp++ = 0xff;
-       *cp++ = 0xff;
-       *cp++ = 0xff;
-       /* starting LBA: 1 (little endian format) by EFI definition */
-       *cp++ = 0x01;
-       *cp++ = 0x00;
-       *cp++ = 0x00;
-       *cp++ = 0x00;
-       /* ending LBA: last block on the disk (little endian format) */
-       size_in_lba = vtoc->efi_last_lba;
-       if (size_in_lba < 0xffffffff) {
-               *cp++ = (size_in_lba & 0x000000ff);
-               *cp++ = (size_in_lba & 0x0000ff00) >> 8;
-               *cp++ = (size_in_lba & 0x00ff0000) >> 16;
-               *cp++ = (size_in_lba & 0xff000000) >> 24;
-       } else {
-               *cp++ = 0xff;
-               *cp++ = 0xff;
-               *cp++ = 0xff;
-               *cp++ = 0xff;
-       }
-
-       (void) memcpy(buf, &mb, sizeof (mb));
-       /* LINTED -- always longlong aligned */
-       dk_ioc.dki_data = (efi_gpt_t *)buf;
-       dk_ioc.dki_lba = 0;
-       dk_ioc.dki_length = len;
-       if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
-               free(buf);
-               switch (errno) {
-               case EIO:
-                       return (VT_EIO);
-               case EINVAL:
-                       return (VT_EINVAL);
-               default:
-                       return (VT_ERROR);
-               }
-       }
-       free(buf);
-       return (0);
-}
-
-/* make sure the user specified something reasonable */
-static int
-check_input(struct dk_gpt *vtoc)
-{
-       int                     resv_part = -1;
-       int                     i, j;
-       diskaddr_t              istart, jstart, isize, jsize, endsect;
-
-       /*
-        * Sanity-check the input (make sure no partitions overlap)
-        */
-       for (i = 0; i < vtoc->efi_nparts; i++) {
-               /* It can't be unassigned and have an actual size */
-               if ((vtoc->efi_parts[i].p_tag == V_UNASSIGNED) &&
-                   (vtoc->efi_parts[i].p_size != 0)) {
-                       if (efi_debug) {
-                               (void) fprintf(stderr, "partition %d is "
-                                   "\"unassigned\" but has a size of %llu",
-                                   i, vtoc->efi_parts[i].p_size);
-                       }
-                       return (VT_EINVAL);
-               }
-               if (vtoc->efi_parts[i].p_tag == V_UNASSIGNED) {
-                       if (uuid_is_null((uchar_t *)&vtoc->efi_parts[i].p_guid))
-                               continue;
-                       /* we have encountered an unknown uuid */
-                       vtoc->efi_parts[i].p_tag = 0xff;
-               }
-               if (vtoc->efi_parts[i].p_tag == V_RESERVED) {
-                       if (resv_part != -1) {
-                               if (efi_debug) {
-                                       (void) fprintf(stderr, "found "
-                                           "duplicate reserved partition "
-                                           "at %d\n", i);
-                               }
-                               return (VT_EINVAL);
-                       }
-                       resv_part = i;
-               }
-               if ((vtoc->efi_parts[i].p_start < vtoc->efi_first_u_lba) ||
-                   (vtoc->efi_parts[i].p_start > vtoc->efi_last_u_lba)) {
-                       if (efi_debug) {
-                               (void) fprintf(stderr,
-                                   "Partition %d starts at %llu.  ",
-                                   i,
-                                   vtoc->efi_parts[i].p_start);
-                               (void) fprintf(stderr,
-                                   "It must be between %llu and %llu.\n",
-                                   vtoc->efi_first_u_lba,
-                                   vtoc->efi_last_u_lba);
-                       }
-                       return (VT_EINVAL);
-               }
-               if ((vtoc->efi_parts[i].p_start +
-                   vtoc->efi_parts[i].p_size <
-                   vtoc->efi_first_u_lba) ||
-                   (vtoc->efi_parts[i].p_start +
-                   vtoc->efi_parts[i].p_size >
-                   vtoc->efi_last_u_lba + 1)) {
-                       if (efi_debug) {
-                               (void) fprintf(stderr,
-                                   "Partition %d ends at %llu.  ",
-                                   i,
-                                   vtoc->efi_parts[i].p_start +
-                                   vtoc->efi_parts[i].p_size);
-                               (void) fprintf(stderr,
-                                   "It must be between %llu and %llu.\n",
-                                   vtoc->efi_first_u_lba,
-                                   vtoc->efi_last_u_lba);
-                       }
-                       return (VT_EINVAL);
-               }
-
-               for (j = 0; j < vtoc->efi_nparts; j++) {
-                       isize = vtoc->efi_parts[i].p_size;
-                       jsize = vtoc->efi_parts[j].p_size;
-                       istart = vtoc->efi_parts[i].p_start;
-                       jstart = vtoc->efi_parts[j].p_start;
-                       if ((i != j) && (isize != 0) && (jsize != 0)) {
-                               endsect = jstart + jsize -1;
-                               if ((jstart <= istart) &&
-                                   (istart <= endsect)) {
-                                       if (efi_debug) {
-                                               (void) fprintf(stderr,
-                                                   "Partition %d overlaps "
-                                                   "partition %d.", i, j);
-                                       }
-                                       return (VT_EINVAL);
-                               }
-                       }
-               }
-       }
-       /* just a warning for now */
-       if ((resv_part == -1) && efi_debug) {
-               (void) fprintf(stderr,
-                   "no reserved partition found\n");
-       }
-       return (0);
-}
-
-/*
- * add all the unallocated space to the current label
- */
-int
-efi_use_whole_disk(int fd)
-{
-       struct dk_gpt           *efi_label;
-       int                     rval;
-       int                     i;
-       uint_t                  resv_index = 0, data_index = 0;
-       diskaddr_t              resv_start = 0, data_start = 0;
-       diskaddr_t              difference;
-
-       rval = efi_alloc_and_read(fd, &efi_label);
-       if (rval < 0) {
-               return (rval);
-       }
-
-       /*
-        * If alter_lba is 1, we are using the backup label.
-        * Since we can locate the backup label by disk capacity,
-        * there must be no unallocated space.
-        */
-       if ((efi_label->efi_altern_lba == 1) || (efi_label->efi_altern_lba
-           >= efi_label->efi_last_lba)) {
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                           "efi_use_whole_disk: requested space not found\n");
-               }
-               efi_free(efi_label);
-               return (VT_ENOSPC);
-       }
-
-       difference = efi_label->efi_last_lba - efi_label->efi_altern_lba;
-
-       /*
-        * Find the last physically non-zero partition.
-        * This is the reserved partition.
-        */
-       for (i = 0; i < efi_label->efi_nparts; i ++) {
-               if (resv_start < efi_label->efi_parts[i].p_start) {
-                       resv_start = efi_label->efi_parts[i].p_start;
-                       resv_index = i;
-               }
-       }
-
-       /*
-        * Find the last physically non-zero partition before that.
-        * This is the data partition.
-        */
-       for (i = 0; i < resv_index; i ++) {
-               if (data_start < efi_label->efi_parts[i].p_start) {
-                       data_start = efi_label->efi_parts[i].p_start;
-                       data_index = i;
-               }
-       }
-
-       /*
-        * Move the reserved partition. There is currently no data in
-        * here except fabricated devids (which get generated via
-        * efi_write()). So there is no need to copy data.
-        */
-       efi_label->efi_parts[data_index].p_size += difference;
-       efi_label->efi_parts[resv_index].p_start += difference;
-       efi_label->efi_last_u_lba += difference;
-
-       rval = efi_write(fd, efi_label);
-       if (rval < 0) {
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                           "efi_use_whole_disk:fail to write label, rval=%d\n",
-                           rval);
-               }
-               efi_free(efi_label);
-               return (rval);
-       }
-
-       efi_free(efi_label);
-       return (0);
-}
-
-
-/*
- * write EFI label and backup label
- */
-int
-efi_write(int fd, struct dk_gpt *vtoc)
-{
-       dk_efi_t                dk_ioc;
-       efi_gpt_t               *efi;
-       efi_gpe_t               *efi_parts;
-       int                     i, j;
-       struct dk_cinfo         dki_info;
-       int                     rval;
-       int                     md_flag = 0;
-       int                     nblocks;
-       diskaddr_t              lba_backup_gpt_hdr;
-
-       if ((rval = efi_get_info(fd, &dki_info)) != 0)
-               return (rval);
-
-       /* check if we are dealing wih a metadevice */
-       if ((strncmp(dki_info.dki_cname, "pseudo", 7) == 0) &&
-           (strncmp(dki_info.dki_dname, "md", 3) == 0)) {
-               md_flag = 1;
-       }
-
-       if (check_input(vtoc)) {
-               /*
-                * not valid; if it's a metadevice just pass it down
-                * because SVM will do its own checking
-                */
-               if (md_flag == 0) {
-                       return (VT_EINVAL);
-               }
-       }
-
-       dk_ioc.dki_lba = 1;
-       if (NBLOCKS(vtoc->efi_nparts, vtoc->efi_lbasize) < 34) {
-               dk_ioc.dki_length = EFI_MIN_ARRAY_SIZE + vtoc->efi_lbasize;
-       } else {
-               dk_ioc.dki_length = NBLOCKS(vtoc->efi_nparts,
-                   vtoc->efi_lbasize) *
-                   vtoc->efi_lbasize;
-       }
-
-       /*
-        * the number of blocks occupied by GUID partition entry array
-        */
-       nblocks = dk_ioc.dki_length / vtoc->efi_lbasize - 1;
-
-       /*
-        * Backup GPT header is located on the block after GUID
-        * partition entry array. Here, we calculate the address
-        * for backup GPT header.
-        */
-       lba_backup_gpt_hdr = vtoc->efi_last_u_lba + 1 + nblocks;
-       if (posix_memalign((void **)&dk_ioc.dki_data,
-           vtoc->efi_lbasize, dk_ioc.dki_length))
-               return (VT_ERROR);
-
-       memset(dk_ioc.dki_data, 0, dk_ioc.dki_length);
-       efi = dk_ioc.dki_data;
-
-       /* stuff user's input into EFI struct */
-       efi->efi_gpt_Signature = LE_64(EFI_SIGNATURE);
-       efi->efi_gpt_Revision = LE_32(vtoc->efi_version); /* 0x02000100 */
-       efi->efi_gpt_HeaderSize = LE_32(sizeof (struct efi_gpt) - LEN_EFI_PAD);
-       efi->efi_gpt_Reserved1 = 0;
-       efi->efi_gpt_MyLBA = LE_64(1ULL);
-       efi->efi_gpt_AlternateLBA = LE_64(lba_backup_gpt_hdr);
-       efi->efi_gpt_FirstUsableLBA = LE_64(vtoc->efi_first_u_lba);
-       efi->efi_gpt_LastUsableLBA = LE_64(vtoc->efi_last_u_lba);
-       efi->efi_gpt_PartitionEntryLBA = LE_64(2ULL);
-       efi->efi_gpt_NumberOfPartitionEntries = LE_32(vtoc->efi_nparts);
-       efi->efi_gpt_SizeOfPartitionEntry = LE_32(sizeof (struct efi_gpe));
-       UUID_LE_CONVERT(efi->efi_gpt_DiskGUID, vtoc->efi_disk_uguid);
-
-       /* LINTED -- always longlong aligned */
-       efi_parts = (efi_gpe_t *)((char *)dk_ioc.dki_data + vtoc->efi_lbasize);
-
-       for (i = 0; i < vtoc->efi_nparts; i++) {
-               for (j = 0;
-                   j < sizeof (conversion_array) /
-                   sizeof (struct uuid_to_ptag); j++) {
-
-                       if (vtoc->efi_parts[i].p_tag == j) {
-                               UUID_LE_CONVERT(
-                                   efi_parts[i].efi_gpe_PartitionTypeGUID,
-                                   conversion_array[j].uuid);
-                               break;
-                       }
-               }
-
-               if (j == sizeof (conversion_array) /
-                   sizeof (struct uuid_to_ptag)) {
-                       /*
-                        * If we didn't have a matching uuid match, bail here.
-                        * Don't write a label with unknown uuid.
-                        */
-                       if (efi_debug) {
-                               (void) fprintf(stderr,
-                                   "Unknown uuid for p_tag %d\n",
-                                   vtoc->efi_parts[i].p_tag);
-                       }
-                       return (VT_EINVAL);
-               }
-
-               /* Zero's should be written for empty partitions */
-               if (vtoc->efi_parts[i].p_tag == V_UNASSIGNED)
-                       continue;
-
-               efi_parts[i].efi_gpe_StartingLBA =
-                   LE_64(vtoc->efi_parts[i].p_start);
-               efi_parts[i].efi_gpe_EndingLBA =
-                   LE_64(vtoc->efi_parts[i].p_start +
-                   vtoc->efi_parts[i].p_size - 1);
-               efi_parts[i].efi_gpe_Attributes.PartitionAttrs =
-                   LE_16(vtoc->efi_parts[i].p_flag);
-               for (j = 0; j < EFI_PART_NAME_LEN; j++) {
-                       efi_parts[i].efi_gpe_PartitionName[j] =
-                           LE_16((ushort_t)vtoc->efi_parts[i].p_name[j]);
-               }
-               if ((vtoc->efi_parts[i].p_tag != V_UNASSIGNED) &&
-                   uuid_is_null((uchar_t *)&vtoc->efi_parts[i].p_uguid)) {
-                       (void) uuid_generate((uchar_t *)
-                           &vtoc->efi_parts[i].p_uguid);
-               }
-               bcopy(&vtoc->efi_parts[i].p_uguid,
-                   &efi_parts[i].efi_gpe_UniquePartitionGUID,
-                   sizeof (uuid_t));
-       }
-       efi->efi_gpt_PartitionEntryArrayCRC32 =
-           LE_32(efi_crc32((unsigned char *)efi_parts,
-           vtoc->efi_nparts * (int)sizeof (struct efi_gpe)));
-       efi->efi_gpt_HeaderCRC32 =
-           LE_32(efi_crc32((unsigned char *)efi,
-           LE_32(efi->efi_gpt_HeaderSize)));
-
-       if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
-               free(dk_ioc.dki_data);
-               switch (errno) {
-               case EIO:
-                       return (VT_EIO);
-               case EINVAL:
-                       return (VT_EINVAL);
-               default:
-                       return (VT_ERROR);
-               }
-       }
-       /* if it's a metadevice we're done */
-       if (md_flag) {
-               free(dk_ioc.dki_data);
-               return (0);
-       }
-
-       /* write backup partition array */
-       dk_ioc.dki_lba = vtoc->efi_last_u_lba + 1;
-       dk_ioc.dki_length -= vtoc->efi_lbasize;
-       /* LINTED */
-       dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data +
-           vtoc->efi_lbasize);
-
-       if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
-               /*
-                * we wrote the primary label okay, so don't fail
-                */
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                           "write of backup partitions to block %llu "
-                           "failed, errno %d\n",
-                           vtoc->efi_last_u_lba + 1,
-                           errno);
-               }
-       }
-       /*
-        * now swap MyLBA and AlternateLBA fields and write backup
-        * partition table header
-        */
-       dk_ioc.dki_lba = lba_backup_gpt_hdr;
-       dk_ioc.dki_length = vtoc->efi_lbasize;
-       /* LINTED */
-       dk_ioc.dki_data = (efi_gpt_t *)((char *)dk_ioc.dki_data -
-           vtoc->efi_lbasize);
-       efi->efi_gpt_AlternateLBA = LE_64(1ULL);
-       efi->efi_gpt_MyLBA = LE_64(lba_backup_gpt_hdr);
-       efi->efi_gpt_PartitionEntryLBA = LE_64(vtoc->efi_last_u_lba + 1);
-       efi->efi_gpt_HeaderCRC32 = 0;
-       efi->efi_gpt_HeaderCRC32 =
-           LE_32(efi_crc32((unsigned char *)dk_ioc.dki_data,
-           LE_32(efi->efi_gpt_HeaderSize)));
-
-       if (efi_ioctl(fd, DKIOCSETEFI, &dk_ioc) == -1) {
-               if (efi_debug) {
-                       (void) fprintf(stderr,
-                           "write of backup header to block %llu failed, "
-                           "errno %d\n",
-                           lba_backup_gpt_hdr,
-                           errno);
-               }
-       }
-       /* write the PMBR */
-       (void) write_pmbr(fd, vtoc);
-       free(dk_ioc.dki_data);
-
-       return (0);
-}
-
-void
-efi_free(struct dk_gpt *ptr)
-{
-       free(ptr);
-}
-
-/*
- * Input: File descriptor
- * Output: 1 if disk has an EFI label, or > 2TB with no VTOC or legacy MBR.
- * Otherwise 0.
- */
-int
-efi_type(int fd)
-{
-#if 0
-       struct vtoc vtoc;
-       struct extvtoc extvtoc;
-
-       if (ioctl(fd, DKIOCGEXTVTOC, &extvtoc) == -1) {
-               if (errno == ENOTSUP)
-                       return (1);
-               else if (errno == ENOTTY) {
-                       if (ioctl(fd, DKIOCGVTOC, &vtoc) == -1)
-                               if (errno == ENOTSUP)
-                                       return (1);
-               }
-       }
-       return (0);
-#else
-       return (ENOSYS);
-#endif
-}
-
-void
-efi_err_check(struct dk_gpt *vtoc)
-{
-       int                     resv_part = -1;
-       int                     i, j;
-       diskaddr_t              istart, jstart, isize, jsize, endsect;
-       int                     overlap = 0;
-
-       /*
-        * make sure no partitions overlap
-        */
-       for (i = 0; i < vtoc->efi_nparts; i++) {
-               /* It can't be unassigned and have an actual size */
-               if ((vtoc->efi_parts[i].p_tag == V_UNASSIGNED) &&
-                   (vtoc->efi_parts[i].p_size != 0)) {
-                       (void) fprintf(stderr,
-                           "partition %d is \"unassigned\" but has a size "
-                           "of %llu\n", i, vtoc->efi_parts[i].p_size);
-               }
-               if (vtoc->efi_parts[i].p_tag == V_UNASSIGNED) {
-                       continue;
-               }
-               if (vtoc->efi_parts[i].p_tag == V_RESERVED) {
-                       if (resv_part != -1) {
-                               (void) fprintf(stderr,
-                                   "found duplicate reserved partition at "
-                                   "%d\n", i);
-                       }
-                       resv_part = i;
-                       if (vtoc->efi_parts[i].p_size != EFI_MIN_RESV_SIZE)
-                               (void) fprintf(stderr,
-                                   "Warning: reserved partition size must "
-                                   "be %d sectors\n", EFI_MIN_RESV_SIZE);
-               }
-               if ((vtoc->efi_parts[i].p_start < vtoc->efi_first_u_lba) ||
-                   (vtoc->efi_parts[i].p_start > vtoc->efi_last_u_lba)) {
-                       (void) fprintf(stderr,
-                           "Partition %d starts at %llu\n",
-                           i,
-                           vtoc->efi_parts[i].p_start);
-                       (void) fprintf(stderr,
-                           "It must be between %llu and %llu.\n",
-                           vtoc->efi_first_u_lba,
-                           vtoc->efi_last_u_lba);
-               }
-               if ((vtoc->efi_parts[i].p_start +
-                   vtoc->efi_parts[i].p_size <
-                   vtoc->efi_first_u_lba) ||
-                   (vtoc->efi_parts[i].p_start +
-                   vtoc->efi_parts[i].p_size >
-                   vtoc->efi_last_u_lba + 1)) {
-                       (void) fprintf(stderr,
-                           "Partition %d ends at %llu\n",
-                           i,
-                           vtoc->efi_parts[i].p_start +
-                           vtoc->efi_parts[i].p_size);
-                       (void) fprintf(stderr,
-                           "It must be between %llu and %llu.\n",
-                           vtoc->efi_first_u_lba,
-                           vtoc->efi_last_u_lba);
-               }
-
-               for (j = 0; j < vtoc->efi_nparts; j++) {
-                       isize = vtoc->efi_parts[i].p_size;
-                       jsize = vtoc->efi_parts[j].p_size;
-                       istart = vtoc->efi_parts[i].p_start;
-                       jstart = vtoc->efi_parts[j].p_start;
-                       if ((i != j) && (isize != 0) && (jsize != 0)) {
-                               endsect = jstart + jsize -1;
-                               if ((jstart <= istart) &&
-                                   (istart <= endsect)) {
-                                       if (!overlap) {
-                                       (void) fprintf(stderr,
-                                           "label error: EFI Labels do not "
-                                           "support overlapping partitions\n");
-                                       }
-                                       (void) fprintf(stderr,
-                                           "Partition %d overlaps partition "
-                                           "%d.\n", i, j);
-                                       overlap = 1;
-                               }
-                       }
-               }
-       }
-       /* make sure there is a reserved partition */
-       if (resv_part == -1) {
-               (void) fprintf(stderr,
-                   "no reserved partition found\n");
-       }
-}
-
-/*
- * We need to get information necessary to construct a *new* efi
- * label type
- */
-int
-efi_auto_sense(int fd, struct dk_gpt **vtoc)
-{
-
-       int     i;
-
-       /*
-        * Now build the default partition table
-        */
-       if (efi_alloc_and_init(fd, EFI_NUMPAR, vtoc) != 0) {
-               if (efi_debug) {
-                       (void) fprintf(stderr, "efi_alloc_and_init failed.\n");
-               }
-               return (-1);
-       }
-
-       for (i = 0; i < MIN((*vtoc)->efi_nparts, V_NUMPAR); i++) {
-               (*vtoc)->efi_parts[i].p_tag = default_vtoc_map[i].p_tag;
-               (*vtoc)->efi_parts[i].p_flag = default_vtoc_map[i].p_flag;
-               (*vtoc)->efi_parts[i].p_start = 0;
-               (*vtoc)->efi_parts[i].p_size = 0;
-       }
-       /*
-        * Make constants first
-        * and variable partitions later
-        */
-
-       /* root partition - s0 128 MB */
-       (*vtoc)->efi_parts[0].p_start = 34;
-       (*vtoc)->efi_parts[0].p_size = 262144;
-
-       /* partition - s1  128 MB */
-       (*vtoc)->efi_parts[1].p_start = 262178;
-       (*vtoc)->efi_parts[1].p_size = 262144;
-
-       /* partition -s2 is NOT the Backup disk */
-       (*vtoc)->efi_parts[2].p_tag = V_UNASSIGNED;
-
-       /* partition -s6 /usr partition - HOG */
-       (*vtoc)->efi_parts[6].p_start = 524322;
-       (*vtoc)->efi_parts[6].p_size = (*vtoc)->efi_last_u_lba - 524322
-           - (1024 * 16);
-
-       /* efi reserved partition - s9 16K */
-       (*vtoc)->efi_parts[8].p_start = (*vtoc)->efi_last_u_lba - (1024 * 16);
-       (*vtoc)->efi_parts[8].p_size = (1024 * 16);
-       (*vtoc)->efi_parts[8].p_tag = V_RESERVED;
-       return (0);
-}
diff --git a/zfs/lib/libnvpair/Makefile.am b/zfs/lib/libnvpair/Makefile.am
deleted file mode 100644 (file)
index c9ac1f1..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-VPATH = \
-       $(top_srcdir)/module/nvpair \
-       $(top_srcdir)/lib/libnvpair
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-lib_LTLIBRARIES = libnvpair.la
-
-USER_C = \
-       libnvpair.c \
-       nvpair_alloc_system.c
-
-KERNEL_C = \
-       nvpair_alloc_fixed.c \
-       nvpair.c \
-       fnvpair.c
-
-nodist_libnvpair_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-libnvpair_la_LIBADD = \
-        $(top_builddir)/lib/libuutil/libuutil.la
-
-libnvpair_la_LDFLAGS = -version-info 1:1:0
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libnvpair/Makefile.in b/zfs/lib/libnvpair/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libnvpair/libnvpair.c b/zfs/lib/libnvpair/libnvpair.c
deleted file mode 100644 (file)
index b852cb6..0000000
+++ /dev/null
@@ -1,1274 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2000, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-#include <unistd.h>
-#include <strings.h>
-#include <libintl.h>
-#include <sys/types.h>
-#include <sys/inttypes.h>
-#include <stdarg.h>
-#include <note.h>
-#include "libnvpair.h"
-
-/*
- * libnvpair - A tools library for manipulating <name, value> pairs.
- *
- *     This library provides routines packing an unpacking nv pairs
- *     for transporting data across process boundaries, transporting
- *     between kernel and userland, and possibly saving onto disk files.
- */
-
-/*
- * Print control structure.
- */
-
-#define        DEFINEOP(opname, vtype) \
-       struct { \
-               int (*op)(struct nvlist_prtctl *, void *, nvlist_t *, \
-                   const char *, vtype); \
-               void *arg; \
-       } opname
-
-#define        DEFINEARROP(opname, vtype) \
-       struct { \
-               int (*op)(struct nvlist_prtctl *, void *, nvlist_t *, \
-                   const char *, vtype, uint_t); \
-               void *arg; \
-       } opname
-
-struct nvlist_printops {
-       DEFINEOP(print_boolean, int);
-       DEFINEOP(print_boolean_value, boolean_t);
-       DEFINEOP(print_byte, uchar_t);
-       DEFINEOP(print_int8, int8_t);
-       DEFINEOP(print_uint8, uint8_t);
-       DEFINEOP(print_int16, int16_t);
-       DEFINEOP(print_uint16, uint16_t);
-       DEFINEOP(print_int32, int32_t);
-       DEFINEOP(print_uint32, uint32_t);
-       DEFINEOP(print_int64, int64_t);
-       DEFINEOP(print_uint64, uint64_t);
-       DEFINEOP(print_double, double);
-       DEFINEOP(print_string, char *);
-       DEFINEOP(print_hrtime, hrtime_t);
-       DEFINEOP(print_nvlist, nvlist_t *);
-       DEFINEARROP(print_boolean_array, boolean_t *);
-       DEFINEARROP(print_byte_array, uchar_t *);
-       DEFINEARROP(print_int8_array, int8_t *);
-       DEFINEARROP(print_uint8_array, uint8_t *);
-       DEFINEARROP(print_int16_array, int16_t *);
-       DEFINEARROP(print_uint16_array, uint16_t *);
-       DEFINEARROP(print_int32_array, int32_t *);
-       DEFINEARROP(print_uint32_array, uint32_t *);
-       DEFINEARROP(print_int64_array, int64_t *);
-       DEFINEARROP(print_uint64_array, uint64_t *);
-       DEFINEARROP(print_string_array, char **);
-       DEFINEARROP(print_nvlist_array, nvlist_t **);
-};
-
-struct nvlist_prtctl {
-       FILE *nvprt_fp;                 /* output destination */
-       enum nvlist_indent_mode nvprt_indent_mode; /* see above */
-       int nvprt_indent;               /* absolute indent, or tab depth */
-       int nvprt_indentinc;            /* indent or tab increment */
-       const char *nvprt_nmfmt;        /* member name format, max one %s */
-       const char *nvprt_eomfmt;       /* after member format, e.g. "\n" */
-       const char *nvprt_btwnarrfmt;   /* between array members */
-       int nvprt_btwnarrfmt_nl;        /* nvprt_eoamfmt includes newline? */
-       struct nvlist_printops *nvprt_dfltops;
-       struct nvlist_printops *nvprt_custops;
-};
-
-#define        DFLTPRTOP(pctl, type) \
-       ((pctl)->nvprt_dfltops->print_##type.op)
-
-#define        DFLTPRTOPARG(pctl, type) \
-       ((pctl)->nvprt_dfltops->print_##type.arg)
-
-#define        CUSTPRTOP(pctl, type) \
-       ((pctl)->nvprt_custops->print_##type.op)
-
-#define        CUSTPRTOPARG(pctl, type) \
-       ((pctl)->nvprt_custops->print_##type.arg)
-
-#define        RENDER(pctl, type, nvl, name, val) \
-       { \
-               int done = 0; \
-               if ((pctl)->nvprt_custops && CUSTPRTOP(pctl, type)) { \
-                       done = CUSTPRTOP(pctl, type)(pctl, \
-                           CUSTPRTOPARG(pctl, type), nvl, name, val); \
-               } \
-               if (!done) { \
-                       (void) DFLTPRTOP(pctl, type)(pctl, \
-                           DFLTPRTOPARG(pctl, type), nvl, name, val); \
-               } \
-               (void) fprintf(pctl->nvprt_fp, "%s", pctl->nvprt_eomfmt); \
-       }
-
-#define        ARENDER(pctl, type, nvl, name, arrp, count) \
-       { \
-               int done = 0; \
-               if ((pctl)->nvprt_custops && CUSTPRTOP(pctl, type)) { \
-                       done = CUSTPRTOP(pctl, type)(pctl, \
-                           CUSTPRTOPARG(pctl, type), nvl, name, arrp, count); \
-               } \
-               if (!done) { \
-                       (void) DFLTPRTOP(pctl, type)(pctl, \
-                           DFLTPRTOPARG(pctl, type), nvl, name, arrp, count); \
-               } \
-               (void) fprintf(pctl->nvprt_fp, "%s", pctl->nvprt_eomfmt); \
-       }
-
-static void nvlist_print_with_indent(nvlist_t *, nvlist_prtctl_t);
-
-/*
- * ======================================================================
- * |                                                                   |
- * | Indentation                                                       |
- * |                                                                   |
- * ======================================================================
- */
-
-static void
-indent(nvlist_prtctl_t pctl, int onemore)
-{
-       int depth;
-
-       switch (pctl->nvprt_indent_mode) {
-       case NVLIST_INDENT_ABS:
-               (void) fprintf(pctl->nvprt_fp, "%*s",
-                   pctl->nvprt_indent + onemore * pctl->nvprt_indentinc, "");
-               break;
-
-       case NVLIST_INDENT_TABBED:
-               depth = pctl->nvprt_indent + onemore;
-               while (depth-- > 0)
-                       (void) fprintf(pctl->nvprt_fp, "\t");
-       }
-}
-
-/*
- * ======================================================================
- * |                                                                   |
- * | Default nvlist member rendering functions.                                |
- * |                                                                   |
- * ======================================================================
- */
-
-/*
- * Generate functions to print single-valued nvlist members.
- *
- * type_and_variant - suffix to form function name
- * vtype - C type for the member value
- * ptype - C type to cast value to for printing
- * vfmt - format string for pair value, e.g "%d" or "0x%llx"
- */
-
-#define        NVLIST_PRTFUNC(type_and_variant, vtype, ptype, vfmt) \
-static int \
-nvprint_##type_and_variant(nvlist_prtctl_t pctl, void *private, \
-    nvlist_t *nvl, const char *name, vtype value) \
-{ \
-       FILE *fp = pctl->nvprt_fp; \
-       NOTE(ARGUNUSED(private)) \
-       NOTE(ARGUNUSED(nvl)) \
-       indent(pctl, 1); \
-       (void) fprintf(fp, pctl->nvprt_nmfmt, name); \
-       (void) fprintf(fp, vfmt, (ptype)value); \
-       return (1); \
-}
-
-NVLIST_PRTFUNC(boolean, int, int, "%d")
-NVLIST_PRTFUNC(boolean_value, boolean_t, int, "%d")
-NVLIST_PRTFUNC(byte, uchar_t, uchar_t, "0x%2.2x")
-NVLIST_PRTFUNC(int8, int8_t, int, "%d")
-NVLIST_PRTFUNC(uint8, uint8_t, uint8_t, "0x%x")
-NVLIST_PRTFUNC(int16, int16_t, int16_t, "%d")
-NVLIST_PRTFUNC(uint16, uint16_t, uint16_t, "0x%x")
-NVLIST_PRTFUNC(int32, int32_t, int32_t, "%d")
-NVLIST_PRTFUNC(uint32, uint32_t, uint32_t, "0x%x")
-NVLIST_PRTFUNC(int64, int64_t, longlong_t, "%lld")
-NVLIST_PRTFUNC(uint64, uint64_t, u_longlong_t, "0x%llx")
-NVLIST_PRTFUNC(double, double, double, "0x%f")
-NVLIST_PRTFUNC(string, char *, char *, "%s")
-NVLIST_PRTFUNC(hrtime, hrtime_t, hrtime_t, "0x%llx")
-
-/*
- * Generate functions to print array-valued nvlist members.
- */
-
-#define        NVLIST_ARRPRTFUNC(type_and_variant, vtype, ptype, vfmt) \
-static int \
-nvaprint_##type_and_variant(nvlist_prtctl_t pctl, void *private, \
-    nvlist_t *nvl, const char *name, vtype *valuep, uint_t count) \
-{ \
-       FILE *fp = pctl->nvprt_fp; \
-       uint_t i; \
-       NOTE(ARGUNUSED(private)) \
-       NOTE(ARGUNUSED(nvl)) \
-       for (i = 0; i < count; i++) { \
-               if (i == 0 || pctl->nvprt_btwnarrfmt_nl) { \
-                       indent(pctl, 1); \
-                       (void) fprintf(fp, pctl->nvprt_nmfmt, name); \
-                       if (pctl->nvprt_btwnarrfmt_nl) \
-                               (void) fprintf(fp, "[%d]: ", i); \
-               } \
-               if (i != 0) \
-                       (void) fprintf(fp, "%s", pctl->nvprt_btwnarrfmt); \
-               (void) fprintf(fp, vfmt, (ptype)valuep[i]); \
-       } \
-       return (1); \
-}
-
-NVLIST_ARRPRTFUNC(boolean_array, boolean_t, boolean_t, "%d")
-NVLIST_ARRPRTFUNC(byte_array, uchar_t, uchar_t, "0x%2.2x")
-NVLIST_ARRPRTFUNC(int8_array, int8_t, int8_t, "%d")
-NVLIST_ARRPRTFUNC(uint8_array, uint8_t, uint8_t, "0x%x")
-NVLIST_ARRPRTFUNC(int16_array, int16_t, int16_t, "%d")
-NVLIST_ARRPRTFUNC(uint16_array, uint16_t, uint16_t, "0x%x")
-NVLIST_ARRPRTFUNC(int32_array, int32_t, int32_t, "%d")
-NVLIST_ARRPRTFUNC(uint32_array, uint32_t, uint32_t, "0x%x")
-NVLIST_ARRPRTFUNC(int64_array, int64_t, longlong_t, "%lld")
-NVLIST_ARRPRTFUNC(uint64_array, uint64_t, u_longlong_t, "0x%llx")
-NVLIST_ARRPRTFUNC(string_array, char *, char *, "%s")
-
-/*ARGSUSED*/
-static int
-nvprint_nvlist(nvlist_prtctl_t pctl, void *private,
-    nvlist_t *nvl, const char *name, nvlist_t *value)
-{
-       FILE *fp = pctl->nvprt_fp;
-
-       indent(pctl, 1);
-       (void) fprintf(fp, "%s = (embedded nvlist)\n", name);
-
-       pctl->nvprt_indent += pctl->nvprt_indentinc;
-       nvlist_print_with_indent(value, pctl);
-       pctl->nvprt_indent -= pctl->nvprt_indentinc;
-
-       indent(pctl, 1);
-       (void) fprintf(fp, "(end %s)\n", name);
-
-       return (1);
-}
-
-/*ARGSUSED*/
-static int
-nvaprint_nvlist_array(nvlist_prtctl_t pctl, void *private,
-    nvlist_t *nvl, const char *name, nvlist_t **valuep, uint_t count)
-{
-       FILE *fp = pctl->nvprt_fp;
-       uint_t i;
-
-       indent(pctl, 1);
-       (void) fprintf(fp, "%s = (array of embedded nvlists)\n", name);
-
-       for (i = 0; i < count; i++) {
-               indent(pctl, 1);
-               (void) fprintf(fp, "(start %s[%d])\n", name, i);
-
-               pctl->nvprt_indent += pctl->nvprt_indentinc;
-               nvlist_print_with_indent(valuep[i], pctl);
-               pctl->nvprt_indent -= pctl->nvprt_indentinc;
-
-               indent(pctl, 1);
-               (void) fprintf(fp, "(end %s[%d])\n", name, i);
-       }
-
-       return (1);
-}
-
-/*
- * ======================================================================
- * |                                                                   |
- * | Interfaces that allow control over formatting.                    |
- * |                                                                   |
- * ======================================================================
- */
-
-void
-nvlist_prtctl_setdest(nvlist_prtctl_t pctl, FILE *fp)
-{
-       pctl->nvprt_fp = fp;
-}
-
-FILE *
-nvlist_prtctl_getdest(nvlist_prtctl_t pctl)
-{
-       return (pctl->nvprt_fp);
-}
-
-
-void
-nvlist_prtctl_setindent(nvlist_prtctl_t pctl, enum nvlist_indent_mode mode,
-    int start, int inc)
-{
-       if (mode < NVLIST_INDENT_ABS || mode > NVLIST_INDENT_TABBED)
-               mode = NVLIST_INDENT_TABBED;
-
-       if (start < 0)
-               start = 0;
-
-       if (inc < 0)
-               inc = 1;
-
-       pctl->nvprt_indent_mode = mode;
-       pctl->nvprt_indent = start;
-       pctl->nvprt_indentinc = inc;
-}
-
-void
-nvlist_prtctl_doindent(nvlist_prtctl_t pctl, int onemore)
-{
-       indent(pctl, onemore);
-}
-
-
-void
-nvlist_prtctl_setfmt(nvlist_prtctl_t pctl, enum nvlist_prtctl_fmt which,
-    const char *fmt)
-{
-       switch (which) {
-       case NVLIST_FMT_MEMBER_NAME:
-               if (fmt == NULL)
-                       fmt = "%s = ";
-               pctl->nvprt_nmfmt = fmt;
-               break;
-
-       case NVLIST_FMT_MEMBER_POSTAMBLE:
-               if (fmt == NULL)
-                       fmt = "\n";
-               pctl->nvprt_eomfmt = fmt;
-               break;
-
-       case NVLIST_FMT_BTWN_ARRAY:
-               if (fmt == NULL) {
-                       pctl->nvprt_btwnarrfmt = " ";
-                       pctl->nvprt_btwnarrfmt_nl = 0;
-               } else {
-                       pctl->nvprt_btwnarrfmt = fmt;
-                       pctl->nvprt_btwnarrfmt_nl = (strstr(fmt, "\n") != NULL);
-               }
-               break;
-
-       default:
-               break;
-       }
-}
-
-
-void
-nvlist_prtctl_dofmt(nvlist_prtctl_t pctl, enum nvlist_prtctl_fmt which, ...)
-{
-       FILE *fp = pctl->nvprt_fp;
-       va_list ap;
-       char *name;
-
-       va_start(ap, which);
-
-       switch (which) {
-       case NVLIST_FMT_MEMBER_NAME:
-               name = va_arg(ap, char *);
-               (void) fprintf(fp, pctl->nvprt_nmfmt, name);
-               break;
-
-       case NVLIST_FMT_MEMBER_POSTAMBLE:
-               (void) fprintf(fp, "%s", pctl->nvprt_eomfmt);
-               break;
-
-       case NVLIST_FMT_BTWN_ARRAY:
-               (void) fprintf(fp, "%s", pctl->nvprt_btwnarrfmt);
-               break;
-
-       default:
-               break;
-       }
-
-       va_end(ap);
-}
-
-/*
- * ======================================================================
- * |                                                                   |
- * | Interfaces to allow appointment of replacement rendering functions.|
- * |                                                                   |
- * ======================================================================
- */
-
-#define        NVLIST_PRINTCTL_REPLACE(type, vtype) \
-void \
-nvlist_prtctlop_##type(nvlist_prtctl_t pctl, \
-    int (*func)(nvlist_prtctl_t, void *, nvlist_t *, const char *, vtype), \
-    void *private) \
-{ \
-       CUSTPRTOP(pctl, type) = func; \
-       CUSTPRTOPARG(pctl, type) = private; \
-}
-
-NVLIST_PRINTCTL_REPLACE(boolean, int)
-NVLIST_PRINTCTL_REPLACE(boolean_value, boolean_t)
-NVLIST_PRINTCTL_REPLACE(byte, uchar_t)
-NVLIST_PRINTCTL_REPLACE(int8, int8_t)
-NVLIST_PRINTCTL_REPLACE(uint8, uint8_t)
-NVLIST_PRINTCTL_REPLACE(int16, int16_t)
-NVLIST_PRINTCTL_REPLACE(uint16, uint16_t)
-NVLIST_PRINTCTL_REPLACE(int32, int32_t)
-NVLIST_PRINTCTL_REPLACE(uint32, uint32_t)
-NVLIST_PRINTCTL_REPLACE(int64, int64_t)
-NVLIST_PRINTCTL_REPLACE(uint64, uint64_t)
-NVLIST_PRINTCTL_REPLACE(double, double)
-NVLIST_PRINTCTL_REPLACE(string, char *)
-NVLIST_PRINTCTL_REPLACE(hrtime, hrtime_t)
-NVLIST_PRINTCTL_REPLACE(nvlist, nvlist_t *)
-
-#define        NVLIST_PRINTCTL_AREPLACE(type, vtype) \
-void \
-nvlist_prtctlop_##type(nvlist_prtctl_t pctl, \
-    int (*func)(nvlist_prtctl_t, void *, nvlist_t *, const char *, vtype, \
-    uint_t), void *private) \
-{ \
-       CUSTPRTOP(pctl, type) = func; \
-       CUSTPRTOPARG(pctl, type) = private; \
-}
-
-NVLIST_PRINTCTL_AREPLACE(boolean_array, boolean_t *)
-NVLIST_PRINTCTL_AREPLACE(byte_array, uchar_t *)
-NVLIST_PRINTCTL_AREPLACE(int8_array, int8_t *)
-NVLIST_PRINTCTL_AREPLACE(uint8_array, uint8_t *)
-NVLIST_PRINTCTL_AREPLACE(int16_array, int16_t *)
-NVLIST_PRINTCTL_AREPLACE(uint16_array, uint16_t *)
-NVLIST_PRINTCTL_AREPLACE(int32_array, int32_t *)
-NVLIST_PRINTCTL_AREPLACE(uint32_array, uint32_t *)
-NVLIST_PRINTCTL_AREPLACE(int64_array, int64_t *)
-NVLIST_PRINTCTL_AREPLACE(uint64_array, uint64_t *)
-NVLIST_PRINTCTL_AREPLACE(string_array, char **)
-NVLIST_PRINTCTL_AREPLACE(nvlist_array, nvlist_t **)
-
-/*
- * ======================================================================
- * |                                                                   |
- * | Interfaces to manage nvlist_prtctl_t cookies.                     |
- * |                                                                   |
- * ======================================================================
- */
-
-
-static const struct nvlist_printops defprtops = {
-       { nvprint_boolean, NULL },
-       { nvprint_boolean_value, NULL },
-       { nvprint_byte, NULL },
-       { nvprint_int8, NULL },
-       { nvprint_uint8, NULL },
-       { nvprint_int16, NULL },
-       { nvprint_uint16, NULL },
-       { nvprint_int32, NULL },
-       { nvprint_uint32, NULL },
-       { nvprint_int64, NULL },
-       { nvprint_uint64, NULL },
-       { nvprint_double, NULL },
-       { nvprint_string, NULL },
-       { nvprint_hrtime, NULL },
-       { nvprint_nvlist, NULL },
-       { nvaprint_boolean_array, NULL },
-       { nvaprint_byte_array, NULL },
-       { nvaprint_int8_array, NULL },
-       { nvaprint_uint8_array, NULL },
-       { nvaprint_int16_array, NULL },
-       { nvaprint_uint16_array, NULL },
-       { nvaprint_int32_array, NULL },
-       { nvaprint_uint32_array, NULL },
-       { nvaprint_int64_array, NULL },
-       { nvaprint_uint64_array, NULL },
-       { nvaprint_string_array, NULL },
-       { nvaprint_nvlist_array, NULL },
-};
-
-static void
-prtctl_defaults(FILE *fp, struct nvlist_prtctl *pctl,
-    struct nvlist_printops *ops)
-{
-       pctl->nvprt_fp = fp;
-       pctl->nvprt_indent_mode = NVLIST_INDENT_TABBED;
-       pctl->nvprt_indent = 0;
-       pctl->nvprt_indentinc = 1;
-       pctl->nvprt_nmfmt = "%s = ";
-       pctl->nvprt_eomfmt = "\n";
-       pctl->nvprt_btwnarrfmt = " ";
-       pctl->nvprt_btwnarrfmt_nl = 0;
-
-       pctl->nvprt_dfltops = (struct nvlist_printops *)&defprtops;
-       pctl->nvprt_custops = ops;
-}
-
-nvlist_prtctl_t
-nvlist_prtctl_alloc(void)
-{
-       struct nvlist_prtctl *pctl;
-       struct nvlist_printops *ops;
-
-       if ((pctl = malloc(sizeof (*pctl))) == NULL)
-               return (NULL);
-
-       if ((ops = calloc(1, sizeof (*ops))) == NULL) {
-               free(pctl);
-               return (NULL);
-       }
-
-       prtctl_defaults(stdout, pctl, ops);
-
-       return (pctl);
-}
-
-void
-nvlist_prtctl_free(nvlist_prtctl_t pctl)
-{
-       if (pctl != NULL) {
-               free(pctl->nvprt_custops);
-               free(pctl);
-       }
-}
-
-/*
- * ======================================================================
- * |                                                                   |
- * | Top-level print request interfaces.                               |
- * |                                                                   |
- * ======================================================================
- */
-
-/*
- * nvlist_print - Prints elements in an event buffer
- */
-static void
-nvlist_print_with_indent(nvlist_t *nvl, nvlist_prtctl_t pctl)
-{
-       FILE *fp = pctl->nvprt_fp;
-       char *name;
-       uint_t nelem;
-       nvpair_t *nvp;
-
-       if (nvl == NULL)
-               return;
-
-       indent(pctl, 0);
-       (void) fprintf(fp, "nvlist version: %d\n", NVL_VERSION(nvl));
-
-       nvp = nvlist_next_nvpair(nvl, NULL);
-
-       while (nvp) {
-               data_type_t type = nvpair_type(nvp);
-
-               name = nvpair_name(nvp);
-               nelem = 0;
-
-               switch (type) {
-               case DATA_TYPE_BOOLEAN: {
-                       RENDER(pctl, boolean, nvl, name, 1);
-                       break;
-               }
-               case DATA_TYPE_BOOLEAN_VALUE: {
-                       boolean_t val;
-                       (void) nvpair_value_boolean_value(nvp, &val);
-                       RENDER(pctl, boolean_value, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_BYTE: {
-                       uchar_t val;
-                       (void) nvpair_value_byte(nvp, &val);
-                       RENDER(pctl, byte, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_INT8: {
-                       int8_t val;
-                       (void) nvpair_value_int8(nvp, &val);
-                       RENDER(pctl, int8, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_UINT8: {
-                       uint8_t val;
-                       (void) nvpair_value_uint8(nvp, &val);
-                       RENDER(pctl, uint8, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_INT16: {
-                       int16_t val;
-                       (void) nvpair_value_int16(nvp, &val);
-                       RENDER(pctl, int16, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_UINT16: {
-                       uint16_t val;
-                       (void) nvpair_value_uint16(nvp, &val);
-                       RENDER(pctl, uint16, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_INT32: {
-                       int32_t val;
-                       (void) nvpair_value_int32(nvp, &val);
-                       RENDER(pctl, int32, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_UINT32: {
-                       uint32_t val;
-                       (void) nvpair_value_uint32(nvp, &val);
-                       RENDER(pctl, uint32, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_INT64: {
-                       int64_t val;
-                       (void) nvpair_value_int64(nvp, &val);
-                       RENDER(pctl, int64, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_UINT64: {
-                       uint64_t val;
-                       (void) nvpair_value_uint64(nvp, &val);
-                       RENDER(pctl, uint64, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_DOUBLE: {
-                       double val;
-                       (void) nvpair_value_double(nvp, &val);
-                       RENDER(pctl, double, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_STRING: {
-                       char *val;
-                       (void) nvpair_value_string(nvp, &val);
-                       RENDER(pctl, string, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_BOOLEAN_ARRAY: {
-                       boolean_t *val;
-                       (void) nvpair_value_boolean_array(nvp, &val, &nelem);
-                       ARENDER(pctl, boolean_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_BYTE_ARRAY: {
-                       uchar_t *val;
-                       (void) nvpair_value_byte_array(nvp, &val, &nelem);
-                       ARENDER(pctl, byte_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_INT8_ARRAY: {
-                       int8_t *val;
-                       (void) nvpair_value_int8_array(nvp, &val, &nelem);
-                       ARENDER(pctl, int8_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_UINT8_ARRAY: {
-                       uint8_t *val;
-                       (void) nvpair_value_uint8_array(nvp, &val, &nelem);
-                       ARENDER(pctl, uint8_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_INT16_ARRAY: {
-                       int16_t *val;
-                       (void) nvpair_value_int16_array(nvp, &val, &nelem);
-                       ARENDER(pctl, int16_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_UINT16_ARRAY: {
-                       uint16_t *val;
-                       (void) nvpair_value_uint16_array(nvp, &val, &nelem);
-                       ARENDER(pctl, uint16_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_INT32_ARRAY: {
-                       int32_t *val;
-                       (void) nvpair_value_int32_array(nvp, &val, &nelem);
-                       ARENDER(pctl, int32_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_UINT32_ARRAY: {
-                       uint32_t *val;
-                       (void) nvpair_value_uint32_array(nvp, &val, &nelem);
-                       ARENDER(pctl, uint32_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_INT64_ARRAY: {
-                       int64_t *val;
-                       (void) nvpair_value_int64_array(nvp, &val, &nelem);
-                       ARENDER(pctl, int64_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_UINT64_ARRAY: {
-                       uint64_t *val;
-                       (void) nvpair_value_uint64_array(nvp, &val, &nelem);
-                       ARENDER(pctl, uint64_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_STRING_ARRAY: {
-                       char **val;
-                       (void) nvpair_value_string_array(nvp, &val, &nelem);
-                       ARENDER(pctl, string_array, nvl, name, val, nelem);
-                       break;
-               }
-               case DATA_TYPE_HRTIME: {
-                       hrtime_t val;
-                       (void) nvpair_value_hrtime(nvp, &val);
-                       RENDER(pctl, hrtime, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_NVLIST: {
-                       nvlist_t *val;
-                       (void) nvpair_value_nvlist(nvp, &val);
-                       RENDER(pctl, nvlist, nvl, name, val);
-                       break;
-               }
-               case DATA_TYPE_NVLIST_ARRAY: {
-                       nvlist_t **val;
-                       (void) nvpair_value_nvlist_array(nvp, &val, &nelem);
-                       ARENDER(pctl, nvlist_array, nvl, name, val, nelem);
-                       break;
-               }
-               default:
-                       (void) fprintf(fp, " unknown data type (%d)", type);
-                       break;
-               }
-               nvp = nvlist_next_nvpair(nvl, nvp);
-       }
-}
-
-void
-nvlist_print(FILE *fp, nvlist_t *nvl)
-{
-       struct nvlist_prtctl pc;
-
-       prtctl_defaults(fp, &pc, NULL);
-       nvlist_print_with_indent(nvl, &pc);
-}
-
-void
-nvlist_prt(nvlist_t *nvl, nvlist_prtctl_t pctl)
-{
-       nvlist_print_with_indent(nvl, pctl);
-}
-
-#define        NVP(elem, type, vtype, ptype, format) { \
-       vtype   value; \
-\
-       (void) nvpair_value_##type(elem, &value); \
-       (void) printf("%*s%s: " format "\n", indent, "", \
-           nvpair_name(elem), (ptype)value); \
-}
-
-#define        NVPA(elem, type, vtype, ptype, format) { \
-       uint_t  i, count; \
-       vtype   *value;  \
-\
-       (void) nvpair_value_##type(elem, &value, &count); \
-       for (i = 0; i < count; i++) { \
-               (void) printf("%*s%s[%d]: " format "\n", indent, "", \
-                   nvpair_name(elem), i, (ptype)value[i]); \
-       } \
-}
-
-/*
- * Similar to nvlist_print() but handles arrays slightly differently.
- */
-void
-dump_nvlist(nvlist_t *list, int indent)
-{
-       nvpair_t        *elem = NULL;
-       boolean_t       bool_value;
-       nvlist_t        *nvlist_value;
-       nvlist_t        **nvlist_array_value;
-       uint_t          i, count;
-
-       if (list == NULL) {
-               return;
-       }
-
-       while ((elem = nvlist_next_nvpair(list, elem)) != NULL) {
-               switch (nvpair_type(elem)) {
-               case DATA_TYPE_BOOLEAN:
-                       (void) printf("%*s%s\n", indent, "", nvpair_name(elem));
-                       break;
-
-               case DATA_TYPE_BOOLEAN_VALUE:
-                       (void) nvpair_value_boolean_value(elem, &bool_value);
-                       (void) printf("%*s%s: %s\n", indent, "",
-                           nvpair_name(elem), bool_value ? "true" : "false");
-                       break;
-
-               case DATA_TYPE_BYTE:
-                       NVP(elem, byte, uchar_t, int, "%u");
-                       break;
-
-               case DATA_TYPE_INT8:
-                       NVP(elem, int8, int8_t, int, "%d");
-                       break;
-
-               case DATA_TYPE_UINT8:
-                       NVP(elem, uint8, uint8_t, int, "%u");
-                       break;
-
-               case DATA_TYPE_INT16:
-                       NVP(elem, int16, int16_t, int, "%d");
-                       break;
-
-               case DATA_TYPE_UINT16:
-                       NVP(elem, uint16, uint16_t, int, "%u");
-                       break;
-
-               case DATA_TYPE_INT32:
-                       NVP(elem, int32, int32_t, long, "%ld");
-                       break;
-
-               case DATA_TYPE_UINT32:
-                       NVP(elem, uint32, uint32_t, ulong_t, "%lu");
-                       break;
-
-               case DATA_TYPE_INT64:
-                       NVP(elem, int64, int64_t, longlong_t, "%lld");
-                       break;
-
-               case DATA_TYPE_UINT64:
-                       NVP(elem, uint64, uint64_t, u_longlong_t, "%llu");
-                       break;
-
-               case DATA_TYPE_STRING:
-                       NVP(elem, string, char *, char *, "'%s'");
-                       break;
-
-               case DATA_TYPE_BYTE_ARRAY:
-                       NVPA(elem, byte_array, uchar_t, int, "%u");
-                       break;
-
-               case DATA_TYPE_INT8_ARRAY:
-                       NVPA(elem, int8_array, int8_t, int, "%d");
-                       break;
-
-               case DATA_TYPE_UINT8_ARRAY:
-                       NVPA(elem, uint8_array, uint8_t, int, "%u");
-                       break;
-
-               case DATA_TYPE_INT16_ARRAY:
-                       NVPA(elem, int16_array, int16_t, int, "%d");
-                       break;
-
-               case DATA_TYPE_UINT16_ARRAY:
-                       NVPA(elem, uint16_array, uint16_t, int, "%u");
-                       break;
-
-               case DATA_TYPE_INT32_ARRAY:
-                       NVPA(elem, int32_array, int32_t, long, "%ld");
-                       break;
-
-               case DATA_TYPE_UINT32_ARRAY:
-                       NVPA(elem, uint32_array, uint32_t, ulong_t, "%lu");
-                       break;
-
-               case DATA_TYPE_INT64_ARRAY:
-                       NVPA(elem, int64_array, int64_t, longlong_t, "%lld");
-                       break;
-
-               case DATA_TYPE_UINT64_ARRAY:
-                       NVPA(elem, uint64_array, uint64_t, u_longlong_t,
-                           "%llu");
-                       break;
-
-               case DATA_TYPE_STRING_ARRAY:
-                       NVPA(elem, string_array, char *, char *, "'%s'");
-                       break;
-
-               case DATA_TYPE_NVLIST:
-                       (void) nvpair_value_nvlist(elem, &nvlist_value);
-                       (void) printf("%*s%s:\n", indent, "",
-                           nvpair_name(elem));
-                       dump_nvlist(nvlist_value, indent + 4);
-                       break;
-
-               case DATA_TYPE_NVLIST_ARRAY:
-                       (void) nvpair_value_nvlist_array(elem,
-                           &nvlist_array_value, &count);
-                       for (i = 0; i < count; i++) {
-                               (void) printf("%*s%s[%u]:\n", indent, "",
-                                   nvpair_name(elem), i);
-                               dump_nvlist(nvlist_array_value[i], indent + 4);
-                       }
-                       break;
-
-               default:
-                       (void) printf(dgettext(TEXT_DOMAIN, "bad config type "
-                           "%d for %s\n"), nvpair_type(elem),
-                           nvpair_name(elem));
-               }
-       }
-}
-
-/*
- * ======================================================================
- * |                                                                   |
- * | Misc private interface.                                           |
- * |                                                                   |
- * ======================================================================
- */
-
-/*
- * Determine if string 'value' matches 'nvp' value.  The 'value' string is
- * converted, depending on the type of 'nvp', prior to match.  For numeric
- * types, a radix independent sscanf conversion of 'value' is used. If 'nvp'
- * is an array type, 'ai' is the index into the array against which we are
- * checking for match. If nvp is of DATA_TYPE_STRING*, the caller can pass
- * in a regex_t compilation of value in 'value_regex' to trigger regular
- * expression string match instead of simple strcmp().
- *
- * Return 1 on match, 0 on no-match, and -1 on error.  If the error is
- * related to value syntax error and 'ep' is non-NULL, *ep will point into
- * the 'value' string at the location where the error exists.
- *
- * NOTE: It may be possible to move the non-regex_t version of this into
- * common code used by library/kernel/boot.
- */
-int
-nvpair_value_match_regex(nvpair_t *nvp, int ai,
-    char *value, regex_t *value_regex, char **ep)
-{
-       char    *evalue;
-       uint_t  a_len;
-       int     sr;
-
-       if (ep)
-               *ep = NULL;
-
-       if ((nvp == NULL) || (value == NULL))
-               return (-1);            /* error fail match - invalid args */
-
-       /* make sure array and index combination make sense */
-       if ((nvpair_type_is_array(nvp) && (ai < 0)) ||
-           (!nvpair_type_is_array(nvp) && (ai >= 0)))
-               return (-1);            /* error fail match - bad index */
-
-       /* non-string values should be single 'chunk' */
-       if ((nvpair_type(nvp) != DATA_TYPE_STRING) &&
-           (nvpair_type(nvp) != DATA_TYPE_STRING_ARRAY)) {
-               value += strspn(value, " \t");
-               evalue = value + strcspn(value, " \t");
-               if (*evalue) {
-                       if (ep)
-                               *ep = evalue;
-                       return (-1);    /* error fail match - syntax */
-               }
-       }
-
-       sr = EOF;
-       switch (nvpair_type(nvp)) {
-       case DATA_TYPE_STRING: {
-               char    *val;
-
-               /* check string value for match */
-               if (nvpair_value_string(nvp, &val) == 0) {
-                       if (value_regex) {
-                               if (regexec(value_regex, val,
-                                   (size_t)0, NULL, 0) == 0)
-                                       return (1);     /* match */
-                       } else {
-                               if (strcmp(value, val) == 0)
-                                       return (1);     /* match */
-                       }
-               }
-               break;
-       }
-       case DATA_TYPE_STRING_ARRAY: {
-               char **val_array;
-
-               /* check indexed string value of array for match */
-               if ((nvpair_value_string_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len)) {
-                       if (value_regex) {
-                               if (regexec(value_regex, val_array[ai],
-                                   (size_t)0, NULL, 0) == 0)
-                                       return (1);
-                       } else {
-                               if (strcmp(value, val_array[ai]) == 0)
-                                       return (1);
-                       }
-               }
-               break;
-       }
-       case DATA_TYPE_BYTE: {
-               uchar_t val, val_arg;
-
-               /* scanf uchar_t from value and check for match */
-               sr = sscanf(value, "%c", &val_arg);
-               if ((sr == 1) && (nvpair_value_byte(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_BYTE_ARRAY: {
-               uchar_t *val_array, val_arg;
-
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%c", &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_byte_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT8: {
-               int8_t val, val_arg;
-
-               /* scanf int8_t from value and check for match */
-               sr = sscanf(value, "%"SCNi8, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int8(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT8_ARRAY: {
-               int8_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi8, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int8_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_UINT8: {
-               uint8_t val, val_arg;
-
-               /* scanf uint8_t from value and check for match */
-               sr = sscanf(value, "%"SCNi8, (int8_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint8(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_UINT8_ARRAY: {
-               uint8_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi8, (int8_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint8_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT16: {
-               int16_t val, val_arg;
-
-               /* scanf int16_t from value and check for match */
-               sr = sscanf(value, "%"SCNi16, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int16(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT16_ARRAY: {
-               int16_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi16, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int16_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_UINT16: {
-               uint16_t val, val_arg;
-
-               /* scanf uint16_t from value and check for match */
-               sr = sscanf(value, "%"SCNi16, (int16_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint16(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_UINT16_ARRAY: {
-               uint16_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi16, (int16_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint16_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT32: {
-               int32_t val, val_arg;
-
-               /* scanf int32_t from value and check for match */
-               sr = sscanf(value, "%"SCNi32, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int32(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT32_ARRAY: {
-               int32_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi32, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int32_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_UINT32: {
-               uint32_t val, val_arg;
-
-               /* scanf uint32_t from value and check for match */
-               sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint32(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_UINT32_ARRAY: {
-               uint32_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint32_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT64: {
-               int64_t val, val_arg;
-
-               /* scanf int64_t from value and check for match */
-               sr = sscanf(value, "%"SCNi64, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int64(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_INT64_ARRAY: {
-               int64_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi64, &val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_int64_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                               return (1);
-               break;
-       }
-       case DATA_TYPE_UINT64: {
-               uint64_t val_arg, val;
-
-               /* scanf uint64_t from value and check for match */
-               sr = sscanf(value, "%"SCNi64, (int64_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint64(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_UINT64_ARRAY: {
-               uint64_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi64, (int64_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_uint64_array(nvp, &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_BOOLEAN_VALUE: {
-               boolean_t val, val_arg;
-
-               /* scanf boolean_t from value and check for match */
-               sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_boolean_value(nvp, &val) == 0) &&
-                   (val == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_BOOLEAN_ARRAY: {
-               boolean_t *val_array, val_arg;
-
-               /* check indexed value of array for match */
-               sr = sscanf(value, "%"SCNi32, (int32_t *)&val_arg);
-               if ((sr == 1) &&
-                   (nvpair_value_boolean_array(nvp,
-                   &val_array, &a_len) == 0) &&
-                   (ai < a_len) &&
-                   (val_array[ai] == val_arg))
-                       return (1);
-               break;
-       }
-       case DATA_TYPE_HRTIME:
-       case DATA_TYPE_NVLIST:
-       case DATA_TYPE_NVLIST_ARRAY:
-       case DATA_TYPE_BOOLEAN:
-       case DATA_TYPE_DOUBLE:
-       case DATA_TYPE_UNKNOWN:
-       default:
-               /*
-                * unknown/unsupported data type
-                */
-               return (-1);            /* error fail match */
-       }
-
-       /*
-        * check to see if sscanf failed conversion, return approximate
-        * pointer to problem
-        */
-       if (sr != 1) {
-               if (ep)
-                       *ep = value;
-               return (-1);            /* error fail match  - syntax */
-       }
-
-       return (0);                     /* fail match */
-}
-
-int
-nvpair_value_match(nvpair_t *nvp, int ai, char *value, char **ep)
-{
-       return (nvpair_value_match_regex(nvp, ai, value, NULL, ep));
-}
diff --git a/zfs/lib/libnvpair/nvpair_alloc_system.c b/zfs/lib/libnvpair/nvpair_alloc_system.c
deleted file mode 100644 (file)
index f45dc5f..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include <rpc/types.h>
-#include <sys/nvpair.h>
-
-static void *
-nv_alloc_sys(nv_alloc_t *nva, size_t size)
-{
-       return (kmem_alloc(size, (int)(uintptr_t)nva->nva_arg));
-}
-
-/*ARGSUSED*/
-static void
-nv_free_sys(nv_alloc_t *nva, void *buf, size_t size)
-{
-       kmem_free(buf, size);
-}
-
-static const nv_alloc_ops_t system_ops = {
-       NULL,                   /* nv_ao_init() */
-       NULL,                   /* nv_ao_fini() */
-       nv_alloc_sys,           /* nv_ao_alloc() */
-       nv_free_sys,            /* nv_ao_free() */
-       NULL                    /* nv_ao_reset() */
-};
-
-nv_alloc_t nv_alloc_sleep_def = {
-       &system_ops,
-       (void *)KM_SLEEP
-};
-
-nv_alloc_t nv_alloc_nosleep_def = {
-       &system_ops,
-       (void *)KM_NOSLEEP
-};
-
-nv_alloc_t *nv_alloc_sleep = &nv_alloc_sleep_def;
-nv_alloc_t *nv_alloc_nosleep = &nv_alloc_nosleep_def;
diff --git a/zfs/lib/libshare/Makefile.am b/zfs/lib/libshare/Makefile.am
deleted file mode 100644 (file)
index 42bd207..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-noinst_LTLIBRARIES = libshare.la
-
-USER_C = \
-       libshare_impl.h \
-       libshare.c \
-       nfs.c \
-       nfs.h \
-       smb.c \
-       smb.h
-
-KERNEL_C =
-
-nodist_libshare_la_SOURCES = \
-       $(USER_C)
-       $(KERNEL_C)
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libshare/Makefile.in b/zfs/lib/libshare/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libshare/libshare.c b/zfs/lib/libshare/libshare.c
deleted file mode 100644 (file)
index ea59dcd..0000000
+++ /dev/null
@@ -1,804 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 Gunnar Beutner
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <strings.h>
-#include <libintl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <libzfs.h>
-#include <libshare.h>
-#include "libshare_impl.h"
-#include "nfs.h"
-#include "smb.h"
-
-static sa_share_impl_t find_share(sa_handle_impl_t handle,
-    const char *sharepath);
-static sa_share_impl_t alloc_share(const char *sharepath);
-static void free_share(sa_share_impl_t share);
-
-static void parse_sharetab(sa_handle_impl_t impl_handle);
-static int process_share(sa_handle_impl_t impl_handle,
-    sa_share_impl_t impl_share, char *pathname, char *resource,
-    char *fstype, char *options, char *description,
-    char *dataset, boolean_t from_sharetab);
-static void update_sharetab(sa_handle_impl_t impl_handle);
-
-static int update_zfs_share(sa_share_impl_t impl_handle, const char *proto);
-static int update_zfs_shares(sa_handle_impl_t impl_handle, const char *proto);
-
-static int fstypes_count;
-static sa_fstype_t *fstypes;
-
-sa_fstype_t *
-register_fstype(const char *name, const sa_share_ops_t *ops)
-{
-       sa_fstype_t *fstype;
-
-       fstype = calloc(sizeof (sa_fstype_t), 1);
-
-       if (fstype == NULL)
-               return (NULL);
-
-       fstype->name = name;
-       fstype->ops = ops;
-       fstype->fsinfo_index = fstypes_count;
-
-       fstypes_count++;
-
-       fstype->next = fstypes;
-       fstypes = fstype;
-
-       return (fstype);
-}
-
-sa_handle_t
-sa_init(int init_service)
-{
-       sa_handle_impl_t impl_handle;
-
-       impl_handle = calloc(sizeof (struct sa_handle_impl), 1);
-
-       if (impl_handle == NULL)
-               return (NULL);
-
-       impl_handle->zfs_libhandle = libzfs_init();
-
-       if (impl_handle->zfs_libhandle != NULL) {
-               libzfs_print_on_error(impl_handle->zfs_libhandle, B_TRUE);
-       }
-
-       parse_sharetab(impl_handle);
-       update_zfs_shares(impl_handle, NULL);
-
-       return ((sa_handle_t)impl_handle);
-}
-
-__attribute__((constructor)) static void
-libshare_init(void)
-{
-       libshare_nfs_init();
-       libshare_smb_init();
-}
-
-static void
-parse_sharetab(sa_handle_impl_t impl_handle) {
-       FILE *fp;
-       char line[512];
-       char *eol, *pathname, *resource, *fstype, *options, *description;
-
-       fp = fopen("/etc/dfs/sharetab", "r");
-
-       if (fp == NULL)
-               return;
-
-       while (fgets(line, sizeof (line), fp) != NULL) {
-               eol = line + strlen(line) - 1;
-
-               while (eol >= line) {
-                       if (*eol != '\r' && *eol != '\n')
-                               break;
-
-                       *eol = '\0';
-                       eol--;
-               }
-
-               pathname = line;
-
-               if ((resource = strchr(pathname, '\t')) == NULL)
-                       continue;
-
-               *resource = '\0';
-               resource++;
-
-               if ((fstype = strchr(resource, '\t')) == NULL)
-                       continue;
-
-               *fstype = '\0';
-               fstype++;
-
-               if ((options = strchr(fstype, '\t')) == NULL)
-                       continue;
-
-               *options = '\0';
-               options++;
-
-               if ((description = strchr(fstype, '\t')) != NULL) {
-                       *description = '\0';
-                       description++;
-               }
-
-               if (strcmp(resource, "-") == 0)
-                       resource = NULL;
-
-               (void) process_share(impl_handle, NULL, pathname, resource,
-                   fstype, options, description, NULL, B_TRUE);
-       }
-
-       fclose(fp);
-}
-
-static void
-update_sharetab(sa_handle_impl_t impl_handle)
-{
-       sa_share_impl_t impl_share;
-       int temp_fd;
-       FILE *temp_fp;
-       char tempfile[] = "/etc/dfs/sharetab.XXXXXX";
-       sa_fstype_t *fstype;
-       const char *resource;
-
-       if (mkdir("/etc/dfs", 0755) < 0 && errno != EEXIST) {
-               return;
-       }
-
-       temp_fd = mkstemp(tempfile);
-
-       if (temp_fd < 0)
-               return;
-
-       temp_fp = fdopen(temp_fd, "w");
-
-       if (temp_fp == NULL)
-               return;
-
-       impl_share = impl_handle->shares;
-       while (impl_share != NULL) {
-               fstype = fstypes;
-               while (fstype != NULL) {
-                       if (FSINFO(impl_share, fstype)->active &&
-                           FSINFO(impl_share, fstype)->shareopts != NULL) {
-                               resource = FSINFO(impl_share, fstype)->resource;
-
-                               if (resource == NULL)
-                                       resource = "-";
-
-                               fprintf(temp_fp, "%s\t%s\t%s\t%s\n",
-                                   impl_share->sharepath, resource,
-                                   fstype->name,
-                                   FSINFO(impl_share, fstype)->shareopts);
-                       }
-
-                       fstype = fstype->next;
-               }
-
-               impl_share = impl_share->next;
-       }
-
-       fflush(temp_fp);
-       fsync(temp_fd);
-       fclose(temp_fp);
-
-       rename(tempfile, "/etc/dfs/sharetab");
-}
-
-typedef struct update_cookie_s {
-       sa_handle_impl_t handle;
-       const char *proto;
-} update_cookie_t;
-
-static int
-update_zfs_shares_cb(zfs_handle_t *zhp, void *pcookie)
-{
-       update_cookie_t *udata = (update_cookie_t *)pcookie;
-       char mountpoint[ZFS_MAXPROPLEN];
-       char shareopts[ZFS_MAXPROPLEN];
-       char *dataset;
-       zfs_type_t type = zfs_get_type(zhp);
-
-       if (type == ZFS_TYPE_FILESYSTEM &&
-           zfs_iter_filesystems(zhp, update_zfs_shares_cb, pcookie) != 0) {
-               zfs_close(zhp);
-               return (1);
-       }
-
-       if (type != ZFS_TYPE_FILESYSTEM) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, mountpoint,
-           sizeof (mountpoint), NULL, NULL, 0, B_FALSE) != 0) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       dataset = (char *)zfs_get_name(zhp);
-
-       if (dataset == NULL) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if (!zfs_is_mounted(zhp, NULL)) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if ((udata->proto == NULL || strcmp(udata->proto, "nfs") == 0) &&
-           zfs_prop_get(zhp, ZFS_PROP_SHARENFS, shareopts,
-           sizeof (shareopts), NULL, NULL, 0, B_FALSE) == 0 &&
-           strcmp(shareopts, "off") != 0) {
-               (void) process_share(udata->handle, NULL, mountpoint, NULL,
-                   "nfs", shareopts, NULL, dataset, B_FALSE);
-       }
-
-       if ((udata->proto == NULL || strcmp(udata->proto, "smb") == 0) &&
-           zfs_prop_get(zhp, ZFS_PROP_SHARESMB, shareopts,
-           sizeof (shareopts), NULL, NULL, 0, B_FALSE) == 0 &&
-           strcmp(shareopts, "off") != 0) {
-               (void) process_share(udata->handle, NULL, mountpoint, NULL,
-                   "smb", shareopts, NULL, dataset, B_FALSE);
-       }
-
-       zfs_close(zhp);
-
-       return (0);
-}
-
-static int
-update_zfs_share(sa_share_impl_t impl_share, const char *proto)
-{
-       sa_handle_impl_t impl_handle = impl_share->handle;
-       zfs_handle_t *zhp;
-       update_cookie_t udata;
-
-       if (impl_handle->zfs_libhandle == NULL)
-                       return (SA_SYSTEM_ERR);
-
-       assert(impl_share->dataset != NULL);
-
-       zhp = zfs_open(impl_share->handle->zfs_libhandle, impl_share->dataset,
-           ZFS_TYPE_FILESYSTEM);
-
-       if (zhp == NULL)
-               return (SA_SYSTEM_ERR);
-
-       udata.handle = impl_handle;
-       udata.proto = proto;
-       (void) update_zfs_shares_cb(zhp, &udata);
-
-       return (SA_OK);
-}
-
-static int
-update_zfs_shares(sa_handle_impl_t impl_handle, const char *proto)
-{
-       update_cookie_t udata;
-
-       if (impl_handle->zfs_libhandle == NULL)
-               return (SA_SYSTEM_ERR);
-
-       udata.handle = impl_handle;
-       udata.proto = proto;
-       (void) zfs_iter_root(impl_handle->zfs_libhandle, update_zfs_shares_cb,
-           &udata);
-
-       return (SA_OK);
-}
-
-static int
-process_share(sa_handle_impl_t impl_handle, sa_share_impl_t impl_share,
-    char *pathname, char *resource, char *proto,
-    char *options, char *description, char *dataset,
-    boolean_t from_sharetab)
-{
-       struct stat statbuf;
-       int rc;
-       char *resource_dup = NULL, *dataset_dup = NULL;
-       boolean_t new_share;
-       sa_fstype_t *fstype;
-
-       new_share = B_FALSE;
-
-       if (impl_share == NULL)
-               impl_share = find_share(impl_handle, pathname);
-
-       if (impl_share == NULL) {
-               if (lstat(pathname, &statbuf) != 0 ||
-                   !S_ISDIR(statbuf.st_mode))
-                       return (SA_BAD_PATH);
-
-               impl_share = alloc_share(pathname);
-
-               if (impl_share == NULL) {
-                       rc = SA_NO_MEMORY;
-                       goto err;
-               }
-
-               new_share = B_TRUE;
-       }
-
-       if (dataset != NULL) {
-               dataset_dup = strdup(dataset);
-
-               if (dataset_dup == NULL) {
-                       rc = SA_NO_MEMORY;
-                       goto err;
-               }
-       }
-
-       free(impl_share->dataset);
-       impl_share->dataset = dataset_dup;
-
-       rc = SA_INVALID_PROTOCOL;
-
-       fstype = fstypes;
-       while (fstype != NULL) {
-               if (strcmp(fstype->name, proto) == 0) {
-                       if (resource != NULL) {
-                               resource_dup = strdup(resource);
-
-                               if (resource_dup == NULL) {
-                                       rc = SA_NO_MEMORY;
-                                       goto err;
-                               }
-                       }
-
-                       free(FSINFO(impl_share, fstype)->resource);
-                       FSINFO(impl_share, fstype)->resource = resource_dup;
-
-                       rc = fstype->ops->update_shareopts(impl_share,
-                           resource, options);
-
-                       if (rc == SA_OK && from_sharetab)
-                               FSINFO(impl_share, fstype)->active = B_TRUE;
-
-                       break;
-               }
-
-               fstype = fstype->next;
-       }
-
-       if (rc != SA_OK)
-               goto err;
-
-       if (new_share) {
-               impl_share->handle = impl_handle;
-
-               impl_share->next = impl_handle->shares;
-               impl_handle->shares = impl_share;
-
-       }
-
-err:
-       if (rc != SA_OK) {
-               if (new_share)
-                       free_share(impl_share);
-       }
-
-       return (rc);
-}
-
-void
-sa_fini(sa_handle_t handle)
-{
-       sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle;
-       sa_share_impl_t impl_share, next;
-       sa_share_impl_t *pcurr;
-
-       if (impl_handle == NULL)
-               return;
-
-       /*
-        * clean up shares which don't have a non-NULL dataset property,
-        * which means they're in sharetab but we couldn't find their
-        * ZFS dataset.
-        */
-       pcurr = &(impl_handle->shares);
-       impl_share = *pcurr;
-       while (impl_share != NULL) {
-               next = impl_share->next;
-
-               if (impl_share->dataset == NULL) {
-                       /* remove item from the linked list */
-                       *pcurr = next;
-
-                       sa_disable_share(impl_share, NULL);
-
-                       free_share(impl_share);
-               } else {
-                       pcurr = &(impl_share->next);
-               }
-
-               impl_share = next;
-       }
-
-       update_sharetab(impl_handle);
-
-       if (impl_handle->zfs_libhandle != NULL)
-               libzfs_fini(impl_handle->zfs_libhandle);
-
-       impl_share = impl_handle->shares;
-       while (impl_share != NULL) {
-               next = impl_share->next;
-               free_share(impl_share);
-               impl_share = next;
-       }
-
-       free(impl_handle);
-}
-
-static sa_share_impl_t
-find_share(sa_handle_impl_t impl_handle, const char *sharepath)
-{
-       sa_share_impl_t impl_share;
-
-       impl_share = impl_handle->shares;
-       while (impl_share != NULL) {
-               if (strcmp(impl_share->sharepath, sharepath) == 0) {
-                       break;
-               }
-
-               impl_share = impl_share->next;
-       }
-
-       return (impl_share);
-}
-
-sa_share_t
-sa_find_share(sa_handle_t handle, char *sharepath)
-{
-       return ((sa_share_t)find_share((sa_handle_impl_t)handle, sharepath));
-}
-
-int
-sa_enable_share(sa_share_t share, char *protocol)
-{
-       sa_share_impl_t impl_share = (sa_share_impl_t)share;
-       int rc, ret;
-       boolean_t found_protocol;
-       sa_fstype_t *fstype;
-
-#ifdef DEBUG
-       fprintf(stderr, "sa_enable_share: share->sharepath=%s, protocol=%s\n",
-               impl_share->sharepath, protocol);
-#endif
-
-       assert(impl_share->handle != NULL);
-
-       ret = SA_OK;
-       found_protocol = B_FALSE;
-
-       fstype = fstypes;
-       while (fstype != NULL) {
-               if (protocol == NULL || strcmp(fstype->name, protocol) == 0) {
-                       update_zfs_share(impl_share, fstype->name);
-
-                       rc = fstype->ops->enable_share(impl_share);
-
-                       if (rc != SA_OK)
-                               ret = rc;
-                       else
-                               FSINFO(impl_share, fstype)->active = B_TRUE;
-
-                       found_protocol = B_TRUE;
-               }
-
-               fstype = fstype->next;
-       }
-
-       update_sharetab(impl_share->handle);
-
-       return (found_protocol ? ret : SA_INVALID_PROTOCOL);
-}
-
-int
-sa_disable_share(sa_share_t share, char *protocol)
-{
-       sa_share_impl_t impl_share = (sa_share_impl_t)share;
-       int rc, ret;
-       boolean_t found_protocol;
-       sa_fstype_t *fstype;
-
-#ifdef DEBUG
-       fprintf(stderr, "sa_disable_share: share->sharepath=%s, protocol=%s\n",
-               impl_share->sharepath, protocol);
-#endif
-
-       ret = SA_OK;
-       found_protocol = B_FALSE;
-
-       fstype = fstypes;
-       while (fstype != NULL) {
-               if (protocol == NULL || strcmp(fstype->name, protocol) == 0) {
-                       rc = fstype->ops->disable_share(impl_share);
-
-                       if (rc == SA_OK) {
-                               fstype->ops->clear_shareopts(impl_share);
-
-                               FSINFO(impl_share, fstype)->active = B_FALSE;
-                       } else
-                               ret = rc;
-
-                       found_protocol = B_TRUE;
-               }
-
-               fstype = fstype->next;
-       }
-
-       update_sharetab(impl_share->handle);
-
-       return (found_protocol ? ret : SA_INVALID_PROTOCOL);
-}
-
-/*
- * sa_errorstr(err)
- *
- * convert an error value to an error string
- */
-char *
-sa_errorstr(int err)
-{
-       static char errstr[32];
-       char *ret = NULL;
-
-       switch (err) {
-       case SA_OK:
-               ret = dgettext(TEXT_DOMAIN, "ok");
-               break;
-       case SA_NO_SUCH_PATH:
-               ret = dgettext(TEXT_DOMAIN, "path doesn't exist");
-               break;
-       case SA_NO_MEMORY:
-               ret = dgettext(TEXT_DOMAIN, "no memory");
-               break;
-       case SA_DUPLICATE_NAME:
-               ret = dgettext(TEXT_DOMAIN, "name in use");
-               break;
-       case SA_BAD_PATH:
-               ret = dgettext(TEXT_DOMAIN, "bad path");
-               break;
-       case SA_NO_SUCH_GROUP:
-               ret = dgettext(TEXT_DOMAIN, "no such group");
-               break;
-       case SA_CONFIG_ERR:
-               ret = dgettext(TEXT_DOMAIN, "configuration error");
-               break;
-       case SA_SYSTEM_ERR:
-               ret = dgettext(TEXT_DOMAIN, "system error");
-               break;
-       case SA_SYNTAX_ERR:
-               ret = dgettext(TEXT_DOMAIN, "syntax error");
-               break;
-       case SA_NO_PERMISSION:
-               ret = dgettext(TEXT_DOMAIN, "no permission");
-               break;
-       case SA_BUSY:
-               ret = dgettext(TEXT_DOMAIN, "busy");
-               break;
-       case SA_NO_SUCH_PROP:
-               ret = dgettext(TEXT_DOMAIN, "no such property");
-               break;
-       case SA_INVALID_NAME:
-               ret = dgettext(TEXT_DOMAIN, "invalid name");
-               break;
-       case SA_INVALID_PROTOCOL:
-               ret = dgettext(TEXT_DOMAIN, "invalid protocol");
-               break;
-       case SA_NOT_ALLOWED:
-               ret = dgettext(TEXT_DOMAIN, "operation not allowed");
-               break;
-       case SA_BAD_VALUE:
-               ret = dgettext(TEXT_DOMAIN, "bad property value");
-               break;
-       case SA_INVALID_SECURITY:
-               ret = dgettext(TEXT_DOMAIN, "invalid security type");
-               break;
-       case SA_NO_SUCH_SECURITY:
-               ret = dgettext(TEXT_DOMAIN, "security type not found");
-               break;
-       case SA_VALUE_CONFLICT:
-               ret = dgettext(TEXT_DOMAIN, "property value conflict");
-               break;
-       case SA_NOT_IMPLEMENTED:
-               ret = dgettext(TEXT_DOMAIN, "not implemented");
-               break;
-       case SA_INVALID_PATH:
-               ret = dgettext(TEXT_DOMAIN, "invalid path");
-               break;
-       case SA_NOT_SUPPORTED:
-               ret = dgettext(TEXT_DOMAIN, "operation not supported");
-               break;
-       case SA_PROP_SHARE_ONLY:
-               ret = dgettext(TEXT_DOMAIN, "property not valid for group");
-               break;
-       case SA_NOT_SHARED:
-               ret = dgettext(TEXT_DOMAIN, "not shared");
-               break;
-       case SA_NO_SUCH_RESOURCE:
-               ret = dgettext(TEXT_DOMAIN, "no such resource");
-               break;
-       case SA_RESOURCE_REQUIRED:
-               ret = dgettext(TEXT_DOMAIN, "resource name required");
-               break;
-       case SA_MULTIPLE_ERROR:
-               ret = dgettext(TEXT_DOMAIN, "errors from multiple protocols");
-               break;
-       case SA_PATH_IS_SUBDIR:
-               ret = dgettext(TEXT_DOMAIN, "path is a subpath of share");
-               break;
-       case SA_PATH_IS_PARENTDIR:
-               ret = dgettext(TEXT_DOMAIN, "path is parent of a share");
-               break;
-       case SA_NO_SECTION:
-               ret = dgettext(TEXT_DOMAIN, "protocol requires a section");
-               break;
-       case SA_NO_PROPERTIES:
-               ret = dgettext(TEXT_DOMAIN, "properties not found");
-               break;
-       case SA_NO_SUCH_SECTION:
-               ret = dgettext(TEXT_DOMAIN, "section not found");
-               break;
-       case SA_PASSWORD_ENC:
-               ret = dgettext(TEXT_DOMAIN, "passwords must be encrypted");
-               break;
-       case SA_SHARE_EXISTS:
-               ret = dgettext(TEXT_DOMAIN, "path or file is already shared");
-               break;
-       default:
-               (void) snprintf(errstr, sizeof (errstr),
-                   dgettext(TEXT_DOMAIN, "unknown %d"), err);
-               ret = errstr;
-       }
-       return (ret);
-}
-
-int
-sa_parse_legacy_options(sa_group_t group, char *options, char *proto)
-{
-       sa_fstype_t *fstype;
-
-#ifdef DEBUG
-       fprintf(stderr, "sa_parse_legacy_options: options=%s, proto=%s\n",
-               options, proto);
-#endif
-
-       fstype = fstypes;
-       while (fstype != NULL) {
-               if (strcmp(fstype->name, proto) != 0) {
-                       fstype = fstype->next;
-                       continue;
-               }
-
-               return (fstype->ops->validate_shareopts(options));
-       }
-
-       return (SA_INVALID_PROTOCOL);
-}
-
-boolean_t
-sa_needs_refresh(sa_handle_t handle)
-{
-       return (B_TRUE);
-}
-
-libzfs_handle_t *
-sa_get_zfs_handle(sa_handle_t handle)
-{
-       sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle;
-
-       if (impl_handle == NULL)
-               return (NULL);
-
-       return (impl_handle->zfs_libhandle);
-}
-
-static sa_share_impl_t
-alloc_share(const char *sharepath)
-{
-       sa_share_impl_t impl_share;
-
-       impl_share = calloc(sizeof (struct sa_share_impl), 1);
-
-       if (impl_share == NULL)
-               return (NULL);
-
-       impl_share->sharepath = strdup(sharepath);
-
-       if (impl_share->sharepath == NULL) {
-               free(impl_share);
-               return (NULL);
-       }
-
-       impl_share->fsinfo = calloc(sizeof (sa_share_fsinfo_t), fstypes_count);
-
-       if (impl_share->fsinfo == NULL) {
-               free(impl_share->sharepath);
-               free(impl_share);
-               return (NULL);
-       }
-
-       return (impl_share);
-}
-
-static void
-free_share(sa_share_impl_t impl_share) {
-       sa_fstype_t *fstype;
-
-       fstype = fstypes;
-       while (fstype != NULL) {
-               fstype->ops->clear_shareopts(impl_share);
-
-               free(FSINFO(impl_share, fstype)->resource);
-
-               fstype = fstype->next;
-       }
-
-       free(impl_share->sharepath);
-       free(impl_share->dataset);
-       free(impl_share->fsinfo);
-       free(impl_share);
-}
-
-int
-sa_zfs_process_share(sa_handle_t handle, sa_group_t group, sa_share_t share,
-    char *mountpoint, char *proto, zprop_source_t source, char *shareopts,
-    char *sourcestr, char *dataset)
-{
-       sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle;
-       sa_share_impl_t impl_share = (sa_share_impl_t)share;
-
-#ifdef DEBUG
-       fprintf(stderr, "sa_zfs_process_share: mountpoint=%s, proto=%s, "
-           "shareopts=%s, sourcestr=%s, dataset=%s\n", mountpoint, proto,
-           shareopts, sourcestr, dataset);
-#endif
-
-       return (process_share(impl_handle, impl_share, mountpoint, NULL,
-           proto, shareopts, NULL, dataset, B_FALSE));
-}
-
-void
-sa_update_sharetab_ts(sa_handle_t handle)
-{
-       sa_handle_impl_t impl_handle = (sa_handle_impl_t)handle;
-
-       update_sharetab(impl_handle);
-}
diff --git a/zfs/lib/libshare/libshare_impl.h b/zfs/lib/libshare/libshare_impl.h
deleted file mode 100644 (file)
index 18d619b..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 Gunnar Beutner
- */
-
-struct sa_handle_impl;
-
-typedef struct sa_share_fsinfo {
-       boolean_t active;
-       char *resource;
-       char *shareopts;
-} sa_share_fsinfo_t;
-
-typedef struct sa_share_impl {
-       struct sa_share_impl *next;
-
-       struct sa_handle_impl *handle;
-
-       char *sharepath;
-       char *dataset;
-
-       sa_share_fsinfo_t *fsinfo; /* per-fstype information */
-} *sa_share_impl_t;
-
-#define        FSINFO(impl_share, fstype) (&(impl_share->fsinfo[fstype->fsinfo_index]))
-
-typedef struct sa_share_ops {
-       int (*enable_share)(sa_share_impl_t share);
-       int (*disable_share)(sa_share_impl_t share);
-       int (*validate_shareopts)(const char *shareopts);
-       int (*update_shareopts)(sa_share_impl_t impl_share,
-           const char *resource, const char *shareopts);
-       void (*clear_shareopts)(sa_share_impl_t impl_share);
-} sa_share_ops_t;
-
-typedef struct sa_fstype {
-       struct sa_fstype *next;
-
-       const char *name;
-       const sa_share_ops_t *ops;
-       int fsinfo_index;
-} sa_fstype_t;
-
-typedef struct sa_handle_impl {
-       libzfs_handle_t *zfs_libhandle;
-       sa_share_impl_t shares;
-} *sa_handle_impl_t;
-
-sa_fstype_t *register_fstype(const char *name, const sa_share_ops_t *ops);
diff --git a/zfs/lib/libshare/nfs.c b/zfs/lib/libshare/nfs.c
deleted file mode 100644 (file)
index d1b207e..0000000
+++ /dev/null
@@ -1,737 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 Gunnar Beutner
- * Copyright (c) 2012 Cyril Plisko. All rights reserved.
- */
-
-#include <stdio.h>
-#include <strings.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <libzfs.h>
-#include <libshare.h>
-#include "libshare_impl.h"
-
-static boolean_t nfs_available(void);
-
-static sa_fstype_t *nfs_fstype;
-
-/*
- * nfs_exportfs_temp_fd refers to a temporary copy of the output
- * from exportfs -v.
- */
-static int nfs_exportfs_temp_fd = -1;
-
-typedef int (*nfs_shareopt_callback_t)(const char *opt, const char *value,
-    void *cookie);
-
-typedef int (*nfs_host_callback_t)(const char *sharepath, const char *host,
-    const char *security, const char *access, void *cookie);
-
-/*
- * Invokes the specified callback function for each Solaris share option
- * listed in the specified string.
- */
-static int
-foreach_nfs_shareopt(const char *shareopts,
-    nfs_shareopt_callback_t callback, void *cookie)
-{
-       char *shareopts_dup, *opt, *cur, *value;
-       int was_nul, rc;
-
-       if (shareopts == NULL)
-               return (SA_OK);
-
-       shareopts_dup = strdup(shareopts);
-
-       if (shareopts_dup == NULL)
-               return (SA_NO_MEMORY);
-
-       opt = shareopts_dup;
-       was_nul = 0;
-
-       while (1) {
-               cur = opt;
-
-               while (*cur != ',' && *cur != '\0')
-                       cur++;
-
-               if (*cur == '\0')
-                       was_nul = 1;
-
-               *cur = '\0';
-
-               if (cur > opt) {
-                       value = strchr(opt, '=');
-
-                       if (value != NULL) {
-                               *value = '\0';
-                               value++;
-                       }
-
-                       rc = callback(opt, value, cookie);
-
-                       if (rc != SA_OK) {
-                               free(shareopts_dup);
-                               return (rc);
-                       }
-               }
-
-               opt = cur + 1;
-
-               if (was_nul)
-                       break;
-       }
-
-       free(shareopts_dup);
-
-       return (0);
-}
-
-typedef struct nfs_host_cookie_s {
-       nfs_host_callback_t callback;
-       const char *sharepath;
-       void *cookie;
-       const char *security;
-} nfs_host_cookie_t;
-
-/*
- * Helper function for foreach_nfs_host. This function checks whether the
- * current share option is a host specification and invokes a callback
- * function with information about the host.
- */
-static int
-foreach_nfs_host_cb(const char *opt, const char *value, void *pcookie)
-{
-       int rc;
-       const char *access;
-       char *host_dup, *host, *next;
-       nfs_host_cookie_t *udata = (nfs_host_cookie_t *)pcookie;
-
-#ifdef DEBUG
-       fprintf(stderr, "foreach_nfs_host_cb: key=%s, value=%s\n", opt, value);
-#endif
-
-       if (strcmp(opt, "sec") == 0)
-               udata->security = value;
-
-       if (strcmp(opt, "rw") == 0 || strcmp(opt, "ro") == 0) {
-               if (value == NULL)
-                       value = "*";
-
-               access = opt;
-
-               host_dup = strdup(value);
-
-               if (host_dup == NULL)
-                       return (SA_NO_MEMORY);
-
-               host = host_dup;
-
-               do {
-                       next = strchr(host, ':');
-                       if (next != NULL) {
-                               *next = '\0';
-                               next++;
-                       }
-
-                       rc = udata->callback(udata->sharepath, host,
-                           udata->security, access, udata->cookie);
-
-                       if (rc != SA_OK) {
-                               free(host_dup);
-
-                               return (rc);
-                       }
-
-                       host = next;
-               } while (host != NULL);
-
-               free(host_dup);
-       }
-
-       return (SA_OK);
-}
-
-/*
- * Invokes a callback function for all NFS hosts that are set for a share.
- */
-static int
-foreach_nfs_host(sa_share_impl_t impl_share, nfs_host_callback_t callback,
-    void *cookie)
-{
-       nfs_host_cookie_t udata;
-       char *shareopts;
-
-       udata.callback = callback;
-       udata.sharepath = impl_share->sharepath;
-       udata.cookie = cookie;
-       udata.security = "sys";
-
-       shareopts = FSINFO(impl_share, nfs_fstype)->shareopts;
-
-       return foreach_nfs_shareopt(shareopts, foreach_nfs_host_cb,
-           &udata);
-}
-
-/*
- * Converts a Solaris NFS host specification to its Linux equivalent.
- */
-static int
-get_linux_hostspec(const char *solaris_hostspec, char **plinux_hostspec)
-{
-       /*
-        * For now we just support CIDR masks (e.g. @192.168.0.0/16) and host
-        * wildcards (e.g. *.example.org).
-        */
-       if (solaris_hostspec[0] == '@') {
-               /*
-                * Solaris host specifier, e.g. @192.168.0.0/16; we just need
-                * to skip the @ in this case
-                */
-               *plinux_hostspec = strdup(solaris_hostspec + 1);
-       } else {
-               *plinux_hostspec = strdup(solaris_hostspec);
-       }
-
-       if (*plinux_hostspec == NULL) {
-               return (SA_NO_MEMORY);
-       }
-
-       return (SA_OK);
-}
-
-/*
- * Used internally by nfs_enable_share to enable sharing for a single host.
- */
-static int
-nfs_enable_share_one(const char *sharepath, const char *host,
-    const char *security, const char *access, void *pcookie)
-{
-       int rc;
-       char *linuxhost, *hostpath, *opts;
-       const char *linux_opts = (const char *)pcookie;
-       char *argv[6];
-
-       /* exportfs -i -o sec=XX,rX,<opts> <host>:<sharepath> */
-
-       rc = get_linux_hostspec(host, &linuxhost);
-
-       if (rc < 0)
-               exit(1);
-
-       hostpath = malloc(strlen(linuxhost) + 1 + strlen(sharepath) + 1);
-
-       if (hostpath == NULL) {
-               free(linuxhost);
-
-               exit(1);
-       }
-
-       sprintf(hostpath, "%s:%s", linuxhost, sharepath);
-
-       free(linuxhost);
-
-       if (linux_opts == NULL)
-               linux_opts = "";
-
-       opts = malloc(4 + strlen(security) + 4 + strlen(linux_opts) + 1);
-
-       if (opts == NULL)
-               exit(1);
-
-       sprintf(opts, "sec=%s,%s,%s", security, access, linux_opts);
-
-#ifdef DEBUG
-       fprintf(stderr, "sharing %s with opts %s\n", hostpath, opts);
-#endif
-
-       argv[0] = "/usr/sbin/exportfs";
-       argv[1] = "-i";
-       argv[2] = "-o";
-       argv[3] = opts;
-       argv[4] = hostpath;
-       argv[5] = NULL;
-
-       rc = libzfs_run_process(argv[0], argv, 0);
-
-       free(hostpath);
-       free(opts);
-
-       if (rc < 0)
-               return (SA_SYSTEM_ERR);
-       else
-               return (SA_OK);
-}
-
-/*
- * Adds a Linux share option to an array of NFS options.
- */
-static int
-add_linux_shareopt(char **plinux_opts, const char *key, const char *value)
-{
-       size_t len = 0;
-       char *new_linux_opts;
-
-       if (*plinux_opts != NULL)
-               len = strlen(*plinux_opts);
-
-       new_linux_opts = realloc(*plinux_opts, len + 1 + strlen(key) +
-           (value ? 1 + strlen(value) : 0) + 1);
-
-       if (new_linux_opts == NULL)
-               return (SA_NO_MEMORY);
-
-       new_linux_opts[len] = '\0';
-
-       if (len > 0)
-               strcat(new_linux_opts, ",");
-
-       strcat(new_linux_opts, key);
-
-       if (value != NULL) {
-               strcat(new_linux_opts, "=");
-               strcat(new_linux_opts, value);
-       }
-
-       *plinux_opts = new_linux_opts;
-
-       return (SA_OK);
-}
-
-/*
- * Validates and converts a single Solaris share option to its Linux
- * equivalent.
- */
-static int
-get_linux_shareopts_cb(const char *key, const char *value, void *cookie)
-{
-       char **plinux_opts = (char **)cookie;
-
-       /* host-specific options, these are taken care of elsewhere */
-       if (strcmp(key, "ro") == 0 || strcmp(key, "rw") == 0 ||
-           strcmp(key, "sec") == 0)
-               return (SA_OK);
-
-       if (strcmp(key, "anon") == 0)
-               key = "anonuid";
-
-       if (strcmp(key, "root_mapping") == 0) {
-               (void) add_linux_shareopt(plinux_opts, "root_squash", NULL);
-               key = "anonuid";
-       }
-
-       if (strcmp(key, "nosub") == 0)
-               key = "subtree_check";
-
-       if (strcmp(key, "insecure") != 0 && strcmp(key, "secure") != 0 &&
-           strcmp(key, "async") != 0 && strcmp(key, "sync") != 0 &&
-           strcmp(key, "no_wdelay") != 0 && strcmp(key, "wdelay") != 0 &&
-           strcmp(key, "nohide") != 0 && strcmp(key, "hide") != 0 &&
-           strcmp(key, "crossmnt") != 0 &&
-           strcmp(key, "no_subtree_check") != 0 &&
-           strcmp(key, "subtree_check") != 0 &&
-           strcmp(key, "insecure_locks") != 0 &&
-           strcmp(key, "secure_locks") != 0 &&
-           strcmp(key, "no_auth_nlm") != 0 && strcmp(key, "auth_nlm") != 0 &&
-           strcmp(key, "no_acl") != 0 && strcmp(key, "mountpoint") != 0 &&
-           strcmp(key, "mp") != 0 && strcmp(key, "fsuid") != 0 &&
-           strcmp(key, "refer") != 0 && strcmp(key, "replicas") != 0 &&
-           strcmp(key, "root_squash") != 0 &&
-           strcmp(key, "no_root_squash") != 0 &&
-           strcmp(key, "all_squash") != 0 &&
-           strcmp(key, "no_all_squash") != 0 && strcmp(key, "fsid") != 0 &&
-           strcmp(key, "anonuid") != 0 && strcmp(key, "anongid") != 0) {
-               return (SA_SYNTAX_ERR);
-       }
-
-       (void) add_linux_shareopt(plinux_opts, key, value);
-
-       return (SA_OK);
-}
-
-/*
- * Takes a string containing Solaris share options (e.g. "sync,no_acl") and
- * converts them to a NULL-terminated array of Linux NFS options.
- */
-static int
-get_linux_shareopts(const char *shareopts, char **plinux_opts)
-{
-       int rc;
-
-       assert(plinux_opts != NULL);
-
-       *plinux_opts = NULL;
-
-       /* default options for Solaris shares */
-       (void) add_linux_shareopt(plinux_opts, "no_subtree_check", NULL);
-       (void) add_linux_shareopt(plinux_opts, "no_root_squash", NULL);
-       (void) add_linux_shareopt(plinux_opts, "mountpoint", NULL);
-
-       rc = foreach_nfs_shareopt(shareopts, get_linux_shareopts_cb,
-           plinux_opts);
-
-       if (rc != SA_OK) {
-               free(*plinux_opts);
-               *plinux_opts = NULL;
-       }
-
-       return (rc);
-}
-
-/*
- * Enables NFS sharing for the specified share.
- */
-static int
-nfs_enable_share(sa_share_impl_t impl_share)
-{
-       char *shareopts, *linux_opts;
-       int rc;
-
-       if (!nfs_available()) {
-               return (SA_SYSTEM_ERR);
-       }
-
-       shareopts = FSINFO(impl_share, nfs_fstype)->shareopts;
-
-       if (shareopts == NULL)
-               return (SA_OK);
-
-       rc = get_linux_shareopts(shareopts, &linux_opts);
-
-       if (rc != SA_OK)
-               return (rc);
-
-       rc = foreach_nfs_host(impl_share, nfs_enable_share_one, linux_opts);
-
-       free(linux_opts);
-
-       return (rc);
-}
-
-/*
- * Used internally by nfs_disable_share to disable sharing for a single host.
- */
-static int
-nfs_disable_share_one(const char *sharepath, const char *host,
-    const char *security, const char *access, void *cookie)
-{
-       int rc;
-       char *linuxhost, *hostpath;
-       char *argv[4];
-
-       rc = get_linux_hostspec(host, &linuxhost);
-
-       if (rc < 0)
-               exit(1);
-
-       hostpath = malloc(strlen(linuxhost) + 1 + strlen(sharepath) + 1);
-
-       if (hostpath == NULL) {
-               free(linuxhost);
-               exit(1);
-       }
-
-       sprintf(hostpath, "%s:%s", linuxhost, sharepath);
-
-       free(linuxhost);
-
-#ifdef DEBUG
-       fprintf(stderr, "unsharing %s\n", hostpath);
-#endif
-
-       argv[0] = "/usr/sbin/exportfs";
-       argv[1] = "-u";
-       argv[2] = hostpath;
-       argv[3] = NULL;
-
-       rc = libzfs_run_process(argv[0], argv, 0);
-
-       free(hostpath);
-
-       if (rc < 0)
-               return (SA_SYSTEM_ERR);
-       else
-               return (SA_OK);
-}
-
-/*
- * Disables NFS sharing for the specified share.
- */
-static int
-nfs_disable_share(sa_share_impl_t impl_share)
-{
-       if (!nfs_available()) {
-               /*
-                * The share can't possibly be active, so nothing
-                * needs to be done to disable it.
-                */
-               return (SA_OK);
-       }
-
-       return (foreach_nfs_host(impl_share, nfs_disable_share_one, NULL));
-}
-
-/*
- * Checks whether the specified NFS share options are syntactically correct.
- */
-static int
-nfs_validate_shareopts(const char *shareopts)
-{
-       char *linux_opts;
-       int rc;
-
-       rc = get_linux_shareopts(shareopts, &linux_opts);
-
-       if (rc != SA_OK)
-               return (rc);
-
-       free(linux_opts);
-
-       return (SA_OK);
-}
-
-/*
- * Checks whether a share is currently active.
- */
-static boolean_t
-nfs_is_share_active(sa_share_impl_t impl_share)
-{
-       char line[512];
-       char *tab, *cur;
-       FILE *nfs_exportfs_temp_fp;
-
-       if (!nfs_available())
-               return (B_FALSE);
-
-       nfs_exportfs_temp_fp = fdopen(dup(nfs_exportfs_temp_fd), "r");
-
-       if (nfs_exportfs_temp_fp == NULL ||
-           fseek(nfs_exportfs_temp_fp, 0, SEEK_SET) < 0) {
-               fclose(nfs_exportfs_temp_fp);
-               return (B_FALSE);
-       }
-
-       while (fgets(line, sizeof (line), nfs_exportfs_temp_fp) != NULL) {
-               /*
-                * exportfs uses separate lines for the share path
-                * and the export options when the share path is longer
-                * than a certain amount of characters; this ignores
-                * the option lines
-                */
-               if (line[0] == '\t')
-                       continue;
-
-               tab = strchr(line, '\t');
-
-               if (tab != NULL) {
-                       *tab = '\0';
-                       cur = tab - 1;
-               } else {
-                       /*
-                        * there's no tab character, which means the
-                        * NFS options are on a separate line; we just
-                        * need to remove the new-line character
-                        * at the end of the line
-                        */
-                       cur = line + strlen(line) - 1;
-               }
-
-               /* remove trailing spaces and new-line characters */
-               while (cur >= line && (*cur == ' ' || *cur == '\n'))
-                       *cur-- = '\0';
-
-               if (strcmp(line, impl_share->sharepath) == 0) {
-                       fclose(nfs_exportfs_temp_fp);
-                       return (B_TRUE);
-               }
-       }
-
-       fclose(nfs_exportfs_temp_fp);
-
-       return (B_FALSE);
-}
-
-/*
- * Called to update a share's options. A share's options might be out of
- * date if the share was loaded from disk (i.e. /etc/dfs/sharetab) and the
- * "sharenfs" dataset property has changed in the meantime. This function
- * also takes care of re-enabling the share if necessary.
- */
-static int
-nfs_update_shareopts(sa_share_impl_t impl_share, const char *resource,
-    const char *shareopts)
-{
-       char *shareopts_dup;
-       boolean_t needs_reshare = B_FALSE;
-       char *old_shareopts;
-
-       FSINFO(impl_share, nfs_fstype)->active =
-           nfs_is_share_active(impl_share);
-
-       old_shareopts = FSINFO(impl_share, nfs_fstype)->shareopts;
-
-       if (strcmp(shareopts, "on") == 0)
-               shareopts = "rw";
-
-       if (FSINFO(impl_share, nfs_fstype)->active && old_shareopts != NULL &&
-           strcmp(old_shareopts, shareopts) != 0) {
-               needs_reshare = B_TRUE;
-               nfs_disable_share(impl_share);
-       }
-
-       shareopts_dup = strdup(shareopts);
-
-       if (shareopts_dup == NULL)
-               return (SA_NO_MEMORY);
-
-       if (old_shareopts != NULL)
-               free(old_shareopts);
-
-       FSINFO(impl_share, nfs_fstype)->shareopts = shareopts_dup;
-
-       if (needs_reshare)
-               nfs_enable_share(impl_share);
-
-       return (SA_OK);
-}
-
-/*
- * Clears a share's NFS options. Used by libshare to
- * clean up shares that are about to be free()'d.
- */
-static void
-nfs_clear_shareopts(sa_share_impl_t impl_share)
-{
-       free(FSINFO(impl_share, nfs_fstype)->shareopts);
-       FSINFO(impl_share, nfs_fstype)->shareopts = NULL;
-}
-
-static const sa_share_ops_t nfs_shareops = {
-       .enable_share = nfs_enable_share,
-       .disable_share = nfs_disable_share,
-
-       .validate_shareopts = nfs_validate_shareopts,
-       .update_shareopts = nfs_update_shareopts,
-       .clear_shareopts = nfs_clear_shareopts,
-};
-
-/*
- * nfs_check_exportfs() checks that the exportfs command runs
- * and also maintains a temporary copy of the output from
- * exportfs -v.
- * To update this temporary copy simply call this function again.
- *
- * TODO : Use /var/lib/nfs/etab instead of our private copy.
- *        But must implement locking to prevent concurrent access.
- *
- * TODO : The temporary file descriptor is never closed since
- *        there is no libshare_nfs_fini() function.
- */
-static int
-nfs_check_exportfs(void)
-{
-       pid_t pid;
-       int rc, status;
-       static char nfs_exportfs_tempfile[] = "/tmp/exportfs.XXXXXX";
-
-       /*
-        * Close any existing temporary copies of output from exportfs.
-        * We have already called unlink() so file will be deleted.
-        */
-       if (nfs_exportfs_temp_fd >= 0)
-               close(nfs_exportfs_temp_fd);
-
-       nfs_exportfs_temp_fd = mkstemp(nfs_exportfs_tempfile);
-
-       if (nfs_exportfs_temp_fd < 0)
-               return (SA_SYSTEM_ERR);
-
-       unlink(nfs_exportfs_tempfile);
-
-       fcntl(nfs_exportfs_temp_fd, F_SETFD, FD_CLOEXEC);
-
-       pid = fork();
-
-       if (pid < 0) {
-               (void) close(nfs_exportfs_temp_fd);
-               nfs_exportfs_temp_fd = -1;
-               return (SA_SYSTEM_ERR);
-       }
-
-       if (pid > 0) {
-               while ((rc = waitpid(pid, &status, 0)) <= 0 && errno == EINTR);
-
-               if (rc <= 0) {
-                       (void) close(nfs_exportfs_temp_fd);
-                       nfs_exportfs_temp_fd = -1;
-                       return (SA_SYSTEM_ERR);
-               }
-
-               if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
-                       (void) close(nfs_exportfs_temp_fd);
-                       nfs_exportfs_temp_fd = -1;
-                       return (SA_CONFIG_ERR);
-               }
-
-               return (SA_OK);
-       }
-
-       /* child */
-
-       /* exportfs -v */
-
-       if (dup2(nfs_exportfs_temp_fd, STDOUT_FILENO) < 0)
-               exit(1);
-
-       rc = execlp("/usr/sbin/exportfs", "exportfs", "-v", NULL);
-
-       if (rc < 0) {
-               exit(1);
-       }
-
-       exit(0);
-}
-
-/*
- * Provides a convenient wrapper for determing nfs availability
- */
-static boolean_t
-nfs_available(void)
-{
-       if (nfs_exportfs_temp_fd == -1)
-               (void) nfs_check_exportfs();
-
-       return ((nfs_exportfs_temp_fd != -1) ? B_TRUE : B_FALSE);
-}
-
-/*
- * Initializes the NFS functionality of libshare.
- */
-void
-libshare_nfs_init(void)
-{
-       nfs_fstype = register_fstype("nfs", &nfs_shareops);
-}
diff --git a/zfs/lib/libshare/nfs.h b/zfs/lib/libshare/nfs.h
deleted file mode 100644 (file)
index b9ea6ee..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011 Gunnar Beutner
- */
-
-void libshare_nfs_init(void);
diff --git a/zfs/lib/libshare/smb.c b/zfs/lib/libshare/smb.c
deleted file mode 100644 (file)
index 1ac1a8d..0000000
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2002, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011,2012 Turbo Fredriksson <turbo@bayour.com>, based on nfs.c
- *                         by Gunnar Beutner
- *
- * This is an addition to the zfs device driver to add, modify and remove SMB
- * shares using the 'net share' command that comes with Samba.
- *
- * TESTING
- * Make sure that samba listens to 'localhost' (127.0.0.1) and that the options
- * 'usershare max shares' and 'usershare owner only' have been rewied/set
- * accordingly (see zfs(8) for information).
- *
- * Once configuration in samba have been done, test that this
- * works with the following three commands (in this case, my ZFS
- * filesystem is called 'share/Test1'):
- *
- *     (root)# net -U root -S 127.0.0.1 usershare add Test1 /share/Test1 \
- *             "Comment: /share/Test1" "Everyone:F"
- *     (root)# net usershare list | grep -i test
- *     (root)# net -U root -S 127.0.0.1 usershare delete Test1
- *
- * The first command will create a user share that gives everyone full access.
- * To limit the access below that, use normal UNIX commands (chmod, chown etc).
- */
-
-#include <time.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include <strings.h>
-#include <fcntl.h>
-#include <sys/wait.h>
-#include <unistd.h>
-#include <dirent.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <libzfs.h>
-#include <libshare.h>
-#include "libshare_impl.h"
-#include "smb.h"
-
-static boolean_t smb_available(void);
-
-static sa_fstype_t *smb_fstype;
-
-/*
- * Retrieve the list of SMB shares.
- */
-static int
-smb_retrieve_shares(void)
-{
-       int rc = SA_OK;
-       char file_path[PATH_MAX], line[512], *token, *key, *value;
-       char *dup_value, *path = NULL, *comment = NULL, *name = NULL;
-       char *guest_ok = NULL;
-       DIR *shares_dir;
-       FILE *share_file_fp = NULL;
-       struct dirent *directory;
-       struct stat eStat;
-       smb_share_t *shares, *new_shares = NULL;
-
-       /* opendir(), stat() */
-       shares_dir = opendir(SHARE_DIR);
-       if (shares_dir == NULL)
-               return (SA_SYSTEM_ERR);
-
-       /* Go through the directory, looking for shares */
-       while ((directory = readdir(shares_dir))) {
-               if (directory->d_name[0] == '.')
-                       continue;
-
-               snprintf(file_path, sizeof (file_path),
-                   "%s/%s", SHARE_DIR, directory->d_name);
-
-               if (stat(file_path, &eStat) == -1) {
-                       rc = SA_SYSTEM_ERR;
-                       goto out;
-               }
-
-               if (!S_ISREG(eStat.st_mode))
-                       continue;
-
-               if ((share_file_fp = fopen(file_path, "r")) == NULL) {
-                       rc = SA_SYSTEM_ERR;
-                       goto out;
-               }
-
-               name = strdup(directory->d_name);
-               if (name == NULL) {
-                       rc = SA_NO_MEMORY;
-                       goto out;
-               }
-
-               while (fgets(line, sizeof (line), share_file_fp)) {
-                       if (line[0] == '#')
-                               continue;
-
-                       /* Trim trailing new-line character(s). */
-                       while (line[strlen(line) - 1] == '\r' ||
-                           line[strlen(line) - 1] == '\n')
-                               line[strlen(line) - 1] = '\0';
-
-                       /* Split the line in two, separated by '=' */
-                       token = strchr(line, '=');
-                       if (token == NULL)
-                               continue;
-
-                       key = line;
-                       value = token + 1;
-                       *token = '\0';
-
-                       dup_value = strdup(value);
-                       if (dup_value == NULL) {
-                               rc = SA_NO_MEMORY;
-                               goto out;
-                       }
-
-                       if (strcmp(key, "path") == 0)
-                               path = dup_value;
-                       if (strcmp(key, "comment") == 0)
-                               comment = dup_value;
-                       if (strcmp(key, "guest_ok") == 0)
-                               guest_ok = dup_value;
-
-                       if (path == NULL || comment == NULL || guest_ok == NULL)
-                               continue; /* Incomplete share definition */
-                       else {
-                               shares = (smb_share_t *)
-                                               malloc(sizeof (smb_share_t));
-                               if (shares == NULL) {
-                                       rc = SA_NO_MEMORY;
-                                       goto out;
-                               }
-
-                               strncpy(shares->name, name,
-                                       sizeof (shares->name));
-                               shares->name [sizeof (shares->name) - 1] = '\0';
-
-                               strncpy(shares->path, path,
-                                   sizeof (shares->path));
-                               shares->path [sizeof (shares->path) - 1] = '\0';
-
-                               strncpy(shares->comment, comment,
-                                   sizeof (shares->comment));
-                               shares->comment[sizeof (shares->comment)-1] =
-                                   '\0';
-
-                               shares->guest_ok = atoi(guest_ok);
-
-                               shares->next = new_shares;
-                               new_shares = shares;
-
-                               name = NULL;
-                               path = NULL;
-                               comment = NULL;
-                               guest_ok = NULL;
-                       }
-               }
-
-out:
-               if (share_file_fp != NULL)
-                       fclose(share_file_fp);
-
-               free(name);
-               free(path);
-               free(comment);
-               free(guest_ok);
-       }
-       closedir(shares_dir);
-
-       smb_shares = new_shares;
-
-       return (rc);
-}
-
-/*
- * Used internally by smb_enable_share to enable sharing for a single host.
- */
-static int
-smb_enable_share_one(const char *sharename, const char *sharepath)
-{
-       char *argv[10], *pos;
-       char name[SMB_NAME_MAX], comment[SMB_COMMENT_MAX];
-       int rc;
-
-       /* Support ZFS share name regexp '[[:alnum:]_-.: ]' */
-       strncpy(name, sharename, sizeof (name));
-       name [sizeof (name)-1] = '\0';
-
-       pos = name;
-       while (*pos != '\0') {
-               switch (*pos) {
-               case '/':
-               case '-':
-               case ':':
-               case ' ':
-                       *pos = '_';
-               }
-
-               ++pos;
-       }
-
-       /*
-        * CMD: net -S NET_CMD_ARG_HOST usershare add Test1 /share/Test1 \
-        *      "Comment" "Everyone:F"
-        */
-       snprintf(comment, sizeof (comment), "Comment: %s", sharepath);
-
-       argv[0] = NET_CMD_PATH;
-       argv[1] = (char *)"-S";
-       argv[2] = NET_CMD_ARG_HOST;
-       argv[3] = (char *)"usershare";
-       argv[4] = (char *)"add";
-       argv[5] = (char *)name;
-       argv[6] = (char *)sharepath;
-       argv[7] = (char *)comment;
-       argv[8] = "Everyone:F";
-       argv[9] = NULL;
-
-       rc = libzfs_run_process(argv[0], argv, 0);
-       if (rc < 0)
-               return (SA_SYSTEM_ERR);
-
-       /* Reload the share file */
-       (void) smb_retrieve_shares();
-
-       return (SA_OK);
-}
-
-/*
- * Enables SMB sharing for the specified share.
- */
-static int
-smb_enable_share(sa_share_impl_t impl_share)
-{
-       char *shareopts;
-
-       if (!smb_available())
-               return (SA_SYSTEM_ERR);
-
-       shareopts = FSINFO(impl_share, smb_fstype)->shareopts;
-       if (shareopts == NULL) /* on/off */
-               return (SA_SYSTEM_ERR);
-
-       if (strcmp(shareopts, "off") == 0)
-               return (SA_OK);
-
-       /* Magic: Enable (i.e., 'create new') share */
-       return (smb_enable_share_one(impl_share->dataset,
-           impl_share->sharepath));
-}
-
-/*
- * Used internally by smb_disable_share to disable sharing for a single host.
- */
-static int
-smb_disable_share_one(const char *sharename)
-{
-       int rc;
-       char *argv[7];
-
-       /* CMD: net -S NET_CMD_ARG_HOST usershare delete Test1 */
-       argv[0] = NET_CMD_PATH;
-       argv[1] = (char *)"-S";
-       argv[2] = NET_CMD_ARG_HOST;
-       argv[3] = (char *)"usershare";
-       argv[4] = (char *)"delete";
-       argv[5] = strdup(sharename);
-       argv[6] = NULL;
-
-       rc = libzfs_run_process(argv[0], argv, 0);
-       if (rc < 0)
-               return (SA_SYSTEM_ERR);
-       else
-               return (SA_OK);
-}
-
-/*
- * Disables SMB sharing for the specified share.
- */
-static int
-smb_disable_share(sa_share_impl_t impl_share)
-{
-       smb_share_t *shares = smb_shares;
-
-       if (!smb_available()) {
-               /*
-                * The share can't possibly be active, so nothing
-                * needs to be done to disable it.
-                */
-               return (SA_OK);
-       }
-
-       while (shares != NULL) {
-               if (strcmp(impl_share->sharepath, shares->path) == 0)
-                       return (smb_disable_share_one(shares->name));
-
-               shares = shares->next;
-       }
-
-       return (SA_OK);
-}
-
-/*
- * Checks whether the specified SMB share options are syntactically correct.
- */
-static int
-smb_validate_shareopts(const char *shareopts)
-{
-       /* TODO: Accept 'name' and sec/acl (?) */
-       if ((strcmp(shareopts, "off") == 0) || (strcmp(shareopts, "on") == 0))
-               return (SA_OK);
-
-       return (SA_SYNTAX_ERR);
-}
-
-/*
- * Checks whether a share is currently active.
- */
-static boolean_t
-smb_is_share_active(sa_share_impl_t impl_share)
-{
-       if (!smb_available())
-               return (B_FALSE);
-
-       /* Retrieve the list of (possible) active shares */
-       smb_retrieve_shares();
-
-       while (smb_shares != NULL) {
-               if (strcmp(impl_share->sharepath, smb_shares->path) == 0)
-                       return (B_TRUE);
-
-               smb_shares = smb_shares->next;
-       }
-
-       return (B_FALSE);
-}
-
-/*
- * Called to update a share's options. A share's options might be out of
- * date if the share was loaded from disk and the "sharesmb" dataset
- * property has changed in the meantime. This function also takes care
- * of re-enabling the share if necessary.
- */
-static int
-smb_update_shareopts(sa_share_impl_t impl_share, const char *resource,
-    const char *shareopts)
-{
-       char *shareopts_dup;
-       boolean_t needs_reshare = B_FALSE;
-       char *old_shareopts;
-
-       if (!impl_share)
-               return (SA_SYSTEM_ERR);
-
-       FSINFO(impl_share, smb_fstype)->active =
-           smb_is_share_active(impl_share);
-
-       old_shareopts = FSINFO(impl_share, smb_fstype)->shareopts;
-
-       if (FSINFO(impl_share, smb_fstype)->active && old_shareopts != NULL &&
-               strcmp(old_shareopts, shareopts) != 0) {
-               needs_reshare = B_TRUE;
-               smb_disable_share(impl_share);
-       }
-
-       shareopts_dup = strdup(shareopts);
-
-       if (shareopts_dup == NULL)
-               return (SA_NO_MEMORY);
-
-       if (old_shareopts != NULL)
-               free(old_shareopts);
-
-       FSINFO(impl_share, smb_fstype)->shareopts = shareopts_dup;
-
-       if (needs_reshare)
-               smb_enable_share(impl_share);
-
-       return (SA_OK);
-}
-
-/*
- * Clears a share's SMB options. Used by libshare to
- * clean up shares that are about to be free()'d.
- */
-static void
-smb_clear_shareopts(sa_share_impl_t impl_share)
-{
-       free(FSINFO(impl_share, smb_fstype)->shareopts);
-       FSINFO(impl_share, smb_fstype)->shareopts = NULL;
-}
-
-static const sa_share_ops_t smb_shareops = {
-       .enable_share = smb_enable_share,
-       .disable_share = smb_disable_share,
-
-       .validate_shareopts = smb_validate_shareopts,
-       .update_shareopts = smb_update_shareopts,
-       .clear_shareopts = smb_clear_shareopts,
-};
-
-/*
- * Provides a convenient wrapper for determining SMB availability
- */
-static boolean_t
-smb_available(void)
-{
-       struct stat statbuf;
-
-       if (lstat(SHARE_DIR, &statbuf) != 0 ||
-           !S_ISDIR(statbuf.st_mode))
-               return (B_FALSE);
-
-       if (access(NET_CMD_PATH, F_OK) != 0)
-               return (B_FALSE);
-
-       return (B_TRUE);
-}
-
-/*
- * Initializes the SMB functionality of libshare.
- */
-void
-libshare_smb_init(void)
-{
-       smb_fstype = register_fstype("smb", &smb_shareops);
-}
diff --git a/zfs/lib/libshare/smb.h b/zfs/lib/libshare/smb.h
deleted file mode 100644 (file)
index 7a0c0fd..0000000
+++ /dev/null
@@ -1,49 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2011 Turbo Fredriksson <turbo@bayour.com>.
- */
-
-/*
- * The maximum SMB share name seems to be 254 characters, though good
- * references are hard to find.
- */
-
-#define        SMB_NAME_MAX            255
-#define        SMB_COMMENT_MAX         255
-
-#define        SHARE_DIR               "/var/lib/samba/usershares"
-#define        NET_CMD_PATH            "/usr/bin/net"
-#define        NET_CMD_ARG_HOST        "127.0.0.1"
-
-typedef struct smb_share_s {
-       char name[SMB_NAME_MAX];        /* Share name */
-       char path[PATH_MAX];            /* Share path */
-       char comment[SMB_COMMENT_MAX];  /* Share's comment */
-       boolean_t guest_ok;             /* 'y' or 'n' */
-
-       struct smb_share_s *next;
-} smb_share_t;
-
-smb_share_t *smb_shares;
-
-void libshare_smb_init(void);
diff --git a/zfs/lib/libspl/Makefile.am b/zfs/lib/libspl/Makefile.am
deleted file mode 100644 (file)
index a569446..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-VPATH = \
-       $(top_srcdir)/lib/libspl \
-       $(top_srcdir)/lib/libspl/$(TARGET_ASM_DIR)
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-SUBDIRS = include $(TARGET_ASM_DIR)
-DIST_SUBDIRS = include asm-generic asm-i386 asm-x86_64
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/lib/libspl/include
-
-AM_CCASFLAGS = \
-       -I$(top_srcdir)/lib/libspl/include
-
-noinst_LTLIBRARIES = libspl.la
-
-USER_C = \
-       getexecname.c \
-       gethrtime.c \
-       gethrestime.c \
-       getmntany.c \
-       list.c \
-       mkdirp.c \
-       strlcat.c \
-       strlcpy.c \
-       strnlen.c \
-       timestamp.c \
-       zone.c \
-       xdr.c \
-       include/sys/list.h \
-       include/sys/list_impl.h
-
-USER_ASM = atomic.S
-
-KERNEL_C =
-
-nodist_libspl_la_SOURCES = \
-       $(USER_C) \
-       $(USER_ASM) \
-       $(KERNEL_C)
-
-libspl_la_LIBADD = -lrt
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libspl/Makefile.in b/zfs/lib/libspl/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/asm-generic/Makefile.am b/zfs/lib/libspl/asm-generic/Makefile.am
deleted file mode 100644 (file)
index 17fe501..0000000
+++ /dev/null
@@ -1,18 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-        -I$(top_srcdir)/lib/libspl/include
-
-atomic_SOURCE = atomic.c
-atomic_ASM = atomic.S
-
-COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-         $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) -fPIC
-EXTRA_DIST = $(atomic_SOURCE)
-
-# Generates assembly to simplify inclusion in ../Makefile.am
-all-am:
-       $(COMPILE) -c -S $(atomic_SOURCE) -o $(atomic_ASM)
-
-clean-generic:
-       $(RM) $(atomic_ASM)
diff --git a/zfs/lib/libspl/asm-generic/Makefile.in b/zfs/lib/libspl/asm-generic/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/asm-generic/atomic.c b/zfs/lib/libspl/asm-generic/atomic.c
deleted file mode 100644 (file)
index f5eb4f3..0000000
+++ /dev/null
@@ -1,499 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2009 by Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <atomic.h>
-#include <assert.h>
-#include <pthread.h>
-
-/*
- * All operations are implemented by serializing them through a global
- * pthread mutex.  This provides a correct generic implementation.
- * However all supported architectures are encouraged to provide a
- * native implementation is assembly for performance reasons.
- */
-pthread_mutex_t atomic_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/*
- * Theses are the void returning variants
- */
-
-#define        ATOMIC_INC(name, type) \
-       void atomic_inc_##name(volatile type *target)                   \
-       {                                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               (*target)++;                                            \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-       }
-
-ATOMIC_INC(long, unsigned long)
-ATOMIC_INC(8, uint8_t)
-ATOMIC_INC(uchar, uchar_t)
-ATOMIC_INC(16, uint16_t)
-ATOMIC_INC(ushort, ushort_t)
-ATOMIC_INC(32, uint32_t)
-ATOMIC_INC(uint, uint_t)
-ATOMIC_INC(ulong, ulong_t)
-ATOMIC_INC(64, uint64_t)
-
-
-#define        ATOMIC_DEC(name, type) \
-       void atomic_dec_##name(volatile type *target)                   \
-       {                                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               (*target)--;                                            \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-       }
-
-ATOMIC_DEC(long, unsigned long)
-ATOMIC_DEC(8, uint8_t)
-ATOMIC_DEC(uchar, uchar_t)
-ATOMIC_DEC(16, uint16_t)
-ATOMIC_DEC(ushort, ushort_t)
-ATOMIC_DEC(32, uint32_t)
-ATOMIC_DEC(uint, uint_t)
-ATOMIC_DEC(ulong, ulong_t)
-ATOMIC_DEC(64, uint64_t)
-
-
-#define        ATOMIC_ADD(name, type1, type2) \
-       void atomic_add_##name(volatile type1 *target, type2 bits)      \
-       {                                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               *target += bits;                                        \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-       }
-
-ATOMIC_ADD(8, uint8_t, int8_t)
-ATOMIC_ADD(char, uchar_t, signed char)
-ATOMIC_ADD(16, uint16_t, int16_t)
-ATOMIC_ADD(short, ushort_t, short)
-ATOMIC_ADD(32, uint32_t, int32_t)
-ATOMIC_ADD(int, uint_t, int)
-ATOMIC_ADD(long, ulong_t, long)
-ATOMIC_ADD(64, uint64_t, int64_t)
-
-void
-atomic_add_ptr(volatile void *target, ssize_t bits)
-{
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       *(caddr_t *)target += bits;
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-}
-
-
-#define        ATOMIC_SUB(name, type1, type2) \
-       void atomic_sub_##name(volatile type1 *target, type2 bits)      \
-       {                                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               *target -= bits;                                        \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-       }
-
-ATOMIC_SUB(8, uint8_t, int8_t)
-ATOMIC_SUB(char, uchar_t, signed char)
-ATOMIC_SUB(16, uint16_t, int16_t)
-ATOMIC_SUB(short, ushort_t, short)
-ATOMIC_SUB(32, uint32_t, int32_t)
-ATOMIC_SUB(int, uint_t, int)
-ATOMIC_SUB(long, ulong_t, long)
-ATOMIC_SUB(64, uint64_t, int64_t)
-
-void
-atomic_sub_ptr(volatile void *target, ssize_t bits)
-{
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       *(caddr_t *)target -= bits;
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-}
-
-
-#define        ATOMIC_OR(name, type) \
-       void atomic_or_##name(volatile type *target, type bits)         \
-       {                                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               *target |= bits;                                        \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-       }
-
-ATOMIC_OR(8, uint8_t)
-ATOMIC_OR(uchar, uchar_t)
-ATOMIC_OR(16, uint16_t)
-ATOMIC_OR(ushort, ushort_t)
-ATOMIC_OR(32, uint32_t)
-ATOMIC_OR(uint, uint_t)
-ATOMIC_OR(ulong, ulong_t)
-ATOMIC_OR(64, uint64_t)
-
-
-#define        ATOMIC_AND(name, type) \
-       void atomic_and_##name(volatile type *target, type bits)        \
-       {                                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               *target &= bits;                                        \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-       }
-
-ATOMIC_AND(8, uint8_t)
-ATOMIC_AND(uchar, uchar_t)
-ATOMIC_AND(16, uint16_t)
-ATOMIC_AND(ushort, ushort_t)
-ATOMIC_AND(32, uint32_t)
-ATOMIC_AND(uint, uint_t)
-ATOMIC_AND(ulong, ulong_t)
-ATOMIC_AND(64, uint64_t)
-
-
-/*
- * New value returning variants
- */
-
-#define        ATOMIC_INC_NV(name, type) \
-       type atomic_inc_##name##_nv(volatile type *target)              \
-       {                                                               \
-               type rc;                                                \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               rc = (++(*target));                                     \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (rc);                                            \
-       }
-
-ATOMIC_INC_NV(long, unsigned long)
-ATOMIC_INC_NV(8, uint8_t)
-ATOMIC_INC_NV(uchar, uchar_t)
-ATOMIC_INC_NV(16, uint16_t)
-ATOMIC_INC_NV(ushort, ushort_t)
-ATOMIC_INC_NV(32, uint32_t)
-ATOMIC_INC_NV(uint, uint_t)
-ATOMIC_INC_NV(ulong, ulong_t)
-ATOMIC_INC_NV(64, uint64_t)
-
-
-#define        ATOMIC_DEC_NV(name, type) \
-       type atomic_dec_##name##_nv(volatile type *target)              \
-       {                                                               \
-               type rc;                                                \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               rc = (--(*target));                                     \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (rc);                                            \
-       }
-
-ATOMIC_DEC_NV(long, unsigned long)
-ATOMIC_DEC_NV(8, uint8_t)
-ATOMIC_DEC_NV(uchar, uchar_t)
-ATOMIC_DEC_NV(16, uint16_t)
-ATOMIC_DEC_NV(ushort, ushort_t)
-ATOMIC_DEC_NV(32, uint32_t)
-ATOMIC_DEC_NV(uint, uint_t)
-ATOMIC_DEC_NV(ulong, ulong_t)
-ATOMIC_DEC_NV(64, uint64_t)
-
-
-#define        ATOMIC_ADD_NV(name, type1, type2) \
-       type1 atomic_add_##name##_nv(volatile type1 *target, type2 bits)\
-       {                                                               \
-               type1 rc;                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               rc = (*target += bits);                                 \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (rc);                                            \
-       }
-
-ATOMIC_ADD_NV(8, uint8_t, int8_t)
-ATOMIC_ADD_NV(char, uchar_t, signed char)
-ATOMIC_ADD_NV(16, uint16_t, int16_t)
-ATOMIC_ADD_NV(short, ushort_t, short)
-ATOMIC_ADD_NV(32, uint32_t, int32_t)
-ATOMIC_ADD_NV(int, uint_t, int)
-ATOMIC_ADD_NV(long, ulong_t, long)
-ATOMIC_ADD_NV(64, uint64_t, int64_t)
-
-void *
-atomic_add_ptr_nv(volatile void *target, ssize_t bits)
-{
-       void *ptr;
-
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       ptr = (*(caddr_t *)target += bits);
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-
-       return (ptr);
-}
-
-
-#define        ATOMIC_SUB_NV(name, type1, type2) \
-       type1 atomic_sub_##name##_nv(volatile type1 *target, type2 bits)\
-       {                                                               \
-               type1 rc;                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               rc = (*target -= bits);                                 \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (rc);                                            \
-       }
-
-ATOMIC_SUB_NV(8, uint8_t, int8_t)
-ATOMIC_SUB_NV(char, uchar_t, signed char)
-ATOMIC_SUB_NV(16, uint16_t, int16_t)
-ATOMIC_SUB_NV(short, ushort_t, short)
-ATOMIC_SUB_NV(32, uint32_t, int32_t)
-ATOMIC_SUB_NV(int, uint_t, int)
-ATOMIC_SUB_NV(long, ulong_t, long)
-ATOMIC_SUB_NV(64, uint64_t, int64_t)
-
-void *
-atomic_sub_ptr_nv(volatile void *target, ssize_t bits)
-{
-       void *ptr;
-
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       ptr = (*(caddr_t *)target -= bits);
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-
-       return (ptr);
-}
-
-
-#define        ATOMIC_OR_NV(name, type) \
-       type atomic_or_##name##_nv(volatile type *target, type bits)    \
-       {                                                               \
-               type rc;                                                \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               rc = (*target |= bits);                                 \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (rc);                                            \
-       }
-
-ATOMIC_OR_NV(long, unsigned long)
-ATOMIC_OR_NV(8, uint8_t)
-ATOMIC_OR_NV(uchar, uchar_t)
-ATOMIC_OR_NV(16, uint16_t)
-ATOMIC_OR_NV(ushort, ushort_t)
-ATOMIC_OR_NV(32, uint32_t)
-ATOMIC_OR_NV(uint, uint_t)
-ATOMIC_OR_NV(ulong, ulong_t)
-ATOMIC_OR_NV(64, uint64_t)
-
-
-#define        ATOMIC_AND_NV(name, type) \
-       type atomic_and_##name##_nv(volatile type *target, type bits)   \
-       {                                                               \
-               type rc;                                                \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               rc = (*target &= bits);                                 \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (rc);                                            \
-       }
-
-ATOMIC_AND_NV(long, unsigned long)
-ATOMIC_AND_NV(8, uint8_t)
-ATOMIC_AND_NV(uchar, uchar_t)
-ATOMIC_AND_NV(16, uint16_t)
-ATOMIC_AND_NV(ushort, ushort_t)
-ATOMIC_AND_NV(32, uint32_t)
-ATOMIC_AND_NV(uint, uint_t)
-ATOMIC_AND_NV(ulong, ulong_t)
-ATOMIC_AND_NV(64, uint64_t)
-
-
-/*
- *  If *arg1 == arg2, set *arg1 = arg3; return old value
- */
-
-#define        ATOMIC_CAS(name, type) \
-       type atomic_cas_##name(volatile type *target, type arg1, type arg2) \
-       {                                                               \
-               type old;                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               old = *target;                                          \
-               if (old == arg1)                                        \
-                       *target = arg2;                                 \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (old);                                           \
-       }
-
-ATOMIC_CAS(8, uint8_t)
-ATOMIC_CAS(uchar, uchar_t)
-ATOMIC_CAS(16, uint16_t)
-ATOMIC_CAS(ushort, ushort_t)
-ATOMIC_CAS(32, uint32_t)
-ATOMIC_CAS(uint, uint_t)
-ATOMIC_CAS(ulong, ulong_t)
-ATOMIC_CAS(64, uint64_t)
-
-void *
-atomic_cas_ptr(volatile void *target, void *arg1, void *arg2)
-{
-       void *old;
-
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       old = *(void **)target;
-       if (old == arg1)
-               *(void **)target = arg2;
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-
-       return (old);
-}
-
-
-/*
- * Swap target and return old value
- */
-
-#define        ATOMIC_SWAP(name, type) \
-       type atomic_swap_##name(volatile type *target, type bits)       \
-       {                                                               \
-               type old;                                               \
-               VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);      \
-               old = *target;                                          \
-               *target = bits;                                         \
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);    \
-               return (old);                                           \
-       }
-
-ATOMIC_SWAP(8, uint8_t)
-ATOMIC_SWAP(uchar, uchar_t)
-ATOMIC_SWAP(16, uint16_t)
-ATOMIC_SWAP(ushort, ushort_t)
-ATOMIC_SWAP(32, uint32_t)
-ATOMIC_SWAP(uint, uint_t)
-ATOMIC_SWAP(ulong, ulong_t)
-ATOMIC_SWAP(64, uint64_t)
-
-void *
-atomic_swap_ptr(volatile void *target, void *bits)
-{
-       void *old;
-
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       old = *(void **)target;
-       *(void **)target = bits;
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-
-       return (old);
-}
-
-
-int
-atomic_set_long_excl(volatile ulong_t *target, uint_t value)
-{
-       ulong_t bit;
-
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       bit = (1UL << value);
-       if ((*target & bit) != 0) {
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-               return (-1);
-       }
-       *target |= bit;
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-
-       return (0);
-}
-
-int
-atomic_clear_long_excl(volatile ulong_t *target, uint_t value)
-{
-       ulong_t bit;
-
-       VERIFY3S(pthread_mutex_lock(&atomic_lock), ==, 0);
-       bit = (1UL << value);
-       if ((*target & bit) != 0) {
-               VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-               return (-1);
-       }
-       *target &= ~bit;
-       VERIFY3S(pthread_mutex_unlock(&atomic_lock), ==, 0);
-
-       return (0);
-}
-
-void
-membar_enter(void)
-{
-       /* XXX - Implement me */
-}
-
-void
-membar_exit(void)
-{
-       /* XXX - Implement me */
-}
-
-void
-membar_producer(void)
-{
-       /* XXX - Implement me */
-}
-
-void
-membar_consumer(void)
-{
-       /* XXX - Implement me */
-}
-
-/* Legacy kernel interfaces; they will go away (eventually). */
-
-uint8_t
-cas8(uint8_t *target, uint8_t arg1, uint8_t arg2)
-{
-       return (atomic_cas_8(target, arg1, arg2));
-}
-
-uint32_t
-cas32(uint32_t *target, uint32_t arg1, uint32_t arg2)
-{
-       return (atomic_cas_32(target, arg1, arg2));
-}
-
-uint64_t
-cas64(uint64_t *target, uint64_t arg1, uint64_t arg2)
-{
-       return (atomic_cas_64(target, arg1, arg2));
-}
-
-ulong_t
-caslong(ulong_t *target, ulong_t arg1, ulong_t arg2)
-{
-       return (atomic_cas_ulong(target, arg1, arg2));
-}
-
-void *
-casptr(void *target, void *arg1, void *arg2)
-{
-       return (atomic_cas_ptr(target, arg1, arg2));
-}
-
-void
-atomic_and_long(ulong_t *target, ulong_t bits)
-{
-       return (atomic_and_ulong(target, bits));
-}
-
-void
-atomic_or_long(ulong_t *target, ulong_t bits)
-{
-       return (atomic_or_ulong(target, bits));
-}
diff --git a/zfs/lib/libspl/asm-i386/Makefile.am b/zfs/lib/libspl/asm-i386/Makefile.am
deleted file mode 100644 (file)
index e112610..0000000
+++ /dev/null
@@ -1 +0,0 @@
-noinst_HEADERS = atomic.S
diff --git a/zfs/lib/libspl/asm-i386/Makefile.in b/zfs/lib/libspl/asm-i386/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/asm-i386/atomic.S b/zfs/lib/libspl/asm-i386/atomic.S
deleted file mode 100644 (file)
index d3d4250..0000000
+++ /dev/null
@@ -1,836 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-       .ident  "%Z%%M% %I%     %E% SMI"
-
-       .file   "%M%"
-
-#define _ASM
-#include <ia32/sys/asm_linkage.h>
-
-       ENTRY(atomic_inc_8)
-       ALTENTRY(atomic_inc_uchar)
-       movl    4(%esp), %eax
-       lock
-       incb    (%eax)
-       ret
-       SET_SIZE(atomic_inc_uchar)
-       SET_SIZE(atomic_inc_8)
-
-       ENTRY(atomic_inc_16)
-       ALTENTRY(atomic_inc_ushort)
-       movl    4(%esp), %eax
-       lock
-       incw    (%eax)
-       ret
-       SET_SIZE(atomic_inc_ushort)
-       SET_SIZE(atomic_inc_16)
-
-       ENTRY(atomic_inc_32)
-       ALTENTRY(atomic_inc_uint)
-       ALTENTRY(atomic_inc_ulong)
-       movl    4(%esp), %eax
-       lock
-       incl    (%eax)
-       ret
-       SET_SIZE(atomic_inc_ulong)
-       SET_SIZE(atomic_inc_uint)
-       SET_SIZE(atomic_inc_32)
-
-       ENTRY(atomic_inc_8_nv)
-       ALTENTRY(atomic_inc_uchar_nv)
-       movl    4(%esp), %edx
-       movb    (%edx), %al
-1:
-       leal    1(%eax), %ecx
-       lock
-       cmpxchgb %cl, (%edx)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_inc_uchar_nv)
-       SET_SIZE(atomic_inc_8_nv)
-
-       ENTRY(atomic_inc_16_nv)
-       ALTENTRY(atomic_inc_ushort_nv)
-       movl    4(%esp), %edx
-       movw    (%edx), %ax
-1:
-       leal    1(%eax), %ecx
-       lock
-       cmpxchgw %cx, (%edx)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_inc_ushort_nv)
-       SET_SIZE(atomic_inc_16_nv)
-
-       ENTRY(atomic_inc_32_nv)
-       ALTENTRY(atomic_inc_uint_nv)
-       ALTENTRY(atomic_inc_ulong_nv)
-       movl    4(%esp), %edx
-       movl    (%edx), %eax
-1:
-       leal    1(%eax), %ecx
-       lock
-       cmpxchgl %ecx, (%edx)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_inc_ulong_nv)
-       SET_SIZE(atomic_inc_uint_nv)
-       SET_SIZE(atomic_inc_32_nv)
-
-       /*
-        * NOTE: If atomic_inc_64 and atomic_inc_64_nv are ever
-        * separated, you need to also edit the libc i386 platform
-        * specific mapfile and remove the NODYNSORT attribute
-        * from atomic_inc_64_nv.
-        */
-       ENTRY(atomic_inc_64)
-       ALTENTRY(atomic_inc_64_nv)
-       pushl   %edi
-       pushl   %ebx
-       movl    12(%esp), %edi
-       movl    (%edi), %eax
-       movl    4(%edi), %edx
-1:
-       xorl    %ebx, %ebx
-       xorl    %ecx, %ecx
-       incl    %ebx
-       addl    %eax, %ebx
-       adcl    %edx, %ecx
-       lock
-       cmpxchg8b (%edi)
-       jne     1b
-       movl    %ebx, %eax
-       movl    %ecx, %edx
-       popl    %ebx
-       popl    %edi
-       ret
-       SET_SIZE(atomic_inc_64_nv)
-       SET_SIZE(atomic_inc_64)
-
-       ENTRY(atomic_dec_8)
-       ALTENTRY(atomic_dec_uchar)
-       movl    4(%esp), %eax
-       lock
-       decb    (%eax)
-       ret
-       SET_SIZE(atomic_dec_uchar)
-       SET_SIZE(atomic_dec_8)
-
-       ENTRY(atomic_dec_16)
-       ALTENTRY(atomic_dec_ushort)
-       movl    4(%esp), %eax
-       lock
-       decw    (%eax)
-       ret
-       SET_SIZE(atomic_dec_ushort)
-       SET_SIZE(atomic_dec_16)
-
-       ENTRY(atomic_dec_32)
-       ALTENTRY(atomic_dec_uint)
-       ALTENTRY(atomic_dec_ulong)
-       movl    4(%esp), %eax
-       lock
-       decl    (%eax)
-       ret
-       SET_SIZE(atomic_dec_ulong)
-       SET_SIZE(atomic_dec_uint)
-       SET_SIZE(atomic_dec_32)
-
-       ENTRY(atomic_dec_8_nv)
-       ALTENTRY(atomic_dec_uchar_nv)
-       movl    4(%esp), %edx
-       movb    (%edx), %al
-1:
-       leal    -1(%eax), %ecx
-       lock
-       cmpxchgb %cl, (%edx)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_dec_uchar_nv)
-       SET_SIZE(atomic_dec_8_nv)
-
-       ENTRY(atomic_dec_16_nv)
-       ALTENTRY(atomic_dec_ushort_nv)
-       movl    4(%esp), %edx
-       movw    (%edx), %ax
-1:
-       leal    -1(%eax), %ecx
-       lock
-       cmpxchgw %cx, (%edx)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_dec_ushort_nv)
-       SET_SIZE(atomic_dec_16_nv)
-
-       ENTRY(atomic_dec_32_nv)
-       ALTENTRY(atomic_dec_uint_nv)
-       ALTENTRY(atomic_dec_ulong_nv)
-       movl    4(%esp), %edx
-       movl    (%edx), %eax
-1:
-       leal    -1(%eax), %ecx
-       lock
-       cmpxchgl %ecx, (%edx)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_dec_ulong_nv)
-       SET_SIZE(atomic_dec_uint_nv)
-       SET_SIZE(atomic_dec_32_nv)
-
-       /*
-        * NOTE: If atomic_dec_64 and atomic_dec_64_nv are ever
-        * separated, it is important to edit the libc i386 platform
-        * specific mapfile and remove the NODYNSORT attribute
-        * from atomic_dec_64_nv.
-        */
-       ENTRY(atomic_dec_64)
-       ALTENTRY(atomic_dec_64_nv)
-       pushl   %edi
-       pushl   %ebx
-       movl    12(%esp), %edi
-       movl    (%edi), %eax
-       movl    4(%edi), %edx
-1:
-       xorl    %ebx, %ebx
-       xorl    %ecx, %ecx
-       not     %ecx
-       not     %ebx
-       addl    %eax, %ebx
-       adcl    %edx, %ecx
-       lock
-       cmpxchg8b (%edi)
-       jne     1b
-       movl    %ebx, %eax
-       movl    %ecx, %edx
-       popl    %ebx
-       popl    %edi
-       ret
-       SET_SIZE(atomic_dec_64_nv)
-       SET_SIZE(atomic_dec_64)
-
-       ENTRY(atomic_add_8)
-       ALTENTRY(atomic_add_char)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       addb    %cl, (%eax)
-       ret
-       SET_SIZE(atomic_add_char)
-       SET_SIZE(atomic_add_8)
-
-       ENTRY(atomic_add_16)
-       ALTENTRY(atomic_add_short)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       addw    %cx, (%eax)
-       ret
-       SET_SIZE(atomic_add_short)
-       SET_SIZE(atomic_add_16)
-
-       ENTRY(atomic_add_32)
-       ALTENTRY(atomic_add_int)
-       ALTENTRY(atomic_add_ptr)
-       ALTENTRY(atomic_add_long)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       addl    %ecx, (%eax)
-       ret
-       SET_SIZE(atomic_add_long)
-       SET_SIZE(atomic_add_ptr)
-       SET_SIZE(atomic_add_int)
-       SET_SIZE(atomic_add_32)
-
-       ENTRY(atomic_sub_8)
-       ALTENTRY(atomic_sub_char)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       subb    %cl, (%eax)
-       ret
-       SET_SIZE(atomic_sub_char)
-       SET_SIZE(atomic_sub_8)
-
-       ENTRY(atomic_sub_16)
-       ALTENTRY(atomic_sub_short)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       subw    %cx, (%eax)
-       ret
-       SET_SIZE(atomic_sub_short)
-       SET_SIZE(atomic_sub_16)
-
-       ENTRY(atomic_sub_32)
-       ALTENTRY(atomic_sub_int)
-       ALTENTRY(atomic_sub_ptr)
-       ALTENTRY(atomic_sub_long)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       subl    %ecx, (%eax)
-       ret
-       SET_SIZE(atomic_sub_long)
-       SET_SIZE(atomic_sub_ptr)
-       SET_SIZE(atomic_sub_int)
-       SET_SIZE(atomic_sub_32)
-
-       ENTRY(atomic_or_8)
-       ALTENTRY(atomic_or_uchar)
-       movl    4(%esp), %eax
-       movb    8(%esp), %cl
-       lock
-       orb     %cl, (%eax)
-       ret
-       SET_SIZE(atomic_or_uchar)
-       SET_SIZE(atomic_or_8)
-
-       ENTRY(atomic_or_16)
-       ALTENTRY(atomic_or_ushort)
-       movl    4(%esp), %eax
-       movw    8(%esp), %cx
-       lock
-       orw     %cx, (%eax)
-       ret
-       SET_SIZE(atomic_or_ushort)
-       SET_SIZE(atomic_or_16)
-
-       ENTRY(atomic_or_32)
-       ALTENTRY(atomic_or_uint)
-       ALTENTRY(atomic_or_ulong)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       orl     %ecx, (%eax)
-       ret
-       SET_SIZE(atomic_or_ulong)
-       SET_SIZE(atomic_or_uint)
-       SET_SIZE(atomic_or_32)
-
-       ENTRY(atomic_and_8)
-       ALTENTRY(atomic_and_uchar)
-       movl    4(%esp), %eax
-       movb    8(%esp), %cl
-       lock
-       andb    %cl, (%eax)
-       ret
-       SET_SIZE(atomic_and_uchar)
-       SET_SIZE(atomic_and_8)
-
-       ENTRY(atomic_and_16)
-       ALTENTRY(atomic_and_ushort)
-       movl    4(%esp), %eax
-       movw    8(%esp), %cx
-       lock
-       andw    %cx, (%eax)
-       ret
-       SET_SIZE(atomic_and_ushort)
-       SET_SIZE(atomic_and_16)
-
-       ENTRY(atomic_and_32)
-       ALTENTRY(atomic_and_uint)
-       ALTENTRY(atomic_and_ulong)
-       movl    4(%esp), %eax
-       movl    8(%esp), %ecx
-       lock
-       andl    %ecx, (%eax)
-       ret
-       SET_SIZE(atomic_and_ulong)
-       SET_SIZE(atomic_and_uint)
-       SET_SIZE(atomic_and_32)
-
-       ENTRY(atomic_add_8_nv)
-       ALTENTRY(atomic_add_char_nv)
-       movl    4(%esp), %edx
-       movb    (%edx), %al
-1:
-       movl    8(%esp), %ecx
-       addb    %al, %cl
-       lock
-       cmpxchgb %cl, (%edx)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_add_char_nv)
-       SET_SIZE(atomic_add_8_nv)
-
-       ENTRY(atomic_add_16_nv)
-       ALTENTRY(atomic_add_short_nv)
-       movl    4(%esp), %edx
-       movw    (%edx), %ax
-1:
-       movl    8(%esp), %ecx
-       addw    %ax, %cx
-       lock
-       cmpxchgw %cx, (%edx)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_add_short_nv)
-       SET_SIZE(atomic_add_16_nv)
-
-       ENTRY(atomic_add_32_nv)
-       ALTENTRY(atomic_add_int_nv)
-       ALTENTRY(atomic_add_ptr_nv)
-       ALTENTRY(atomic_add_long_nv)
-       movl    4(%esp), %edx
-       movl    (%edx), %eax
-1:
-       movl    8(%esp), %ecx
-       addl    %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%edx)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_add_long_nv)
-       SET_SIZE(atomic_add_ptr_nv)
-       SET_SIZE(atomic_add_int_nv)
-       SET_SIZE(atomic_add_32_nv)
-
-       ENTRY(atomic_sub_8_nv)
-       ALTENTRY(atomic_sub_char_nv)
-       movl    4(%esp), %edx
-       movb    (%edx), %al
-1:
-       movl    8(%esp), %ecx
-       subb    %al, %cl
-       lock
-       cmpxchgb %cl, (%edx)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_sub_char_nv)
-       SET_SIZE(atomic_sub_8_nv)
-
-       ENTRY(atomic_sub_16_nv)
-       ALTENTRY(atomic_sub_short_nv)
-       movl    4(%esp), %edx
-       movw    (%edx), %ax
-1:
-       movl    8(%esp), %ecx
-       subw    %ax, %cx
-       lock
-       cmpxchgw %cx, (%edx)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_sub_short_nv)
-       SET_SIZE(atomic_sub_16_nv)
-
-       ENTRY(atomic_sub_32_nv)
-       ALTENTRY(atomic_sub_int_nv)
-       ALTENTRY(atomic_sub_ptr_nv)
-       ALTENTRY(atomic_sub_long_nv)
-       movl    4(%esp), %edx
-       movl    (%edx), %eax
-1:
-       movl    8(%esp), %ecx
-       subl    %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%edx)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_sub_long_nv)
-       SET_SIZE(atomic_sub_ptr_nv)
-       SET_SIZE(atomic_sub_int_nv)
-       SET_SIZE(atomic_sub_32_nv)
-
-       /*
-        * NOTE: If atomic_add_64 and atomic_add_64_nv are ever
-        * separated, it is important to edit the libc i386 platform
-        * specific mapfile and remove the NODYNSORT attribute
-        * from atomic_add_64_nv.
-        */
-       ENTRY(atomic_add_64)
-       ALTENTRY(atomic_add_64_nv)
-       pushl   %edi
-       pushl   %ebx
-       movl    12(%esp), %edi
-       movl    (%edi), %eax
-       movl    4(%edi), %edx
-1:
-       movl    16(%esp), %ebx
-       movl    20(%esp), %ecx
-       addl    %eax, %ebx
-       adcl    %edx, %ecx
-       lock
-       cmpxchg8b (%edi)
-       jne     1b
-       movl    %ebx, %eax
-       movl    %ecx, %edx
-       popl    %ebx
-       popl    %edi
-       ret
-       SET_SIZE(atomic_add_64_nv)
-       SET_SIZE(atomic_add_64)
-
-       ENTRY(atomic_sub_64)
-       ALTENTRY(atomic_sub_64_nv)
-       pushl   %edi
-       pushl   %ebx
-       movl    12(%esp), %edi
-       movl    (%edi), %eax
-       movl    4(%edi), %edx
-1:
-       movl    16(%esp), %ebx
-       movl    20(%esp), %ecx
-       subl    %eax, %ebx
-       adcl    %edx, %ecx
-       lock
-       cmpxchg8b (%edi)
-       jne     1b
-       movl    %ebx, %eax
-       movl    %ecx, %edx
-       popl    %ebx
-       popl    %edi
-       ret
-       SET_SIZE(atomic_sub_64_nv)
-       SET_SIZE(atomic_sub_64)
-
-       ENTRY(atomic_or_8_nv)
-       ALTENTRY(atomic_or_uchar_nv)
-       movl    4(%esp), %edx
-       movb    (%edx), %al
-1:
-       movl    8(%esp), %ecx
-       orb     %al, %cl
-       lock
-       cmpxchgb %cl, (%edx)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_or_uchar_nv)
-       SET_SIZE(atomic_or_8_nv)
-
-       ENTRY(atomic_or_16_nv)
-       ALTENTRY(atomic_or_ushort_nv)
-       movl    4(%esp), %edx
-       movw    (%edx), %ax
-1:
-       movl    8(%esp), %ecx
-       orw     %ax, %cx
-       lock
-       cmpxchgw %cx, (%edx)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_or_ushort_nv)
-       SET_SIZE(atomic_or_16_nv)
-
-       ENTRY(atomic_or_32_nv)
-       ALTENTRY(atomic_or_uint_nv)
-       ALTENTRY(atomic_or_ulong_nv)
-       movl    4(%esp), %edx
-       movl    (%edx), %eax
-1:
-       movl    8(%esp), %ecx
-       orl     %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%edx)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_or_ulong_nv)
-       SET_SIZE(atomic_or_uint_nv)
-       SET_SIZE(atomic_or_32_nv)
-
-       /*
-        * NOTE: If atomic_or_64 and atomic_or_64_nv are ever
-        * separated, it is important to edit the libc i386 platform
-        * specific mapfile and remove the NODYNSORT attribute
-        * from atomic_or_64_nv.
-        */
-       ENTRY(atomic_or_64)
-       ALTENTRY(atomic_or_64_nv)
-       pushl   %edi
-       pushl   %ebx
-       movl    12(%esp), %edi
-       movl    (%edi), %eax
-       movl    4(%edi), %edx
-1:
-       movl    16(%esp), %ebx
-       movl    20(%esp), %ecx
-       orl     %eax, %ebx
-       orl     %edx, %ecx
-       lock
-       cmpxchg8b (%edi)
-       jne     1b
-       movl    %ebx, %eax
-       movl    %ecx, %edx
-       popl    %ebx
-       popl    %edi
-       ret
-       SET_SIZE(atomic_or_64_nv)
-       SET_SIZE(atomic_or_64)
-
-       ENTRY(atomic_and_8_nv)
-       ALTENTRY(atomic_and_uchar_nv)
-       movl    4(%esp), %edx
-       movb    (%edx), %al
-1:
-       movl    8(%esp), %ecx
-       andb    %al, %cl
-       lock
-       cmpxchgb %cl, (%edx)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_and_uchar_nv)
-       SET_SIZE(atomic_and_8_nv)
-
-       ENTRY(atomic_and_16_nv)
-       ALTENTRY(atomic_and_ushort_nv)
-       movl    4(%esp), %edx
-       movw    (%edx), %ax
-1:
-       movl    8(%esp), %ecx
-       andw    %ax, %cx
-       lock
-       cmpxchgw %cx, (%edx)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_and_ushort_nv)
-       SET_SIZE(atomic_and_16_nv)
-
-       ENTRY(atomic_and_32_nv)
-       ALTENTRY(atomic_and_uint_nv)
-       ALTENTRY(atomic_and_ulong_nv)
-       movl    4(%esp), %edx
-       movl    (%edx), %eax
-1:
-       movl    8(%esp), %ecx
-       andl    %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%edx)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_and_ulong_nv)
-       SET_SIZE(atomic_and_uint_nv)
-       SET_SIZE(atomic_and_32_nv)
-
-       /*
-        * NOTE: If atomic_and_64 and atomic_and_64_nv are ever
-        * separated, it is important to edit the libc i386 platform
-        * specific mapfile and remove the NODYNSORT attribute
-        * from atomic_and_64_nv.
-        */
-       ENTRY(atomic_and_64)
-       ALTENTRY(atomic_and_64_nv)
-       pushl   %edi
-       pushl   %ebx
-       movl    12(%esp), %edi
-       movl    (%edi), %eax
-       movl    4(%edi), %edx
-1:
-       movl    16(%esp), %ebx
-       movl    20(%esp), %ecx
-       andl    %eax, %ebx
-       andl    %edx, %ecx
-       lock
-       cmpxchg8b (%edi)
-       jne     1b
-       movl    %ebx, %eax
-       movl    %ecx, %edx
-       popl    %ebx
-       popl    %edi
-       ret
-       SET_SIZE(atomic_and_64_nv)
-       SET_SIZE(atomic_and_64)
-
-       ENTRY(atomic_cas_8)
-       ALTENTRY(atomic_cas_uchar)
-       movl    4(%esp), %edx
-       movzbl  8(%esp), %eax
-       movb    12(%esp), %cl
-       lock
-       cmpxchgb %cl, (%edx)
-       ret
-       SET_SIZE(atomic_cas_uchar)
-       SET_SIZE(atomic_cas_8)
-
-       ENTRY(atomic_cas_16)
-       ALTENTRY(atomic_cas_ushort)
-       movl    4(%esp), %edx
-       movzwl  8(%esp), %eax
-       movw    12(%esp), %cx
-       lock
-       cmpxchgw %cx, (%edx)
-       ret
-       SET_SIZE(atomic_cas_ushort)
-       SET_SIZE(atomic_cas_16)
-
-       ENTRY(atomic_cas_32)
-       ALTENTRY(atomic_cas_uint)
-       ALTENTRY(atomic_cas_ulong)
-       ALTENTRY(atomic_cas_ptr)
-       movl    4(%esp), %edx
-       movl    8(%esp), %eax
-       movl    12(%esp), %ecx
-       lock
-       cmpxchgl %ecx, (%edx)
-       ret
-       SET_SIZE(atomic_cas_ptr)
-       SET_SIZE(atomic_cas_ulong)
-       SET_SIZE(atomic_cas_uint)
-       SET_SIZE(atomic_cas_32)
-
-       ENTRY(atomic_cas_64)
-       pushl   %ebx
-       pushl   %esi
-       movl    12(%esp), %esi
-       movl    16(%esp), %eax
-       movl    20(%esp), %edx
-       movl    24(%esp), %ebx
-       movl    28(%esp), %ecx
-       lock
-       cmpxchg8b (%esi)
-       popl    %esi
-       popl    %ebx
-       ret
-       SET_SIZE(atomic_cas_64)
-
-       ENTRY(atomic_swap_8)
-       ALTENTRY(atomic_swap_uchar)
-       movl    4(%esp), %edx
-       movzbl  8(%esp), %eax
-       lock
-       xchgb   %al, (%edx)
-       ret
-       SET_SIZE(atomic_swap_uchar)
-       SET_SIZE(atomic_swap_8)
-
-       ENTRY(atomic_swap_16)
-       ALTENTRY(atomic_swap_ushort)
-       movl    4(%esp), %edx
-       movzwl  8(%esp), %eax
-       lock
-       xchgw   %ax, (%edx)
-       ret
-       SET_SIZE(atomic_swap_ushort)
-       SET_SIZE(atomic_swap_16)
-
-       ENTRY(atomic_swap_32)
-       ALTENTRY(atomic_swap_uint)
-       ALTENTRY(atomic_swap_ptr)
-       ALTENTRY(atomic_swap_ulong)
-       movl    4(%esp), %edx
-       movl    8(%esp), %eax
-       lock
-       xchgl   %eax, (%edx)
-       ret
-       SET_SIZE(atomic_swap_ulong)
-       SET_SIZE(atomic_swap_ptr)
-       SET_SIZE(atomic_swap_uint)
-       SET_SIZE(atomic_swap_32)
-
-       ENTRY(atomic_swap_64)
-       pushl   %esi
-       pushl   %ebx
-       movl    12(%esp), %esi
-       movl    16(%esp), %ebx
-       movl    20(%esp), %ecx
-       movl    (%esi), %eax
-       movl    4(%esi), %edx
-1:
-       lock
-       cmpxchg8b (%esi)
-       jne     1b
-       popl    %ebx
-       popl    %esi
-       ret
-       SET_SIZE(atomic_swap_64)
-
-       ENTRY(atomic_set_long_excl)
-       movl    4(%esp), %edx
-       movl    8(%esp), %ecx
-       xorl    %eax, %eax
-       lock
-       btsl    %ecx, (%edx)
-       jnc     1f
-       decl    %eax
-1:
-       ret
-       SET_SIZE(atomic_set_long_excl)
-
-       ENTRY(atomic_clear_long_excl)
-       movl    4(%esp), %edx
-       movl    8(%esp), %ecx
-       xorl    %eax, %eax
-       lock
-       btrl    %ecx, (%edx)
-       jc      1f
-       decl    %eax
-1:
-       ret
-       SET_SIZE(atomic_clear_long_excl)
-
-       /*
-        * NOTE: membar_enter, membar_exit, membar_producer, and 
-        * membar_consumer are all identical routines. We define them
-        * separately, instead of using ALTENTRY definitions to alias them
-        * together, so that DTrace and debuggers will see a unique address
-        * for them, allowing more accurate tracing.
-       */
-
-
-       ENTRY(membar_enter)
-       lock
-       xorl    $0, (%esp)
-       ret
-       SET_SIZE(membar_enter)
-
-       ENTRY(membar_exit)
-       lock
-       xorl    $0, (%esp)
-       ret
-       SET_SIZE(membar_exit)
-
-       ENTRY(membar_producer)
-       lock
-       xorl    $0, (%esp)
-       ret
-       SET_SIZE(membar_producer)
-
-       ENTRY(membar_consumer)
-       lock
-       xorl    $0, (%esp)
-       ret
-       SET_SIZE(membar_consumer)
-
-#ifdef __ELF__
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/zfs/lib/libspl/asm-x86_64/Makefile.am b/zfs/lib/libspl/asm-x86_64/Makefile.am
deleted file mode 100644 (file)
index e112610..0000000
+++ /dev/null
@@ -1 +0,0 @@
-noinst_HEADERS = atomic.S
diff --git a/zfs/lib/libspl/asm-x86_64/Makefile.in b/zfs/lib/libspl/asm-x86_64/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/asm-x86_64/atomic.S b/zfs/lib/libspl/asm-x86_64/atomic.S
deleted file mode 100644 (file)
index 49c9b2a..0000000
+++ /dev/null
@@ -1,687 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-       .ident  "%Z%%M% %I%     %E% SMI"
-
-       .file   "%M%"
-
-#define _ASM
-#include <ia32/sys/asm_linkage.h>
-
-       ENTRY(atomic_inc_8)
-       ALTENTRY(atomic_inc_uchar)
-       lock
-       incb    (%rdi)
-       ret
-       SET_SIZE(atomic_inc_uchar)
-       SET_SIZE(atomic_inc_8)
-
-       ENTRY(atomic_inc_16)
-       ALTENTRY(atomic_inc_ushort)
-       lock
-       incw    (%rdi)
-       ret
-       SET_SIZE(atomic_inc_ushort)
-       SET_SIZE(atomic_inc_16)
-
-       ENTRY(atomic_inc_32)
-       ALTENTRY(atomic_inc_uint)
-       lock
-       incl    (%rdi)
-       ret
-       SET_SIZE(atomic_inc_uint)
-       SET_SIZE(atomic_inc_32)
-
-       ENTRY(atomic_inc_64)
-       ALTENTRY(atomic_inc_ulong)
-       lock
-       incq    (%rdi)
-       ret
-       SET_SIZE(atomic_inc_ulong)
-       SET_SIZE(atomic_inc_64)
-
-       ENTRY(atomic_inc_8_nv)
-       ALTENTRY(atomic_inc_uchar_nv)
-       movb    (%rdi), %al
-1:
-       leaq    1(%rax), %rcx
-       lock
-       cmpxchgb %cl, (%rdi)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_inc_uchar_nv)
-       SET_SIZE(atomic_inc_8_nv)
-
-       ENTRY(atomic_inc_16_nv)
-       ALTENTRY(atomic_inc_ushort_nv)
-       movw    (%rdi), %ax
-1:
-       leaq    1(%rax), %rcx
-       lock
-       cmpxchgw %cx, (%rdi)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_inc_ushort_nv)
-       SET_SIZE(atomic_inc_16_nv)
-
-       ENTRY(atomic_inc_32_nv)
-       ALTENTRY(atomic_inc_uint_nv)
-       movl    (%rdi), %eax
-1:
-       leaq    1(%rax), %rcx
-       lock
-       cmpxchgl %ecx, (%rdi)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_inc_uint_nv)
-       SET_SIZE(atomic_inc_32_nv)
-
-       ENTRY(atomic_inc_64_nv)
-       ALTENTRY(atomic_inc_ulong_nv)
-       movq    (%rdi), %rax
-1:
-       leaq    1(%rax), %rcx
-       lock
-       cmpxchgq %rcx, (%rdi)
-       jne     1b
-       movq    %rcx, %rax
-       ret
-       SET_SIZE(atomic_inc_ulong_nv)
-       SET_SIZE(atomic_inc_64_nv)
-
-       ENTRY(atomic_dec_8)
-       ALTENTRY(atomic_dec_uchar)
-       lock
-       decb    (%rdi)
-       ret
-       SET_SIZE(atomic_dec_uchar)
-       SET_SIZE(atomic_dec_8)
-
-       ENTRY(atomic_dec_16)
-       ALTENTRY(atomic_dec_ushort)
-       lock
-       decw    (%rdi)
-       ret
-       SET_SIZE(atomic_dec_ushort)
-       SET_SIZE(atomic_dec_16)
-
-       ENTRY(atomic_dec_32)
-       ALTENTRY(atomic_dec_uint)
-       lock
-       decl    (%rdi)
-       ret
-       SET_SIZE(atomic_dec_uint)
-       SET_SIZE(atomic_dec_32)
-
-       ENTRY(atomic_dec_64)
-       ALTENTRY(atomic_dec_ulong)
-       lock
-       decq    (%rdi)
-       ret
-       SET_SIZE(atomic_dec_ulong)
-       SET_SIZE(atomic_dec_64)
-
-       ENTRY(atomic_dec_8_nv)
-       ALTENTRY(atomic_dec_uchar_nv)
-       movb    (%rdi), %al
-1:
-       leaq    -1(%rax), %rcx
-       lock
-       cmpxchgb %cl, (%rdi)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_dec_uchar_nv)
-       SET_SIZE(atomic_dec_8_nv)
-
-       ENTRY(atomic_dec_16_nv)
-       ALTENTRY(atomic_dec_ushort_nv)
-       movw    (%rdi), %ax
-1:
-       leaq    -1(%rax), %rcx
-       lock
-       cmpxchgw %cx, (%rdi)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_dec_ushort_nv)
-       SET_SIZE(atomic_dec_16_nv)
-
-       ENTRY(atomic_dec_32_nv)
-       ALTENTRY(atomic_dec_uint_nv)
-       movl    (%rdi), %eax
-1:
-       leaq    -1(%rax), %rcx
-       lock
-       cmpxchgl %ecx, (%rdi)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_dec_uint_nv)
-       SET_SIZE(atomic_dec_32_nv)
-
-       ENTRY(atomic_dec_64_nv)
-       ALTENTRY(atomic_dec_ulong_nv)
-       movq    (%rdi), %rax
-1:
-       leaq    -1(%rax), %rcx
-       lock
-       cmpxchgq %rcx, (%rdi)
-       jne     1b
-       movq    %rcx, %rax
-       ret
-       SET_SIZE(atomic_dec_ulong_nv)
-       SET_SIZE(atomic_dec_64_nv)
-
-       ENTRY(atomic_add_8)
-       ALTENTRY(atomic_add_char)
-       lock
-       addb    %sil, (%rdi)
-       ret
-       SET_SIZE(atomic_add_char)
-       SET_SIZE(atomic_add_8)
-
-       ENTRY(atomic_add_16)
-       ALTENTRY(atomic_add_short)
-       lock
-       addw    %si, (%rdi)
-       ret
-       SET_SIZE(atomic_add_short)
-       SET_SIZE(atomic_add_16)
-
-       ENTRY(atomic_add_32)
-       ALTENTRY(atomic_add_int)
-       lock
-       addl    %esi, (%rdi)
-       ret
-       SET_SIZE(atomic_add_int)
-       SET_SIZE(atomic_add_32)
-
-       ENTRY(atomic_add_64)
-       ALTENTRY(atomic_add_ptr)
-       ALTENTRY(atomic_add_long)
-       lock
-       addq    %rsi, (%rdi)
-       ret
-       SET_SIZE(atomic_add_long)
-       SET_SIZE(atomic_add_ptr)
-       SET_SIZE(atomic_add_64)
-
-       ENTRY(atomic_sub_8)
-       ALTENTRY(atomic_sub_char)
-       lock
-       subb    %sil, (%rdi)
-       ret
-       SET_SIZE(atomic_sub_char)
-       SET_SIZE(atomic_sub_8)
-
-       ENTRY(atomic_sub_16)
-       ALTENTRY(atomic_sub_short)
-       lock
-       subw    %si, (%rdi)
-       ret
-       SET_SIZE(atomic_sub_short)
-       SET_SIZE(atomic_sub_16)
-
-       ENTRY(atomic_sub_32)
-       ALTENTRY(atomic_sub_int)
-       lock
-       subl    %esi, (%rdi)
-       ret
-       SET_SIZE(atomic_sub_int)
-       SET_SIZE(atomic_sub_32)
-
-       ENTRY(atomic_sub_64)
-       ALTENTRY(atomic_sub_ptr)
-       ALTENTRY(atomic_sub_long)
-       lock
-       subq    %rsi, (%rdi)
-       ret
-       SET_SIZE(atomic_sub_long)
-       SET_SIZE(atomic_sub_ptr)
-       SET_SIZE(atomic_sub_64)
-
-       ENTRY(atomic_or_8)
-       ALTENTRY(atomic_or_uchar)
-       lock
-       orb     %sil, (%rdi)
-       ret
-       SET_SIZE(atomic_or_uchar)
-       SET_SIZE(atomic_or_8)
-
-       ENTRY(atomic_or_16)
-       ALTENTRY(atomic_or_ushort)
-       lock
-       orw     %si, (%rdi)
-       ret
-       SET_SIZE(atomic_or_ushort)
-       SET_SIZE(atomic_or_16)
-
-       ENTRY(atomic_or_32)
-       ALTENTRY(atomic_or_uint)
-       lock
-       orl     %esi, (%rdi)
-       ret
-       SET_SIZE(atomic_or_uint)
-       SET_SIZE(atomic_or_32)
-
-       ENTRY(atomic_or_64)
-       ALTENTRY(atomic_or_ulong)
-       lock
-       orq     %rsi, (%rdi)
-       ret
-       SET_SIZE(atomic_or_ulong)
-       SET_SIZE(atomic_or_64)
-
-       ENTRY(atomic_and_8)
-       ALTENTRY(atomic_and_uchar)
-       lock
-       andb    %sil, (%rdi)
-       ret
-       SET_SIZE(atomic_and_uchar)
-       SET_SIZE(atomic_and_8)
-
-       ENTRY(atomic_and_16)
-       ALTENTRY(atomic_and_ushort)
-       lock
-       andw    %si, (%rdi)
-       ret
-       SET_SIZE(atomic_and_ushort)
-       SET_SIZE(atomic_and_16)
-
-       ENTRY(atomic_and_32)
-       ALTENTRY(atomic_and_uint)
-       lock
-       andl    %esi, (%rdi)
-       ret
-       SET_SIZE(atomic_and_uint)
-       SET_SIZE(atomic_and_32)
-
-       ENTRY(atomic_and_64)
-       ALTENTRY(atomic_and_ulong)
-       lock
-       andq    %rsi, (%rdi)
-       ret
-       SET_SIZE(atomic_and_ulong)
-       SET_SIZE(atomic_and_64)
-
-       ENTRY(atomic_add_8_nv)
-       ALTENTRY(atomic_add_char_nv)
-       movb    (%rdi), %al
-1:
-       movb    %sil, %cl
-       addb    %al, %cl
-       lock
-       cmpxchgb %cl, (%rdi)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_add_char_nv)
-       SET_SIZE(atomic_add_8_nv)
-
-       ENTRY(atomic_add_16_nv)
-       ALTENTRY(atomic_add_short_nv)
-       movw    (%rdi), %ax
-1:
-       movw    %si, %cx
-       addw    %ax, %cx
-       lock
-       cmpxchgw %cx, (%rdi)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_add_short_nv)
-       SET_SIZE(atomic_add_16_nv)
-
-       ENTRY(atomic_add_32_nv)
-       ALTENTRY(atomic_add_int_nv)
-       movl    (%rdi), %eax
-1:
-       movl    %esi, %ecx
-       addl    %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%rdi)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_add_int_nv)
-       SET_SIZE(atomic_add_32_nv)
-
-       ENTRY(atomic_add_64_nv)
-       ALTENTRY(atomic_add_ptr_nv)
-       ALTENTRY(atomic_add_long_nv)
-       movq    (%rdi), %rax
-1:
-       movq    %rsi, %rcx
-       addq    %rax, %rcx
-       lock
-       cmpxchgq %rcx, (%rdi)
-       jne     1b
-       movq    %rcx, %rax
-       ret
-       SET_SIZE(atomic_add_long_nv)
-       SET_SIZE(atomic_add_ptr_nv)
-       SET_SIZE(atomic_add_64_nv)
-
-       ENTRY(atomic_sub_8_nv)
-       ALTENTRY(atomic_sub_char_nv)
-       movb    (%rdi), %al
-1:
-       movb    %sil, %cl
-       subb    %al, %cl
-       lock
-       cmpxchgb %cl, (%rdi)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_sub_char_nv)
-       SET_SIZE(atomic_sub_8_nv)
-
-       ENTRY(atomic_sub_16_nv)
-       ALTENTRY(atomic_sub_short_nv)
-       movw    (%rdi), %ax
-1:
-       movw    %si, %cx
-       subw    %ax, %cx
-       lock
-       cmpxchgw %cx, (%rdi)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_sub_short_nv)
-       SET_SIZE(atomic_sub_16_nv)
-
-       ENTRY(atomic_sub_32_nv)
-       ALTENTRY(atomic_sub_int_nv)
-       movl    (%rdi), %eax
-1:
-       movl    %esi, %ecx
-       subl    %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%rdi)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_sub_int_nv)
-       SET_SIZE(atomic_sub_32_nv)
-
-       ENTRY(atomic_sub_64_nv)
-       ALTENTRY(atomic_sub_ptr_nv)
-       ALTENTRY(atomic_sub_long_nv)
-       movq    (%rdi), %rax
-1:
-       movq    %rsi, %rcx
-       subq    %rax, %rcx
-       lock
-       cmpxchgq %rcx, (%rdi)
-       jne     1b
-       movq    %rcx, %rax
-       ret
-       SET_SIZE(atomic_sub_long_nv)
-       SET_SIZE(atomic_sub_ptr_nv)
-       SET_SIZE(atomic_sub_64_nv)
-
-       ENTRY(atomic_and_8_nv)
-       ALTENTRY(atomic_and_uchar_nv)
-       movb    (%rdi), %al
-1:
-       movb    %sil, %cl
-       andb    %al, %cl
-       lock
-       cmpxchgb %cl, (%rdi)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_and_uchar_nv)
-       SET_SIZE(atomic_and_8_nv)
-
-       ENTRY(atomic_and_16_nv)
-       ALTENTRY(atomic_and_ushort_nv)
-       movw    (%rdi), %ax
-1:
-       movw    %si, %cx
-       andw    %ax, %cx
-       lock
-       cmpxchgw %cx, (%rdi)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_and_ushort_nv)
-       SET_SIZE(atomic_and_16_nv)
-
-       ENTRY(atomic_and_32_nv)
-       ALTENTRY(atomic_and_uint_nv)
-       movl    (%rdi), %eax
-1:
-       movl    %esi, %ecx
-       andl    %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%rdi)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_and_uint_nv)
-       SET_SIZE(atomic_and_32_nv)
-
-       ENTRY(atomic_and_64_nv)
-       ALTENTRY(atomic_and_ulong_nv)
-       movq    (%rdi), %rax
-1:
-       movq    %rsi, %rcx
-       andq    %rax, %rcx
-       lock
-       cmpxchgq %rcx, (%rdi)
-       jne     1b
-       movq    %rcx, %rax
-       ret
-       SET_SIZE(atomic_and_ulong_nv)
-       SET_SIZE(atomic_and_64_nv)
-
-       ENTRY(atomic_or_8_nv)
-       ALTENTRY(atomic_or_uchar_nv)
-       movb    (%rdi), %al
-1:
-       movb    %sil, %cl
-       orb     %al, %cl
-       lock
-       cmpxchgb %cl, (%rdi)
-       jne     1b
-       movzbl  %cl, %eax
-       ret
-       SET_SIZE(atomic_and_uchar_nv)
-       SET_SIZE(atomic_and_8_nv)
-
-       ENTRY(atomic_or_16_nv)
-       ALTENTRY(atomic_or_ushort_nv)
-       movw    (%rdi), %ax
-1:
-       movw    %si, %cx
-       orw     %ax, %cx
-       lock
-       cmpxchgw %cx, (%rdi)
-       jne     1b
-       movzwl  %cx, %eax
-       ret
-       SET_SIZE(atomic_or_ushort_nv)
-       SET_SIZE(atomic_or_16_nv)
-
-       ENTRY(atomic_or_32_nv)
-       ALTENTRY(atomic_or_uint_nv)
-       movl    (%rdi), %eax
-1:
-       movl    %esi, %ecx
-       orl     %eax, %ecx
-       lock
-       cmpxchgl %ecx, (%rdi)
-       jne     1b
-       movl    %ecx, %eax
-       ret
-       SET_SIZE(atomic_or_uint_nv)
-       SET_SIZE(atomic_or_32_nv)
-
-       ENTRY(atomic_or_64_nv)
-       ALTENTRY(atomic_or_ulong_nv)
-       movq    (%rdi), %rax
-1:
-       movq    %rsi, %rcx
-       orq     %rax, %rcx
-       lock
-       cmpxchgq %rcx, (%rdi)
-       jne     1b
-       movq    %rcx, %rax
-       ret
-       SET_SIZE(atomic_or_ulong_nv)
-       SET_SIZE(atomic_or_64_nv)
-
-       ENTRY(atomic_cas_8)
-       ALTENTRY(atomic_cas_uchar)
-       movzbl  %sil, %eax
-       lock
-       cmpxchgb %dl, (%rdi)
-       ret
-       SET_SIZE(atomic_cas_uchar)
-       SET_SIZE(atomic_cas_8)
-
-       ENTRY(atomic_cas_16)
-       ALTENTRY(atomic_cas_ushort)
-       movzwl  %si, %eax
-       lock
-       cmpxchgw %dx, (%rdi)
-       ret
-       SET_SIZE(atomic_cas_ushort)
-       SET_SIZE(atomic_cas_16)
-
-       ENTRY(atomic_cas_32)
-       ALTENTRY(atomic_cas_uint)
-       movl    %esi, %eax
-       lock
-       cmpxchgl %edx, (%rdi)
-       ret
-       SET_SIZE(atomic_cas_uint)
-       SET_SIZE(atomic_cas_32)
-
-       ENTRY(atomic_cas_64)
-       ALTENTRY(atomic_cas_ulong)
-       ALTENTRY(atomic_cas_ptr)
-       movq    %rsi, %rax
-       lock
-       cmpxchgq %rdx, (%rdi)
-       ret
-       SET_SIZE(atomic_cas_ptr)
-       SET_SIZE(atomic_cas_ulong)
-       SET_SIZE(atomic_cas_64)
-
-       ENTRY(atomic_swap_8)
-       ALTENTRY(atomic_swap_uchar)
-       movzbl  %sil, %eax
-       lock
-       xchgb %al, (%rdi)
-       ret
-       SET_SIZE(atomic_swap_uchar)
-       SET_SIZE(atomic_swap_8)
-
-       ENTRY(atomic_swap_16)
-       ALTENTRY(atomic_swap_ushort)
-       movzwl  %si, %eax
-       lock
-       xchgw %ax, (%rdi)
-       ret
-       SET_SIZE(atomic_swap_ushort)
-       SET_SIZE(atomic_swap_16)
-
-       ENTRY(atomic_swap_32)
-       ALTENTRY(atomic_swap_uint)
-       movl    %esi, %eax
-       lock
-       xchgl %eax, (%rdi)
-       ret
-       SET_SIZE(atomic_swap_uint)
-       SET_SIZE(atomic_swap_32)
-
-       ENTRY(atomic_swap_64)
-       ALTENTRY(atomic_swap_ulong)
-       ALTENTRY(atomic_swap_ptr)
-       movq    %rsi, %rax
-       lock
-       xchgq %rax, (%rdi)
-       ret
-       SET_SIZE(atomic_swap_ptr)
-       SET_SIZE(atomic_swap_ulong)
-       SET_SIZE(atomic_swap_64)
-
-       ENTRY(atomic_set_long_excl)
-       xorl    %eax, %eax
-       lock
-       btsq    %rsi, (%rdi)
-       jnc     1f
-       decl    %eax
-1:
-       ret
-       SET_SIZE(atomic_set_long_excl)
-
-       ENTRY(atomic_clear_long_excl)
-       xorl    %eax, %eax
-       lock
-       btrq    %rsi, (%rdi)
-       jc      1f
-       decl    %eax
-1:
-       ret
-       SET_SIZE(atomic_clear_long_excl)
-
-       /*
-        * NOTE: membar_enter, and membar_exit are identical routines. 
-        * We define them separately, instead of using an ALTENTRY
-        * definitions to alias them together, so that DTrace and
-        * debuggers will see a unique address for them, allowing 
-        * more accurate tracing.
-       */
-
-       ENTRY(membar_enter)
-       mfence
-       ret
-       SET_SIZE(membar_enter)
-
-       ENTRY(membar_exit)
-       mfence
-       ret
-       SET_SIZE(membar_exit)
-
-       ENTRY(membar_producer)
-       sfence
-       ret
-       SET_SIZE(membar_producer)
-
-       ENTRY(membar_consumer)
-       lfence
-       ret
-       SET_SIZE(membar_consumer)
-
-#ifdef __ELF__
-.section .note.GNU-stack,"",%progbits
-#endif
diff --git a/zfs/lib/libspl/getexecname.c b/zfs/lib/libspl/getexecname.c
deleted file mode 100644 (file)
index 478351c..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-#include <string.h>
-#include <unistd.h>
-#include <pthread.h>
-#include <limits.h>
-
-const char *
-getexecname(void)
-{
-       static char execname[PATH_MAX + 1] = "";
-       static pthread_mutex_t mtx = PTHREAD_MUTEX_INITIALIZER;
-       char *ptr = NULL;
-       ssize_t rc;
-
-       pthread_mutex_lock(&mtx);
-
-       if (strlen(execname) == 0) {
-               rc = readlink("/proc/self/exe",
-                   execname, sizeof (execname) - 1);
-               if (rc == -1) {
-                       execname[0] = '\0';
-               } else {
-                       execname[rc] = '\0';
-                       ptr = execname;
-               }
-       } else {
-               ptr = execname;
-       }
-
-       pthread_mutex_unlock(&mtx);
-       return (ptr);
-}
diff --git a/zfs/lib/libspl/gethrestime.c b/zfs/lib/libspl/gethrestime.c
deleted file mode 100644 (file)
index d37cc2d..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <time.h>
-#include <sys/time.h>
-
-void
-gethrestime(timestruc_t *ts)
-{
-       struct timeval tv;
-
-       gettimeofday(&tv, NULL);
-       ts->tv_sec = tv.tv_sec;
-       ts->tv_nsec = tv.tv_usec * NSEC_PER_USEC;
-}
diff --git a/zfs/lib/libspl/gethrtime.c b/zfs/lib/libspl/gethrtime.c
deleted file mode 100644 (file)
index 95ceb18..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <time.h>
-#include <sys/time.h>
-#include <stdlib.h>
-#include <stdio.h>
-
-hrtime_t
-gethrtime(void)
-{
-       struct timespec ts;
-       int rc;
-
-       rc = clock_gettime(CLOCK_MONOTONIC, &ts);
-       if (rc) {
-               fprintf(stderr, "Error: clock_gettime() = %d\n", rc);
-               abort();
-       }
-
-       return ((((u_int64_t)ts.tv_sec) * NANOSEC) + ts.tv_nsec);
-}
diff --git a/zfs/lib/libspl/getmntany.c b/zfs/lib/libspl/getmntany.c
deleted file mode 100644 (file)
index d78357a..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Copyright 2006 Ricardo Correia.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1988 AT&T */
-/*       All Rights Reserved   */
-
-#include <stdio.h>
-#include <string.h>
-#include <mntent.h>
-#include <sys/mnttab.h>
-
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
-
-#define        BUFSIZE (MNT_LINE_MAX + 2)
-
-__thread char buf[BUFSIZE];
-
-#define        DIFF(xx)        ( \
-           (mrefp->xx != NULL) && \
-           (mgetp->xx == NULL || strcmp(mrefp->xx, mgetp->xx) != 0))
-
-int
-getmntany(FILE *fp, struct mnttab *mgetp, struct mnttab *mrefp)
-{
-       int ret;
-
-       while (
-           ((ret = _sol_getmntent(fp, mgetp)) == 0) && (
-           DIFF(mnt_special) || DIFF(mnt_mountp) ||
-           DIFF(mnt_fstype) || DIFF(mnt_mntopts)));
-
-       return (ret);
-}
-
-int
-_sol_getmntent(FILE *fp, struct mnttab *mgetp)
-{
-       struct mntent mntbuf;
-       struct mntent *ret;
-
-       ret = getmntent_r(fp, &mntbuf, buf, BUFSIZE);
-
-       if (ret != NULL) {
-               mgetp->mnt_special = mntbuf.mnt_fsname;
-               mgetp->mnt_mountp = mntbuf.mnt_dir;
-               mgetp->mnt_fstype = mntbuf.mnt_type;
-               mgetp->mnt_mntopts = mntbuf.mnt_opts;
-               return (0);
-       }
-
-       if (feof(fp))
-               return (-1);
-
-       return (MNT_TOOLONG);
-}
-
-int
-getextmntent(FILE *fp, struct extmnttab *mp, int len)
-{
-       int ret;
-       struct stat64 st;
-
-       ret = _sol_getmntent(fp, (struct mnttab *) mp);
-       if (ret == 0) {
-               if (stat64(mp->mnt_mountp, &st) != 0) {
-                       mp->mnt_major = 0;
-                       mp->mnt_minor = 0;
-                       return (ret);
-               }
-               mp->mnt_major = major(st.st_dev);
-               mp->mnt_minor = minor(st.st_dev);
-       }
-
-       return (ret);
-}
diff --git a/zfs/lib/libspl/include/Makefile.am b/zfs/lib/libspl/include/Makefile.am
deleted file mode 100644 (file)
index 626a8f4..0000000
+++ /dev/null
@@ -1,28 +0,0 @@
-SUBDIRS = ia32 rpc sys util
-
-libspldir = $(includedir)/libspl
-libspl_HEADERS = \
-       $(top_srcdir)/lib/libspl/include/assert.h \
-       $(top_srcdir)/lib/libspl/include/atomic.h \
-       $(top_srcdir)/lib/libspl/include/attr.h \
-       $(top_srcdir)/lib/libspl/include/devid.h \
-       $(top_srcdir)/lib/libspl/include/libdevinfo.h \
-       $(top_srcdir)/lib/libspl/include/libgen.h \
-       $(top_srcdir)/lib/libspl/include/libshare.h \
-       $(top_srcdir)/lib/libspl/include/limits.h \
-       $(top_srcdir)/lib/libspl/include/locale.h \
-       $(top_srcdir)/lib/libspl/include/note.h \
-       $(top_srcdir)/lib/libspl/include/priv.h \
-       $(top_srcdir)/lib/libspl/include/statcommon.h \
-       $(top_srcdir)/lib/libspl/include/stdio.h \
-       $(top_srcdir)/lib/libspl/include/stdlib.h \
-       $(top_srcdir)/lib/libspl/include/string.h \
-       $(top_srcdir)/lib/libspl/include/strings.h \
-       $(top_srcdir)/lib/libspl/include/stropts.h \
-       $(top_srcdir)/lib/libspl/include/synch.h \
-       $(top_srcdir)/lib/libspl/include/thread.h \
-       $(top_srcdir)/lib/libspl/include/tzfile.h \
-       $(top_srcdir)/lib/libspl/include/ucred.h \
-       $(top_srcdir)/lib/libspl/include/umem.h \
-       $(top_srcdir)/lib/libspl/include/unistd.h \
-       $(top_srcdir)/lib/libspl/include/zone.h
diff --git a/zfs/lib/libspl/include/Makefile.in b/zfs/lib/libspl/include/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/assert.h b/zfs/lib/libspl/include/assert.h
deleted file mode 100644 (file)
index 52924e8..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include_next <assert.h>
-
-#ifndef _LIBSPL_ASSERT_H
-#define        _LIBSPL_ASSERT_H
-
-#include <stdio.h>
-#include <stdlib.h>
-
-#ifndef __assert_c99
-static inline void
-__assert_c99(const char *expr, const char *file, int line, const char *func)
-{
-       fprintf(stderr, "%s:%i: %s: Assertion `%s` failed.\n",
-               file, line, func, expr);
-       abort();
-}
-#endif  /* __assert_c99 */
-
-#ifndef verify
-#if defined(__STDC__)
-#if __STDC_VERSION__ - 0 >= 199901L
-#define        verify(EX) (void)((EX) || \
-       (__assert_c99(#EX, __FILE__, __LINE__, __func__), 0))
-#else
-#define        verify(EX) (void)((EX) || (__assert(#EX, __FILE__, __LINE__), 0))
-#endif  /* __STDC_VERSION__ - 0 >= 199901L */
-#else
-#define        verify(EX) (void)((EX) || (_assert("EX", __FILE__, __LINE__), 0))
-#endif /* __STDC__ */
-#endif  /* verify */
-
-#undef VERIFY
-#undef ASSERT
-
-#define        VERIFY  verify
-#define        ASSERT  assert
-
-extern void __assert(const char *, const char *, int);
-
-static inline int
-assfail(const char *buf, const char *file, int line)
-{
-       __assert(buf, file, line);
-       return (0);
-}
-
-/* BEGIN CSTYLED */
-#define        VERIFY3_IMPL(LEFT, OP, RIGHT, TYPE) do { \
-       const TYPE __left = (TYPE)(LEFT); \
-       const TYPE __right = (TYPE)(RIGHT); \
-       if (!(__left OP __right)) { \
-               char *__buf = alloca(256); \
-               (void) snprintf(__buf, 256, "%s %s %s (0x%llx %s 0x%llx)", \
-                       #LEFT, #OP, #RIGHT, \
-                       (u_longlong_t)__left, #OP, (u_longlong_t)__right); \
-               assfail(__buf, __FILE__, __LINE__); \
-       } \
-} while (0)
-/* END CSTYLED */
-
-#define        VERIFY3S(x, y, z)       VERIFY3_IMPL(x, y, z, int64_t)
-#define        VERIFY3U(x, y, z)       VERIFY3_IMPL(x, y, z, uint64_t)
-#define        VERIFY3P(x, y, z)       VERIFY3_IMPL(x, y, z, uintptr_t)
-#define        VERIFY0(x)              VERIFY3_IMPL(x, ==, 0, uint64_t)
-
-#ifdef NDEBUG
-#define        ASSERT3S(x, y, z)       ((void)0)
-#define        ASSERT3U(x, y, z)       ((void)0)
-#define        ASSERT3P(x, y, z)       ((void)0)
-#define        ASSERT0(x)              ((void)0)
-#define        ASSERTV(x)
-#define        IMPLY(A, B)             ((void)0)
-#define        EQUIV(A, B)             ((void)0)
-#else
-#define        ASSERT3S(x, y, z)       VERIFY3S(x, y, z)
-#define        ASSERT3U(x, y, z)       VERIFY3U(x, y, z)
-#define        ASSERT3P(x, y, z)       VERIFY3P(x, y, z)
-#define        ASSERT0(x)              VERIFY0(x)
-#define        ASSERTV(x)              x
-#define        IMPLY(A, B) \
-       ((void)(((!(A)) || (B)) || \
-           assfail("(" #A ") implies (" #B ")", __FILE__, __LINE__)))
-#define        EQUIV(A, B) \
-       ((void)((!!(A) == !!(B)) || \
-           assfail("(" #A ") is equivalent to (" #B ")", __FILE__, __LINE__)))
-
-#endif  /* NDEBUG */
-
-#endif  /* _LIBSPL_ASSERT_H */
diff --git a/zfs/lib/libspl/include/atomic.h b/zfs/lib/libspl/include/atomic.h
deleted file mode 100644 (file)
index 9b0775b..0000000
+++ /dev/null
@@ -1,296 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef        _SYS_ATOMIC_H
-#define        _SYS_ATOMIC_H
-
-#include <sys/types.h>
-#include <sys/inttypes.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined(__STDC__)
-/*
- * Increment target.
- */
-extern void atomic_inc_8(volatile uint8_t *);
-extern void atomic_inc_uchar(volatile uchar_t *);
-extern void atomic_inc_16(volatile uint16_t *);
-extern void atomic_inc_ushort(volatile ushort_t *);
-extern void atomic_inc_32(volatile uint32_t *);
-extern void atomic_inc_uint(volatile uint_t *);
-extern void atomic_inc_ulong(volatile ulong_t *);
-#if defined(_INT64_TYPE)
-extern void atomic_inc_64(volatile uint64_t *);
-#endif
-
-/*
- * Decrement target
- */
-extern void atomic_dec_8(volatile uint8_t *);
-extern void atomic_dec_uchar(volatile uchar_t *);
-extern void atomic_dec_16(volatile uint16_t *);
-extern void atomic_dec_ushort(volatile ushort_t *);
-extern void atomic_dec_32(volatile uint32_t *);
-extern void atomic_dec_uint(volatile uint_t *);
-extern void atomic_dec_ulong(volatile ulong_t *);
-#if defined(_INT64_TYPE)
-extern void atomic_dec_64(volatile uint64_t *);
-#endif
-
-/*
- * Add delta to target
- */
-extern void atomic_add_8(volatile uint8_t *, int8_t);
-extern void atomic_add_char(volatile uchar_t *, signed char);
-extern void atomic_add_16(volatile uint16_t *, int16_t);
-extern void atomic_add_short(volatile ushort_t *, short);
-extern void atomic_add_32(volatile uint32_t *, int32_t);
-extern void atomic_add_int(volatile uint_t *, int);
-extern void atomic_add_ptr(volatile void *, ssize_t);
-extern void atomic_add_long(volatile ulong_t *, long);
-#if defined(_INT64_TYPE)
-extern void atomic_add_64(volatile uint64_t *, int64_t);
-#endif
-
-/*
- * Substract delta from target
- */
-extern void atomic_sub_8(volatile uint8_t *, int8_t);
-extern void atomic_sub_char(volatile uchar_t *, signed char);
-extern void atomic_sub_16(volatile uint16_t *, int16_t);
-extern void atomic_sub_short(volatile ushort_t *, short);
-extern void atomic_sub_32(volatile uint32_t *, int32_t);
-extern void atomic_sub_int(volatile uint_t *, int);
-extern void atomic_sub_ptr(volatile void *, ssize_t);
-extern void atomic_sub_long(volatile ulong_t *, long);
-#if defined(_INT64_TYPE)
-extern void atomic_sub_64(volatile uint64_t *, int64_t);
-#endif
-
-/*
- * logical OR bits with target
- */
-extern void atomic_or_8(volatile uint8_t *, uint8_t);
-extern void atomic_or_uchar(volatile uchar_t *, uchar_t);
-extern void atomic_or_16(volatile uint16_t *, uint16_t);
-extern void atomic_or_ushort(volatile ushort_t *, ushort_t);
-extern void atomic_or_32(volatile uint32_t *, uint32_t);
-extern void atomic_or_uint(volatile uint_t *, uint_t);
-extern void atomic_or_ulong(volatile ulong_t *, ulong_t);
-#if defined(_INT64_TYPE)
-extern void atomic_or_64(volatile uint64_t *, uint64_t);
-#endif
-
-/*
- * logical AND bits with target
- */
-extern void atomic_and_8(volatile uint8_t *, uint8_t);
-extern void atomic_and_uchar(volatile uchar_t *, uchar_t);
-extern void atomic_and_16(volatile uint16_t *, uint16_t);
-extern void atomic_and_ushort(volatile ushort_t *, ushort_t);
-extern void atomic_and_32(volatile uint32_t *, uint32_t);
-extern void atomic_and_uint(volatile uint_t *, uint_t);
-extern void atomic_and_ulong(volatile ulong_t *, ulong_t);
-#if defined(_INT64_TYPE)
-extern void atomic_and_64(volatile uint64_t *, uint64_t);
-#endif
-
-/*
- * As above, but return the new value.  Note that these _nv() variants are
- * substantially more expensive on some platforms than the no-return-value
- * versions above, so don't use them unless you really need to know the
- * new value *atomically* (e.g. when decrementing a reference count and
- * checking whether it went to zero).
- */
-
-/*
- * Increment target and return new value.
- */
-extern uint8_t atomic_inc_8_nv(volatile uint8_t *);
-extern uchar_t atomic_inc_uchar_nv(volatile uchar_t *);
-extern uint16_t atomic_inc_16_nv(volatile uint16_t *);
-extern ushort_t atomic_inc_ushort_nv(volatile ushort_t *);
-extern uint32_t atomic_inc_32_nv(volatile uint32_t *);
-extern uint_t atomic_inc_uint_nv(volatile uint_t *);
-extern ulong_t atomic_inc_ulong_nv(volatile ulong_t *);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_inc_64_nv(volatile uint64_t *);
-#endif
-
-/*
- * Decrement target and return new value.
- */
-extern uint8_t atomic_dec_8_nv(volatile uint8_t *);
-extern uchar_t atomic_dec_uchar_nv(volatile uchar_t *);
-extern uint16_t atomic_dec_16_nv(volatile uint16_t *);
-extern ushort_t atomic_dec_ushort_nv(volatile ushort_t *);
-extern uint32_t atomic_dec_32_nv(volatile uint32_t *);
-extern uint_t atomic_dec_uint_nv(volatile uint_t *);
-extern ulong_t atomic_dec_ulong_nv(volatile ulong_t *);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_dec_64_nv(volatile uint64_t *);
-#endif
-
-/*
- * Add delta to target
- */
-extern uint8_t atomic_add_8_nv(volatile uint8_t *, int8_t);
-extern uchar_t atomic_add_char_nv(volatile uchar_t *, signed char);
-extern uint16_t atomic_add_16_nv(volatile uint16_t *, int16_t);
-extern ushort_t atomic_add_short_nv(volatile ushort_t *, short);
-extern uint32_t atomic_add_32_nv(volatile uint32_t *, int32_t);
-extern uint_t atomic_add_int_nv(volatile uint_t *, int);
-extern void *atomic_add_ptr_nv(volatile void *, ssize_t);
-extern ulong_t atomic_add_long_nv(volatile ulong_t *, long);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_add_64_nv(volatile uint64_t *, int64_t);
-#endif
-
-/*
- * Substract delta from target
- */
-extern uint8_t atomic_sub_8_nv(volatile uint8_t *, int8_t);
-extern uchar_t atomic_sub_char_nv(volatile uchar_t *, signed char);
-extern uint16_t atomic_sub_16_nv(volatile uint16_t *, int16_t);
-extern ushort_t atomic_sub_short_nv(volatile ushort_t *, short);
-extern uint32_t atomic_sub_32_nv(volatile uint32_t *, int32_t);
-extern uint_t atomic_sub_int_nv(volatile uint_t *, int);
-extern void *atomic_sub_ptr_nv(volatile void *, ssize_t);
-extern ulong_t atomic_sub_long_nv(volatile ulong_t *, long);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_sub_64_nv(volatile uint64_t *, int64_t);
-#endif
-
-/*
- * logical OR bits with target and return new value.
- */
-extern uint8_t atomic_or_8_nv(volatile uint8_t *, uint8_t);
-extern uchar_t atomic_or_uchar_nv(volatile uchar_t *, uchar_t);
-extern uint16_t atomic_or_16_nv(volatile uint16_t *, uint16_t);
-extern ushort_t atomic_or_ushort_nv(volatile ushort_t *, ushort_t);
-extern uint32_t atomic_or_32_nv(volatile uint32_t *, uint32_t);
-extern uint_t atomic_or_uint_nv(volatile uint_t *, uint_t);
-extern ulong_t atomic_or_ulong_nv(volatile ulong_t *, ulong_t);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_or_64_nv(volatile uint64_t *, uint64_t);
-#endif
-
-/*
- * logical AND bits with target and return new value.
- */
-extern uint8_t atomic_and_8_nv(volatile uint8_t *, uint8_t);
-extern uchar_t atomic_and_uchar_nv(volatile uchar_t *, uchar_t);
-extern uint16_t atomic_and_16_nv(volatile uint16_t *, uint16_t);
-extern ushort_t atomic_and_ushort_nv(volatile ushort_t *, ushort_t);
-extern uint32_t atomic_and_32_nv(volatile uint32_t *, uint32_t);
-extern uint_t atomic_and_uint_nv(volatile uint_t *, uint_t);
-extern ulong_t atomic_and_ulong_nv(volatile ulong_t *, ulong_t);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_and_64_nv(volatile uint64_t *, uint64_t);
-#endif
-
-/*
- * If *arg1 == arg2, set *arg1 = arg3; return old value
- */
-extern uint8_t atomic_cas_8(volatile uint8_t *, uint8_t, uint8_t);
-extern uchar_t atomic_cas_uchar(volatile uchar_t *, uchar_t, uchar_t);
-extern uint16_t atomic_cas_16(volatile uint16_t *, uint16_t, uint16_t);
-extern ushort_t atomic_cas_ushort(volatile ushort_t *, ushort_t, ushort_t);
-extern uint32_t atomic_cas_32(volatile uint32_t *, uint32_t, uint32_t);
-extern uint_t atomic_cas_uint(volatile uint_t *, uint_t, uint_t);
-extern void *atomic_cas_ptr(volatile void *, void *, void *);
-extern ulong_t atomic_cas_ulong(volatile ulong_t *, ulong_t, ulong_t);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_cas_64(volatile uint64_t *, uint64_t, uint64_t);
-#endif
-
-/*
- * Swap target and return old value
- */
-extern uint8_t atomic_swap_8(volatile uint8_t *, uint8_t);
-extern uchar_t atomic_swap_uchar(volatile uchar_t *, uchar_t);
-extern uint16_t atomic_swap_16(volatile uint16_t *, uint16_t);
-extern ushort_t atomic_swap_ushort(volatile ushort_t *, ushort_t);
-extern uint32_t atomic_swap_32(volatile uint32_t *, uint32_t);
-extern uint_t atomic_swap_uint(volatile uint_t *, uint_t);
-extern void *atomic_swap_ptr(volatile void *, void *);
-extern ulong_t atomic_swap_ulong(volatile ulong_t *, ulong_t);
-#if defined(_INT64_TYPE)
-extern uint64_t atomic_swap_64(volatile uint64_t *, uint64_t);
-#endif
-
-/*
- * Perform an exclusive atomic bit set/clear on a target.
- * Returns 0 if bit was sucessfully set/cleared, or -1
- * if the bit was already set/cleared.
- */
-extern int atomic_set_long_excl(volatile ulong_t *, uint_t);
-extern int atomic_clear_long_excl(volatile ulong_t *, uint_t);
-
-/*
- * Generic memory barrier used during lock entry, placed after the
- * memory operation that acquires the lock to guarantee that the lock
- * protects its data.  No stores from after the memory barrier will
- * reach visibility, and no loads from after the barrier will be
- * resolved, before the lock acquisition reaches global visibility.
- */
-extern void membar_enter(void);
-
-/*
- * Generic memory barrier used during lock exit, placed before the
- * memory operation that releases the lock to guarantee that the lock
- * protects its data.  All loads and stores issued before the barrier
- * will be resolved before the subsequent lock update reaches visibility.
- */
-extern void membar_exit(void);
-
-/*
- * Arrange that all stores issued before this point in the code reach
- * global visibility before any stores that follow; useful in producer
- * modules that update a data item, then set a flag that it is available.
- * The memory barrier guarantees that the available flag is not visible
- * earlier than the updated data, i.e. it imposes store ordering.
- */
-extern void membar_producer(void);
-
-/*
- * Arrange that all loads issued before this point in the code are
- * completed before any subsequent loads; useful in consumer modules
- * that check to see if data is available and read the data.
- * The memory barrier guarantees that the data is not sampled until
- * after the available flag has been seen, i.e. it imposes load ordering.
- */
-extern void membar_consumer(void);
-#endif  /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_ATOMIC_H */
diff --git a/zfs/lib/libspl/include/attr.h b/zfs/lib/libspl/include/attr.h
deleted file mode 100644 (file)
index da1671a..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-#ifndef _LIBSPL_ATTR_H
-#define        _LIBSPL_ATTR_H
-
-#endif /* _LIBSPL_ATTR_H */
diff --git a/zfs/lib/libspl/include/devid.h b/zfs/lib/libspl/include/devid.h
deleted file mode 100644 (file)
index 5406c33..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_DEVID_H
-#define        _LIBSPL_DEVID_H
-
-#include <stdlib.h>
-
-typedef int ddi_devid_t;
-
-typedef struct devid_nmlist {
-       char *devname;
-       dev_t dev;
-} devid_nmlist_t;
-
-static inline
-int
-devid_str_decode(
-    char *devidstr,
-    ddi_devid_t *retdevid,
-    char **retminor_name)
-{
-       abort();
-}
-
-static inline
-int
-devid_deviceid_to_nmlist(
-    char *search_path,
-    ddi_devid_t devid,
-    char *minor_name,
-    devid_nmlist_t **retlist)
-{
-       abort();
-}
-
-static inline
-void
-devid_str_free(char *str)
-{
-       abort();
-}
-
-static inline
-void
-devid_free(ddi_devid_t devid)
-{
-       abort();
-}
-
-static inline
-void
-devid_free_nmlist(devid_nmlist_t *list)
-{
-       abort();
-}
-
-static inline
-int
-devid_get(
-    int fd,
-    ddi_devid_t *retdevid)
-{
-       return (-1);
-}
-
-static inline
-int
-devid_get_minor_name(
-    int fd,
-    char **retminor_name)
-{
-       abort();
-}
-
-static inline
-char *
-devid_str_encode(
-    ddi_devid_t devid,
-    char *minor_name)
-{
-       abort();
-}
-
-#endif
diff --git a/zfs/lib/libspl/include/ia32/Makefile.am b/zfs/lib/libspl/include/ia32/Makefile.am
deleted file mode 100644 (file)
index 081839c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = sys
diff --git a/zfs/lib/libspl/include/ia32/Makefile.in b/zfs/lib/libspl/include/ia32/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/ia32/sys/Makefile.am b/zfs/lib/libspl/include/ia32/sys/Makefile.am
deleted file mode 100644 (file)
index c8136ee..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-libspldir = $(includedir)/libspl/ia32/sys
-libspl_HEADERS = \
-        $(top_srcdir)/lib/libspl/include/ia32/sys/asm_linkage.h
diff --git a/zfs/lib/libspl/include/ia32/sys/Makefile.in b/zfs/lib/libspl/include/ia32/sys/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/ia32/sys/asm_linkage.h b/zfs/lib/libspl/include/ia32/sys/asm_linkage.h
deleted file mode 100644 (file)
index 61c4d1a..0000000
+++ /dev/null
@@ -1,302 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _IA32_SYS_ASM_LINKAGE_H
-#define        _IA32_SYS_ASM_LINKAGE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifdef _ASM    /* The remainder of this file is only for assembly files */
-
-/*
- * make annoying differences in assembler syntax go away
- */
-
-/*
- * D16 and A16 are used to insert instructions prefixes; the
- * macros help the assembler code be slightly more portable.
- */
-#if !defined(__GNUC_AS__)
-/*
- * /usr/ccs/bin/as prefixes are parsed as separate instructions
- */
-#define        D16     data16;
-#define        A16     addr16;
-
-/*
- * (There are some weird constructs in constant expressions)
- */
-#define        _CONST(const)           [const]
-#define        _BITNOT(const)          -1!_CONST(const)
-#define        _MUL(a, b)              _CONST(a \* b)
-
-#else
-/*
- * Why not use the 'data16' and 'addr16' prefixes .. well, the
- * assembler doesn't quite believe in real mode, and thus argues with
- * us about what we're trying to do.
- */
-#define        D16     .byte   0x66;
-#define        A16     .byte   0x67;
-
-#define        _CONST(const)           (const)
-#define        _BITNOT(const)          ~_CONST(const)
-#define        _MUL(a, b)              _CONST(a * b)
-
-#endif
-
-/*
- * C pointers are different sizes between i386 and amd64.
- * These constants can be used to compute offsets into pointer arrays.
- */
-#if defined(__amd64)
-#define        CLONGSHIFT      3
-#define        CLONGSIZE       8
-#define        CLONGMASK       7
-#elif defined(__i386)
-#define        CLONGSHIFT      2
-#define        CLONGSIZE       4
-#define        CLONGMASK       3
-#endif
-
-/*
- * Since we know we're either ILP32 or LP64 ..
- */
-#define        CPTRSHIFT       CLONGSHIFT
-#define        CPTRSIZE        CLONGSIZE
-#define        CPTRMASK        CLONGMASK
-
-#if CPTRSIZE != (1 << CPTRSHIFT) || CLONGSIZE != (1 << CLONGSHIFT)
-#error "inconsistent shift constants"
-#endif
-
-#if CPTRMASK != (CPTRSIZE - 1) || CLONGMASK != (CLONGSIZE - 1)
-#error "inconsistent mask constants"
-#endif
-
-#define        ASM_ENTRY_ALIGN 16
-
-/*
- * SSE register alignment and save areas
- */
-
-#define        XMM_SIZE        16
-#define        XMM_ALIGN       16
-
-#if defined(__amd64)
-
-#define        SAVE_XMM_PROLOG(sreg, nreg)                             \
-       subq    $_CONST(_MUL(XMM_SIZE, nreg)), %rsp;            \
-       movq    %rsp, sreg
-
-#define        RSTOR_XMM_EPILOG(sreg, nreg)                            \
-       addq    $_CONST(_MUL(XMM_SIZE, nreg)), %rsp
-
-#elif defined(__i386)
-
-#define        SAVE_XMM_PROLOG(sreg, nreg)                             \
-       subl    $_CONST(_MUL(XMM_SIZE, nreg) + XMM_ALIGN), %esp; \
-       movl    %esp, sreg;                                     \
-       addl    $XMM_ALIGN, sreg;                               \
-       andl    $_BITNOT(XMM_ALIGN-1), sreg
-
-#define        RSTOR_XMM_EPILOG(sreg, nreg)                            \
-       addl    $_CONST(_MUL(XMM_SIZE, nreg) + XMM_ALIGN), %esp;
-
-#endif /* __i386 */
-
-/*
- * profiling causes definitions of the MCOUNT and RTMCOUNT
- * particular to the type
- */
-#ifdef GPROF
-
-#define        MCOUNT(x) \
-       pushl   %ebp; \
-       movl    %esp, %ebp; \
-       call    _mcount; \
-       popl    %ebp
-
-#endif /* GPROF */
-
-#ifdef PROF
-
-#define        MCOUNT(x) \
-/* CSTYLED */ \
-       .lcomm .L_/**/x/**/1, 4, 4; \
-       pushl   %ebp; \
-       movl    %esp, %ebp; \
-/* CSTYLED */ \
-       movl    $.L_/**/x/**/1, %edx; \
-       call    _mcount; \
-       popl    %ebp
-
-#endif /* PROF */
-
-/*
- * if we are not profiling, MCOUNT should be defined to nothing
- */
-#if !defined(PROF) && !defined(GPROF)
-#define        MCOUNT(x)
-#endif /* !defined(PROF) && !defined(GPROF) */
-
-#define        RTMCOUNT(x)     MCOUNT(x)
-
-/*
- * Macro to define weak symbol aliases. These are similar to the ANSI-C
- *     #pragma weak name = _name
- * except a compiler can determine type. The assembler must be told. Hence,
- * the second parameter must be the type of the symbol (i.e.: function,...)
- */
-#define        ANSI_PRAGMA_WEAK(sym, stype)    \
-       .weak   sym; \
-       .type sym, @stype; \
-/* CSTYLED */ \
-sym    = _/**/sym
-
-/*
- * Like ANSI_PRAGMA_WEAK(), but for unrelated names, as in:
- *     #pragma weak sym1 = sym2
- */
-#define        ANSI_PRAGMA_WEAK2(sym1, sym2, stype)    \
-       .weak   sym1; \
-       .type sym1, @stype; \
-sym1   = sym2
-
-/*
- * ENTRY provides the standard procedure entry code and an easy way to
- * insert the calls to mcount for profiling. ENTRY_NP is identical, but
- * never calls mcount.
- */
-#define        ENTRY(x) \
-       .text; \
-       .align  ASM_ENTRY_ALIGN; \
-       .globl  x; \
-       .type   x, @function; \
-x:     MCOUNT(x)
-
-#define        ENTRY_NP(x) \
-       .text; \
-       .align  ASM_ENTRY_ALIGN; \
-       .globl  x; \
-       .type   x, @function; \
-x:
-
-#define        RTENTRY(x) \
-       .text; \
-       .align  ASM_ENTRY_ALIGN; \
-       .globl  x; \
-       .type   x, @function; \
-x:     RTMCOUNT(x)
-
-/*
- * ENTRY2 is identical to ENTRY but provides two labels for the entry point.
- */
-#define        ENTRY2(x, y) \
-       .text; \
-       .align  ASM_ENTRY_ALIGN; \
-       .globl  x, y; \
-       .type   x, @function; \
-       .type   y, @function; \
-/* CSTYLED */ \
-x:     ; \
-y:     MCOUNT(x)
-
-#define        ENTRY_NP2(x, y) \
-       .text; \
-       .align  ASM_ENTRY_ALIGN; \
-       .globl  x, y; \
-       .type   x, @function; \
-       .type   y, @function; \
-/* CSTYLED */ \
-x:     ; \
-y:
-
-
-/*
- * ALTENTRY provides for additional entry points.
- */
-#define        ALTENTRY(x) \
-       .globl x; \
-       .type   x, @function; \
-x:
-
-/*
- * DGDEF and DGDEF2 provide global data declarations.
- *
- * DGDEF provides a word aligned word of storage.
- *
- * DGDEF2 allocates "sz" bytes of storage with **NO** alignment.  This
- * implies this macro is best used for byte arrays.
- *
- * DGDEF3 allocates "sz" bytes of storage with "algn" alignment.
- */
-#define        DGDEF2(name, sz) \
-       .data; \
-       .globl  name; \
-       .type   name, @object; \
-       .size   name, sz; \
-name:
-
-#define        DGDEF3(name, sz, algn) \
-       .data; \
-       .align  algn; \
-       .globl  name; \
-       .type   name, @object; \
-       .size   name, sz; \
-name:
-
-#define        DGDEF(name)     DGDEF3(name, 4, 4)
-
-/*
- * SET_SIZE trails a function and set the size for the ELF symbol table.
- */
-#define        SET_SIZE(x) \
-       .size   x, [.-x]
-
-/*
- * NWORD provides native word value.
- */
-#if defined(__amd64)
-
-/*CSTYLED*/
-#define        NWORD   quad
-
-#elif defined(__i386)
-
-#define        NWORD   long
-
-#endif  /* __i386 */
-
-#endif /* _ASM */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _IA32_SYS_ASM_LINKAGE_H */
diff --git a/zfs/lib/libspl/include/libdevinfo.h b/zfs/lib/libspl/include/libdevinfo.h
deleted file mode 100644 (file)
index be1d291..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_LIBDEVINFO_H
-#define        _LIBSPL_LIBDEVINFO_H
-
-#endif /* _LIBSPL_LIBDEVINFO_H */
diff --git a/zfs/lib/libspl/include/libgen.h b/zfs/lib/libspl/include/libgen.h
deleted file mode 100644 (file)
index 7c03d81..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_LIBGEN_H
-#define        _LIBSPL_LIBGEN_H
-
-#include <sys/types.h>
-
-extern int mkdirp(const char *, mode_t);
-
-#endif /* _LIBSPL_LIBGEN_H */
diff --git a/zfs/lib/libspl/include/libshare.h b/zfs/lib/libspl/include/libshare.h
deleted file mode 100644 (file)
index 4016ff0..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-#ifndef _LIBSPL_LIBSHARE_H
-#define        _LIBSPL_LIBSHARE_H
-
-typedef void *sa_handle_t;     /* opaque handle to access core functions */
-typedef void *sa_group_t;
-typedef void *sa_share_t;
-
-/* API Initialization */
-#define        SA_INIT_SHARE_API       0x0001  /* init share specific interface */
-#define        SA_INIT_CONTROL_API     0x0002  /* init control specific interface */
-
-/*
- * defined error values
- */
-
-#define        SA_OK                   0
-#define        SA_NO_SUCH_PATH         1       /* provided path doesn't exist */
-#define        SA_NO_MEMORY            2       /* no memory for data structures */
-#define        SA_DUPLICATE_NAME       3       /* object name is already in use */
-#define        SA_BAD_PATH             4       /* not a full path */
-#define        SA_NO_SUCH_GROUP        5       /* group is not defined */
-#define        SA_CONFIG_ERR           6       /* system configuration error */
-#define        SA_SYSTEM_ERR           7       /* system error, use errno */
-#define        SA_SYNTAX_ERR           8       /* syntax error on command line */
-#define        SA_NO_PERMISSION        9       /* no permission for operation */
-#define        SA_BUSY                 10      /* resource is busy */
-#define        SA_NO_SUCH_PROP         11      /* property doesn't exist */
-#define        SA_INVALID_NAME         12      /* name of object is invalid */
-#define        SA_INVALID_PROTOCOL     13      /* specified protocol not valid */
-#define        SA_NOT_ALLOWED          14      /* operation not allowed */
-#define        SA_BAD_VALUE            15      /* bad value for property */
-#define        SA_INVALID_SECURITY     16      /* invalid security type */
-#define        SA_NO_SUCH_SECURITY     17      /* security set not found */
-#define        SA_VALUE_CONFLICT       18      /* property value conflict */
-#define        SA_NOT_IMPLEMENTED      19      /* plugin interface not implemented */
-#define        SA_INVALID_PATH         20      /* path is sub-dir of existing share */
-#define        SA_NOT_SUPPORTED        21      /* operation not supported for proto */
-#define        SA_PROP_SHARE_ONLY      22      /* property valid on share only */
-#define        SA_NOT_SHARED           23      /* path is not shared */
-#define        SA_NO_SUCH_RESOURCE     24      /* resource not found */
-#define        SA_RESOURCE_REQUIRED    25      /* resource name is required  */
-#define        SA_MULTIPLE_ERROR       26      /* multiple protocols reported error */
-#define        SA_PATH_IS_SUBDIR       27      /* check_path found path is subdir */
-#define        SA_PATH_IS_PARENTDIR    28      /* check_path found path is parent */
-#define        SA_NO_SECTION           29      /* protocol requires section info */
-#define        SA_NO_SUCH_SECTION      30      /* no section found */
-#define        SA_NO_PROPERTIES        31      /* no properties found */
-#define        SA_PASSWORD_ENC         32      /* passwords must be encrypted */
-#define        SA_SHARE_EXISTS         33      /* path or file is already shared */
-
-/* initialization */
-extern sa_handle_t sa_init(int);
-extern void sa_fini(sa_handle_t);
-extern char *sa_errorstr(int);
-
-/* share control */
-extern sa_share_t sa_find_share(sa_handle_t, char *);
-extern int sa_enable_share(sa_group_t, char *);
-extern int sa_disable_share(sa_share_t, char *);
-
-/* protocol specific interfaces */
-extern int sa_parse_legacy_options(sa_group_t, char *, char *);
-
-/* ZFS functions */
-extern boolean_t sa_needs_refresh(sa_handle_t handle);
-libzfs_handle_t *sa_get_zfs_handle(sa_handle_t handle);
-extern int sa_zfs_process_share(sa_handle_t handle, sa_group_t group,
-    sa_share_t share, char *mountpoint, char *proto, zprop_source_t source,
-    char *shareopts, char *sourcestr, char *dataset);
-
-#endif /* _LIBSPL_LIBSHARE_H */
diff --git a/zfs/lib/libspl/include/limits.h b/zfs/lib/libspl/include/limits.h
deleted file mode 100644 (file)
index 1a42cfe..0000000
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include_next <limits.h>
-
-#ifndef _LIBSPL_LIMITS_H
-#define        _LIBSPL_LIMITS_H
-
-#define        DBL_DIG         15
-#define        DBL_MAX         1.7976931348623157081452E+308
-#define        DBL_MIN         2.2250738585072013830903E-308
-
-#define        FLT_DIG         6
-#define        FLT_MAX         3.4028234663852885981170E+38F
-#define        FLT_MIN         1.1754943508222875079688E-38F
-
-#endif /* _LIBSPL_LIMITS_H */
diff --git a/zfs/lib/libspl/include/locale.h b/zfs/lib/libspl/include/locale.h
deleted file mode 100644 (file)
index 6c74df7..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include_next <locale.h>
-
-#ifndef _LIBSPL_LOCALE_H
-#define        _LIBSPL_LOCALE_H
-
-#include <time.h>
-#include <sys/time.h>
-
-#endif
diff --git a/zfs/lib/libspl/include/note.h b/zfs/lib/libspl/include/note.h
deleted file mode 100644 (file)
index cb6b33e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1994 by Sun Microsystems, Inc.
- */
-
-/*
- * note.h:      interface for annotating source with info for tools
- *
- * NOTE is the default interface, but if the identifier NOTE is in use for
- * some other purpose, you may prepare a similar header file using your own
- * identifier, mapping that identifier to _NOTE.  Also, exported header
- * files should *not* use NOTE, since the name may already be in use in
- * a program's namespace.  Rather, exported header files should include
- * sys/note.h directly and use _NOTE.  For consistency, all kernel source
- * should use _NOTE.
- */
-
-#ifndef _NOTE_H
-#define        _NOTE_H
-
-#include <sys/note.h>
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-#define        NOTE    _NOTE
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif  /* _NOTE_H */
diff --git a/zfs/lib/libspl/include/priv.h b/zfs/lib/libspl/include/priv.h
deleted file mode 100644 (file)
index 15b76a4..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_PRIV_H
-#define        _LIBSPL_PRIV_H
-
-#include <sys/types.h>
-
-/* Couldn't find this definition in OpenGrok */
-#define        PRIV_SYS_CONFIG "sys_config"
-
-/*
- * priv_op_t indicates a privilege operation type
- */
-typedef enum priv_op {
-       PRIV_ON,
-       PRIV_OFF,
-       PRIV_SET
-} priv_op_t;
-
-static inline boolean_t priv_ineffect(const char *priv) { return B_TRUE; }
-
-#endif
diff --git a/zfs/lib/libspl/include/rpc/Makefile.am b/zfs/lib/libspl/include/rpc/Makefile.am
deleted file mode 100644 (file)
index 7a29aba..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-libspldir = $(includedir)/libspl/rpc
-libspl_HEADERS = \
-       $(top_srcdir)/lib/libspl/include/rpc/types.h \
-       $(top_srcdir)/lib/libspl/include/rpc/xdr.h
diff --git a/zfs/lib/libspl/include/rpc/Makefile.in b/zfs/lib/libspl/include/rpc/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/rpc/types.h b/zfs/lib/libspl/include/rpc/types.h
deleted file mode 100644 (file)
index aa9901f..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef LIBSPL_RPC_TYPES_H
-#define        LIBSPL_RPC_TYPES_H
-
-#include_next <rpc/types.h>
-#include <sys/kmem.h>
-
-#endif /* LIBSPL_RPC_TYPES_H */
diff --git a/zfs/lib/libspl/include/rpc/xdr.h b/zfs/lib/libspl/include/rpc/xdr.h
deleted file mode 100644 (file)
index 99500d6..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- *     Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
- *       All Rights Reserved
- *
- * Portions of this source code were derived from Berkeley 4.3 BSD
- * under license from the Regents of the University of California.
- */
-
-#ifndef LIBSPL_RPC_XDR_H
-#define        LIBSPL_RPC_XDR_H
-
-#include_next <rpc/xdr.h>
-
-/*
- * These are XDR control operators
- */
-
-#define        XDR_GET_BYTES_AVAIL 1
-
-typedef struct xdr_bytesrec {
-       bool_t xc_is_last_record;
-       size_t xc_num_avail;
-} xdr_bytesrec_t;
-
-/*
- * These are the request arguments to XDR_CONTROL.
- *
- * XDR_PEEK - returns the contents of the next XDR unit on the XDR stream.
- * XDR_SKIPBYTES - skips the next N bytes in the XDR stream.
- * XDR_RDMAGET - for xdr implementation over RDMA, gets private flags from
- *              the XDR stream being moved over RDMA
- * XDR_RDMANOCHUNK - for xdr implementaion over RDMA, sets private flags in
- *                   the XDR stream moving over RDMA.
- */
-#define        XDR_PEEK        2
-#define        XDR_SKIPBYTES   3
-#define        XDR_RDMAGET     4
-#define        XDR_RDMASET     5
-
-extern bool_t xdr_control(XDR *xdrs, int request, void *info);
-
-#endif
diff --git a/zfs/lib/libspl/include/statcommon.h b/zfs/lib/libspl/include/statcommon.h
deleted file mode 100644 (file)
index 1f376f5..0000000
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- * Common routines for acquiring snapshots of kstats for
- * iostat, mpstat, and vmstat.
- */
-
-#ifndef        _STATCOMMON_H
-#define        _STATCOMMON_H
-
-#include <sys/types.h>
-
-#define        NODATE  0       /* Default:  No time stamp */
-#define        DDATE   1       /* Standard date format */
-#define        UDATE   2       /* Internal representation of Unix time */
-
-/* Print a timestamp in either Unix or standard format. */
-void print_timestamp(uint_t);
-
-#endif /* _STATCOMMON_H */
diff --git a/zfs/lib/libspl/include/stdio.h b/zfs/lib/libspl/include/stdio.h
deleted file mode 100644 (file)
index 6152b09..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include_next <stdio.h>
-
-#ifndef _LIBSPL_STDIO_H
-#define        _LIBSPL_STDIO_H
-
-#define        enable_extended_FILE_stdio(fd, sig)     ((void) 0)
-
-#endif
diff --git a/zfs/lib/libspl/include/stdlib.h b/zfs/lib/libspl/include/stdlib.h
deleted file mode 100644 (file)
index a4ce4f7..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include_next <stdlib.h>
-
-#ifndef _LIBSPL_STDLIB_H
-#define        _LIBSPL_STDLIB_H
-
-extern const char *getexecname(void);
-
-#endif
diff --git a/zfs/lib/libspl/include/string.h b/zfs/lib/libspl/include/string.h
deleted file mode 100644 (file)
index 9e5133e..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_STRING_H
-#define        _LIBSPL_STRING_H
-
-#include_next <string.h>
-
-extern size_t strlcat(char *dst, const char *src, size_t dstsize);
-extern size_t strlcpy(char *dst, const char *src, size_t len);
-extern size_t strnlen(const char *str, size_t maxlen);
-
-#endif
diff --git a/zfs/lib/libspl/include/strings.h b/zfs/lib/libspl/include/strings.h
deleted file mode 100644 (file)
index 3f35af4..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_STRINGS_H
-#define        _LIBSPL_STRINGS_H
-
-#include <string.h>
-#include_next <strings.h>
-
-#endif
diff --git a/zfs/lib/libspl/include/stropts.h b/zfs/lib/libspl/include/stropts.h
deleted file mode 100644 (file)
index 37acd40..0000000
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-#ifndef _LIBSPL_STROPTS_H
-#define        _LIBSPL_STROPTS_H
-
-#endif /* _LIBSPL_STROPTS_H */
diff --git a/zfs/lib/libspl/include/synch.h b/zfs/lib/libspl/include/synch.h
deleted file mode 100644 (file)
index 93d2314..0000000
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Copyright 2014 Zettabyte Software, LLC.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYNCH_H
-#define        _LIBSPL_SYNCH_H
-
-#ifndef __sun__
-
-#include <assert.h>
-#include <pthread.h>
-
-/*
- * Definitions of synchronization types.
- */
-#define        USYNC_THREAD    0x00            /* private to a process */
-#define        USYNC_PROCESS   0x01            /* shared by processes */
-
-typedef pthread_rwlock_t rwlock_t;
-
-#define        DEFAULTRWLOCK           PTHREAD_RWLOCK_INITIALIZER
-
-static inline int
-rwlock_init(rwlock_t *rwlp, int type, void *arg)
-{
-       pthread_rwlockattr_t attr;
-       int err = 0;
-
-       VERIFY0(pthread_rwlockattr_init(&attr));
-       switch (type) {
-       case USYNC_THREAD:
-               VERIFY0(pthread_rwlockattr_setpshared(&attr,
-                       PTHREAD_PROCESS_PRIVATE));
-               break;
-       case USYNC_PROCESS:
-               VERIFY0(pthread_rwlockattr_setpshared(&attr,
-                       PTHREAD_PROCESS_SHARED));
-               break;
-       default:
-               VERIFY0(1);
-       }
-
-       err = pthread_rwlock_init(rwlp, &attr);
-       VERIFY0(pthread_rwlockattr_destroy(&attr));
-
-       return (err);
-}
-
-#define        rwlock_destroy(x)       pthread_rwlock_destroy((x))
-#define        rw_rdlock(x)            pthread_rwlock_rdlock((x))
-#define        rw_wrlock(x)            pthread_rwlock_wrlock((x))
-#define        rw_unlock(x)            pthread_rwlock_unlock((x))
-#define        rw_tryrdlock(x)         pthread_rwlock_tryrdlock((x))
-#define        rw_trywrlock(x)         pthread_rwlock_trywrlock((x))
-
-#endif /* __sun__ */
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/Makefile.am b/zfs/lib/libspl/include/sys/Makefile.am
deleted file mode 100644 (file)
index 6aad845..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-SUBDIRS = dktp sysevent
-
-libspldir = $(includedir)/libspl/sys
-libspl_HEADERS = \
-       $(top_srcdir)/lib/libspl/include/sys/acl.h \
-       $(top_srcdir)/lib/libspl/include/sys/acl_impl.h \
-       $(top_srcdir)/lib/libspl/include/sys/bitmap.h \
-       $(top_srcdir)/lib/libspl/include/sys/byteorder.h \
-       $(top_srcdir)/lib/libspl/include/sys/callb.h \
-       $(top_srcdir)/lib/libspl/include/sys/cmn_err.h \
-       $(top_srcdir)/lib/libspl/include/sys/compress.h \
-       $(top_srcdir)/lib/libspl/include/sys/cred.h \
-       $(top_srcdir)/lib/libspl/include/sys/debug.h \
-       $(top_srcdir)/lib/libspl/include/sys/dkio.h \
-       $(top_srcdir)/lib/libspl/include/sys/dklabel.h \
-       $(top_srcdir)/lib/libspl/include/sys/feature_tests.h \
-       $(top_srcdir)/lib/libspl/include/sys/file.h \
-       $(top_srcdir)/lib/libspl/include/sys/frame.h \
-       $(top_srcdir)/lib/libspl/include/sys/int_limits.h \
-       $(top_srcdir)/lib/libspl/include/sys/int_types.h \
-       $(top_srcdir)/lib/libspl/include/sys/inttypes.h \
-       $(top_srcdir)/lib/libspl/include/sys/isa_defs.h \
-       $(top_srcdir)/lib/libspl/include/sys/kmem.h \
-       $(top_srcdir)/lib/libspl/include/sys/kstat.h \
-       $(top_srcdir)/lib/libspl/include/sys/list.h \
-       $(top_srcdir)/lib/libspl/include/sys/list_impl.h \
-       $(top_srcdir)/lib/libspl/include/sys/mhd.h \
-       $(top_srcdir)/lib/libspl/include/sys/mkdev.h \
-       $(top_srcdir)/lib/libspl/include/sys/mnttab.h \
-       $(top_srcdir)/lib/libspl/include/sys/mount.h \
-       $(top_srcdir)/lib/libspl/include/sys/note.h \
-       $(top_srcdir)/lib/libspl/include/sys/param.h \
-       $(top_srcdir)/lib/libspl/include/sys/policy.h \
-       $(top_srcdir)/lib/libspl/include/sys/priv.h \
-       $(top_srcdir)/lib/libspl/include/sys/processor.h \
-       $(top_srcdir)/lib/libspl/include/sys/stack.h \
-       $(top_srcdir)/lib/libspl/include/sys/stat.h \
-       $(top_srcdir)/lib/libspl/include/sys/stropts.h \
-       $(top_srcdir)/lib/libspl/include/sys/sunddi.h \
-       $(top_srcdir)/lib/libspl/include/sys/sysevent.h \
-       $(top_srcdir)/lib/libspl/include/sys/sysmacros.h \
-       $(top_srcdir)/lib/libspl/include/sys/systeminfo.h \
-       $(top_srcdir)/lib/libspl/include/sys/systm.h \
-       $(top_srcdir)/lib/libspl/include/sys/time.h \
-       $(top_srcdir)/lib/libspl/include/sys/types32.h \
-       $(top_srcdir)/lib/libspl/include/sys/types.h \
-       $(top_srcdir)/lib/libspl/include/sys/tzfile.h \
-       $(top_srcdir)/lib/libspl/include/sys/uio.h \
-       $(top_srcdir)/lib/libspl/include/sys/va_list.h \
-       $(top_srcdir)/lib/libspl/include/sys/varargs.h \
-       $(top_srcdir)/lib/libspl/include/sys/vnode.h \
-       $(top_srcdir)/lib/libspl/include/sys/vtoc.h \
-       $(top_srcdir)/lib/libspl/include/sys/zone.h
diff --git a/zfs/lib/libspl/include/sys/Makefile.in b/zfs/lib/libspl/include/sys/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/sys/acl.h b/zfs/lib/libspl/include/sys/acl.h
deleted file mode 100644 (file)
index e6df864..0000000
+++ /dev/null
@@ -1,287 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_ACL_H
-#define        _SYS_ACL_H
-
-#include <sys/types.h>
-#include <sys/acl_impl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define        MAX_ACL_ENTRIES         (1024)  /* max entries of each type */
-typedef struct acl {
-       int             a_type;         /* the type of ACL entry */
-       uid_t           a_id;           /* the entry in -uid or gid */
-       o_mode_t        a_perm;         /* the permission field */
-} aclent_t;
-
-typedef struct ace {
-       uid_t           a_who;          /* uid or gid */
-       uint32_t        a_access_mask;  /* read,write,... */
-       uint16_t        a_flags;        /* see below */
-       uint16_t        a_type;         /* allow or deny */
-} ace_t;
-
-typedef struct acl_info acl_t;
-
-/*
- * The following are Defined types for an aclent_t.
- */
-#define        USER_OBJ        (0x01)          /* object owner */
-#define        USER            (0x02)          /* additional users */
-#define        GROUP_OBJ       (0x04)          /* owning group of the object */
-#define        GROUP           (0x08)          /* additional groups */
-#define        CLASS_OBJ       (0x10)          /* file group class and mask entry */
-#define        OTHER_OBJ       (0x20)          /* other entry for the object */
-#define        ACL_DEFAULT     (0x1000)        /* default flag */
-/* default object owner */
-#define        DEF_USER_OBJ    (ACL_DEFAULT | USER_OBJ)
-/* default additional users */
-#define        DEF_USER        (ACL_DEFAULT | USER)
-/* default owning group */
-#define        DEF_GROUP_OBJ   (ACL_DEFAULT | GROUP_OBJ)
-/* default additional groups */
-#define        DEF_GROUP       (ACL_DEFAULT | GROUP)
-/* default mask entry */
-#define        DEF_CLASS_OBJ   (ACL_DEFAULT | CLASS_OBJ)
-/* default other entry */
-#define        DEF_OTHER_OBJ   (ACL_DEFAULT | OTHER_OBJ)
-
-/*
- * The following are defined for ace_t.
- */
-#define        ACE_READ_DATA           0x00000001
-#define        ACE_LIST_DIRECTORY      0x00000001
-#define        ACE_WRITE_DATA          0x00000002
-#define        ACE_ADD_FILE            0x00000002
-#define        ACE_APPEND_DATA         0x00000004
-#define        ACE_ADD_SUBDIRECTORY    0x00000004
-#define        ACE_READ_NAMED_ATTRS    0x00000008
-#define        ACE_WRITE_NAMED_ATTRS   0x00000010
-#define        ACE_EXECUTE             0x00000020
-#define        ACE_DELETE_CHILD        0x00000040
-#define        ACE_READ_ATTRIBUTES     0x00000080
-#define        ACE_WRITE_ATTRIBUTES    0x00000100
-#define        ACE_DELETE              0x00010000
-#define        ACE_READ_ACL            0x00020000
-#define        ACE_WRITE_ACL           0x00040000
-#define        ACE_WRITE_OWNER         0x00080000
-#define        ACE_SYNCHRONIZE         0x00100000
-
-#define        ACE_FILE_INHERIT_ACE            0x0001
-#define        ACE_DIRECTORY_INHERIT_ACE       0x0002
-#define        ACE_NO_PROPAGATE_INHERIT_ACE    0x0004
-#define        ACE_INHERIT_ONLY_ACE            0x0008
-#define        ACE_SUCCESSFUL_ACCESS_ACE_FLAG  0x0010
-#define        ACE_FAILED_ACCESS_ACE_FLAG      0x0020
-#define        ACE_IDENTIFIER_GROUP            0x0040
-#define        ACE_INHERITED_ACE               0x0080
-#define        ACE_OWNER                       0x1000
-#define        ACE_GROUP                       0x2000
-#define        ACE_EVERYONE                    0x4000
-
-#define        ACE_ACCESS_ALLOWED_ACE_TYPE     0x0000
-#define        ACE_ACCESS_DENIED_ACE_TYPE      0x0001
-#define        ACE_SYSTEM_AUDIT_ACE_TYPE       0x0002
-#define        ACE_SYSTEM_ALARM_ACE_TYPE       0x0003
-
-#define        ACL_AUTO_INHERIT                0x0001
-#define        ACL_PROTECTED                   0x0002
-#define        ACL_DEFAULTED                   0x0004
-#define        ACL_FLAGS_ALL                   (ACL_AUTO_INHERIT|ACL_PROTECTED| \
-    ACL_DEFAULTED)
-
-#ifdef _KERNEL
-
-/*
- * These are only applicable in a CIFS context.
- */
-#define        ACE_ACCESS_ALLOWED_COMPOUND_ACE_TYPE            0x04
-#define        ACE_ACCESS_ALLOWED_OBJECT_ACE_TYPE              0x05
-#define        ACE_ACCESS_DENIED_OBJECT_ACE_TYPE               0x06
-#define        ACE_SYSTEM_AUDIT_OBJECT_ACE_TYPE                0x07
-#define        ACE_SYSTEM_ALARM_OBJECT_ACE_TYPE                0x08
-#define        ACE_ACCESS_ALLOWED_CALLBACK_ACE_TYPE            0x09
-#define        ACE_ACCESS_DENIED_CALLBACK_ACE_TYPE             0x0A
-#define        ACE_ACCESS_ALLOWED_CALLBACK_OBJECT_ACE_TYPE     0x0B
-#define        ACE_ACCESS_DENIED_CALLBACK_OBJECT_ACE_TYPE      0x0C
-#define        ACE_SYSTEM_AUDIT_CALLBACK_ACE_TYPE              0x0D
-#define        ACE_SYSTEM_ALARM_CALLBACK_ACE_TYPE              0x0E
-#define        ACE_SYSTEM_AUDIT_CALLBACK_OBJECT_ACE_TYPE       0x0F
-#define        ACE_SYSTEM_ALARM_CALLBACK_OBJECT_ACE_TYPE       0x10
-
-#define        ACE_ALL_TYPES   0x001F
-
-typedef struct ace_object {
-       uid_t           a_who;          /* uid or gid */
-       uint32_t        a_access_mask;  /* read,write,... */
-       uint16_t        a_flags;        /* see below */
-       uint16_t        a_type;         /* allow or deny */
-       uint8_t         a_obj_type[16]; /* obj type */
-       uint8_t         a_inherit_obj_type[16];  /* inherit obj */
-} ace_object_t;
-
-#endif
-
-#define        ACE_ALL_PERMS   (ACE_READ_DATA|ACE_LIST_DIRECTORY|ACE_WRITE_DATA| \
-    ACE_ADD_FILE|ACE_APPEND_DATA|ACE_ADD_SUBDIRECTORY|ACE_READ_NAMED_ATTRS| \
-    ACE_WRITE_NAMED_ATTRS|ACE_EXECUTE|ACE_DELETE_CHILD|ACE_READ_ATTRIBUTES| \
-    ACE_WRITE_ATTRIBUTES|ACE_DELETE|ACE_READ_ACL|ACE_WRITE_ACL| \
-    ACE_WRITE_OWNER|ACE_SYNCHRONIZE)
-
-/*
- * The following flags are supported by both NFSv4 ACLs and ace_t.
- */
-#define        ACE_NFSV4_SUP_FLAGS (ACE_FILE_INHERIT_ACE | \
-    ACE_DIRECTORY_INHERIT_ACE | \
-    ACE_NO_PROPAGATE_INHERIT_ACE | \
-    ACE_INHERIT_ONLY_ACE | \
-    ACE_IDENTIFIER_GROUP)
-
-#define        ACE_TYPE_FLAGS          (ACE_OWNER|ACE_GROUP|ACE_EVERYONE| \
-    ACE_IDENTIFIER_GROUP)
-#define        ACE_INHERIT_FLAGS       (ACE_FILE_INHERIT_ACE| \
-    ACE_DIRECTORY_INHERIT_ACE|ACE_NO_PROPAGATE_INHERIT_ACE|ACE_INHERIT_ONLY_ACE)
-
-/* cmd args to acl(2) for aclent_t  */
-#define        GETACL                  1
-#define        SETACL                  2
-#define        GETACLCNT               3
-
-/* cmd's to manipulate ace acls. */
-#define        ACE_GETACL              4
-#define        ACE_SETACL              5
-#define        ACE_GETACLCNT           6
-
-/* minimal acl entries from GETACLCNT */
-#define        MIN_ACL_ENTRIES         4
-
-#if !defined(_KERNEL)
-
-/* acl check errors */
-#define        GRP_ERROR               1
-#define        USER_ERROR              2
-#define        OTHER_ERROR             3
-#define        CLASS_ERROR             4
-#define        DUPLICATE_ERROR         5
-#define        MISS_ERROR              6
-#define        MEM_ERROR               7
-#define        ENTRY_ERROR             8
-
-
-/*
- * similar to ufs_acl.h: changed to char type for user commands (tar, cpio)
- * Attribute types
- */
-#define        UFSD_FREE       ('0')   /* Free entry */
-#define        UFSD_ACL        ('1')   /* Access Control Lists */
-#define        UFSD_DFACL      ('2')   /* reserved for future use */
-#define        ACE_ACL         ('3')   /* ace_t style acls */
-
-/*
- * flag to [f]acl_get()
- * controls whether a trivial acl should be returned.
- */
-#define        ACL_NO_TRIVIAL  0x2
-
-
-/*
- * Flags to control acl_totext()
- */
-
-#define        ACL_APPEND_ID   0x1     /* append uid/gid to user/group entries */
-#define        ACL_COMPACT_FMT 0x2     /* build ACL in ls -V format */
-#define        ACL_NORESOLVE   0x4     /* don't do name service lookups */
-
-/*
- * Legacy aclcheck errors for aclent_t ACLs
- */
-#define        EACL_GRP_ERROR          GRP_ERROR
-#define        EACL_USER_ERROR         USER_ERROR
-#define        EACL_OTHER_ERROR        OTHER_ERROR
-#define        EACL_CLASS_ERROR        CLASS_ERROR
-#define        EACL_DUPLICATE_ERROR    DUPLICATE_ERROR
-#define        EACL_MISS_ERROR         MISS_ERROR
-#define        EACL_MEM_ERROR          MEM_ERROR
-#define        EACL_ENTRY_ERROR        ENTRY_ERROR
-
-#define        EACL_INHERIT_ERROR      9               /* invalid inherit flags */
-#define        EACL_FLAGS_ERROR        10              /* unknown flag value */
-#define        EACL_PERM_MASK_ERROR    11              /* unknown permission */
-#define        EACL_COUNT_ERROR        12              /* invalid acl count */
-
-#define        EACL_INVALID_SLOT       13              /* invalid acl slot */
-#define        EACL_NO_ACL_ENTRY       14              /* Entry doesn't exist */
-#define        EACL_DIFF_TYPE          15              /* acls aren't same type */
-
-#define        EACL_INVALID_USER_GROUP 16              /* need user/group name */
-#define        EACL_INVALID_STR        17              /* invalid acl string */
-#define        EACL_FIELD_NOT_BLANK    18              /* can't have blank field */
-#define        EACL_INVALID_ACCESS_TYPE 19             /* invalid access type */
-#define        EACL_UNKNOWN_DATA       20              /* Unrecognized data in ACL */
-#define        EACL_MISSING_FIELDS     21              /* missing fields in acl */
-
-#define        EACL_INHERIT_NOTDIR     22              /* Need dir for inheritance */
-
-extern int aclcheck(aclent_t *, int, int *);
-extern int acltomode(aclent_t *, int, mode_t *);
-extern int aclfrommode(aclent_t *, int, mode_t *);
-extern int aclsort(int, int, aclent_t *);
-extern char *acltotext(aclent_t *, int);
-extern aclent_t *aclfromtext(char *, int *);
-extern void acl_free(acl_t *);
-extern int acl_get(const char *, int, acl_t **);
-extern int facl_get(int, int, acl_t **);
-extern int acl_set(const char *, acl_t *acl);
-extern int facl_set(int, acl_t *acl);
-extern int acl_strip(const char *, uid_t, gid_t, mode_t);
-extern int acl_trivial(const char *);
-extern char *acl_totext(acl_t *, int);
-extern int acl_fromtext(const char *, acl_t **);
-extern int acl_check(acl_t *, int);
-
-#else  /* !defined(_KERNEL) */
-
-extern void ksort(caddr_t, int, int, int (*)(void *, void *));
-extern int cmp2acls(void *, void *);
-
-#endif /* !defined(_KERNEL) */
-
-#if defined(__STDC__)
-extern int acl(const char *path, int cmd, int cnt, void *buf);
-extern int facl(int fd, int cmd, int cnt, void *buf);
-#else  /* !__STDC__ */
-extern int acl();
-extern int facl();
-#endif /* defined(__STDC__) */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_ACL_H */
diff --git a/zfs/lib/libspl/include/sys/acl_impl.h b/zfs/lib/libspl/include/sys/acl_impl.h
deleted file mode 100644 (file)
index 7173349..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_ACL_IMPL_H
-#define        _SYS_ACL_IMPL_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * acl flags
- *
- * ACL_AUTO_INHERIT, ACL_PROTECTED and ACL_DEFAULTED
- * flags can also be stored in this field.
- */
-#define        ACL_IS_TRIVIAL  0x10000
-#define        ACL_IS_DIR      0x20000
-
-typedef enum acl_type {
-       ACLENT_T = 0,
-       ACE_T = 1
-} acl_type_t;
-
-struct acl_info {
-       acl_type_t acl_type;            /* style of acl */
-       int acl_cnt;                    /* number of acl entries */
-       int acl_entry_size;             /* sizeof acl entry */
-       int acl_flags;                  /* special flags about acl */
-       void *acl_aclp;                 /* the acl */
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_ACL_IMPL_H */
diff --git a/zfs/lib/libspl/include/sys/bitmap.h b/zfs/lib/libspl/include/sys/bitmap.h
deleted file mode 100644 (file)
index 95122ab..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_BITMAP_H
-#define        _LIBSPL_SYS_BITMAP_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/byteorder.h b/zfs/lib/libspl/include/sys/byteorder.h
deleted file mode 100644 (file)
index 528d2d2..0000000
+++ /dev/null
@@ -1,199 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T     */
-/*       All Rights Reserved   */
-
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#ifndef _SYS_BYTEORDER_H
-#define        _SYS_BYTEORDER_H
-
-
-
-#include <sys/isa_defs.h>
-#include <sys/int_types.h>
-
-#if defined(__GNUC__) && defined(_ASM_INLINES) && \
-       (defined(__i386) || defined(__amd64))
-#include <asm/byteorder.h>
-#endif
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * macros for conversion between host and (internet) network byte order
- */
-
-#if defined(_BIG_ENDIAN) && !defined(ntohl) && !defined(__lint)
-/* big-endian */
-#define        ntohl(x)        (x)
-#define        ntohs(x)        (x)
-#define        htonl(x)        (x)
-#define        htons(x)        (x)
-
-#elif !defined(ntohl) /* little-endian */
-
-#ifndef        _IN_PORT_T
-#define        _IN_PORT_T
-typedef uint16_t in_port_t;
-#endif
-
-#ifndef        _IN_ADDR_T
-#define        _IN_ADDR_T
-typedef uint32_t in_addr_t;
-#endif
-
-#if !defined(_XPG4_2) || defined(__EXTENSIONS__) || defined(_XPG5)
-extern uint32_t htonl(uint32_t);
-extern uint16_t htons(uint16_t);
-extern         uint32_t ntohl(uint32_t);
-extern uint16_t ntohs(uint16_t);
-#else
-extern in_addr_t htonl(in_addr_t);
-extern in_port_t htons(in_port_t);
-extern         in_addr_t ntohl(in_addr_t);
-extern in_port_t ntohs(in_port_t);
-#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) || defined(_XPG5) */
-#endif
-
-#if !defined(_XPG4_2) || defined(__EXTENSIONS__)
-
-/*
- * Macros to reverse byte order
- */
-#define        BSWAP_8(x)      ((x) & 0xff)
-#define        BSWAP_16(x)     ((BSWAP_8(x) << 8) | BSWAP_8((x) >> 8))
-#define        BSWAP_32(x)     ((BSWAP_16(x) << 16) | BSWAP_16((x) >> 16))
-#define        BSWAP_64(x)     ((BSWAP_32(x) << 32) | BSWAP_32((x) >> 32))
-
-#define        BMASK_8(x)      ((x) & 0xff)
-#define        BMASK_16(x)     ((x) & 0xffff)
-#define        BMASK_32(x)     ((x) & 0xffffffff)
-#define        BMASK_64(x)     (x)
-
-/*
- * Macros to convert from a specific byte order to/from native byte order
- */
-#ifdef _BIG_ENDIAN
-#define        BE_8(x)         BMASK_8(x)
-#define        BE_16(x)        BMASK_16(x)
-#define        BE_32(x)        BMASK_32(x)
-#define        BE_64(x)        BMASK_64(x)
-#define        LE_8(x)         BSWAP_8(x)
-#define        LE_16(x)        BSWAP_16(x)
-#define        LE_32(x)        BSWAP_32(x)
-#define        LE_64(x)        BSWAP_64(x)
-#else
-#define        LE_8(x)         BMASK_8(x)
-#define        LE_16(x)        BMASK_16(x)
-#define        LE_32(x)        BMASK_32(x)
-#define        LE_64(x)        BMASK_64(x)
-#define        BE_8(x)         BSWAP_8(x)
-#define        BE_16(x)        BSWAP_16(x)
-#define        BE_32(x)        BSWAP_32(x)
-#define        BE_64(x)        BSWAP_64(x)
-#endif
-
-/*
- * Macros to read unaligned values from a specific byte order to
- * native byte order
- */
-
-#define        BE_IN8(xa) \
-       *((uint8_t *)(xa))
-
-#define        BE_IN16(xa) \
-       (((uint16_t)BE_IN8(xa) << 8) | BE_IN8((uint8_t *)(xa)+1))
-
-#define        BE_IN32(xa) \
-       (((uint32_t)BE_IN16(xa) << 16) | BE_IN16((uint8_t *)(xa)+2))
-
-#define        BE_IN64(xa) \
-       (((uint64_t)BE_IN32(xa) << 32) | BE_IN32((uint8_t *)(xa)+4))
-
-#define        LE_IN8(xa) \
-       *((uint8_t *)(xa))
-
-#define        LE_IN16(xa) \
-       (((uint16_t)LE_IN8((uint8_t *)(xa) + 1) << 8) | LE_IN8(xa))
-
-#define        LE_IN32(xa) \
-       (((uint32_t)LE_IN16((uint8_t *)(xa) + 2) << 16) | LE_IN16(xa))
-
-#define        LE_IN64(xa) \
-       (((uint64_t)LE_IN32((uint8_t *)(xa) + 4) << 32) | LE_IN32(xa))
-
-/*
- * Macros to write unaligned values from native byte order to a specific byte
- * order.
- */
-
-#define        BE_OUT8(xa, yv) *((uint8_t *)(xa)) = (uint8_t)(yv);
-
-#define        BE_OUT16(xa, yv) \
-       BE_OUT8((uint8_t *)(xa) + 1, yv); \
-       BE_OUT8((uint8_t *)(xa), (yv) >> 8);
-
-#define        BE_OUT32(xa, yv) \
-       BE_OUT16((uint8_t *)(xa) + 2, yv); \
-       BE_OUT16((uint8_t *)(xa), (yv) >> 16);
-
-#define        BE_OUT64(xa, yv) \
-       BE_OUT32((uint8_t *)(xa) + 4, yv); \
-       BE_OUT32((uint8_t *)(xa), (yv) >> 32);
-
-#define        LE_OUT8(xa, yv) *((uint8_t *)(xa)) = (uint8_t)(yv);
-
-#define        LE_OUT16(xa, yv) \
-       LE_OUT8((uint8_t *)(xa), yv); \
-       LE_OUT8((uint8_t *)(xa) + 1, (yv) >> 8);
-
-#define        LE_OUT32(xa, yv) \
-       LE_OUT16((uint8_t *)(xa), yv); \
-       LE_OUT16((uint8_t *)(xa) + 2, (yv) >> 16);
-
-#define        LE_OUT64(xa, yv) \
-       LE_OUT32((uint8_t *)(xa), yv); \
-       LE_OUT32((uint8_t *)(xa) + 4, (yv) >> 32);
-
-#endif /* !defined(_XPG4_2) || defined(__EXTENSIONS__) */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_BYTEORDER_H */
diff --git a/zfs/lib/libspl/include/sys/callb.h b/zfs/lib/libspl/include/sys/callb.h
deleted file mode 100644 (file)
index 8ffd187..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_CALLB_H
-#define        _SYS_CALLB_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/cmn_err.h b/zfs/lib/libspl/include/sys/cmn_err.h
deleted file mode 100644 (file)
index 63ff4eb..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_CMN_ERR_H
-#define        _LIBSPL_SYS_CMN_ERR_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/compress.h b/zfs/lib/libspl/include/sys/compress.h
deleted file mode 100644 (file)
index 282f178..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_COMPRESS_H
-#define        _LIBSPL_SYS_COMPRESS_H
-
-#endif /* _LIBSPL_SYS_COMPRESS_H */
diff --git a/zfs/lib/libspl/include/sys/cred.h b/zfs/lib/libspl/include/sys/cred.h
deleted file mode 100644 (file)
index 463b3ab..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_CRED_H
-#define        _LIBSPL_SYS_CRED_H
-
-typedef struct cred cred_t;
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/debug.h b/zfs/lib/libspl/include/sys/debug.h
deleted file mode 100644 (file)
index fde4a01..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_DEBUG_H
-#define        _LIBSPL_SYS_DEBUG_H
-
-#include <assert.h>
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/dkio.h b/zfs/lib/libspl/include/sys/dkio.h
deleted file mode 100644 (file)
index 6b430b8..0000000
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_DKIO_H
-#define        _SYS_DKIO_H
-
-
-
-#include <sys/dklabel.h>       /* Needed for NDKMAP define */
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Structures and definitions for disk io control commands
- */
-
-/*
- * Structures used as data by ioctl calls.
- */
-
-#define        DK_DEVLEN       16              /* device name max length, including */
-                                       /* unit # & NULL (ie - "xyc1") */
-
-/*
- * Used for controller info
- */
-struct dk_cinfo {
-       char    dki_cname[DK_DEVLEN];   /* controller name (no unit #) */
-       ushort_t dki_ctype;             /* controller type */
-       ushort_t dki_flags;             /* flags */
-       ushort_t dki_cnum;              /* controller number */
-       uint_t  dki_addr;               /* controller address */
-       uint_t  dki_space;              /* controller bus type */
-       uint_t  dki_prio;               /* interrupt priority */
-       uint_t  dki_vec;                /* interrupt vector */
-       char    dki_dname[DK_DEVLEN];   /* drive name (no unit #) */
-       uint_t  dki_unit;               /* unit number */
-       uint_t  dki_slave;              /* slave number */
-       ushort_t dki_partition;         /* partition number */
-       ushort_t dki_maxtransfer;       /* max. transfer size in DEV_BSIZE */
-};
-
-/*
- * Controller types
- */
-#define        DKC_UNKNOWN     0
-#define        DKC_CDROM       1       /* CD-ROM, SCSI or otherwise */
-#define        DKC_WDC2880     2
-#define        DKC_XXX_0       3       /* unassigned */
-#define        DKC_XXX_1       4       /* unassigned */
-#define        DKC_DSD5215     5
-#define        DKC_ACB4000     7
-#define        DKC_MD21        8
-#define        DKC_XXX_2       9       /* unassigned */
-#define        DKC_NCRFLOPPY   10
-#define        DKC_SMSFLOPPY   12
-#define        DKC_SCSI_CCS    13      /* SCSI CCS compatible */
-#define        DKC_INTEL82072  14      /* native floppy chip */
-#define        DKC_MD          16      /* meta-disk (virtual-disk) driver */
-#define        DKC_INTEL82077  19      /* 82077 floppy disk controller */
-#define        DKC_DIRECT      20      /* Intel direct attached device i.e. IDE */
-#define        DKC_PCMCIA_MEM  21      /* PCMCIA memory disk-like type */
-#define        DKC_PCMCIA_ATA  22      /* PCMCIA AT Attached type */
-#define        DKC_VBD         23      /* virtual block device */
-
-/*
- * Sun reserves up through 1023
- */
-
-#define        DKC_CUSTOMER_BASE       1024
-
-/*
- * Flags
- */
-#define        DKI_BAD144      0x01    /* use DEC std 144 bad sector fwding */
-#define        DKI_MAPTRK      0x02    /* controller does track mapping */
-#define        DKI_FMTTRK      0x04    /* formats only full track at a time */
-#define        DKI_FMTVOL      0x08    /* formats only full volume at a time */
-#define        DKI_FMTCYL      0x10    /* formats only full cylinders at a time */
-#define        DKI_HEXUNIT     0x20    /* unit number is printed as 3 hex digits */
-#define        DKI_PCMCIA_PFD  0x40    /* PCMCIA pseudo-floppy memory card */
-
-/*
- * Used for all partitions
- */
-struct dk_allmap {
-       struct dk_map   dka_map[NDKMAP];
-};
-
-#if defined(_SYSCALL32)
-struct dk_allmap32 {
-       struct dk_map32 dka_map[NDKMAP];
-};
-#endif /* _SYSCALL32 */
-
-/*
- * Definition of a disk's geometry
- */
-struct dk_geom {
-       unsigned short  dkg_ncyl;       /* # of data cylinders */
-       unsigned short  dkg_acyl;       /* # of alternate cylinders */
-       unsigned short  dkg_bcyl;       /* cyl offset (for fixed head area) */
-       unsigned short  dkg_nhead;      /* # of heads */
-       unsigned short  dkg_obs1;       /* obsolete */
-       unsigned short  dkg_nsect;      /* # of data sectors per track */
-       unsigned short  dkg_intrlv;     /* interleave factor */
-       unsigned short  dkg_obs2;       /* obsolete */
-       unsigned short  dkg_obs3;       /* obsolete */
-       unsigned short  dkg_apc;        /* alternates per cyl (SCSI only) */
-       unsigned short  dkg_rpm;        /* revolutions per minute */
-       unsigned short  dkg_pcyl;       /* # of physical cylinders */
-       unsigned short  dkg_write_reinstruct;   /* # sectors to skip, writes */
-       unsigned short  dkg_read_reinstruct;    /* # sectors to skip, reads */
-       unsigned short  dkg_extra[7];   /* for compatible expansion */
-};
-
-/*
- * These defines are for historic compatibility with old drivers.
- */
-#define        dkg_bhead       dkg_obs1        /* used to be head offset */
-#define        dkg_gap1        dkg_obs2        /* used to be gap1 */
-#define        dkg_gap2        dkg_obs3        /* used to be gap2 */
-
-/*
- * Disk io control commands
- * Warning: some other ioctls with the DIOC prefix exist elsewhere.
- * The Generic DKIOC numbers are from  0   -  50.
- *     The Floppy Driver uses          51  - 100.
- *     The Hard Disk (except SCSI)     101 - 106.      (these are obsolete)
- *     The CDROM Driver                151 - 200.
- *     The USCSI ioctl                 201 - 250.
- */
-#define        DKIOC           (0x04 << 8)
-
-/*
- * The following ioctls are generic in nature and need to be
- * suported as appropriate by all disk drivers
- */
-#define        DKIOCGGEOM      (DKIOC|1)               /* Get geometry */
-#define        DKIOCINFO       (DKIOC|3)               /* Get info */
-#define        DKIOCEJECT      (DKIOC|6)               /* Generic 'eject' */
-#define        DKIOCGVTOC      (DKIOC|11)              /* Get VTOC */
-#define        DKIOCSVTOC      (DKIOC|12)              /* Set VTOC & Write to Disk */
-
-/*
- * Disk Cache Controls.  These ioctls should be supported by
- * all disk drivers.
- *
- * DKIOCFLUSHWRITECACHE when used from user-mode ignores the ioctl
- * argument, but it should be passed as NULL to allow for future
- * reinterpretation.  From user-mode, this ioctl request is synchronous.
- *
- * When invoked from within the kernel, the arg can be NULL to indicate
- * a synchronous request or can be the address of a struct dk_callback
- * to request an asynchronous callback when the flush request is complete.
- * In this case, the flag to the ioctl must include FKIOCTL and the
- * dkc_callback field of the pointed to struct must be non-null or the
- * request is made synchronously.
- *
- * In the callback case: if the ioctl returns 0, a callback WILL be performed.
- * If the ioctl returns non-zero, a callback will NOT be performed.
- * NOTE: In some cases, the callback may be done BEFORE the ioctl call
- * returns.  The caller's locking strategy should be prepared for this case.
- */
-#define        DKIOCFLUSHWRITECACHE    (DKIOC|34)      /* flush cache to phys medium */
-
-struct dk_callback {
-       void (*dkc_callback)(void *dkc_cookie, int error);
-       void *dkc_cookie;
-       int dkc_flag;
-};
-
-/* bit flag definitions for dkc_flag */
-#define        FLUSH_VOLATILE          0x1     /* Bit 0: if set, only flush */
-                                       /* volatile cache; otherwise, flush */
-                                       /* volatile and non-volatile cache */
-
-#define        DKIOCGETWCE             (DKIOC|36)      /* Get current write cache */
-                                               /* enablement status */
-#define        DKIOCSETWCE             (DKIOC|37)      /* Enable/Disable write cache */
-
-/*
- * The following ioctls are used by Sun drivers to communicate
- * with their associated format routines. Support of these ioctls
- * is not required of foreign drivers
- */
-#define        DKIOCSGEOM      (DKIOC|2)               /* Set geometry */
-#define        DKIOCSAPART     (DKIOC|4)               /* Set all partitions */
-#define        DKIOCGAPART     (DKIOC|5)               /* Get all partitions */
-#define        DKIOCG_PHYGEOM  (DKIOC|32)              /* get physical geometry */
-#define        DKIOCG_VIRTGEOM (DKIOC|33)              /* get virtual geometry */
-
-/*
- * The following ioctl's are removable media support
- */
-#define        DKIOCLOCK       (DKIOC|7)       /* Generic 'lock' */
-#define        DKIOCUNLOCK     (DKIOC|8)       /* Generic 'unlock' */
-#define        DKIOCSTATE      (DKIOC|13)      /* Inquire insert/eject state */
-#define        DKIOCREMOVABLE  (DKIOC|16)      /* is media removable */
-
-
-/*
- * ioctl for hotpluggable devices
- */
-#define        DKIOCHOTPLUGGABLE       (DKIOC|35)      /* is hotpluggable */
-
-/*
- * Ioctl to force driver to re-read the alternate partition and rebuild
- * the internal defect map.
- */
-#define        DKIOCADDBAD     (DKIOC|20)      /* Re-read the alternate map (IDE) */
-#define        DKIOCGETDEF     (DKIOC|21)      /* read defect list (IDE)          */
-
-/*
- * Used by applications to get disk defect information from IDE
- * drives.
- */
-#ifdef _SYSCALL32
-struct defect_header32 {
-       int             head;
-       caddr32_t       buffer;
-};
-#endif /* _SYSCALL32 */
-
-struct defect_header {
-       int             head;
-       caddr_t         buffer;
-};
-
-#define        DKIOCPARTINFO   (DKIOC|22)      /* Get partition or slice parameters */
-
-/*
- * Used by applications to get partition or slice information
- */
-#ifdef _SYSCALL32
-struct part_info32 {
-       uint32_t        p_start;
-       int             p_length;
-};
-#endif /* _SYSCALL32 */
-
-struct part_info {
-       uint64_t        p_start;
-       int             p_length;
-};
-
-/* The following ioctls are for Optical Memory Device */
-#define        DKIOC_EBP_ENABLE  (DKIOC|40)    /* enable by pass erase on write */
-#define        DKIOC_EBP_DISABLE (DKIOC|41)    /* disable by pass erase on write */
-
-/*
- * This state enum is the argument passed to the DKIOCSTATE ioctl.
- */
-enum dkio_state { DKIO_NONE, DKIO_EJECTED, DKIO_INSERTED, DKIO_DEV_GONE };
-
-#define        DKIOCGMEDIAINFO (DKIOC|42)      /* get information about the media */
-
-/*
- * ioctls to read/write mboot info.
- */
-#define        DKIOCGMBOOT     (DKIOC|43)      /* get mboot info */
-#define        DKIOCSMBOOT     (DKIOC|44)      /* set mboot info */
-
-/*
- * ioctl to get the device temperature.
- */
-#define        DKIOCGTEMPERATURE       (DKIOC|45)      /* get temperature */
-
-/*
- * Used for providing the temperature.
- */
-
-struct dk_temperature  {
-       uint_t          dkt_flags;      /* Flags */
-       short           dkt_cur_temp;   /* Current disk temperature */
-       short           dkt_ref_temp;   /* reference disk temperature */
-};
-
-#define        DKT_BYPASS_PM           0x1
-#define        DKT_INVALID_TEMP        0xFFFF
-
-
-/*
- * Used for Media info or the current profile info
- */
-struct dk_minfo {
-       uint_t          dki_media_type; /* Media type or profile info */
-       uint_t          dki_lbsize;     /* Logical blocksize of media */
-       diskaddr_t      dki_capacity;   /* Capacity as # of dki_lbsize blks */
-};
-
-/*
- * Media types or profiles known
- */
-#define        DK_UNKNOWN              0x00    /* Media inserted - type unknown */
-
-
-/*
- * SFF 8090 Specification Version 3, media types 0x01 - 0xfffe are retained to
- * maintain compatibility with SFF8090.  The following define the
- * optical media type.
- */
-#define        DK_REMOVABLE_DISK       0x02 /* Removable Disk */
-#define        DK_MO_ERASABLE          0x03 /* MO Erasable */
-#define        DK_MO_WRITEONCE         0x04 /* MO Write once */
-#define        DK_AS_MO                0x05 /* AS MO */
-#define        DK_CDROM                0x08 /* CDROM */
-#define        DK_CDR                  0x09 /* CD-R */
-#define        DK_CDRW                 0x0A /* CD-RW */
-#define        DK_DVDROM               0x10 /* DVD-ROM */
-#define        DK_DVDR                 0x11 /* DVD-R */
-#define        DK_DVDRAM               0x12 /* DVD_RAM or DVD-RW */
-
-/*
- * Media types for other rewritable magnetic media
- */
-#define        DK_FIXED_DISK           0x10001 /* Fixed disk SCSI or otherwise */
-#define        DK_FLOPPY               0x10002 /* Floppy media */
-#define        DK_ZIP                  0x10003 /* IOMEGA ZIP media */
-#define        DK_JAZ                  0x10004 /* IOMEGA JAZ media */
-
-#define        DKIOCSETEFI     (DKIOC|17)              /* Set EFI info */
-#define        DKIOCGETEFI     (DKIOC|18)              /* Get EFI info */
-
-#define        DKIOCPARTITION  (DKIOC|9)               /* Get partition info */
-
-/*
- * Ioctls to get/set volume capabilities related to Logical Volume Managers.
- * They include the ability to get/set capabilities and to issue a read to a
- * specific underlying device of a replicated device.
- */
-
-#define        DKIOCGETVOLCAP  (DKIOC | 25)    /* Get volume capabilities */
-#define        DKIOCSETVOLCAP  (DKIOC | 26)    /* Set volume capabilities */
-#define        DKIOCDMR        (DKIOC | 27)    /* Issue a directed read */
-
-typedef uint_t volcapinfo_t;
-
-typedef uint_t volcapset_t;
-
-#define        DKV_ABR_CAP 0x00000001          /* Support Appl.Based Recovery */
-#define        DKV_DMR_CAP 0x00000002          /* Support Directed  Mirror Read */
-
-typedef struct volcap {
-       volcapinfo_t vc_info;   /* Capabilities available */
-       volcapset_t vc_set;     /* Capabilities set */
-} volcap_t;
-
-#define        VOL_SIDENAME 256
-
-typedef struct vol_directed_rd {
-       int             vdr_flags;
-       offset_t        vdr_offset;
-       size_t          vdr_nbytes;
-       size_t          vdr_bytesread;
-       void            *vdr_data;
-       int             vdr_side;
-       char            vdr_side_name[VOL_SIDENAME];
-} vol_directed_rd_t;
-
-#define        DKV_SIDE_INIT           (-1)
-#define        DKV_DMR_NEXT_SIDE       0x00000001
-#define        DKV_DMR_DONE            0x00000002
-#define        DKV_DMR_ERROR           0x00000004
-#define        DKV_DMR_SUCCESS         0x00000008
-#define        DKV_DMR_SHORT           0x00000010
-
-#ifdef _MULTI_DATAMODEL
-#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
-#pragma pack(4)
-#endif
-typedef struct vol_directed_rd32 {
-       int32_t         vdr_flags;
-       offset_t        vdr_offset;     /* 64-bit element on 32-bit alignment */
-       size32_t        vdr_nbytes;
-       size32_t        vdr_bytesread;
-       caddr32_t       vdr_data;
-       int32_t         vdr_side;
-       char            vdr_side_name[VOL_SIDENAME];
-} vol_directed_rd32_t;
-#if _LONG_LONG_ALIGNMENT == 8 && _LONG_LONG_ALIGNMENT_32 == 4
-#pragma pack()
-#endif
-#endif /* _MULTI_DATAMODEL */
-
-/*
- * The ioctl is used to fetch disk's device type, vendor ID,
- * model number/product ID, firmware revision and serial number together.
- *
- * Currently there are two device types - DKD_ATA_TYPE which means the
- * disk is driven by cmdk/ata or dad/uata driver, and DKD_SCSI_TYPE
- * which means the disk is driven by sd/scsi hba driver.
- */
-#define        DKIOC_GETDISKID (DKIOC|46)
-
-/* These two labels are for dkd_dtype of dk_disk_id_t */
-#define        DKD_ATA_TYPE    0x01 /* ATA disk or legacy mode SATA disk */
-#define        DKD_SCSI_TYPE   0x02 /* SCSI disk or native mode SATA disk */
-
-#define        DKD_ATA_MODEL   40      /* model number length */
-#define        DKD_ATA_FWVER   8       /* firmware revision length */
-#define        DKD_ATA_SERIAL  20      /* serial number length */
-
-#define        DKD_SCSI_VENDOR 8       /* vendor ID length */
-#define        DKD_SCSI_PRODUCT 16     /* product ID length */
-#define        DKD_SCSI_REVLEVEL 4     /* revision level length */
-#define        DKD_SCSI_SERIAL 12      /* serial number length */
-
-/*
- * The argument type for DKIOC_GETDISKID ioctl.
- */
-typedef struct dk_disk_id {
-       uint_t  dkd_dtype;
-       union {
-               struct {
-                       char dkd_amodel[DKD_ATA_MODEL];         /* 40 bytes */
-                       char dkd_afwver[DKD_ATA_FWVER];         /* 8 bytes */
-                       char dkd_aserial[DKD_ATA_SERIAL];       /* 20 bytes */
-               } ata_disk_id;
-               struct {
-                       char dkd_svendor[DKD_SCSI_VENDOR];      /* 8 bytes */
-                       char dkd_sproduct[DKD_SCSI_PRODUCT];    /* 16 bytes */
-                       char dkd_sfwver[DKD_SCSI_REVLEVEL];     /* 4 bytes */
-                       char dkd_sserial[DKD_SCSI_SERIAL];      /* 12 bytes */
-               } scsi_disk_id;
-       } disk_id;
-} dk_disk_id_t;
-
-/*
- * The ioctl is used to update the firmware of device.
- */
-#define        DKIOC_UPDATEFW          (DKIOC|47)
-
-/* The argument type for DKIOC_UPDATEFW ioctl */
-typedef struct dk_updatefw {
-       caddr_t         dku_ptrbuf;     /* pointer to firmware buf */
-       uint_t          dku_size;       /* firmware buf length */
-       uint8_t         dku_type;       /* firmware update type */
-} dk_updatefw_t;
-
-#ifdef _SYSCALL32
-typedef struct dk_updatefw_32 {
-       caddr32_t       dku_ptrbuf;     /* pointer to firmware buf */
-       uint_t          dku_size;       /* firmware buf length */
-       uint8_t         dku_type;       /* firmware update type */
-} dk_updatefw_32_t;
-#endif /* _SYSCALL32 */
-
-/*
- * firmware update type - temporary or permanent use
- */
-#define        FW_TYPE_TEMP    0x0             /* temporary use */
-#define        FW_TYPE_PERM    0x1             /* permanent use */
-
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_DKIO_H */
diff --git a/zfs/lib/libspl/include/sys/dklabel.h b/zfs/lib/libspl/include/sys/dklabel.h
deleted file mode 100644 (file)
index 8772e4a..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 1990-2002 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_DKLABEL_H
-#define        _SYS_DKLABEL_H
-
-
-
-#include <sys/isa_defs.h>
-#include <sys/types32.h>
-#include <sys/isa_defs.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Miscellaneous defines
- */
-#define        DKL_MAGIC       0xDABE          /* magic number */
-#define        FKL_MAGIC       0xff            /* magic number for DOS floppies */
-
-#if defined(_SUNOS_VTOC_16)
-#define        NDKMAP          16              /* # of logical partitions */
-#define        DK_LABEL_LOC    1               /* location of disk label */
-#elif defined(_SUNOS_VTOC_8)
-#define        NDKMAP          8               /* # of logical partitions */
-#define        DK_LABEL_LOC    0               /* location of disk label */
-#else
-#error "No VTOC format defined."
-#endif
-
-#define        LEN_DKL_ASCII   128             /* length of dkl_asciilabel */
-#define        LEN_DKL_VVOL    8               /* length of v_volume */
-#define        DK_LABEL_SIZE   512             /* size of disk label */
-#define        DK_MAX_BLOCKS   0x7fffffff      /* max # of blocks handled */
-
-/*
- * Reserve two cylinders on SCSI disks.
- * One is for the backup disk label and the other is for the deviceid.
- *
- * IPI disks only reserve one cylinder, but they will go away soon.
- * CDROMs do not reserve any cylinders.
- */
-#define        DK_ACYL         2
-
-/*
- * Format of a Sun disk label.
- * Resides in cylinder 0, head 0, sector 0.
- *
- * sizeof (struct dk_label) should be 512 (the current sector size),
- * but should the sector size increase, this structure should remain
- * at the beginning of the sector.
- */
-
-/*
- * partition headers:  section 1
- * Returned in struct dk_allmap by ioctl DKIOC[SG]APART (dkio(7I))
- */
-struct dk_map {
-       uint64_t        dkl_cylno;      /* starting cylinder */
-       uint64_t        dkl_nblk;       /* number of blocks;  if == 0, */
-                                       /* partition is undefined */
-};
-
-/*
- * partition headers:  section 1
- * Fixed size for on-disk dk_label
- */
-struct dk_map32 {
-       daddr32_t       dkl_cylno;      /* starting cylinder */
-       daddr32_t       dkl_nblk;       /* number of blocks;  if == 0, */
-                                       /* partition is undefined */
-};
-
-/*
- * partition headers:  section 2,
- * brought over from AT&T SVr4 vtoc structure.
- */
-struct dk_map2 {
-       uint16_t        p_tag;          /* ID tag of partition */
-       uint16_t        p_flag;         /* permission flag */
-};
-
-struct dkl_partition    {
-       uint16_t        p_tag;          /* ID tag of partition */
-       uint16_t        p_flag;         /* permision flags */
-       daddr32_t       p_start;        /* start sector no of partition */
-       int32_t         p_size;         /* # of blocks in partition */
-};
-
-
-/*
- * VTOC inclusions from AT&T SVr4
- * Fixed sized types for on-disk VTOC
- */
-
-struct dk_vtoc {
-#if defined(_SUNOS_VTOC_16)
-       uint32_t v_bootinfo[3];         /* info for mboot (unsupported) */
-       uint32_t v_sanity;              /* to verify vtoc sanity */
-       uint32_t v_version;             /* layout version */
-       char    v_volume[LEN_DKL_VVOL]; /* volume name */
-       uint16_t v_sectorsz;            /* sector size in bytes */
-       uint16_t v_nparts;              /* number of partitions */
-       uint32_t v_reserved[10];        /* free space */
-       struct dkl_partition v_part[NDKMAP];    /* partition headers */
-       time32_t timestamp[NDKMAP];     /* partition timestamp (unsupported) */
-       char    v_asciilabel[LEN_DKL_ASCII];    /* for compatibility    */
-#elif defined(_SUNOS_VTOC_8)
-       uint32_t        v_version;              /* layout version */
-       char            v_volume[LEN_DKL_VVOL]; /* volume name */
-       uint16_t        v_nparts;               /* number of partitions  */
-       struct dk_map2  v_part[NDKMAP];         /* partition hdrs, sec 2 */
-       uint32_t        v_bootinfo[3];          /* info needed by mboot */
-       uint32_t        v_sanity;               /* to verify vtoc sanity */
-       uint32_t        v_reserved[10];         /* free space */
-       time32_t        v_timestamp[NDKMAP];    /* partition timestamp */
-#else
-#error "No VTOC format defined."
-#endif
-};
-
-/*
- * define the amount of disk label padding needed to make
- * the entire structure occupy 512 bytes.
- */
-#if defined(_SUNOS_VTOC_16)
-#define        LEN_DKL_PAD     (DK_LABEL_SIZE - \
-                           ((sizeof (struct dk_vtoc) + \
-                           (4 * sizeof (uint32_t)) + \
-                           (12 * sizeof (uint16_t)) + \
-                           (2 * (sizeof (uint16_t))))))
-#elif defined(_SUNOS_VTOC_8)
-#define        LEN_DKL_PAD     (DK_LABEL_SIZE \
-                           - ((LEN_DKL_ASCII) + \
-                           (sizeof (struct dk_vtoc)) + \
-                           (sizeof (struct dk_map32)  * NDKMAP) + \
-                           (14 * (sizeof (uint16_t))) + \
-                           (2 * (sizeof (uint16_t)))))
-#else
-#error "No VTOC format defined."
-#endif
-
-
-struct dk_label {
-#if defined(_SUNOS_VTOC_16)
-       struct  dk_vtoc dkl_vtoc;       /* vtoc inclusions from AT&T SVr4 */
-       uint32_t        dkl_pcyl;       /* # of physical cylinders */
-       uint32_t        dkl_ncyl;       /* # of data cylinders */
-       uint16_t        dkl_acyl;       /* # of alternate cylinders */
-       uint16_t        dkl_bcyl;       /* cyl offset (for fixed head area) */
-       uint32_t        dkl_nhead;      /* # of heads */
-       uint32_t        dkl_nsect;      /* # of data sectors per track */
-       uint16_t        dkl_intrlv;     /* interleave factor */
-       uint16_t        dkl_skew;       /* skew factor */
-       uint16_t        dkl_apc;        /* alternates per cyl (SCSI only)   */
-       uint16_t        dkl_rpm;        /* revolutions per minute */
-       uint16_t        dkl_write_reinstruct;   /* # sectors to skip, writes */
-       uint16_t        dkl_read_reinstruct;    /* # sectors to skip, reads  */
-       uint16_t        dkl_extra[4];   /* for compatible expansion */
-       char            dkl_pad[LEN_DKL_PAD];   /* unused part of 512 bytes */
-#elif defined(_SUNOS_VTOC_8)
-       char            dkl_asciilabel[LEN_DKL_ASCII]; /* for compatibility */
-       struct dk_vtoc  dkl_vtoc;       /* vtoc inclusions from AT&T SVr4 */
-       uint16_t        dkl_write_reinstruct;   /* # sectors to skip, writes */
-       uint16_t        dkl_read_reinstruct;    /* # sectors to skip, reads */
-       char            dkl_pad[LEN_DKL_PAD]; /* unused part of 512 bytes */
-       uint16_t        dkl_rpm;        /* rotations per minute */
-       uint16_t        dkl_pcyl;       /* # physical cylinders */
-       uint16_t        dkl_apc;        /* alternates per cylinder */
-       uint16_t        dkl_obs1;       /* obsolete */
-       uint16_t        dkl_obs2;       /* obsolete */
-       uint16_t        dkl_intrlv;     /* interleave factor */
-       uint16_t        dkl_ncyl;       /* # of data cylinders */
-       uint16_t        dkl_acyl;       /* # of alternate cylinders */
-       uint16_t        dkl_nhead;      /* # of heads in this partition */
-       uint16_t        dkl_nsect;      /* # of 512 byte sectors per track */
-       uint16_t        dkl_obs3;       /* obsolete */
-       uint16_t        dkl_obs4;       /* obsolete */
-       struct dk_map32 dkl_map[NDKMAP]; /* logical partition headers */
-#else
-#error "No VTOC format defined."
-#endif
-       uint16_t        dkl_magic;      /* identifies this label format */
-       uint16_t        dkl_cksum;      /* xor checksum of sector */
-};
-
-#if defined(_SUNOS_VTOC_16)
-#define        dkl_asciilabel  dkl_vtoc.v_asciilabel
-#define        v_timestamp     timestamp
-
-#elif defined(_SUNOS_VTOC_8)
-
-/*
- * These defines are for historic compatibility with old drivers.
- */
-#define        dkl_gap1        dkl_obs1        /* used to be gap1 */
-#define        dkl_gap2        dkl_obs2        /* used to be gap2 */
-#define        dkl_bhead       dkl_obs3        /* used to be label head offset */
-#define        dkl_ppart       dkl_obs4        /* used to by physical partition */
-#else
-#error "No VTOC format defined."
-#endif
-
-struct fk_label {                      /* DOS floppy label */
-       uchar_t  fkl_type;
-       uchar_t  fkl_magich;
-       uchar_t  fkl_magicl;
-       uchar_t  filler;
-};
-
-/*
- * Layout of stored fabricated device id  (on-disk)
- */
-#define        DK_DEVID_BLKSIZE        (512)
-#define        DK_DEVID_SIZE           (DK_DEVID_BLKSIZE - ((sizeof (uchar_t) * 7)))
-#define        DK_DEVID_REV_MSB        (0)
-#define        DK_DEVID_REV_LSB        (1)
-
-struct dk_devid {
-       uchar_t dkd_rev_hi;                     /* revision (MSB) */
-       uchar_t dkd_rev_lo;                     /* revision (LSB) */
-       uchar_t dkd_flags;                      /* flags (not used yet) */
-       uchar_t dkd_devid[DK_DEVID_SIZE];       /* devid stored here */
-       uchar_t dkd_checksum3;                  /* checksum (MSB) */
-       uchar_t dkd_checksum2;
-       uchar_t dkd_checksum1;
-       uchar_t dkd_checksum0;                  /* checksum (LSB) */
-};
-
-#define        DKD_GETCHKSUM(dkd)      ((dkd)->dkd_checksum3 << 24) + \
-                               ((dkd)->dkd_checksum2 << 16) + \
-                               ((dkd)->dkd_checksum1 << 8)  + \
-                               ((dkd)->dkd_checksum0)
-
-#define        DKD_FORMCHKSUM(c, dkd)  (dkd)->dkd_checksum3 = hibyte(hiword((c))); \
-                               (dkd)->dkd_checksum2 = lobyte(hiword((c))); \
-                               (dkd)->dkd_checksum1 = hibyte(loword((c))); \
-                               (dkd)->dkd_checksum0 = lobyte(loword((c)));
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_DKLABEL_H */
diff --git a/zfs/lib/libspl/include/sys/dktp/Makefile.am b/zfs/lib/libspl/include/sys/dktp/Makefile.am
deleted file mode 100644 (file)
index 9887675..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-libspldir = $(includedir)/libspl/sys/dktp
-libspl_HEADERS = \
-       $(top_srcdir)/lib/libspl/include/sys/dktp/fdisk.h
-
diff --git a/zfs/lib/libspl/include/sys/dktp/Makefile.in b/zfs/lib/libspl/include/sys/dktp/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/sys/dktp/fdisk.h b/zfs/lib/libspl/include/sys/dktp/fdisk.h
deleted file mode 100644 (file)
index e90135f..0000000
+++ /dev/null
@@ -1,173 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*     Copyright (c) 1984, 1986, 1987, 1988 AT&T       */
-/*       All Rights Reserved   */
-
-
-#ifndef _SYS_DKTP_FDISK_H
-#define        _SYS_DKTP_FDISK_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * fdisk.h
- * This file defines the structure of physical disk sector 0 for use on
- * AT386 systems.  The format of this sector is constrained by the ROM
- * BIOS and MS-DOS conventions.
- * Note that this block does not define the partitions used by the unix
- * driver.  The unix partitions are obtained from the VTOC.
- */
-
-/*
- * the MAX values are the maximum usable values for BIOS chs values
- * The MAX_CYL value of 1022 is the maximum usable value
- *   the value of 1023 is a fence value,
- *   indicating no CHS geometry exists for the corresponding LBA value.
- * HEAD range [ 0 .. MAX_HEAD ], so number of heads is (MAX_HEAD + 1)
- * SECT range [ 1 .. MAX_SECT ], so number of sectors is (MAX_SECT)
- */
-#define        MAX_SECT        (63)
-#define        MAX_CYL         (1022)
-#define        MAX_HEAD        (254)
-
-/*
- * BOOTSZ was reduced from 446 to 440 bytes to NOT overwrite the Windows
- * Vista DISKID. Otherwise Vista won't boot from Solaris GRUB in a dual-boot
- * setup.
- * The actual size of mboot code is 425 bytes while that of GRUB stage1 is
- * 423 bytes. So this changes does not harm them.
- */
-#define        BOOTSZ          440     /* size of boot code in master boot block */
-#define        FD_NUMPART      4       /* number of 'partitions' in fdisk table */
-#define        MBB_MAGIC       0xAA55  /* magic number for mboot.signature */
-#define        DEFAULT_INTLV   4       /* default interleave for testing tracks */
-#define        MINPSIZE        4       /* minimum number of cylinders in a partition */
-#define        TSTPAT          0xE5    /* test pattern for verifying disk */
-
-/*
- * structure to hold the fdisk partition table
- */
-struct ipart {
-       unsigned char bootid;   /* bootable or not */
-       unsigned char beghead;  /* beginning head, sector, cylinder */
-       unsigned char begsect;  /* begcyl is a 10-bit number. High 2 bits */
-       unsigned char begcyl;   /*      are in begsect. */
-       unsigned char systid;   /* OS type */
-       unsigned char endhead;  /* ending head, sector, cylinder */
-       unsigned char endsect;  /* endcyl is a 10-bit number.  High 2 bits */
-       unsigned char endcyl;   /*      are in endsect. */
-       uint32_t relsect;       /* first sector relative to start of disk */
-       uint32_t numsect;       /* number of sectors in partition */
-};
-/*
- * Values for bootid.
- */
-#define        NOTACTIVE       0
-#define        ACTIVE          128
-/*
- * Values for systid.
- */
-#define        UNUSED          0       /* Empty Partition */
-#define        DOSOS12         1       /* DOS partition, 12-bit FAT */
-#define        PCIXOS          2       /* PC/IX partition */
-#define        DOSOS16         4       /* DOS partition, 16-bit FAT */
-#define        EXTDOS          5       /* EXT-DOS partition */
-#define        DOSHUGE         6       /* Huge DOS partition  > 32MB */
-#define        FDISK_IFS       7       /* Installable File System (IFS): HPFS & NTFS */
-#define        FDISK_AIXBOOT   8       /* AIX Boot */
-#define        FDISK_AIXDATA   9       /* AIX Data */
-#define        FDISK_OS2BOOT   10      /* OS/2 Boot Manager */
-#define        FDISK_WINDOWS   11      /* Windows 95 FAT32 (up to 2047GB) */
-#define        FDISK_EXT_WIN   12      /* Windows 95 FAT32 (extended-INT13) */
-#define        FDISK_FAT95     14      /* DOS 16-bit FAT, LBA-mapped */
-#define        FDISK_EXTLBA    15      /* Extended partition, LBA-mapped */
-#define        DIAGPART        18      /* Diagnostic boot partition (OS independent) */
-#define        FDISK_LINUX     65      /* Linux */
-#define        FDISK_LINUXDSWAP        66      /* Linux swap (sharing disk w/ DRDOS) */
-#define        FDISK_LINUXDNAT 67      /* Linux native (sharing disk with DRDOS) */
-#define        FDISK_CPM       82      /* CP/M */
-#define        DOSDATA         86      /* DOS data partition */
-#define        OTHEROS         98      /* part. type for appl. (DB?) needs */
-                               /* raw partition.  ID was 0 but conflicted */
-                               /* with DOS 3.3 fdisk    */
-#define        UNIXOS          99      /* UNIX V.x partition */
-#define        FDISK_NOVELL2   100     /* Novell Netware 286 */
-#define        FDISK_NOVELL3   101     /* Novell Netware 3.x and later */
-#define        FDISK_QNX4      119     /* QNX 4.x */
-#define        FDISK_QNX42     120     /* QNX 4.x 2nd part */
-#define        FDISK_QNX43     121     /* QNX 4.x 3rd part */
-#define        SUNIXOS         130     /* Solaris UNIX partition */
-#define        FDISK_LINUXNAT  131     /* Linux native */
-#define        FDISK_NTFSVOL1  134     /* NTFS volume set 1 */
-#define        FDISK_NTFSVOL2  135     /* NTFS volume set 2 */
-#define        FDISK_BSD       165     /* BSD/386, 386BSD, NetBSD, FreeBSD, OpenBSD */
-#define        FDISK_NEXTSTEP  167     /* NeXTSTEP */
-#define        FDISK_BSDIFS    183     /* BSDI file system */
-#define        FDISK_BSDISWAP  184     /* BSDI swap */
-#define        X86BOOT         190     /* x86 Solaris boot partition */
-#define        SUNIXOS2        191     /* Solaris UNIX partition */
-#define        EFI_PMBR        238     /* EFI PMBR */
-#define        EFI_FS          239     /* EFI File System (System Partition) */
-#define        MAXDOS          65535L  /* max size (sectors) for DOS partition */
-
-/*
- * structure to hold master boot block in physical sector 0 of the disk.
- * Note that partitions stuff can't be directly included in the structure
- * because of lameo '386 compiler alignment design.
- * Alignment issues also force us to have 2 16bit entities for a single
- * 32bit win_volserno. It is not used anywhere anyway.
- */
-
-struct mboot { /* master boot block */
-       char    bootinst[BOOTSZ];
-       uint16_t win_volserno_lo;
-       uint16_t win_volserno_hi;
-       uint16_t reserved;
-       char    parts[FD_NUMPART * sizeof (struct ipart)];
-       ushort_t signature;
-};
-
-#if defined(__i386) || defined(__amd64)
-
-/* Byte offset of the start of the partition table within the sector */
-#define        FDISK_PART_TABLE_START  446
-
-/* Maximum number of valid partitions assumed as 32 */
-#define        MAX_EXT_PARTS   32
-
-#else
-
-#define        MAX_EXT_PARTS   0
-
-#endif /* if defined(__i386) || defined(__amd64) */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_DKTP_FDISK_H */
diff --git a/zfs/lib/libspl/include/sys/feature_tests.h b/zfs/lib/libspl/include/sys/feature_tests.h
deleted file mode 100644 (file)
index 1a68b75..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_FEATURE_TESTS_H
-#define        _SYS_FEATURE_TESTS_H
-
-#define        __NORETURN      __attribute__((__noreturn__))
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/file.h b/zfs/lib/libspl/include/sys/file.h
deleted file mode 100644 (file)
index 163a4dc..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_FILE_H
-#define        _LIBSPL_SYS_FILE_H
-
-#include_next <sys/file.h>
-
-#include <sys/user.h>
-
-#define        FREAD   1
-#define        FWRITE  2
-// #define FAPPEND  8
-
-#define        FCREAT  O_CREAT
-#define        FTRUNC  O_TRUNC
-#define        FOFFMAX O_LARGEFILE
-#define        FSYNC   O_SYNC
-#define        FDSYNC  O_DSYNC
-#define        FRSYNC  O_RSYNC
-#define        FEXCL   O_EXCL
-
-#define        FNODSYNC        0x10000 /* fsync pseudo flag */
-#define        FNOFOLLOW       0x20000 /* don't follow symlinks */
-#define        FIGNORECASE     0x80000 /* request case-insensitive lookups */
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/frame.h b/zfs/lib/libspl/include/sys/frame.h
deleted file mode 100644 (file)
index a4c7d8b..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_FRAME_H
-#define        _SYS_FRAME_H
-
-#include <sys/types.h>
-
-#if defined(_LP64) || defined(_I32LPx)
-typedef long   greg_t;
-#else
-typedef int    greg_t;
-#endif
-
-struct frame {
-       greg_t fr_savfp;  /* saved frame pointer */
-       greg_t fr_savpc;  /* saved program counter */
-};
-
-
-/*
- * In the x86 world, a stack frame looks like this:
- *
- *             |--------------------------|
- * 4n+8(%ebp) ->| argument word n         |
- *             | ...                      |    (Previous frame)
- *    8(%ebp) ->| argument word 0         |
- *             |--------------------------|--------------------
- *    4(%ebp) ->| return address          |
- *             |--------------------------|
- *    0(%ebp) ->| previous %ebp (optional) |
- *             |--------------------------|
- *   -4(%ebp) ->| unspecified             |    (Current frame)
- *             | ...                      |
- *    0(%esp) ->| variable size                   |
- *             |--------------------------|
- */
-
-/*
- * Stack alignment macros.
- */
-
-#define        STACK_ALIGN32           4
-#define        STACK_ENTRY_ALIGN32     4
-#define        STACK_BIAS32            0
-#define        SA32(x)                 (((x)+(STACK_ALIGN32-1)) & ~(STACK_ALIGN32-1))
-#define        STACK_RESERVE32         0
-#define        MINFRAME32              0
-
-#if defined(__amd64)
-
-/*
- * In the amd64 world, a stack frame looks like this:
- *
- *             |--------------------------|
- * 8n+16(%rbp)->| argument word n         |
- *             | ...                      |    (Previous frame)
- *   16(%rbp) ->| argument word 0         |
- *             |--------------------------|--------------------
- *    8(%rbp) ->| return address          |
- *             |--------------------------|
- *    0(%rbp) ->| previous %rbp            |
- *             |--------------------------|
- *   -8(%rbp) ->| unspecified             |    (Current frame)
- *             | ...                      |
- *    0(%rsp) ->| variable size                   |
- *             |--------------------------|
- * -128(%rsp) ->| reserved for function           |
- *             |--------------------------|
- *
- * The end of the input argument area must be aligned on a 16-byte
- * boundary; i.e. (%rsp - 8) % 16 == 0 at function entry.
- *
- * The 128-byte location beyond %rsp is considered to be reserved for
- * functions and is NOT modified by signal handlers.  It can be used
- * to store temporary data that is not needed across function calls.
- */
-
-/*
- * Stack alignment macros.
- */
-
-#define        STACK_ALIGN64           16
-#define        STACK_ENTRY_ALIGN64     8
-#define        STACK_BIAS64            0
-#define        SA64(x)                 (((x)+(STACK_ALIGN64-1)) & ~(STACK_ALIGN64-1))
-#define        STACK_RESERVE64         128
-#define        MINFRAME64              0
-
-#define        STACK_ALIGN             STACK_ALIGN64
-#define        STACK_ENTRY_ALIGN       STACK_ENTRY_ALIGN64
-#define        STACK_BIAS              STACK_BIAS64
-#define        SA(x)                   SA64(x)
-#define        STACK_RESERVE           STACK_RESERVE64
-#define        MINFRAME                MINFRAME64
-
-#elif defined(__i386)
-
-#define        STACK_ALIGN             STACK_ALIGN32
-#define        STACK_ENTRY_ALIGN       STACK_ENTRY_ALIGN32
-#define        STACK_BIAS              STACK_BIAS32
-#define        SA(x)                   SA32(x)
-#define        STACK_RESERVE           STACK_RESERVE32
-#define        MINFRAME                MINFRAME32
-
-#endif /* __i386 */
-
-#endif /* _SYS_FRAME_H */
diff --git a/zfs/lib/libspl/include/sys/int_limits.h b/zfs/lib/libspl/include/sys/int_limits.h
deleted file mode 100644 (file)
index 7af68cd..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_INT_LIMITS_H
-#define        _LIBSPL_SYS_INT_LIMITS_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/int_types.h b/zfs/lib/libspl/include/sys/int_types.h
deleted file mode 100644 (file)
index 51e9e02..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SOL_SYS_INT_TYPES_H
-#define        _SOL_SYS_INT_TYPES_H
-
-#include <inttypes.h>
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/inttypes.h b/zfs/lib/libspl/include/sys/inttypes.h
deleted file mode 100644 (file)
index d7d0639..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SOL_SYS_INTTYPES_H
-#define        _SOL_SYS_INTTYPES_H
-
-#include <inttypes.h>
-
-#define        _INT64_TYPE
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/isa_defs.h b/zfs/lib/libspl/include/sys/isa_defs.h
deleted file mode 100644 (file)
index ae1a352..0000000
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef        _SYS_ISA_DEFS_H
-#define        _SYS_ISA_DEFS_H
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-/* x86_64 arch specific defines */
-#if defined(__x86_64) || defined(__x86_64__)
-
-#if !defined(__x86_64)
-#define        __x86_64
-#endif
-
-#if !defined(__amd64)
-#define        __amd64
-#endif
-
-#if !defined(__x86)
-#define        __x86
-#endif
-
-#if !defined(_LP64)
-#define        _LP64
-#endif
-
-#if !defined(_LITTLE_ENDIAN)
-#define        _LITTLE_ENDIAN
-#endif
-
-#define        _SUNOS_VTOC_16
-
-/* i386 arch specific defines */
-#elif defined(__i386) || defined(__i386__)
-
-#if !defined(__i386)
-#define        __i386
-#endif
-
-#if !defined(__x86)
-#define        __x86
-#endif
-
-#if !defined(_ILP32)
-#define        _ILP32
-#endif
-
-#if !defined(_LITTLE_ENDIAN)
-#define        _LITTLE_ENDIAN
-#endif
-
-#define        _SUNOS_VTOC_16
-
-/* powerpc arch specific defines */
-#elif defined(__powerpc) || defined(__powerpc__)
-
-#if !defined(__powerpc)
-#define        __powerpc
-#endif
-
-#if !defined(__powerpc__)
-#define        __powerpc__
-#endif
-
-#if !defined(_LP64)
-#ifdef __powerpc64__
-#define        _LP64
-#else
-#define        _LP32
-#endif
-#endif
-
-#if !defined(_BIG_ENDIAN)
-#define        _BIG_ENDIAN
-#endif
-
-#define        _SUNOS_VTOC_16
-
-/* arm arch specific defines */
-#elif defined(__arm) || defined(__arm__) || defined(__aarch64__)
-
-#if !defined(__arm)
-#define        __arm
-#endif
-
-#if !defined(__arm__)
-#define        __arm__
-#endif
-
-#if defined(__ARMEL__) || defined(__AARCH64EL__)
-#define        _LITTLE_ENDIAN
-#else
-#define        _BIG_ENDIAN
-#endif
-
-#define        _SUNOS_VTOC_16
-
-/* sparc arch specific defines */
-#elif defined(__sparc) || defined(__sparc__)
-
-#if !defined(__sparc)
-#define        __sparc
-#endif
-
-#if !defined(__sparc__)
-#define        __sparc__
-#endif
-
-#define        _BIG_ENDIAN
-#define        _SUNOS_VTOC_16
-
-/* sparc64 arch specific defines */
-#elif defined(__sparc64) || defined(__sparc64__)
-
-#if !defined(__sparc64)
-#define        __sparc64
-#endif
-
-#if !defined(__sparc64__)
-#define        __sparc64__
-#endif
-
-#define        _BIG_ENDIAN
-#define        _SUNOS_VTOC_16
-
-#else /* Currently x86_64, i386, arm, powerpc, and sparc are supported */
-#error "Unsupported ISA type"
-#endif
-
-#if defined(_ILP32) && defined(_LP64)
-#error "Both _ILP32 and _LP64 are defined"
-#endif
-
-#if defined(_LITTLE_ENDIAN) && defined(_BIG_ENDIAN)
-#error "Both _LITTLE_ENDIAN and _BIG_ENDIAN are defined"
-#endif
-
-#if !defined(_LITTLE_ENDIAN) && !defined(_BIG_ENDIAN)
-#error "Neither _LITTLE_ENDIAN nor _BIG_ENDIAN are defined"
-#endif
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif /* _SYS_ISA_DEFS_H */
diff --git a/zfs/lib/libspl/include/sys/kmem.h b/zfs/lib/libspl/include/sys/kmem.h
deleted file mode 100644 (file)
index 83d4756..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_KMEM_H
-#define        _SYS_KMEM_H
-
-#include <stdlib.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define        KM_SLEEP        0x00000000      /* same as KM_SLEEP */
-#define        KM_NOSLEEP      0x00000001      /* same as KM_NOSLEEP */
-
-#define        kmem_alloc(size, flags)         malloc(size)
-#define        kmem_free(ptr, size)            free(ptr)
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_KMEM_H */
diff --git a/zfs/lib/libspl/include/sys/kstat.h b/zfs/lib/libspl/include/sys/kstat.h
deleted file mode 100644 (file)
index fcd3ed9..0000000
+++ /dev/null
@@ -1,820 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef        _SYS_KSTAT_H
-#define        _SYS_KSTAT_H
-
-
-
-/*
- * Definition of general kernel statistics structures and /dev/kstat ioctls
- */
-
-#include <sys/types.h>
-#include <sys/time.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef int    kid_t;          /* unique kstat id */
-
-/*
- * Kernel statistics driver (/dev/kstat) ioctls
- */
-
-#define        KSTAT_IOC_BASE          ('K' << 8)
-
-#define        KSTAT_IOC_CHAIN_ID      KSTAT_IOC_BASE | 0x01
-#define        KSTAT_IOC_READ          KSTAT_IOC_BASE | 0x02
-#define        KSTAT_IOC_WRITE         KSTAT_IOC_BASE | 0x03
-
-/*
- * /dev/kstat ioctl usage (kd denotes /dev/kstat descriptor):
- *
- *     kcid = ioctl(kd, KSTAT_IOC_CHAIN_ID, NULL);
- *     kcid = ioctl(kd, KSTAT_IOC_READ, kstat_t *);
- *     kcid = ioctl(kd, KSTAT_IOC_WRITE, kstat_t *);
- */
-
-#define        KSTAT_STRLEN    31      /* 30 chars + NULL; must be 16 * n - 1 */
-
-/*
- * The generic kstat header
- */
-
-typedef struct kstat {
-       /*
-        * Fields relevant to both kernel and user
-        */
-       hrtime_t        ks_crtime;      /* creation time (from gethrtime()) */
-       struct kstat    *ks_next;       /* kstat chain linkage */
-       kid_t           ks_kid;         /* unique kstat ID */
-       char            ks_module[KSTAT_STRLEN]; /* provider module name */
-       uchar_t         ks_resv;        /* reserved, currently just padding */
-       int             ks_instance;    /* provider module's instance */
-       char            ks_name[KSTAT_STRLEN]; /* kstat name */
-       uchar_t         ks_type;        /* kstat data type */
-       char            ks_class[KSTAT_STRLEN]; /* kstat class */
-       uchar_t         ks_flags;       /* kstat flags */
-       void            *ks_data;       /* kstat type-specific data */
-       uint_t          ks_ndata;       /* # of type-specific data records */
-       size_t          ks_data_size;   /* total size of kstat data section */
-       hrtime_t        ks_snaptime;    /* time of last data shapshot */
-       /*
-        * Fields relevant to kernel only
-        */
-       int             (*ks_update)(struct kstat *, int); /* dynamic update */
-       void            *ks_private;    /* arbitrary provider-private data */
-       int             (*ks_snapshot)(struct kstat *, void *, int);
-       void            *ks_lock;       /* protects this kstat's data */
-} kstat_t;
-
-#ifdef _SYSCALL32
-
-typedef int32_t kid32_t;
-
-typedef struct kstat32 {
-       /*
-        * Fields relevant to both kernel and user
-        */
-       hrtime_t        ks_crtime;
-       caddr32_t       ks_next;                /* struct kstat pointer */
-       kid32_t         ks_kid;
-       char            ks_module[KSTAT_STRLEN];
-       uint8_t         ks_resv;
-       int32_t         ks_instance;
-       char            ks_name[KSTAT_STRLEN];
-       uint8_t         ks_type;
-       char            ks_class[KSTAT_STRLEN];
-       uint8_t         ks_flags;
-       caddr32_t       ks_data;                /* type-specific data */
-       uint32_t        ks_ndata;
-       size32_t        ks_data_size;
-       hrtime_t        ks_snaptime;
-       /*
-        * Fields relevant to kernel only (only needed here for padding)
-        */
-       int32_t         _ks_update;
-       caddr32_t       _ks_private;
-       int32_t         _ks_snapshot;
-       caddr32_t       _ks_lock;
-} kstat32_t;
-
-#endif /* _SYSCALL32 */
-
-/*
- * kstat structure and locking strategy
- *
- * Each kstat consists of a header section (a kstat_t) and a data section.
- * The system maintains a set of kstats, protected by kstat_chain_lock.
- * kstat_chain_lock protects all additions to/deletions from this set,
- * as well as all changes to kstat headers.  kstat data sections are
- * *optionally* protected by the per-kstat ks_lock.  If ks_lock is non-NULL,
- * kstat clients (e.g. /dev/kstat) will acquire this lock for all of their
- * operations on that kstat.  It is up to the kstat provider to decide whether
- * guaranteeing consistent data to kstat clients is sufficiently important
- * to justify the locking cost.  Note, however, that most statistic updates
- * already occur under one of the provider's mutexes, so if the provider sets
- * ks_lock to point to that mutex, then kstat data locking is free.
- *
- * NOTE: variable-size kstats MUST employ kstat data locking, to prevent
- * data-size races with kstat clients.
- *
- * NOTE: ks_lock is really of type (kmutex_t *); it is declared as (void *)
- * in the kstat header so that users don't have to be exposed to all of the
- * kernel's lock-related data structures.
- */
-
-#if    defined(_KERNEL)
-
-#define        KSTAT_ENTER(k)  \
-       { kmutex_t *lp = (k)->ks_lock; if (lp) mutex_enter(lp); }
-
-#define        KSTAT_EXIT(k)   \
-       { kmutex_t *lp = (k)->ks_lock; if (lp) mutex_exit(lp); }
-
-#define        KSTAT_UPDATE(k, rw)             (*(k)->ks_update)((k), (rw))
-
-#define        KSTAT_SNAPSHOT(k, buf, rw)      (*(k)->ks_snapshot)((k), (buf), (rw))
-
-#endif /* defined(_KERNEL) */
-
-/*
- * kstat time
- *
- * All times associated with kstats (e.g. creation time, snapshot time,
- * kstat_timer_t and kstat_io_t timestamps, etc.) are 64-bit nanosecond values,
- * as returned by gethrtime().  The accuracy of these timestamps is machine
- * dependent, but the precision (units) is the same across all platforms.
- */
-
-/*
- * kstat identity (KID)
- *
- * Each kstat is assigned a unique KID (kstat ID) when it is added to the
- * global kstat chain.  The KID is used as a cookie by /dev/kstat to
- * request information about the corresponding kstat.  There is also
- * an identity associated with the entire kstat chain, kstat_chain_id,
- * which is bumped each time a kstat is added or deleted.  /dev/kstat uses
- * the chain ID to detect changes in the kstat chain (e.g., a new disk
- * coming online) between ioctl()s.
- */
-
-/*
- * kstat module, kstat instance
- *
- * ks_module and ks_instance contain the name and instance of the module
- * that created the kstat.  In cases where there can only be one instance,
- * ks_instance is 0.  The kernel proper (/kernel/unix) uses "unix" as its
- * module name.
- */
-
-/*
- * kstat name
- *
- * ks_name gives a meaningful name to a kstat.  The full kstat namespace
- * is module.instance.name, so the name only need be unique within a
- * module.  kstat_create() will fail if you try to create a kstat with
- * an already-used (ks_module, ks_instance, ks_name) triplet.  Spaces are
- * allowed in kstat names, but strongly discouraged, since they hinder
- * awk-style processing at user level.
- */
-
-/*
- * kstat type
- *
- * The kstat mechanism provides several flavors of kstat data, defined
- * below.  The "raw" kstat type is just treated as an array of bytes; you
- * can use this to export any kind of data you want.
- *
- * Some kstat types allow multiple data structures per kstat, e.g.
- * KSTAT_TYPE_NAMED; others do not.  This is part of the spec for each
- * kstat data type.
- *
- * User-level tools should *not* rely on the #define KSTAT_NUM_TYPES.  To
- * get this information, read out the standard system kstat "kstat_types".
- */
-
-#define        KSTAT_TYPE_RAW          0       /* can be anything */
-                                       /* ks_ndata >= 1 */
-#define        KSTAT_TYPE_NAMED        1       /* name/value pair */
-                                       /* ks_ndata >= 1 */
-#define        KSTAT_TYPE_INTR         2       /* interrupt statistics */
-                                       /* ks_ndata == 1 */
-#define        KSTAT_TYPE_IO           3       /* I/O statistics */
-                                       /* ks_ndata == 1 */
-#define        KSTAT_TYPE_TIMER        4       /* event timer */
-                                       /* ks_ndata >= 1 */
-
-#define        KSTAT_NUM_TYPES         5
-
-/*
- * kstat class
- *
- * Each kstat can be characterized as belonging to some broad class
- * of statistics, e.g. disk, tape, net, vm, streams, etc.  This field
- * can be used as a filter to extract related kstats.  The following
- * values are currently in use: disk, tape, net, controller, vm, kvm,
- * hat, streams, kstat, and misc.  (The kstat class encompasses things
- * like kstat_types.)
- */
-
-/*
- * kstat flags
- *
- * Any of the following flags may be passed to kstat_create().  They are
- * all zero by default.
- *
- *     KSTAT_FLAG_VIRTUAL:
- *
- *             Tells kstat_create() not to allocate memory for the
- *             kstat data section; instead, you will set the ks_data
- *             field to point to the data you wish to export.  This
- *             provides a convenient way to export existing data
- *             structures.
- *
- *     KSTAT_FLAG_VAR_SIZE:
- *
- *             The size of the kstat you are creating will vary over time.
- *             For example, you may want to use the kstat mechanism to
- *             export a linked list.  NOTE: The kstat framework does not
- *             manage the data section, so all variable-size kstats must be
- *             virtual kstats.  Moreover, variable-size kstats MUST employ
- *             kstat data locking to prevent data-size races with kstat
- *             clients.  See the section on "kstat snapshot" for details.
- *
- *     KSTAT_FLAG_WRITABLE:
- *
- *             Makes the kstat's data section writable by root.
- *             The ks_snapshot routine (see below) does not need to check for
- *             this; permission checking is handled in the kstat driver.
- *
- *     KSTAT_FLAG_PERSISTENT:
- *
- *             Indicates that this kstat is to be persistent over time.
- *             For persistent kstats, kstat_delete() simply marks the
- *             kstat as dormant; a subsequent kstat_create() reactivates
- *             the kstat.  This feature is provided so that statistics
- *             are not lost across driver close/open (e.g., raw disk I/O
- *             on a disk with no mounted partitions.)
- *             NOTE: Persistent kstats cannot be virtual, since ks_data
- *             points to garbage as soon as the driver goes away.
- *
- * The following flags are maintained by the kstat framework:
- *
- *     KSTAT_FLAG_DORMANT:
- *
- *             For persistent kstats, indicates that the kstat is in the
- *             dormant state (e.g., the corresponding device is closed).
- *
- *     KSTAT_FLAG_INVALID:
- *
- *             This flag is set when a kstat is in a transitional state,
- *             e.g. between kstat_create() and kstat_install().
- *             kstat clients must not attempt to access the kstat's data
- *             if this flag is set.
- */
-
-#define        KSTAT_FLAG_VIRTUAL              0x01
-#define        KSTAT_FLAG_VAR_SIZE             0x02
-#define        KSTAT_FLAG_WRITABLE             0x04
-#define        KSTAT_FLAG_PERSISTENT           0x08
-#define        KSTAT_FLAG_DORMANT              0x10
-#define        KSTAT_FLAG_INVALID              0x20
-
-/*
- * Dynamic update support
- *
- * The kstat mechanism allows for an optional ks_update function to update
- * kstat data.  This is useful for drivers where the underlying device
- * keeps cheap hardware stats, but extraction is expensive.  Instead of
- * constantly keeping the kstat data section up to date, you can supply a
- * ks_update function which updates the kstat's data section on demand.
- * To take advantage of this feature, simply set the ks_update field before
- * calling kstat_install().
- *
- * The ks_update function, if supplied, must have the following structure:
- *
- *     int
- *     foo_kstat_update(kstat_t *ksp, int rw)
- *     {
- *             if (rw == KSTAT_WRITE) {
- *                     ... update the native stats from ksp->ks_data;
- *                             return EACCES if you don't support this
- *             } else {
- *                     ... update ksp->ks_data from the native stats
- *             }
- *     }
- *
- * The ks_update return codes are: 0 for success, EACCES if you don't allow
- * KSTAT_WRITE, and EIO for any other type of error.
- *
- * In general, the ks_update function may need to refer to provider-private
- * data; for example, it may need a pointer to the provider's raw statistics.
- * The ks_private field is available for this purpose.  Its use is entirely
- * at the provider's discretion.
- *
- * All variable-size kstats MUST supply a ks_update routine, which computes
- * and sets ks_data_size (and ks_ndata if that is meaningful), since these
- * are needed to perform kstat snapshots (see below).
- *
- * No kstat locking should be done inside the ks_update routine.  The caller
- * will already be holding the kstat's ks_lock (to ensure consistent data).
- */
-
-#define        KSTAT_READ      0
-#define        KSTAT_WRITE     1
-
-/*
- * Kstat snapshot
- *
- * In order to get a consistent view of a kstat's data, clients must obey
- * the kstat's locking strategy.  However, these clients may need to perform
- * operations on the data which could cause a fault (e.g. copyout()), or
- * operations which are simply expensive.  Doing so could cause deadlock
- * (e.g. if you're holding a disk's kstat lock which is ultimately required
- * to resolve a copyout() fault), performance degradation (since the providers'
- * activity is serialized at the kstat lock), device timing problems, etc.
- *
- * To avoid these problems, kstat data is provided via snapshots.  Taking
- * a snapshot is a simple process: allocate a wired-down kernel buffer,
- * acquire the kstat's data lock, copy the data into the buffer ("take the
- * snapshot"), and release the lock.  This ensures that the kstat's data lock
- * will be held as briefly as possible, and that no faults will occur while
- * the lock is held.
- *
- * Normally, the snapshot is taken by default_kstat_snapshot(), which
- * timestamps the data (sets ks_snaptime), copies it, and does a little
- * massaging to deal with incomplete transactions on i/o kstats.  However,
- * this routine only works for kstats with contiguous data (the typical case).
- * If you create a kstat whose data is, say, a linked list, you must provide
- * your own ks_snapshot routine.  The routine you supply must have the
- * following prototype (replace "foo" with something appropriate):
- *
- *     int foo_kstat_snapshot(kstat_t *ksp, void *buf, int rw);
- *
- * The minimal snapshot routine -- one which copies contiguous data that
- * doesn't need any massaging -- would be this:
- *
- *     ksp->ks_snaptime = gethrtime();
- *     if (rw == KSTAT_WRITE)
- *             bcopy(buf, ksp->ks_data, ksp->ks_data_size);
- *     else
- *             bcopy(ksp->ks_data, buf, ksp->ks_data_size);
- *     return (0);
- *
- * A more illuminating example is taking a snapshot of a linked list:
- *
- *     ksp->ks_snaptime = gethrtime();
- *     if (rw == KSTAT_WRITE)
- *             return (EACCES);                ... See below ...
- *     for (foo = first_foo; foo; foo = foo->next) {
- *             bcopy((char *) foo, (char *) buf, sizeof (struct foo));
- *             buf = ((struct foo *) buf) + 1;
- *     }
- *     return (0);
- *
- * In the example above, we have decided that we don't want to allow
- * KSTAT_WRITE access, so we return EACCES if this is attempted.
- *
- * The key points are:
- *
- *     (1) ks_snaptime must be set (via gethrtime()) to timestamp the data.
- *     (2) Data gets copied from the kstat to the buffer on KSTAT_READ,
- *             and from the buffer to the kstat on KSTAT_WRITE.
- *     (3) ks_snapshot return values are: 0 for success, EACCES if you
- *             don't allow KSTAT_WRITE, and EIO for any other type of error.
- *
- * Named kstats (see section on "Named statistics" below) containing long
- * strings (KSTAT_DATA_STRING) need special handling.  The kstat driver
- * assumes that all strings are copied into the buffer after the array of
- * named kstats, and the pointers (KSTAT_NAMED_STR_PTR()) are updated to point
- * into the copy within the buffer. The default snapshot routine does this,
- * but overriding routines should contain at least the following:
- *
- * if (rw == KSTAT_READ) {
- *     kstat_named_t *knp = buf;
- *     char *end = knp + ksp->ks_ndata;
- *     uint_t i;
- *
- *     ... Do the regular copy ...
- *     bcopy(ksp->ks_data, buf, sizeof (kstat_named_t) * ksp->ks_ndata);
- *
- *     for (i = 0; i < ksp->ks_ndata; i++, knp++) {
- *             if (knp[i].data_type == KSTAT_DATA_STRING &&
- *                 KSTAT_NAMED_STR_PTR(knp) != NULL) {
- *                     bcopy(KSTAT_NAMED_STR_PTR(knp), end,
- *                         KSTAT_NAMED_STR_BUFLEN(knp));
- *                     KSTAT_NAMED_STR_PTR(knp) = end;
- *                     end += KSTAT_NAMED_STR_BUFLEN(knp);
- *             }
- *     }
- */
-
-/*
- * Named statistics.
- *
- * List of arbitrary name=value statistics.
- */
-
-typedef struct kstat_named {
-       char    name[KSTAT_STRLEN];     /* name of counter */
-       uchar_t data_type;              /* data type */
-       union {
-               char            c[16];  /* enough for 128-bit ints */
-               int32_t         i32;
-               uint32_t        ui32;
-               struct {
-                       union {
-                               char            *ptr;   /* NULL-term string */
-#if defined(_KERNEL) && defined(_MULTI_DATAMODEL)
-                               caddr32_t       ptr32;
-#endif
-                               char            __pad[8]; /* 64-bit padding */
-                       } addr;
-                       uint32_t        len;    /* # bytes for strlen + '\0' */
-               } str;
-/*
- * The int64_t and uint64_t types are not valid for a maximally conformant
- * 32-bit compilation environment (cc -Xc) using compilers prior to the
- * introduction of C99 conforming compiler (reference ISO/IEC 9899:1990).
- * In these cases, the visibility of i64 and ui64 is only permitted for
- * 64-bit compilation environments or 32-bit non-maximally conformant
- * C89 or C90 ANSI C compilation environments (cc -Xt and cc -Xa). In the
- * C99 ANSI C compilation environment, the long long type is supported.
- * The _INT64_TYPE is defined by the implementation (see sys/int_types.h).
- */
-#if defined(_INT64_TYPE)
-               int64_t         i64;
-               uint64_t        ui64;
-#endif
-               long            l;
-               ulong_t         ul;
-
-               /* These structure members are obsolete */
-
-               longlong_t      ll;
-               u_longlong_t    ull;
-               float           f;
-               double          d;
-       } value;                        /* value of counter */
-} kstat_named_t;
-
-#define        KSTAT_DATA_CHAR         0
-#define        KSTAT_DATA_INT32        1
-#define        KSTAT_DATA_UINT32       2
-#define        KSTAT_DATA_INT64        3
-#define        KSTAT_DATA_UINT64       4
-
-#if !defined(_LP64)
-#define        KSTAT_DATA_LONG         KSTAT_DATA_INT32
-#define        KSTAT_DATA_ULONG        KSTAT_DATA_UINT32
-#else
-#if !defined(_KERNEL)
-#define        KSTAT_DATA_LONG         KSTAT_DATA_INT64
-#define        KSTAT_DATA_ULONG        KSTAT_DATA_UINT64
-#else
-#define        KSTAT_DATA_LONG         7       /* only visible to the kernel */
-#define        KSTAT_DATA_ULONG        8       /* only visible to the kernel */
-#endif /* !_KERNEL */
-#endif /* !_LP64 */
-
-/*
- * Statistics exporting named kstats with long strings (KSTAT_DATA_STRING)
- * may not make the assumption that ks_data_size is equal to (ks_ndata * sizeof
- * (kstat_named_t)).  ks_data_size in these cases is equal to the sum of the
- * amount of space required to store the strings (ie, the sum of
- * KSTAT_NAMED_STR_BUFLEN() for all KSTAT_DATA_STRING statistics) plus the
- * space required to store the kstat_named_t's.
- *
- * The default update routine will update ks_data_size automatically for
- * variable-length kstats containing long strings (using the default update
- * routine only makes sense if the string is the only thing that is changing
- * in size, and ks_ndata is constant).  Fixed-length kstats containing long
- * strings must explicitly change ks_data_size (after creation but before
- * initialization) to reflect the correct amount of space required for the
- * long strings and the kstat_named_t's.
- */
-#define        KSTAT_DATA_STRING       9
-
-/* These types are obsolete */
-
-#define        KSTAT_DATA_LONGLONG     KSTAT_DATA_INT64
-#define        KSTAT_DATA_ULONGLONG    KSTAT_DATA_UINT64
-#define        KSTAT_DATA_FLOAT        5
-#define        KSTAT_DATA_DOUBLE       6
-
-#define        KSTAT_NAMED_PTR(kptr)   ((kstat_named_t *)(kptr)->ks_data)
-
-/*
- * Retrieve the pointer of the string contained in the given named kstat.
- */
-#define        KSTAT_NAMED_STR_PTR(knptr) ((knptr)->value.str.addr.ptr)
-
-/*
- * Retrieve the length of the buffer required to store the string in the given
- * named kstat.
- */
-#define        KSTAT_NAMED_STR_BUFLEN(knptr) ((knptr)->value.str.len)
-
-/*
- * Interrupt statistics.
- *
- * An interrupt is a hard interrupt (sourced from the hardware device
- * itself), a soft interrupt (induced by the system via the use of
- * some system interrupt source), a watchdog interrupt (induced by
- * a periodic timer call), spurious (an interrupt entry point was
- * entered but there was no interrupt condition to service),
- * or multiple service (an interrupt condition was detected and
- * serviced just prior to returning from any of the other types).
- *
- * Measurement of the spurious class of interrupts is useful for
- * autovectored devices in order to pinpoint any interrupt latency
- * problems in a particular system configuration.
- *
- * Devices that have more than one interrupt of the same
- * type should use multiple structures.
- */
-
-#define        KSTAT_INTR_HARD                 0
-#define        KSTAT_INTR_SOFT                 1
-#define        KSTAT_INTR_WATCHDOG             2
-#define        KSTAT_INTR_SPURIOUS             3
-#define        KSTAT_INTR_MULTSVC              4
-
-#define        KSTAT_NUM_INTRS                 5
-
-typedef struct kstat_intr {
-       uint_t  intrs[KSTAT_NUM_INTRS]; /* interrupt counters */
-} kstat_intr_t;
-
-#define        KSTAT_INTR_PTR(kptr)    ((kstat_intr_t *)(kptr)->ks_data)
-
-/*
- * I/O statistics.
- */
-
-typedef struct kstat_io {
-
-       /*
-        * Basic counters.
-        *
-        * The counters should be updated at the end of service
-        * (e.g., just prior to calling biodone()).
-        */
-
-       u_longlong_t    nread;          /* number of bytes read */
-       u_longlong_t    nwritten;       /* number of bytes written */
-       uint_t          reads;          /* number of read operations */
-       uint_t          writes;         /* number of write operations */
-
-       /*
-        * Accumulated time and queue length statistics.
-        *
-        * Accumulated time statistics are kept as a running sum
-        * of "active" time.  Queue length statistics are kept as a
-        * running sum of the product of queue length and elapsed time
-        * at that length -- i.e., a Riemann sum for queue length
-        * integrated against time.  (You can also think of the active time
-        * as a Riemann sum, for the boolean function (queue_length > 0)
-        * integrated against time, or you can think of it as the
-        * Lebesgue measure of the set on which queue_length > 0.)
-        *
-        *              ^
-        *              |                       _________
-        *              8                       | i4    |
-        *              |                       |       |
-        *      Queue   6                       |       |
-        *      Length  |       _________       |       |
-        *              4       | i2    |_______|       |
-        *              |       |           i3          |
-        *              2_______|                       |
-        *              |    i1                         |
-        *              |_______________________________|
-        *              Time->  t1      t2      t3      t4
-        *
-        * At each change of state (entry or exit from the queue),
-        * we add the elapsed time (since the previous state change)
-        * to the active time if the queue length was non-zero during
-        * that interval; and we add the product of the elapsed time
-        * times the queue length to the running length*time sum.
-        *
-        * This method is generalizable to measuring residency
-        * in any defined system: instead of queue lengths, think
-        * of "outstanding RPC calls to server X".
-        *
-        * A large number of I/O subsystems have at least two basic
-        * "lists" of transactions they manage: one for transactions
-        * that have been accepted for processing but for which processing
-        * has yet to begin, and one for transactions which are actively
-        * being processed (but not done). For this reason, two cumulative
-        * time statistics are defined here: wait (pre-service) time,
-        * and run (service) time.
-        *
-        * All times are 64-bit nanoseconds (hrtime_t), as returned by
-        * gethrtime().
-        *
-        * The units of cumulative busy time are accumulated nanoseconds.
-        * The units of cumulative length*time products are elapsed time
-        * times queue length.
-        *
-        * Updates to the fields below are performed implicitly by calls to
-        * these five functions:
-        *
-        *      kstat_waitq_enter()
-        *      kstat_waitq_exit()
-        *      kstat_runq_enter()
-        *      kstat_runq_exit()
-        *
-        *      kstat_waitq_to_runq()           (see below)
-        *      kstat_runq_back_to_waitq()      (see below)
-        *
-        * Since kstat_waitq_exit() is typically followed immediately
-        * by kstat_runq_enter(), there is a single kstat_waitq_to_runq()
-        * function which performs both operations.  This is a performance
-        * win since only one timestamp is required.
-        *
-        * In some instances, it may be necessary to move a request from
-        * the run queue back to the wait queue, e.g. for write throttling.
-        * For these situations, call kstat_runq_back_to_waitq().
-        *
-        * These fields should never be updated by any other means.
-        */
-
-       hrtime_t wtime;         /* cumulative wait (pre-service) time */
-       hrtime_t wlentime;      /* cumulative wait length*time product */
-       hrtime_t wlastupdate;   /* last time wait queue changed */
-       hrtime_t rtime;         /* cumulative run (service) time */
-       hrtime_t rlentime;      /* cumulative run length*time product */
-       hrtime_t rlastupdate;   /* last time run queue changed */
-
-       uint_t  wcnt;           /* count of elements in wait state */
-       uint_t  rcnt;           /* count of elements in run state */
-
-} kstat_io_t;
-
-#define        KSTAT_IO_PTR(kptr)      ((kstat_io_t *)(kptr)->ks_data)
-
-/*
- * Event timer statistics - cumulative elapsed time and number of events.
- *
- * Updates to these fields are performed implicitly by calls to
- * kstat_timer_start() and kstat_timer_stop().
- */
-
-typedef struct kstat_timer {
-       char            name[KSTAT_STRLEN];     /* event name */
-       uchar_t         resv;                   /* reserved */
-       u_longlong_t    num_events;             /* number of events */
-       hrtime_t        elapsed_time;           /* cumulative elapsed time */
-       hrtime_t        min_time;               /* shortest event duration */
-       hrtime_t        max_time;               /* longest event duration */
-       hrtime_t        start_time;             /* previous event start time */
-       hrtime_t        stop_time;              /* previous event stop time */
-} kstat_timer_t;
-
-#define        KSTAT_TIMER_PTR(kptr)   ((kstat_timer_t *)(kptr)->ks_data)
-
-#if    defined(_KERNEL)
-
-#include <sys/t_lock.h>
-
-extern kid_t   kstat_chain_id;         /* bumped at each state change */
-extern void    kstat_init(void);       /* initialize kstat framework */
-
-/*
- * Adding and deleting kstats.
- *
- * The typical sequence to add a kstat is:
- *
- *     ksp = kstat_create(module, instance, name, class, type, ndata, flags);
- *     if (ksp) {
- *             ... provider initialization, if necessary
- *             kstat_install(ksp);
- *     }
- *
- * There are three logically distinct steps here:
- *
- * Step 1: System Initialization (kstat_create)
- *
- * kstat_create() performs system initialization.  kstat_create()
- * allocates memory for the entire kstat (header plus data), initializes
- * all header fields, initializes the data section to all zeroes, assigns
- * a unique KID, and puts the kstat onto the system's kstat chain.
- * The returned kstat is marked invalid (KSTAT_FLAG_INVALID is set),
- * because the provider (caller) has not yet had a chance to initialize
- * the data section.
- *
- * By default, kstats are exported to all zones on the system.  A kstat may be
- * created via kstat_create_zone() to specify a zone to which the statistics
- * should be exported.  kstat_zone_add() may be used to specify additional
- * zones to which the statistics are to be exported.
- *
- * Step 2: Provider Initialization
- *
- * The provider performs any necessary initialization of the data section,
- * e.g. setting the name fields in a KSTAT_TYPE_NAMED.  Virtual kstats set
- * the ks_data field at this time.  The provider may also set the ks_update,
- * ks_snapshot, ks_private, and ks_lock fields if necessary.
- *
- * Step 3: Installation (kstat_install)
- *
- * Once the kstat is completely initialized, kstat_install() clears the
- * INVALID flag, thus making the kstat accessible to the outside world.
- * kstat_install() also clears the DORMANT flag for persistent kstats.
- *
- * Removing a kstat from the system
- *
- * kstat_delete(ksp) removes ksp from the kstat chain and frees all
- * associated system resources.  NOTE: When you call kstat_delete(),
- * you must NOT be holding that kstat's ks_lock.  Otherwise, you may
- * deadlock with a kstat reader.
- *
- * Persistent kstats
- *
- * From the provider's point of view, persistence is transparent.  The only
- * difference between ephemeral (normal) kstats and persistent kstats
- * is that you pass KSTAT_FLAG_PERSISTENT to kstat_create().  Magically,
- * this has the effect of making your data visible even when you're
- * not home.  Persistence is important to tools like iostat, which want
- * to get a meaningful picture of disk activity.  Without persistence,
- * raw disk i/o statistics could never accumulate: they would come and
- * go with each open/close of the raw device.
- *
- * The magic of persistence works by slightly altering the behavior of
- * kstat_create() and kstat_delete().  The first call to kstat_create()
- * creates a new kstat, as usual.  However, kstat_delete() does not
- * actually delete the kstat: it performs one final update of the data
- * (i.e., calls the ks_update routine), marks the kstat as dormant, and
- * sets the ks_lock, ks_update, ks_private, and ks_snapshot fields back
- * to their default values (since they might otherwise point to garbage,
- * e.g. if the provider is going away).  kstat clients can still access
- * the dormant kstat just like a live kstat; they just continue to see
- * the final data values as long as the kstat remains dormant.
- * All subsequent kstat_create() calls simply find the already-existing,
- * dormant kstat and return a pointer to it, without altering any fields.
- * The provider then performs its usual initialization sequence, and
- * calls kstat_install().  kstat_install() uses the old data values to
- * initialize the native data (i.e., ks_update is called with KSTAT_WRITE),
- * thus making it seem like you were never gone.
- */
-
-extern kstat_t *kstat_create(const char *, int, const char *, const char *,
-    uchar_t, uint_t, uchar_t);
-extern kstat_t *kstat_create_zone(const char *, int, const char *,
-    const char *, uchar_t, uint_t, uchar_t, zoneid_t);
-extern void kstat_install(kstat_t *);
-extern void kstat_delete(kstat_t *);
-extern void kstat_named_setstr(kstat_named_t *knp, const char *src);
-extern void kstat_set_string(char *, const char *);
-extern void kstat_delete_byname(const char *, int, const char *);
-extern void kstat_delete_byname_zone(const char *, int, const char *, zoneid_t);
-extern void kstat_named_init(kstat_named_t *, const char *, uchar_t);
-extern void kstat_timer_init(kstat_timer_t *, const char *);
-extern void kstat_waitq_enter(kstat_io_t *);
-extern void kstat_waitq_exit(kstat_io_t *);
-extern void kstat_runq_enter(kstat_io_t *);
-extern void kstat_runq_exit(kstat_io_t *);
-extern void kstat_waitq_to_runq(kstat_io_t *);
-extern void kstat_runq_back_to_waitq(kstat_io_t *);
-extern void kstat_timer_start(kstat_timer_t *);
-extern void kstat_timer_stop(kstat_timer_t *);
-
-extern void kstat_zone_add(kstat_t *, zoneid_t);
-extern void kstat_zone_remove(kstat_t *, zoneid_t);
-extern int kstat_zone_find(kstat_t *, zoneid_t);
-
-extern kstat_t *kstat_hold_bykid(kid_t kid, zoneid_t);
-extern kstat_t *kstat_hold_byname(const char *, int, const char *, zoneid_t);
-extern void kstat_rele(kstat_t *);
-
-#endif /* defined(_KERNEL) */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_KSTAT_H */
diff --git a/zfs/lib/libspl/include/sys/list.h b/zfs/lib/libspl/include/sys/list.h
deleted file mode 100644 (file)
index 6db92ed..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef        _SYS_LIST_H
-#define        _SYS_LIST_H
-
-#include <sys/list_impl.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-typedef struct list_node list_node_t;
-typedef struct list list_t;
-
-void list_create(list_t *, size_t, size_t);
-void list_destroy(list_t *);
-
-void list_insert_after(list_t *, void *, void *);
-void list_insert_before(list_t *, void *, void *);
-void list_insert_head(list_t *, void *);
-void list_insert_tail(list_t *, void *);
-void list_remove(list_t *, void *);
-void *list_remove_head(list_t *);
-void *list_remove_tail(list_t *);
-void list_move_tail(list_t *, list_t *);
-
-void *list_head(list_t *);
-void *list_tail(list_t *);
-void *list_next(list_t *, void *);
-void *list_prev(list_t *, void *);
-int list_is_empty(list_t *);
-
-void list_link_init(list_node_t *);
-void list_link_replace(list_node_t *, list_node_t *);
-
-int list_link_active(list_node_t *);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_LIST_H */
diff --git a/zfs/lib/libspl/include/sys/list_impl.h b/zfs/lib/libspl/include/sys/list_impl.h
deleted file mode 100644 (file)
index a6614f9..0000000
+++ /dev/null
@@ -1,51 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2003 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef        _SYS_LIST_IMPL_H
-#define        _SYS_LIST_IMPL_H
-
-#include <sys/types.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-struct list_node {
-       struct list_node *list_next;
-       struct list_node *list_prev;
-};
-
-struct list {
-       size_t  list_size;
-       size_t  list_offset;
-       struct list_node list_head;
-};
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_LIST_IMPL_H */
diff --git a/zfs/lib/libspl/include/sys/mhd.h b/zfs/lib/libspl/include/sys/mhd.h
deleted file mode 100644 (file)
index fcc062d..0000000
+++ /dev/null
@@ -1,159 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_MHD_H
-#define        _SYS_MHD_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Definitions for multi-host device I/O control commands
- */
-#define        MHIOC                           ('M'<<8)
-#define        MHIOCENFAILFAST                 (MHIOC|1)
-#define        MHIOCTKOWN                      (MHIOC|2)
-#define        MHIOCRELEASE                    (MHIOC|3)
-#define        MHIOCSTATUS                     (MHIOC|4)
-#define        MHIOCGRP_INKEYS                 (MHIOC|5)
-#define        MHIOCGRP_INRESV                 (MHIOC|6)
-#define        MHIOCGRP_REGISTER               (MHIOC|7)
-#define        MHIOCGRP_RESERVE                (MHIOC|8)
-#define        MHIOCGRP_PREEMPTANDABORT        (MHIOC|9)
-#define        MHIOCGRP_PREEMPT                (MHIOC|10)
-#define        MHIOCGRP_CLEAR                  (MHIOC|11)
-#define        MHIOCGRP_REGISTERANDIGNOREKEY   (MHIOC|14)
-#define        MHIOCQRESERVE                   (MHIOC|12)
-#define        MHIOCREREGISTERDEVID            (MHIOC|13)
-
-/*
- * Following is the structure to specify the delay parameters in
- * milliseconds, via the MHIOCTKOWN ioctl.
- */
-struct mhioctkown {
-       int reinstate_resv_delay;
-       int min_ownership_delay;
-       int max_ownership_delay;
-};
-
-#define        MHIOC_RESV_KEY_SIZE     8
-typedef struct mhioc_resv_key {
-       uchar_t key[MHIOC_RESV_KEY_SIZE];
-} mhioc_resv_key_t;
-
-typedef struct mhioc_key_list {
-       uint32_t                listsize;
-       uint32_t                listlen;
-       mhioc_resv_key_t        *list;
-} mhioc_key_list_t;
-
-typedef struct mhioc_inkeys {
-       uint32_t                generation;
-       mhioc_key_list_t        *li;
-} mhioc_inkeys_t;
-
-#if defined(_SYSCALL32)
-struct mhioc_key_list32 {
-       uint32_t                listsize;
-       uint32_t                listlen;
-       caddr32_t               list;
-} mhioc_key_list32_t;
-
-struct mhioc_inkeys32 {
-       uint32_t                generation;
-       caddr32_t               li;
-} mhioc_inkeys32_t;
-#endif
-
-typedef struct mhioc_resv_desc {
-       mhioc_resv_key_t        key;
-       uint8_t                 type;
-       uint8_t                 scope;
-       uint32_t                scope_specific_addr;
-} mhioc_resv_desc_t;
-
-typedef struct mhioc_resv_desc_list {
-       uint32_t                listsize;
-       uint32_t                listlen;
-       mhioc_resv_desc_t       *list;
-} mhioc_resv_desc_list_t;
-
-typedef struct mhioc_inresvs {
-       uint32_t                generation;
-       mhioc_resv_desc_list_t  *li;
-} mhioc_inresvs_t;
-
-#if defined(_SYSCALL32)
-struct mhioc_resv_desc_list32 {
-       uint32_t                listsize;
-       uint32_t                listlen;
-       caddr32_t               list;
-} mhioc_resv_desc_list32_t;
-
-typedef struct mhioc_inresvs32 {
-       uint32_t                generation;
-       caddr32_t               li;
-} mhioc_inresvs32_t;
-#endif
-
-typedef struct mhioc_register {
-    mhioc_resv_key_t   oldkey;
-    mhioc_resv_key_t   newkey;
-    boolean_t          aptpl;  /* True if persistent across power failures */
-} mhioc_register_t;
-
-typedef struct mhioc_preemptandabort {
-    mhioc_resv_desc_t  resvdesc;
-    mhioc_resv_key_t   victim_key;
-} mhioc_preemptandabort_t;
-
-typedef struct mhioc_registerandignorekey {
-    mhioc_resv_key_t   newkey;
-    boolean_t          aptpl;  /* True if persistent across power failures */
-} mhioc_registerandignorekey_t;
-
-/*
- * SCSI-3 PGR Reservation Type Codes.  Codes with the _OBSOLETE suffix
- * have been removed from the SCSI3 PGR standard.
- */
-#define        SCSI3_RESV_READSHARED_OBSOLETE                  0
-#define        SCSI3_RESV_WRITEEXCLUSIVE                       1
-#define        SCSI3_RESV_READEXCLUSIVE_OBSOLETE               2
-#define        SCSI3_RESV_EXCLUSIVEACCESS                      3
-#define        SCSI3_RESV_SHAREDACCESS_OBSOLETE                4
-#define        SCSI3_RESV_WRITEEXCLUSIVEREGISTRANTSONLY        5
-#define        SCSI3_RESV_EXCLUSIVEACCESSREGISTRANTSONLY       6
-
-#define        SCSI3_SCOPE_LOGICALUNIT                         0
-#define        SCSI3_SCOPE_EXTENT_OBSOLETE                     1
-#define        SCSI3_SCOPE_ELEMENT                             2
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_MHD_H */
diff --git a/zfs/lib/libspl/include/sys/mkdev.h b/zfs/lib/libspl/include/sys/mkdev.h
deleted file mode 100644 (file)
index 5978de6..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_MKDEV_H
-#define        _LIBSPL_SYS_MKDEV_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/mnttab.h b/zfs/lib/libspl/include/sys/mnttab.h
deleted file mode 100644 (file)
index 21d8965..0000000
+++ /dev/null
@@ -1,86 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*  All Rights Reserved  */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/* Copyright 2006 Ricardo Correia */
-
-#ifndef _SYS_MNTTAB_H
-#define        _SYS_MNTTAB_H
-
-#include <stdio.h>
-#include <mntent.h>
-#include <sys/types.h>
-
-#ifdef MNTTAB
-#undef MNTTAB
-#endif /* MNTTAB */
-
-#define        MNTTAB          "/etc/mtab"
-#define        MNT_LINE_MAX    4096
-
-#define        MNT_TOOLONG     1       /* entry exceeds MNT_LINE_MAX */
-#define        MNT_TOOMANY     2       /* too many fields in line */
-#define        MNT_TOOFEW      3       /* too few fields in line */
-
-struct mnttab {
-       char *mnt_special;
-       char *mnt_mountp;
-       char *mnt_fstype;
-       char *mnt_mntopts;
-};
-
-/*
- * NOTE: fields in extmnttab should match struct mnttab till new fields
- * are encountered, this allows hasmntopt to work properly when its arg is
- * a pointer to an extmnttab struct cast to a mnttab struct pointer.
- */
-
-struct extmnttab {
-       char *mnt_special;
-       char *mnt_mountp;
-       char *mnt_fstype;
-       char *mnt_mntopts;
-       uint_t mnt_major;
-       uint_t mnt_minor;
-};
-
-extern int getmntany(FILE *fp, struct mnttab *mp, struct mnttab *mpref);
-extern int _sol_getmntent(FILE *fp, struct mnttab *mp);
-extern int getextmntent(FILE *fp, struct extmnttab *mp, int len);
-
-static inline char *_sol_hasmntopt(struct mnttab *mnt, char *opt)
-{
-       struct mntent mnt_new;
-
-       mnt_new.mnt_opts = mnt->mnt_mntopts;
-
-       return (hasmntopt(&mnt_new, opt));
-}
-
-#define        hasmntopt       _sol_hasmntopt
-#define        getmntent       _sol_getmntent
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/mount.h b/zfs/lib/libspl/include/sys/mount.h
deleted file mode 100644 (file)
index ad1fa38..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include_next <sys/mount.h>
-
-#ifndef _LIBSPL_SYS_MOUNT_H
-#define        _LIBSPL_SYS_MOUNT_H
-
-#include <assert.h>
-#include <string.h>
-#include <stdlib.h>
-
-/*
- * Some old glibc headers don't define BLKGETSIZE64
- * and we don't want to require the kernel headers
- */
-#if !defined(BLKGETSIZE64)
-#define        BLKGETSIZE64            _IOR(0x12, 114, size_t)
-#endif
-
-/*
- * Some old glibc headers don't correctly define MS_DIRSYNC and
- * instead use the enum name S_WRITE.  When using these older
- * headers define MS_DIRSYNC to be S_WRITE.
- */
-#if !defined(MS_DIRSYNC)
-#define        MS_DIRSYNC              S_WRITE
-#endif
-
-/*
- * Some old glibc headers don't correctly define MS_POSIXACL and
- * instead leave it undefined.  When using these older headers define
- * MS_POSIXACL to the reserved value of (1<<16).
- */
-#if !defined(MS_POSIXACL)
-#define        MS_POSIXACL             (1<<16)
-#endif
-
-#define        MS_USERS        (MS_NOEXEC|MS_NOSUID|MS_NODEV)
-#define        MS_OWNER        (MS_NOSUID|MS_NODEV)
-#define        MS_GROUP        (MS_NOSUID|MS_NODEV)
-#define        MS_COMMENT      0
-
-/*
- * Older glibc <sys/mount.h> headers did not define all the available
- * umount2(2) flags.  Both MNT_FORCE and MNT_DETACH are supported in the
- * kernel back to 2.4.11 so we define them correctly if they are missing.
- */
-#ifdef MNT_FORCE
-#define        MS_FORCE        MNT_FORCE
-#else
-#define        MS_FORCE        0x00000001
-#endif /* MNT_FORCE */
-
-#ifdef MNT_DETACH
-#define        MS_DETACH       MNT_DETACH
-#else
-#define        MS_DETACH       0x00000002
-#endif /* MNT_DETACH */
-
-/*
- * Overlay mount is default in Linux, but for solaris/zfs
- * compatibility, MS_OVERLAY is defined to explicitly have the user
- * provide a flag (-O) to mount over a non empty directory.
- */
-#define        MS_OVERLAY      0x00000004
-
-#endif /* _LIBSPL_SYS_MOUNT_H */
diff --git a/zfs/lib/libspl/include/sys/note.h b/zfs/lib/libspl/include/sys/note.h
deleted file mode 100644 (file)
index 6625b68..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 1994 by Sun Microsystems, Inc.
- */
-
-/*
- * sys/note.h: interface for annotating source with info for tools
- *
- * This is the underlying interface; NOTE (/usr/include/note.h) is the
- * preferred interface, but all exported header files should include this
- * file directly and use _NOTE so as not to take "NOTE" from the user's
- * namespace.  For consistency, *all* kernel source should use _NOTE.
- *
- * By default, annotations expand to nothing.  This file implements
- * that.  Tools using annotations will interpose a different version
- * of this file that will expand annotations as needed.
- */
-
-#ifndef        _SYS_NOTE_H
-#define        _SYS_NOTE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#ifndef _NOTE
-#define        _NOTE(s)
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_NOTE_H */
diff --git a/zfs/lib/libspl/include/sys/param.h b/zfs/lib/libspl/include/sys/param.h
deleted file mode 100644 (file)
index 9f362dd..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_PARAM_H
-#define        _LIBSPL_SYS_PARAM_H
-
-#include_next <sys/param.h>
-#include <unistd.h>
-
-/*
- * File system parameters and macros.
- *
- * The file system is made out of blocks of at most MAXBSIZE units,
- * with smaller units (fragments) only in the last direct block.
- * MAXBSIZE primarily determines the size of buffers in the buffer
- * pool. It may be made larger without any effect on existing
- * file systems; however making it smaller make make some file
- * systems unmountable.
- *
- * Note that the blocked devices are assumed to have DEV_BSIZE
- * "sectors" and that fragments must be some multiple of this size.
- */
-#define        MAXBSIZE        8192
-#define        DEV_BSIZE       512
-#define        DEV_BSHIFT      9               /* log2(DEV_BSIZE) */
-
-#define        MAXNAMELEN      256
-#define        MAXOFFSET_T     LLONG_MAX
-
-#define        UID_NOBODY      60001           /* user ID no body */
-#define        GID_NOBODY      UID_NOBODY
-#define        UID_NOACCESS    60002           /* user ID no access */
-
-#define        MAXUID          UINT32_MAX      /* max user id */
-#define        MAXPROJID       MAXUID          /* max project id */
-
-#ifndef        PAGESIZE
-#define        PAGESIZE        (sysconf(_SC_PAGESIZE))
-#endif /* PAGESIZE */
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/policy.h b/zfs/lib/libspl/include/sys/policy.h
deleted file mode 100644 (file)
index 2f695b3..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-#ifndef        _LIBSYS_SYS_POLICY_H
-#define        _LIBSYS_SYS_POLICY_H
-
-#endif /* _LIBSYS_SYS_POLICY_H */
diff --git a/zfs/lib/libspl/include/sys/priv.h b/zfs/lib/libspl/include/sys/priv.h
deleted file mode 100644 (file)
index 76c76d1..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_PRIV_H
-#define        _LIBSPL_SYS_PRIV_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/processor.h b/zfs/lib/libspl/include/sys/processor.h
deleted file mode 100644 (file)
index 78e95d0..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_PROCESSOR_H
-#define        _LIBSPL_SYS_PROCESSOR_H
-
-#define        getcpuid() (-1)
-
-typedef int    processorid_t;
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/stack.h b/zfs/lib/libspl/include/sys/stack.h
deleted file mode 100644 (file)
index 59807e9..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * This header file distributed under the terms of the CDDL.
- * Portions Copyright 2008 Sun Microsystems, Inc. All Rights reserved.
- */
-#ifndef _SYS_STACK_H
-#define        _SYS_STACK_H
-
-#include <pthread.h>
-
-#define        STACK_BIAS      0
-
-#ifdef __USE_GNU
-
-static inline int
-stack_getbounds(stack_t *sp)
-{
-       pthread_attr_t attr;
-       int rc;
-
-       rc = pthread_getattr_np(pthread_self(), &attr);
-       if (rc)
-               return (rc);
-
-       rc = pthread_attr_getstack(&attr, &sp->ss_sp, &sp->ss_size);
-       if (rc == 0)
-               sp->ss_flags = 0;
-
-       pthread_attr_destroy(&attr);
-
-       return (rc);
-}
-
-static inline int
-thr_stksegment(stack_t *sp)
-{
-       int rc;
-
-       rc = stack_getbounds(sp);
-       if (rc)
-               return (rc);
-
-       /*
-        * thr_stksegment() is expected to set sp.ss_sp to the high stack
-        * address, but the stack_getbounds() interface is expected to
-        * set sp.ss_sp to the low address.  Adjust accordingly.
-        */
-       sp->ss_sp = (void *)(((uintptr_t)sp->ss_sp) + sp->ss_size);
-       sp->ss_flags = 0;
-
-       return (rc);
-}
-
-#endif /* __USE_GNU */
-#endif /* _SYS_STACK_H */
diff --git a/zfs/lib/libspl/include/sys/stat.h b/zfs/lib/libspl/include/sys/stat.h
deleted file mode 100644 (file)
index 3e8d27e..0000000
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#ifndef _LIBSPL_SYS_STAT_H
-#define        _LIBSPL_SYS_STAT_H
-
-#include_next <sys/stat.h>
-
-#include <sys/mount.h> /* for BLKGETSIZE64 */
-
-/*
- * Emulate Solaris' behavior of returning the block device size in fstat64().
- */
-static inline int
-fstat64_blk(int fd, struct stat64 *st)
-{
-       if (fstat64(fd, st) == -1)
-               return (-1);
-
-       /* In Linux we need to use an ioctl to get the size of a block device */
-       if (S_ISBLK(st->st_mode)) {
-               if (ioctl(fd, BLKGETSIZE64, &st->st_size) != 0)
-                       return (-1);
-       }
-
-       return (0);
-}
-#endif /* _LIBSPL_SYS_STAT_H */
diff --git a/zfs/lib/libspl/include/sys/stropts.h b/zfs/lib/libspl/include/sys/stropts.h
deleted file mode 100644 (file)
index 08c2e79..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_STROPTS_H
-#define        _LIBSPL_SYS_STROPTS_H
-
-#endif /* _LIBSPL_SYS_STROPTS_H */
diff --git a/zfs/lib/libspl/include/sys/sunddi.h b/zfs/lib/libspl/include/sys/sunddi.h
deleted file mode 100644 (file)
index ccd2b29..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2008 by Sun Microsystems, Inc.
- */
-
-#ifndef        _SYS_SUNDDI_H
-#define        _SYS_SUNDDI_H
-
-#endif /* _SYS_SUNDDI_H */
diff --git a/zfs/lib/libspl/include/sys/sysevent.h b/zfs/lib/libspl/include/sys/sysevent.h
deleted file mode 100644 (file)
index 074d841..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_SYSEVENT_H
-#define        _LIBSPL_SYS_SYSEVENT_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/sysevent/Makefile.am b/zfs/lib/libspl/include/sys/sysevent/Makefile.am
deleted file mode 100644 (file)
index b849583..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-libspldir = $(includedir)/libspl/sys/sysevent
-libspl_HEADERS = \
-       $(top_srcdir)/lib/libspl/include/sys/sysevent/eventdefs.h
diff --git a/zfs/lib/libspl/include/sys/sysevent/Makefile.in b/zfs/lib/libspl/include/sys/sysevent/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/sys/sysevent/eventdefs.h b/zfs/lib/libspl/include/sys/sysevent/eventdefs.h
deleted file mode 100644 (file)
index 50ab0ca..0000000
+++ /dev/null
@@ -1,236 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- * Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
- */
-
-#ifndef        _SYS_SYSEVENT_EVENTDEFS_H
-#define        _SYS_SYSEVENT_EVENTDEFS_H
-
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * eventdefs.h contains public definitions for sysevent types (classes
- * and subclasses).  All additions/removal/changes are subject
- * to PSARC approval.
- */
-
-/* Sysevent Class definitions */
-#define        EC_NONE         "EC_none"
-#define        EC_PRIV         "EC_priv"
-#define        EC_PLATFORM     "EC_platform"   /* events private to platform */
-#define        EC_DR           "EC_dr" /* Dynamic reconfiguration event class */
-#define        EC_ENV          "EC_env"        /* Environmental monitor event class */
-#define        EC_DOMAIN       "EC_domain"     /* Domain event class */
-#define        EC_AP_DRIVER    "EC_ap_driver"  /* Alternate Pathing event class */
-#define        EC_IPMP         "EC_ipmp"       /* IP Multipathing event class */
-#define        EC_DEV_ADD      "EC_dev_add"    /* device add event class */
-#define        EC_DEV_REMOVE   "EC_dev_remove" /* device remove event class */
-#define        EC_DEV_BRANCH   "EC_dev_branch" /* device tree branch event class */
-#define        EC_FM           "EC_fm"         /* FMA error report event */
-#define        EC_ZFS          "EC_zfs"        /* ZFS event */
-
-/*
- * The following event class is reserved for exclusive use
- * by Sun Cluster software.
- */
-#define        EC_CLUSTER      "EC_Cluster"
-
-/*
- * The following classes are exclusively reserved for use by the
- * Solaris Volume Manager (SVM)
- */
-#define        EC_SVM_CONFIG   "EC_SVM_Config"
-#define        EC_SVM_STATE    "EC_SVM_State"
-
-/*
- * EC_SVM_CONFIG subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/svm.h
- */
-#define        ESC_SVM_CREATE          "ESC_SVM_Create"
-#define        ESC_SVM_DELETE          "ESC_SVM_Delete"
-#define        ESC_SVM_ADD             "ESC_SVM_Add"
-#define        ESC_SVM_REMOVE          "ESC_SVM_Remove"
-#define        ESC_SVM_REPLACE         "ESC_SVM_Replace"
-#define        ESC_SVM_GROW            "ESC_SVM_Grow"
-#define        ESC_SVM_RENAME_SRC      "ESC_SVM_Rename_Src"
-#define        ESC_SVM_RENAME_DST      "ESC_SVM_Rename_Dst"
-#define        ESC_SVM_MEDIATOR_ADD    "ESC_SVM_Mediator_Add"
-#define        ESC_SVM_MEDIATOR_DELETE "ESC_SVM_Mediator_Delete"
-#define        ESC_SVM_HOST_ADD        "ESC_SVM_Host_Add"
-#define        ESC_SVM_HOST_DELETE     "ESC_SVM_Host_Delete"
-#define        ESC_SVM_DRIVE_ADD       "ESC_SVM_Drive_Add"
-#define        ESC_SVM_DRIVE_DELETE    "ESC_SVM_Drive_Delete"
-#define        ESC_SVM_DETACH          "ESC_SVM_Detach"
-#define        ESC_SVM_DETACHING       "ESC_SVM_Detaching"
-#define        ESC_SVM_ATTACH          "ESC_SVM_Attach"
-#define        ESC_SVM_ATTACHING       "ESC_SVM_Attaching"
-
-/*
- * EC_SVM_STATE subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/svm.h
- */
-#define        ESC_SVM_INIT_START      "ESC_SVM_Init_Start"
-#define        ESC_SVM_INIT_FAILED     "ESC_SVM_Init_Failed"
-#define        ESC_SVM_INIT_FATAL      "ESC_SVM_Init_Fatal"
-#define        ESC_SVM_INIT_SUCCESS    "ESC_SVM_Init_Success"
-#define        ESC_SVM_IOERR           "ESC_SVM_Ioerr"
-#define        ESC_SVM_ERRED           "ESC_SVM_Erred"
-#define        ESC_SVM_LASTERRED       "ESC_SVM_Lasterred"
-#define        ESC_SVM_OK              "ESC_SVM_Ok"
-#define        ESC_SVM_ENABLE          "ESC_SVM_Enable"
-#define        ESC_SVM_RESYNC_START    "ESC_SVM_Resync_Start"
-#define        ESC_SVM_RESYNC_FAILED   "ESC_SVM_Resync_Failed"
-#define        ESC_SVM_RESYNC_SUCCESS  "ESC_SVM_Resync_Success"
-#define        ESC_SVM_RESYNC_DONE     "ESC_SVM_Resync_Done"
-#define        ESC_SVM_HOTSPARED       "ESC_SVM_Hotspared"
-#define        ESC_SVM_HS_FREED        "ESC_SVM_HS_Freed"
-#define        ESC_SVM_HS_CHANGED      "ESC_SVM_HS_Changed"
-#define        ESC_SVM_TAKEOVER        "ESC_SVM_Takeover"
-#define        ESC_SVM_RELEASE         "ESC_SVM_Release"
-#define        ESC_SVM_OPEN_FAIL       "ESC_SVM_Open_Fail"
-#define        ESC_SVM_OFFLINE         "ESC_SVM_Offline"
-#define        ESC_SVM_ONLINE          "ESC_SVM_Online"
-#define        ESC_SVM_CHANGE          "ESC_SVM_Change"
-#define        ESC_SVM_EXCHANGE        "ESC_SVM_Exchange"
-#define        ESC_SVM_REGEN_START     "ESC_SVM_Regen_Start"
-#define        ESC_SVM_REGEN_DONE      "ESC_SVM_Regen_Done"
-#define        ESC_SVM_REGEN_FAILED    "ESC_SVM_Regen_Failed"
-
-/*
- * EC_DR subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/dr.h
- */
-
-/* Attachment point state change */
-#define        ESC_DR_AP_STATE_CHANGE  "ESC_dr_ap_state_change"
-#define        ESC_DR_REQ              "ESC_dr_req"    /* Request DR */
-#define        ESC_DR_TARGET_STATE_CHANGE      "ESC_dr_target_state_change"
-
-/*
- * EC_ENV subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/env.h
- */
-#define        ESC_ENV_TEMP    "ESC_env_temp"  /* Temperature change event subclass */
-#define        ESC_ENV_FAN     "ESC_env_fan"   /* Fan status change event subclass */
-#define        ESC_ENV_POWER   "ESC_env_power" /* Power supply change event subclass */
-#define        ESC_ENV_LED     "ESC_env_led"   /* LED change event subclass */
-
-/*
- * EC_DOMAIN subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/domain.h
- */
-
-/* Domain state change */
-#define        ESC_DOMAIN_STATE_CHANGE         "ESC_domain_state_change"
-/* Domain loghost name change */
-#define        ESC_DOMAIN_LOGHOST_CHANGE       "ESC_domain_loghost_change"
-
-/*
- * EC_AP_DRIVER subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/ap_driver.h
- */
-
-/* Alternate Pathing path switch */
-#define        ESC_AP_DRIVER_PATHSWITCH        "ESC_ap_driver_pathswitch"
-/* Alternate Pathing database commit */
-#define        ESC_AP_DRIVER_COMMIT            "ESC_ap_driver_commit"
-/* Alternate Pathing physical path status change */
-#define        ESC_AP_DRIVER_PHYS_PATH_STATUS_CHANGE   \
-       "ESC_ap_driver_phys_path_status_change"
-
-/*
- * EC_IPMP subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/ipmp.h
- */
-
-/* IPMP group has changed state */
-#define        ESC_IPMP_GROUP_STATE            "ESC_ipmp_group_state"
-
-/* IPMP group has been created or removed */
-#define        ESC_IPMP_GROUP_CHANGE           "ESC_ipmp_group_change"
-
-/* IPMP group has had an interface added or removed */
-#define        ESC_IPMP_GROUP_MEMBER_CHANGE    "ESC_ipmp_group_member_change"
-
-/* Interface within an IPMP group has changed state or type */
-#define        ESC_IPMP_IF_CHANGE              "ESC_ipmp_if_change"
-
-
-/*
- * EC_DEV_ADD and EC_DEV_REMOVE subclass definitions - supporting attributes
- * (name/value pairs) are found in sys/sysevent/dev.h
- */
-#define        ESC_DISK        "disk"          /* disk device */
-#define        ESC_NETWORK     "network"       /* network interface */
-#define        ESC_PRINTER     "printer"       /* printer device */
-#define        ESC_LOFI        "lofi"          /* lofi device */
-
-/*
- * EC_DEV_BRANCH subclass definitions - supporting attributes (name/value pairs)
- * are found in sys/sysevent/dev.h
- */
-
-/* device tree branch added */
-#define        ESC_DEV_BRANCH_ADD      "ESC_dev_branch_add"
-
-/* device tree branch removed */
-#define        ESC_DEV_BRANCH_REMOVE   "ESC_dev_branch_remove"
-
-/* FMA Fault and Error event protocol subclass */
-#define        ESC_FM_ERROR            "ESC_FM_error"
-#define        ESC_FM_ERROR_REPLAY     "ESC_FM_error_replay"
-
-/* Service processor subclass definitions */
-#define        ESC_PLATFORM_SP_RESET   "ESC_platform_sp_reset"
-
-/*
- * EC_ACPIEV subclass definitions
- */
-#define        EC_ACPIEV                       "EC_acpiev"
-#define        ESC_ACPIEV_ADD                  "ESC_acpiev_add"
-#define        ESC_ACPIEV_REMOVE               "ESC_acpiev_remove"
-#define        ESC_ACPIEV_WARN                 "ESC_acpiev_warn"
-#define        ESC_ACPIEV_LOW                  "ESC_acpiev_low"
-#define        ESC_ACPIEV_STATE_CHANGE         "ESC_acpiev_state_change"
-
-/*
- * ZFS subclass definitions.  supporting attributes (name/value paris) are found
- * in sys/fs/zfs.h
- */
-#define        ESC_ZFS_RESILVER_START  "ESC_ZFS_resilver_start"
-#define        ESC_ZFS_RESILVER_FINISH "ESC_ZFS_resilver_finish"
-#define        ESC_ZFS_VDEV_REMOVE     "ESC_ZFS_vdev_remove"
-#define        ESC_ZFS_POOL_DESTROY    "ESC_ZFS_pool_destroy"
-#define        ESC_ZFS_VDEV_CLEAR      "ESC_ZFS_vdev_clear"
-#define        ESC_ZFS_VDEV_CHECK      "ESC_ZFS_vdev_check"
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_SYSEVENT_EVENTDEFS_H */
diff --git a/zfs/lib/libspl/include/sys/sysmacros.h b/zfs/lib/libspl/include/sys/sysmacros.h
deleted file mode 100644 (file)
index 5d10657..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_SYSMACROS_H
-#define        _LIBSPL_SYS_SYSMACROS_H
-
-#include_next <sys/sysmacros.h>
-
-/* common macros */
-#ifndef MIN
-#define        MIN(a, b)       ((a) < (b) ? (a) : (b))
-#endif
-#ifndef MAX
-#define        MAX(a, b)       ((a) < (b) ? (b) : (a))
-#endif
-#ifndef ABS
-#define        ABS(a)          ((a) < 0 ? -(a) : (a))
-#endif
-
-#define        makedevice(maj, min)    makedev(maj, min)
-#define        _sysconf(a)             sysconf(a)
-#define        __NORETURN              __attribute__((noreturn))
-
-/*
- * Compatibility macros/typedefs needed for Solaris -> Linux port
- */
-#define        P2ALIGN(x, align)       ((x) & -(align))
-#define        P2CROSS(x, y, align)    (((x) ^ (y)) > (align) - 1)
-#define        P2ROUNDUP(x, align)     ((((x) - 1) | ((align) - 1)) + 1)
-#define        P2BOUNDARY(off, len, align) \
-                               (((off) ^ ((off) + (len) - 1)) > (align) - 1)
-#define        P2PHASE(x, align)       ((x) & ((align) - 1))
-#define        P2NPHASE(x, align)      (-(x) & ((align) - 1))
-#define        P2NPHASE_TYPED(x, align, type) \
-                               (-(type)(x) & ((type)(align) - 1))
-#define        ISP2(x)                 (((x) & ((x) - 1)) == 0)
-#define        IS_P2ALIGNED(v, a)      ((((uintptr_t)(v)) & ((uintptr_t)(a) - 1)) == 0)
-
-/*
- * Typed version of the P2* macros.  These macros should be used to ensure
- * that the result is correctly calculated based on the data type of (x),
- * which is passed in as the last argument, regardless of the data
- * type of the alignment.  For example, if (x) is of type uint64_t,
- * and we want to round it up to a page boundary using "PAGESIZE" as
- * the alignment, we can do either
- *      P2ROUNDUP(x, (uint64_t)PAGESIZE)
- * or
- *      P2ROUNDUP_TYPED(x, PAGESIZE, uint64_t)
- */
-#define        P2ALIGN_TYPED(x, align, type)           \
-       ((type)(x) & -(type)(align))
-#define        P2PHASE_TYPED(x, align, type)           \
-       ((type)(x) & ((type)(align) - 1))
-#define        P2NPHASE_TYPED(x, align, type)          \
-       (-(type)(x) & ((type)(align) - 1))
-#define        P2ROUNDUP_TYPED(x, align, type)         \
-       ((((type)(x) - 1) | ((type)(align) - 1)) + 1)
-#define        P2END_TYPED(x, align, type)             \
-       (-(~(type)(x) & -(type)(align)))
-#define        P2PHASEUP_TYPED(x, align, phase, type)  \
-       ((type)(phase) - (((type)(phase) - (type)(x)) & -(type)(align)))
-#define        P2CROSS_TYPED(x, y, align, type)        \
-       (((type)(x) ^ (type)(y)) > (type)(align) - 1)
-#define        P2SAMEHIGHBIT_TYPED(x, y, type)         \
-       (((type)(x) ^ (type)(y)) < ((type)(x) & (type)(y)))
-
-
-/* avoid any possibility of clashing with <stddef.h> version */
-#if defined(_KERNEL) && !defined(_KMEMUSER) && !defined(offsetof)
-#define        offsetof(s, m)  ((size_t)(&(((s *)0)->m)))
-#endif
-
-#endif /* _LIBSPL_SYS_SYSMACROS_H */
diff --git a/zfs/lib/libspl/include/sys/systeminfo.h b/zfs/lib/libspl/include/sys/systeminfo.h
deleted file mode 100644 (file)
index 3f7cef5..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_SYSTEMINFO_H
-#define        _LIBSPL_SYS_SYSTEMINFO_H
-
-#define        HW_INVALID_HOSTID       0xFFFFFFFF      /* an invalid hostid */
-#define        HW_HOSTID_LEN           11              /* minimum buffer size needed */
-                                               /* to hold a decimal or hex */
-                                               /* hostid string */
-
-#define        sysinfo(cmd, buf, cnt)          (-1)
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/systm.h b/zfs/lib/libspl/include/sys/systm.h
deleted file mode 100644 (file)
index 1ed031d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_SYSTM_H
-#define        _LIBSPL_SYS_SYSTM_H
-
-#endif /* _LIBSPL_SYS_SYSTM_H */
diff --git a/zfs/lib/libspl/include/sys/time.h b/zfs/lib/libspl/include/sys/time.h
deleted file mode 100644 (file)
index f0da440..0000000
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_TIME_H
-#define        _LIBSPL_SYS_TIME_H
-
-#include_next <sys/time.h>
-#include <sys/types.h>
-
-#ifndef SEC
-#define        SEC             1
-#endif
-
-#ifndef MILLISEC
-#define        MILLISEC        1000
-#endif
-
-#ifndef MICROSEC
-#define        MICROSEC        1000000
-#endif
-
-#ifndef NANOSEC
-#define        NANOSEC         1000000000
-#endif
-
-#ifndef NSEC_PER_USEC
-#define        NSEC_PER_USEC   1000L
-#endif
-
-#ifndef MSEC2NSEC
-#define        MSEC2NSEC(m)    ((hrtime_t)(m) * (NANOSEC / MILLISEC))
-#endif
-
-#ifndef NSEC2MSEC
-#define        NSEC2MSEC(n)    ((n) / (NANOSEC / MILLISEC))
-#endif
-
-extern hrtime_t gethrtime(void);
-extern void gethrestime(timestruc_t *);
-
-#endif /* _LIBSPL_SYS_TIME_H */
diff --git a/zfs/lib/libspl/include/sys/types.h b/zfs/lib/libspl/include/sys/types.h
deleted file mode 100644 (file)
index bd34dec..0000000
+++ /dev/null
@@ -1,99 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_TYPES_H
-#define        _LIBSPL_SYS_TYPES_H
-
-#include <sys/isa_defs.h>
-#include <sys/feature_tests.h>
-#include_next <sys/types.h>
-#include <sys/param.h> /* for NBBY */
-#include <sys/types32.h>
-#include <sys/va_list.h>
-
-#ifndef HAVE_INTTYPES
-#include <inttypes.h>
-
-typedef enum boolean { B_FALSE, B_TRUE } boolean_t;
-
-typedef unsigned char  uchar_t;
-typedef unsigned short ushort_t;
-typedef unsigned int   uint_t;
-typedef unsigned long  ulong_t;
-
-typedef long long      longlong_t;
-typedef unsigned long long u_longlong_t;
-#endif /* HAVE_INTTYPES */
-
-typedef longlong_t     offset_t;
-typedef u_longlong_t   u_offset_t;
-typedef u_longlong_t   len_t;
-typedef longlong_t     diskaddr_t;
-
-typedef ulong_t                pfn_t;          /* page frame number */
-typedef ulong_t                pgcnt_t;        /* number of pages */
-typedef long           spgcnt_t;       /* signed number of pages */
-
-typedef longlong_t     hrtime_t;
-typedef struct timespec        timestruc_t;
-typedef struct timespec timespec_t;
-
-typedef short          pri_t;
-
-typedef int            zoneid_t;
-typedef int            projid_t;
-
-typedef int            major_t;
-typedef int            minor_t;
-
-typedef ushort_t o_mode_t; /* old file attribute type */
-
-/*
- * Definitions remaining from previous partial support for 64-bit file
- * offsets.  This partial support for devices greater than 2gb requires
- * compiler support for long long.
- */
-#ifdef _LONG_LONG_LTOH
-typedef union {
-       offset_t _f;    /* Full 64 bit offset value */
-       struct {
-               int32_t _l; /* lower 32 bits of offset value */
-               int32_t _u; /* upper 32 bits of offset value */
-       } _p;
-} lloff_t;
-#endif
-
-#ifdef _LONG_LONG_HTOL
-typedef union {
-       offset_t _f;    /* Full 64 bit offset value */
-       struct {
-               int32_t _u; /* upper 32 bits of offset value */
-               int32_t _l; /* lower 32 bits of offset value */
-       } _p;
-} lloff_t;
-#endif
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/types32.h b/zfs/lib/libspl/include/sys/types32.h
deleted file mode 100644 (file)
index 9ab3b07..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_TYPES32_H
-#define        _SYS_TYPES32_H
-
-
-
-#include <sys/inttypes.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Interoperability types for programs. Used for:
- *
- * Crossing between 32-bit and 64-bit domains.
- *
- * On disk data formats such as filesystem meta data
- * and disk label.
- *
- * Note: Applications should never include this
- *       header file.
- */
-typedef        uint32_t        caddr32_t;
-typedef        int32_t         daddr32_t;
-typedef        int32_t         off32_t;
-typedef        uint32_t        ino32_t;
-typedef        int32_t         blkcnt32_t;
-typedef uint32_t       fsblkcnt32_t;
-typedef        uint32_t        fsfilcnt32_t;
-typedef        int32_t         id32_t;
-typedef        uint32_t        major32_t;
-typedef        uint32_t        minor32_t;
-typedef        int32_t         key32_t;
-typedef        uint32_t        mode32_t;
-typedef        uint32_t        uid32_t;
-typedef        uint32_t        gid32_t;
-typedef        uint32_t        nlink32_t;
-typedef        uint32_t        dev32_t;
-typedef        int32_t         pid32_t;
-typedef        uint32_t        size32_t;
-typedef        int32_t         ssize32_t;
-typedef        int32_t         time32_t;
-typedef        int32_t         clock32_t;
-
-struct timeval32 {
-       time32_t        tv_sec;         /* seconds */
-       int32_t         tv_usec;        /* and microseconds */
-};
-
-typedef struct timespec32 {
-       time32_t        tv_sec;         /* seconds */
-       int32_t         tv_nsec;        /* and nanoseconds */
-} timespec32_t;
-
-typedef struct timespec32 timestruc32_t;
-
-typedef        struct itimerspec32 {
-       struct timespec32 it_interval;
-       struct timespec32 it_value;
-} itimerspec32_t;
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_TYPES32_H */
diff --git a/zfs/lib/libspl/include/sys/tzfile.h b/zfs/lib/libspl/include/sys/tzfile.h
deleted file mode 100644 (file)
index e30e756..0000000
+++ /dev/null
@@ -1,164 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- *     from Arthur Olson's 6.1
- */
-
-#ifndef _LIBSPL_SYS_TZFILE_H
-#define        _LIBSPL_SYS_TZFILE_H
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- * Information about time zone files.
- */
-
-#define        TZDIR   "/usr/share/lib/zoneinfo" /* Time zone object file directory */
-
-#define        TZDEFAULT       (getenv("TZ"))
-
-#define        TZDEFRULES      "posixrules"
-
-/*
- * Each file begins with. . .
- */
-
-struct tzhead {
-       char    tzh_reserved[24];       /* reserved for future use */
-       char    tzh_ttisstdcnt[4];      /* coded number of trans. time flags */
-       char    tzh_leapcnt[4];         /* coded number of leap seconds */
-       char    tzh_timecnt[4];         /* coded number of transition times */
-       char    tzh_typecnt[4];         /* coded number of local time types */
-       char    tzh_charcnt[4];         /* coded number of abbr. chars */
-};
-
-/*
- * . . .followed by. . .
- *
- *     tzh_timecnt (char [4])s         coded transition times a la time(2)
- *     tzh_timecnt (unsigned char)s    types of local time starting at above
- *     tzh_typecnt repetitions of
- *             one (char [4])          coded GMT offset in seconds
- *             one (unsigned char)     used to set tm_isdst
- *             one (unsigned char)     that's an abbreviation list index
- *     tzh_charcnt (char)s             '\0'-terminated zone abbreviations
- *     tzh_leapcnt repetitions of
- *             one (char [4])          coded leap second transition times
- *             one (char [4])          total correction after above
- *     tzh_ttisstdcnt (char)s          indexed by type; if TRUE, transition
- *                                     time is standard time, if FALSE,
- *                                     transition time is wall clock time
- *                                     if absent, transition times are
- *                                     assumed to be wall clock time
- */
-
-/*
- * In the current implementation, "tzset()" refuses to deal with files that
- * exceed any of the limits below.
- */
-
-/*
- * The TZ_MAX_TIMES value below is enough to handle a bit more than a
- * year's worth of solar time (corrected daily to the nearest second) or
- * 138 years of Pacific Presidential Election time
- * (where there are three time zone transitions every fourth year).
- */
-#define        TZ_MAX_TIMES    370
-
-#define        TZ_MAX_TYPES    256     /* Limited by what (unsigned char)'s can hold */
-
-#define        TZ_MAX_CHARS    50      /* Maximum number of abbreviation characters */
-
-#define        TZ_MAX_LEAPS    50      /* Maximum number of leap second corrections */
-
-#define        SECSPERMIN      60
-#define        MINSPERHOUR     60
-#define        HOURSPERDAY     24
-#define        DAYSPERWEEK     7
-#define        DAYSPERNYEAR    365
-#define        DAYSPERLYEAR    366
-#define        SECSPERHOUR     (SECSPERMIN * MINSPERHOUR)
-#define        SECSPERDAY      ((long)SECSPERHOUR * HOURSPERDAY)
-#define        MONSPERYEAR     12
-
-#define        TM_SUNDAY       0
-#define        TM_MONDAY       1
-#define        TM_TUESDAY      2
-#define        TM_WEDNESDAY    3
-#define        TM_THURSDAY     4
-#define        TM_FRIDAY       5
-#define        TM_SATURDAY     6
-
-#define        TM_JANUARY      0
-#define        TM_FEBRUARY     1
-#define        TM_MARCH        2
-#define        TM_APRIL        3
-#define        TM_MAY          4
-#define        TM_JUNE         5
-#define        TM_JULY         6
-#define        TM_AUGUST       7
-#define        TM_SEPTEMBER    8
-#define        TM_OCTOBER      9
-#define        TM_NOVEMBER     10
-#define        TM_DECEMBER     11
-
-#define        TM_YEAR_BASE    1900
-
-#define        EPOCH_YEAR      1970
-#define        EPOCH_WDAY      TM_THURSDAY
-
-/*
- * Accurate only for the past couple of centuries;
- * that will probably do.
- */
-
-#define        isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
-
-/*
- * Use of the underscored variants may cause problems if you move your code to
- * certain System-V-based systems; for maximum portability, use the
- * underscore-free variants.  The underscored variants are provided for
- * backward compatibility only; they may disappear from future versions of
- * this file.
- */
-
-#define        SECS_PER_MIN    SECSPERMIN
-#define        MINS_PER_HOUR   MINSPERHOUR
-#define        HOURS_PER_DAY   HOURSPERDAY
-#define        DAYS_PER_WEEK   DAYSPERWEEK
-#define        DAYS_PER_NYEAR  DAYSPERNYEAR
-#define        DAYS_PER_LYEAR  DAYSPERLYEAR
-#define        SECS_PER_HOUR   SECSPERHOUR
-#define        SECS_PER_DAY    SECSPERDAY
-#define        MONS_PER_YEAR   MONSPERYEAR
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _LIBSPL_SYS_TZFILE_H */
diff --git a/zfs/lib/libspl/include/sys/uio.h b/zfs/lib/libspl/include/sys/uio.h
deleted file mode 100644 (file)
index 97e8412..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-/*
- * University Copyright- Copyright (c) 1982, 1986, 1988
- * The Regents of the University of California
- * All Rights Reserved
- *
- * University Acknowledgment- Portions of this document are derived from
- * software developed by the University of California, Berkeley, and its
- * contributors.
- */
-
-#ifndef        _LIBSPL_SYS_UIO_H
-#define        _LIBSPL_SYS_UIO_H
-
-#include_next <sys/uio.h>
-
-typedef struct iovec iovec_t;
-
-typedef enum uio_rw {
-       UIO_READ =      0,
-       UIO_WRITE =     1,
-} uio_rw_t;
-
-typedef enum uio_seg {
-       UIO_USERSPACE = 0,
-       UIO_SYSSPACE =  1,
-       UIO_USERISPACE = 2,
-} uio_seg_t;
-
-typedef struct uio {
-       struct iovec    *uio_iov;       /* pointer to array of iovecs */
-       int             uio_iovcnt;     /* number of iovecs */
-       offset_t        uio_loffset;    /* file offset */
-       uio_seg_t       uio_segflg;     /* address space (kernel or user) */
-       uint16_t        uio_fmode;      /* file mode flags */
-       uint16_t        uio_extflg;     /* extended flags */
-       offset_t        uio_limit;      /* u-limit (maximum byte offset) */
-       ssize_t         uio_resid;      /* residual count */
-} uio_t;
-
-typedef enum xuio_type {
-       UIOTYPE_ASYNCIO,
-       UIOTYPE_ZEROCOPY,
-} xuio_type_t;
-
-#define        UIOA_IOV_MAX    16
-
-typedef struct uioa_page_s {           /* locked uio_iov state */
-       int     uioa_pfncnt;            /* count of pfn_t(s) in *uioa_ppp */
-       void    **uioa_ppp;             /* page_t or pfn_t arrary */
-       caddr_t uioa_base;              /* address base */
-       size_t  uioa_len;               /* span length */
-} uioa_page_t;
-
-typedef struct xuio {
-       uio_t xu_uio;                           /* embedded UIO structure */
-
-       /* Extended uio fields */
-       enum xuio_type xu_type;                 /* uio type */
-       union {
-               struct {
-                       uint32_t xu_a_state;    /* state of async i/o */
-                       ssize_t xu_a_mbytes;    /* bytes moved */
-                       uioa_page_t *xu_a_lcur; /* uioa_locked[] pointer */
-                       void **xu_a_lppp;       /* lcur->uioa_pppp[] pointer */
-                       void *xu_a_hwst[4];     /* opaque hardware state */
-                       uioa_page_t xu_a_locked[UIOA_IOV_MAX];
-               } xu_aio;
-
-               struct {
-                       int xu_zc_rw;           /* read or write buffer */
-                       void *xu_zc_priv;       /* fs specific */
-               } xu_zc;
-       } xu_ext;
-} xuio_t;
-
-#define        XUIO_XUZC_PRIV(xuio)    xuio->xu_ext.xu_zc.xu_zc_priv
-#define        XUIO_XUZC_RW(xuio)      xuio->xu_ext.xu_zc.xu_zc_rw
-
-#endif /* _SYS_UIO_H */
diff --git a/zfs/lib/libspl/include/sys/va_list.h b/zfs/lib/libspl/include/sys/va_list.h
deleted file mode 100644 (file)
index a36f5c7..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _SYS_VA_LIST_H
-#define        _SYS_VA_LIST_H
-
-#include <stdarg.h>
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/varargs.h b/zfs/lib/libspl/include/sys/varargs.h
deleted file mode 100644 (file)
index 3d00a33..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_VARARGS_H
-#define        _LIBSPL_SYS_VARARGS_H
-
-#endif
diff --git a/zfs/lib/libspl/include/sys/vnode.h b/zfs/lib/libspl/include/sys/vnode.h
deleted file mode 100644 (file)
index efcdd2c..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_VNODE_H
-#define        _LIBSPL_SYS_VNODE_H
-
-#endif /* _LIBSPL_SYS_VNODE_H */
diff --git a/zfs/lib/libspl/include/sys/vtoc.h b/zfs/lib/libspl/include/sys/vtoc.h
deleted file mode 100644 (file)
index 22a652b..0000000
+++ /dev/null
@@ -1,350 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-/*     Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
-/*       All Rights Reserved   */
-
-
-#ifndef _SYS_VTOC_H
-#define        _SYS_VTOC_H
-
-#include <sys/dklabel.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*
- *     Note:  the VTOC is not implemented fully, nor in the manner
- *     that AT&T implements it.  AT&T puts the vtoc structure
- *     into a sector, usually the second sector (pdsector is first).
- *
- *     Sun incorporates the tag, flag, version, and volume vtoc fields into
- *     its Disk Label, which already has some vtoc-equivalent fields.
- *     Upon reading the vtoc with read_vtoc(), the following exceptions
- *     occur:
- *             v_bootinfo [all]        returned as zero
- *             v_sanity                returned as VTOC_SANE
- *                                             if Disk Label was sane
- *             v_sectorsz              returned as 512
- *             v_reserved [all]        retunred as zero
- *             timestamp [all]         returned as zero
- *
- *     See  dklabel.h, read_vtoc(), and write_vtoc().
- */
-
-#define        V_NUMPAR        NDKMAP          /* The number of partitions */
-                                       /* (from dkio.h) */
-
-#define        VTOC_SANE       0x600DDEEE      /* Indicates a sane VTOC */
-#define        V_VERSION       0x01            /* layout version number */
-#define        V_EXTVERSION    V_VERSION       /* extvtoc layout version number */
-
-/*
- * Partition identification tags
- */
-#define        V_UNASSIGNED    0x00            /* unassigned partition */
-#define        V_BOOT          0x01            /* Boot partition */
-#define        V_ROOT          0x02            /* Root filesystem */
-#define        V_SWAP          0x03            /* Swap filesystem */
-#define        V_USR           0x04            /* Usr filesystem */
-#define        V_BACKUP        0x05            /* full disk */
-#define        V_STAND         0x06            /* Stand partition */
-#define        V_VAR           0x07            /* Var partition */
-#define        V_HOME          0x08            /* Home partition */
-#define        V_ALTSCTR       0x09            /* Alternate sector partition */
-#define        V_CACHE         0x0a            /* Cache (cachefs) partition */
-#define        V_RESERVED      0x0b            /* SMI reserved data */
-
-/*
- * Partition permission flags
- */
-#define        V_UNMNT         0x01            /* Unmountable partition */
-#define        V_RONLY         0x10            /* Read only */
-
-/*
- * error codes for reading & writing vtoc
- */
-#define        VT_ERROR        (-2)            /* errno supplies specific error */
-#define        VT_EIO          (-3)            /* I/O error accessing vtoc */
-#define        VT_EINVAL       (-4)            /* illegal value in vtoc or request */
-#define        VT_ENOTSUP      (-5)            /* VTOC op. not supported */
-#define        VT_ENOSPC       (-6)            /* requested space not found */
-#define        VT_EOVERFLOW    (-7)            /* VTOC op. data struct limited */
-
-struct partition       {
-       ushort_t        p_tag;          /* ID tag of partition */
-       ushort_t        p_flag;         /* permission flags */
-       uint64_t        p_start;        /* start sector no of partition */
-       long            p_size;         /* # of blocks in partition */
-};
-
-struct vtoc {
-       unsigned long   v_bootinfo[3];  /* info needed by mboot (unsupported) */
-       unsigned long   v_sanity;       /* to verify vtoc sanity */
-       unsigned long   v_version;      /* layout version */
-       char    v_volume[LEN_DKL_VVOL]; /* volume name */
-       ushort_t        v_sectorsz;     /* sector size in bytes */
-       ushort_t        v_nparts;       /* number of partitions */
-       unsigned long   v_reserved[10]; /* free space */
-       struct partition v_part[V_NUMPAR]; /* partition headers */
-       time_t  timestamp[V_NUMPAR];    /* partition timestamp (unsupported) */
-       char    v_asciilabel[LEN_DKL_ASCII];    /* for compatibility */
-};
-
-struct extpartition {
-       ushort_t p_tag;                 /* ID tag of partition */
-       ushort_t p_flag;                /* permission flags */
-       ushort_t p_pad[2];
-       diskaddr_t p_start;             /* start sector no of partition */
-       diskaddr_t p_size;              /* # of blocks in partition */
-};
-
-
-struct extvtoc {
-       uint64_t        v_bootinfo[3];  /* info needed by mboot (unsupported) */
-       uint64_t        v_sanity;       /* to verify vtoc sanity */
-       uint64_t        v_version;      /* layout version */
-       char    v_volume[LEN_DKL_VVOL]; /* volume name */
-       ushort_t        v_sectorsz;     /* sector size in bytes */
-       ushort_t        v_nparts;       /* number of partitions */
-       ushort_t        pad[2];
-       uint64_t        v_reserved[10];
-       struct extpartition v_part[V_NUMPAR]; /* partition headers */
-       uint64_t timestamp[V_NUMPAR];   /* partition timestamp (unsupported) */
-       char    v_asciilabel[LEN_DKL_ASCII];    /* for compatibility */
-};
-
-#ifdef _KERNEL
-#define        extvtoctovtoc(extv, v)                                          \
-       {                                                               \
-       int i;                                                          \
-       v.v_bootinfo[0]         = (unsigned long)extv.v_bootinfo[0];    \
-       v.v_bootinfo[1]         = (unsigned long)extv.v_bootinfo[1];    \
-       v.v_bootinfo[2]         = (unsigned long)extv.v_bootinfo[2];    \
-       v.v_sanity              = (unsigned long)extv.v_sanity;         \
-       v.v_version             = (unsigned long)extv.v_version;        \
-       bcopy(extv.v_volume, v.v_volume, LEN_DKL_VVOL);                 \
-       v.v_sectorsz            = extv.v_sectorsz;                      \
-       v.v_nparts              = extv.v_nparts;                        \
-       for (i = 0; i < 10; i++)                                        \
-               v.v_reserved[i] = (unsigned long)extv.v_reserved[i];    \
-       for (i = 0; i < V_NUMPAR; i++) {                                \
-               v.v_part[i].p_tag = extv.v_part[i].p_tag;               \
-               v.v_part[i].p_flag = extv.v_part[i].p_flag;             \
-               v.v_part[i].p_start = (uint64_t)extv.v_part[i].p_start; \
-               v.v_part[i].p_size = (long)extv.v_part[i].p_size;       \
-               v.timestamp[i] = (time_t)extv.timestamp[i];             \
-       }                                                               \
-       bcopy(extv.v_asciilabel, v.v_asciilabel, LEN_DKL_ASCII);        \
-       }
-
-#define        vtoctoextvtoc(v, extv)                                          \
-       {                                                               \
-       int i;                                                          \
-       extv.v_bootinfo[0]      = (uint64_t)v.v_bootinfo[0];            \
-       extv.v_bootinfo[1]      = (uint64_t)v.v_bootinfo[1];            \
-       extv.v_bootinfo[2]      = (uint64_t)v.v_bootinfo[2];            \
-       extv.v_sanity           = (uint64_t)v.v_sanity;                 \
-       extv.v_version          = (uint64_t)v.v_version;                \
-       bcopy(v.v_volume, extv.v_volume, LEN_DKL_VVOL);                 \
-       extv.v_sectorsz         = v.v_sectorsz;                         \
-       extv.v_nparts           = v.v_nparts;                           \
-       for (i = 0; i < 10; i++)                                        \
-               extv.v_reserved[i] = (uint64_t)v.v_reserved[i];         \
-       for (i = 0; i < V_NUMPAR; i++) {                                \
-               extv.v_part[i].p_tag = v.v_part[i].p_tag;               \
-               extv.v_part[i].p_flag = v.v_part[i].p_flag;             \
-               extv.v_part[i].p_start =                                \
-                   (diskaddr_t)(unsigned long)v.v_part[i].p_start;     \
-               extv.v_part[i].p_size =                                 \
-                   (diskaddr_t)(unsigned long)v.v_part[i].p_size;      \
-               extv.timestamp[i] = (uint64_t)v.timestamp[i];           \
-       }                                                               \
-       bcopy(v.v_asciilabel, extv.v_asciilabel, LEN_DKL_ASCII);        \
-       }
-#endif /* _KERNEL */
-
-#if defined(_SYSCALL32)
-struct partition32     {
-       uint16_t        p_tag;          /* ID tag of partition */
-       uint16_t        p_flag;         /* permission flags */
-       daddr32_t       p_start;        /* start sector no of partition */
-       int32_t         p_size;         /* # of blocks in partition */
-};
-
-struct vtoc32 {
-       uint32_t        v_bootinfo[3];  /* info needed by mboot (unsupported) */
-       uint32_t        v_sanity;       /* to verify vtoc sanity */
-       uint32_t        v_version;      /* layout version */
-       char    v_volume[LEN_DKL_VVOL]; /* volume name */
-       uint16_t        v_sectorsz;     /* sector size in bytes */
-       uint16_t        v_nparts;       /* number of partitions */
-       uint32_t        v_reserved[10]; /* free space */
-       struct partition32 v_part[V_NUMPAR]; /* partition headers */
-       time32_t timestamp[V_NUMPAR];   /* partition timestamp (unsupported) */
-       char    v_asciilabel[LEN_DKL_ASCII];    /* for compatibility */
-};
-
-#define        vtoc32tovtoc(v32, v)                            \
-       {                                               \
-       int i;                                          \
-       v.v_bootinfo[0]         = v32.v_bootinfo[0];    \
-       v.v_bootinfo[1]         = v32.v_bootinfo[1];    \
-       v.v_bootinfo[2]         = v32.v_bootinfo[2];    \
-       v.v_sanity              = v32.v_sanity;         \
-       v.v_version             = v32.v_version;        \
-       bcopy(v32.v_volume, v.v_volume, LEN_DKL_VVOL);  \
-       v.v_sectorsz            = v32.v_sectorsz;       \
-       v.v_nparts              = v32.v_nparts;         \
-       v.v_version             = v32.v_version;        \
-       for (i = 0; i < 10; i++)                        \
-               v.v_reserved[i] = v32.v_reserved[i];    \
-       for (i = 0; i < V_NUMPAR; i++) {                \
-               v.v_part[i].p_tag = (ushort_t)v32.v_part[i].p_tag;      \
-               v.v_part[i].p_flag = (ushort_t)v32.v_part[i].p_flag;    \
-               v.v_part[i].p_start = (unsigned)v32.v_part[i].p_start;  \
-               v.v_part[i].p_size = (unsigned)v32.v_part[i].p_size;    \
-       }                                               \
-       for (i = 0; i < V_NUMPAR; i++)                  \
-               v.timestamp[i] = (time_t)v32.timestamp[i];              \
-       bcopy(v32.v_asciilabel, v.v_asciilabel, LEN_DKL_ASCII);         \
-       }
-
-#define        vtoc32toextvtoc(v32, extv)                                      \
-       {                                                               \
-       int i;                                                          \
-       extv.v_bootinfo[0]              = v32.v_bootinfo[0];            \
-       extv.v_bootinfo[1]              = v32.v_bootinfo[1];            \
-       extv.v_bootinfo[2]              = v32.v_bootinfo[2];            \
-       extv.v_sanity           = v32.v_sanity;                         \
-       extv.v_version          = v32.v_version;                        \
-       bcopy(v32.v_volume, extv.v_volume, LEN_DKL_VVOL);               \
-       extv.v_sectorsz         = v32.v_sectorsz;                       \
-       extv.v_nparts           = v32.v_nparts;                         \
-       extv.v_version          = v32.v_version;                        \
-       for (i = 0; i < 10; i++)                                        \
-               extv.v_reserved[i] = v32.v_reserved[i];                 \
-       for (i = 0; i < V_NUMPAR; i++) {                                \
-               extv.v_part[i].p_tag = (ushort_t)v32.v_part[i].p_tag;   \
-               extv.v_part[i].p_flag = (ushort_t)v32.v_part[i].p_flag; \
-               extv.v_part[i].p_start = (diskaddr_t)v32.v_part[i].p_start; \
-               extv.v_part[i].p_size = (diskaddr_t)v32.v_part[i].p_size; \
-               extv.timestamp[i] = (time_t)v32.timestamp[i];           \
-       }                                                               \
-       bcopy(v32.v_asciilabel, extv.v_asciilabel, LEN_DKL_ASCII);      \
-       }
-
-
-#define        vtoctovtoc32(v, v32)                            \
-       {                                               \
-       int i;                                          \
-       v32.v_bootinfo[0]       = v.v_bootinfo[0];      \
-       v32.v_bootinfo[1]       = v.v_bootinfo[1];      \
-       v32.v_bootinfo[2]       = v.v_bootinfo[2];      \
-       v32.v_sanity            = v.v_sanity;           \
-       v32.v_version           = v.v_version;          \
-       bcopy(v.v_volume, v32.v_volume, LEN_DKL_VVOL);  \
-       v32.v_sectorsz          = v.v_sectorsz;         \
-       v32.v_nparts            = v.v_nparts;           \
-       v32.v_version           = v.v_version;          \
-       for (i = 0; i < 10; i++)                        \
-               v32.v_reserved[i] = v.v_reserved[i];    \
-       for (i = 0; i < V_NUMPAR; i++) {                \
-               v32.v_part[i].p_tag = (ushort_t)v.v_part[i].p_tag;      \
-               v32.v_part[i].p_flag = (ushort_t)v.v_part[i].p_flag;    \
-               v32.v_part[i].p_start = (unsigned)v.v_part[i].p_start;  \
-               v32.v_part[i].p_size = (unsigned)v.v_part[i].p_size;    \
-       }                                               \
-       for (i = 0; i < V_NUMPAR; i++) {                \
-               if (v.timestamp[i] > TIME32_MAX)        \
-                       v32.timestamp[i] = TIME32_MAX;  \
-               else                                    \
-                       v32.timestamp[i] = (time32_t)v.timestamp[i];    \
-       }                                               \
-       bcopy(v.v_asciilabel, v32.v_asciilabel, LEN_DKL_ASCII);         \
-       }
-
-#define        extvtoctovtoc32(extv, v32)                              \
-       {                                               \
-       int i;                                          \
-       v32.v_bootinfo[0]       = extv.v_bootinfo[0];   \
-       v32.v_bootinfo[1]       = extv.v_bootinfo[1];   \
-       v32.v_bootinfo[2]       = extv.v_bootinfo[2];   \
-       v32.v_sanity            = extv.v_sanity;                \
-       v32.v_version           = extv.v_version;               \
-       bcopy(extv.v_volume, v32.v_volume, LEN_DKL_VVOL);       \
-       v32.v_sectorsz          = extv.v_sectorsz;              \
-       v32.v_nparts            = extv.v_nparts;                \
-       v32.v_version           = extv.v_version;               \
-       for (i = 0; i < 10; i++)                        \
-               v32.v_reserved[i] = extv.v_reserved[i]; \
-       for (i = 0; i < V_NUMPAR; i++) {                \
-               v32.v_part[i].p_tag = (ushort_t)extv.v_part[i].p_tag;   \
-               v32.v_part[i].p_flag = (ushort_t)extv.v_part[i].p_flag; \
-               v32.v_part[i].p_start = (unsigned)extv.v_part[i].p_start; \
-               v32.v_part[i].p_size = (unsigned)extv.v_part[i].p_size; \
-       }                                               \
-       for (i = 0; i < V_NUMPAR; i++) {                \
-               if (extv.timestamp[i] > TIME32_MAX)     \
-                       v32.timestamp[i] = TIME32_MAX;  \
-               else                                    \
-                       v32.timestamp[i] = (time32_t)extv.timestamp[i]; \
-       }                                               \
-       bcopy(extv.v_asciilabel, v32.v_asciilabel, LEN_DKL_ASCII);      \
-       }
-
-
-#endif /* _SYSCALL32 */
-
-/*
- * These defines are the mode parameter for the checksum routines.
- */
-#define        CK_CHECKSUM     0       /* check checksum */
-#define        CK_MAKESUM      1       /* generate checksum */
-
-#if defined(__STDC__)
-
-extern int     read_vtoc(int, struct vtoc *);
-extern int     write_vtoc(int, struct vtoc *);
-extern int     read_extvtoc(int, struct extvtoc *);
-extern int     write_extvtoc(int, struct extvtoc *);
-
-#else
-
-extern int     read_vtoc();
-extern int     write_vtoc();
-extern int     read_extvtoc();
-extern int     write_extvtoc();
-
-#endif         /* __STDC__ */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _SYS_VTOC_H */
diff --git a/zfs/lib/libspl/include/sys/zone.h b/zfs/lib/libspl/include/sys/zone.h
deleted file mode 100644 (file)
index bbb964d..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_SYS_ZONE_H
-#define        _LIBSPL_SYS_ZONE_H
-
-#endif
diff --git a/zfs/lib/libspl/include/thread.h b/zfs/lib/libspl/include/thread.h
deleted file mode 100644 (file)
index 74694e2..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_THREAD_H
-#define        _LIBSPL_THREAD_H
-
-#endif /* _LIBSPL_THREAD_H */
diff --git a/zfs/lib/libspl/include/tzfile.h b/zfs/lib/libspl/include/tzfile.h
deleted file mode 100644 (file)
index 7bd4087..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_TZFILE_H
-#define        _LIBSPL_TZFILE_H
-
-#include <sys/tzfile.h>
-
-#endif /* _LIBSPL_TZFILE_H */
diff --git a/zfs/lib/libspl/include/ucred.h b/zfs/lib/libspl/include/ucred.h
deleted file mode 100644 (file)
index 8178fde..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_UCRED_H
-#define        _LIBSPL_UCRED_H
-
-typedef int ucred_t;
-
-#endif
diff --git a/zfs/lib/libspl/include/umem.h b/zfs/lib/libspl/include/umem.h
deleted file mode 100644 (file)
index a89cb49..0000000
+++ /dev/null
@@ -1,203 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_UMEM_H
-#define        _LIBSPL_UMEM_H
-
-/*
- * XXX: We should use the real portable umem library if it is detected
- * at configure time.  However, if the library is not available, we can
- * use a trivial malloc based implementation.  This obviously impacts
- * performance, but unless you are using a full userspace build of zpool for
- * something other than ztest, you are likely not going to notice or care.
- *
- * https://labs.omniti.com/trac/portableumem
- */
-
-#include <stdlib.h>
-#include <stdio.h>
-
-#ifdef  __cplusplus
-extern "C" {
-#endif
-
-typedef void vmem_t;
-
-/*
- * Flags for umem_alloc/umem_free
- */
-#define        UMEM_DEFAULT            0x0000  /* normal -- may fail */
-#define        UMEM_NOFAIL             0x0100  /* Never fails */
-
-/*
- * Flags for umem_cache_create()
- */
-#define        UMC_NOTOUCH             0x00010000
-#define        UMC_NODEBUG             0x00020000
-#define        UMC_NOMAGAZINE          0x00040000
-#define        UMC_NOHASH              0x00080000
-
-#define        UMEM_CACHE_NAMELEN      31
-
-typedef int umem_nofail_callback_t(void);
-typedef int umem_constructor_t(void *, void *, int);
-typedef void umem_destructor_t(void *, void *);
-typedef void umem_reclaim_t(void *);
-
-typedef struct umem_cache {
-       char                    cache_name[UMEM_CACHE_NAMELEN + 1];
-       size_t                  cache_bufsize;
-       size_t                  cache_align;
-       umem_constructor_t      *cache_constructor;
-       umem_destructor_t       *cache_destructor;
-       umem_reclaim_t          *cache_reclaim;
-       void                    *cache_private;
-       void                    *cache_arena;
-       int                     cache_cflags;
-} umem_cache_t;
-
-static inline void *
-umem_alloc(size_t size, int flags)
-{
-       void *ptr = NULL;
-
-       do {
-               ptr = malloc(size);
-       } while (ptr == NULL && (flags & UMEM_NOFAIL));
-
-       return (ptr);
-}
-
-static inline void *
-umem_alloc_aligned(size_t size, size_t align, int flags)
-{
-       void *ptr = NULL;
-       int rc = EINVAL;
-
-       do {
-               rc = posix_memalign(&ptr, align, size);
-       } while (rc == ENOMEM && (flags & UMEM_NOFAIL));
-
-       if (rc == EINVAL) {
-               fprintf(stderr, "%s: invalid memory alignment (%zd)\n",
-                   __func__, align);
-               if (flags & UMEM_NOFAIL)
-                       abort();
-               return (NULL);
-       }
-
-       return (ptr);
-}
-
-static inline void *
-umem_zalloc(size_t size, int flags)
-{
-       void *ptr = NULL;
-
-       ptr = umem_alloc(size, flags);
-       if (ptr)
-               memset(ptr, 0, size);
-
-       return (ptr);
-}
-
-static inline void
-umem_free(void *ptr, size_t size)
-{
-       free(ptr);
-}
-
-static inline void
-umem_nofail_callback(umem_nofail_callback_t *cb) {}
-
-static inline umem_cache_t *
-umem_cache_create(
-    char *name, size_t bufsize, size_t align,
-    umem_constructor_t *constructor,
-    umem_destructor_t *destructor,
-    umem_reclaim_t *reclaim,
-    void *priv, void *vmp, int cflags)
-{
-       umem_cache_t *cp;
-
-       cp = umem_alloc(sizeof (umem_cache_t), UMEM_DEFAULT);
-       if (cp) {
-               strncpy(cp->cache_name, name, UMEM_CACHE_NAMELEN);
-               cp->cache_bufsize = bufsize;
-               cp->cache_align = align;
-               cp->cache_constructor = constructor;
-               cp->cache_destructor = destructor;
-               cp->cache_reclaim = reclaim;
-               cp->cache_private = priv;
-               cp->cache_arena = vmp;
-               cp->cache_cflags = cflags;
-       }
-
-       return (cp);
-}
-
-static inline void
-umem_cache_destroy(umem_cache_t *cp)
-{
-       umem_free(cp, sizeof (umem_cache_t));
-}
-
-static inline void *
-umem_cache_alloc(umem_cache_t *cp, int flags)
-{
-       void *ptr = NULL;
-
-       if (cp->cache_align != 0)
-               ptr = umem_alloc_aligned(
-                   cp->cache_bufsize, cp->cache_align, flags);
-       else
-               ptr = umem_alloc(cp->cache_bufsize, flags);
-
-       if (ptr && cp->cache_constructor)
-               cp->cache_constructor(ptr, cp->cache_private, UMEM_DEFAULT);
-
-       return (ptr);
-}
-
-static inline void
-umem_cache_free(umem_cache_t *cp, void *ptr)
-{
-       if (cp->cache_destructor)
-               cp->cache_destructor(ptr, cp->cache_private);
-
-       umem_free(ptr, cp->cache_bufsize);
-}
-
-static inline void
-umem_cache_reap_now(umem_cache_t *cp)
-{
-}
-
-#ifdef  __cplusplus
-}
-#endif
-
-#endif
diff --git a/zfs/lib/libspl/include/unistd.h b/zfs/lib/libspl/include/unistd.h
deleted file mode 100644 (file)
index 0246991..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include_next <unistd.h>
-
-#ifndef _LIBSPL_UNISTD_H
-#define        _LIBSPL_UNISTD_H
-
-#include <sys/ioctl.h>
-
-#if !defined(HAVE_ISSETUGID)
-#include <sys/types.h>
-#define        issetugid() (geteuid() == 0 || getegid() == 0)
-#endif
-
-#endif /* _LIBSPL_UNISTD_H */
diff --git a/zfs/lib/libspl/include/util/Makefile.am b/zfs/lib/libspl/include/util/Makefile.am
deleted file mode 100644 (file)
index 060e143..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-libspldir = $(includedir)/libspl
-libspl_HEADERS = \
-       $(top_srcdir)/lib/libspl/include/util/sscanf.h
diff --git a/zfs/lib/libspl/include/util/Makefile.in b/zfs/lib/libspl/include/util/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libspl/include/util/sscanf.h b/zfs/lib/libspl/include/util/sscanf.h
deleted file mode 100644 (file)
index ead36ac..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_UTIL_SSCANF_H
-#define        _LIBSPL_UTIL_SSCANF_H
-
-#endif
diff --git a/zfs/lib/libspl/include/zone.h b/zfs/lib/libspl/include/zone.h
deleted file mode 100644 (file)
index b4a6deb..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#ifndef _LIBSPL_ZONE_H
-#define        _LIBSPL_ZONE_H
-
-
-
-#include <sys/types.h>
-#include <sys/zone.h>
-#include <sys/priv.h>
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#define        GLOBAL_ZONEID           0
-#define        GLOBAL_ZONEID_NAME      "global"
-
-/*
- * Functions for mapping between id and name for active zones.
- */
-extern zoneid_t                getzoneid(void);
-extern zoneid_t                getzoneidbyname(const char *);
-extern ssize_t         getzonenamebyid(zoneid_t, char *, size_t);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _LIBSPL_ZONE_H */
diff --git a/zfs/lib/libspl/list.c b/zfs/lib/libspl/list.c
deleted file mode 100644 (file)
index b29dc8a..0000000
+++ /dev/null
@@ -1,243 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Generic doubly-linked list implementation
- */
-
-#include <sys/list.h>
-#include <sys/list_impl.h>
-#include <sys/types.h>
-#include <sys/sysmacros.h>
-#include <sys/debug.h>
-
-#define        list_d2l(a, obj) ((list_node_t *)(((char *)obj) + (a)->list_offset))
-#define        list_object(a, node) ((void *)(((char *)node) - (a)->list_offset))
-#define        list_empty(a) ((a)->list_head.list_next == &(a)->list_head)
-
-#define        list_insert_after_node(list, node, object) {    \
-       list_node_t *lnew = list_d2l(list, object);     \
-       lnew->list_prev = (node);                       \
-       lnew->list_next = (node)->list_next;            \
-       (node)->list_next->list_prev = lnew;            \
-       (node)->list_next = lnew;                       \
-}
-
-#define        list_insert_before_node(list, node, object) {   \
-       list_node_t *lnew = list_d2l(list, object);     \
-       lnew->list_next = (node);                       \
-       lnew->list_prev = (node)->list_prev;            \
-       (node)->list_prev->list_next = lnew;            \
-       (node)->list_prev = lnew;                       \
-}
-
-#define        list_remove_node(node)                                  \
-       (node)->list_prev->list_next = (node)->list_next;       \
-       (node)->list_next->list_prev = (node)->list_prev;       \
-       (node)->list_next = (node)->list_prev = NULL
-
-void
-list_create(list_t *list, size_t size, size_t offset)
-{
-       ASSERT(list);
-       ASSERT(size > 0);
-       ASSERT(size >= offset + sizeof (list_node_t));
-
-       list->list_size = size;
-       list->list_offset = offset;
-       list->list_head.list_next = list->list_head.list_prev =
-           &list->list_head;
-}
-
-void
-list_destroy(list_t *list)
-{
-       list_node_t *node = &list->list_head;
-
-       ASSERT(list);
-       ASSERT(list->list_head.list_next == node);
-       ASSERT(list->list_head.list_prev == node);
-
-       node->list_next = node->list_prev = NULL;
-}
-
-void
-list_insert_after(list_t *list, void *object, void *nobject)
-{
-       if (object == NULL) {
-               list_insert_head(list, nobject);
-       } else {
-               list_node_t *lold = list_d2l(list, object);
-               list_insert_after_node(list, lold, nobject);
-       }
-}
-
-void
-list_insert_before(list_t *list, void *object, void *nobject)
-{
-       if (object == NULL) {
-               list_insert_tail(list, nobject);
-       } else {
-               list_node_t *lold = list_d2l(list, object);
-               list_insert_before_node(list, lold, nobject);
-       }
-}
-
-void
-list_insert_head(list_t *list, void *object)
-{
-       list_node_t *lold = &list->list_head;
-       list_insert_after_node(list, lold, object);
-}
-
-void
-list_insert_tail(list_t *list, void *object)
-{
-       list_node_t *lold = &list->list_head;
-       list_insert_before_node(list, lold, object);
-}
-
-void
-list_remove(list_t *list, void *object)
-{
-       list_node_t *lold = list_d2l(list, object);
-       ASSERT(!list_empty(list));
-       ASSERT(lold->list_next != NULL);
-       list_remove_node(lold);
-}
-
-void *
-list_remove_head(list_t *list)
-{
-       list_node_t *head = list->list_head.list_next;
-       if (head == &list->list_head)
-               return (NULL);
-       list_remove_node(head);
-       return (list_object(list, head));
-}
-
-void *
-list_remove_tail(list_t *list)
-{
-       list_node_t *tail = list->list_head.list_prev;
-       if (tail == &list->list_head)
-               return (NULL);
-       list_remove_node(tail);
-       return (list_object(list, tail));
-}
-
-void *
-list_head(list_t *list)
-{
-       if (list_empty(list))
-               return (NULL);
-       return (list_object(list, list->list_head.list_next));
-}
-
-void *
-list_tail(list_t *list)
-{
-       if (list_empty(list))
-               return (NULL);
-       return (list_object(list, list->list_head.list_prev));
-}
-
-void *
-list_next(list_t *list, void *object)
-{
-       list_node_t *node = list_d2l(list, object);
-
-       if (node->list_next != &list->list_head)
-               return (list_object(list, node->list_next));
-
-       return (NULL);
-}
-
-void *
-list_prev(list_t *list, void *object)
-{
-       list_node_t *node = list_d2l(list, object);
-
-       if (node->list_prev != &list->list_head)
-               return (list_object(list, node->list_prev));
-
-       return (NULL);
-}
-
-/*
- *  Insert src list after dst list. Empty src list thereafter.
- */
-void
-list_move_tail(list_t *dst, list_t *src)
-{
-       list_node_t *dstnode = &dst->list_head;
-       list_node_t *srcnode = &src->list_head;
-
-       ASSERT(dst->list_size == src->list_size);
-       ASSERT(dst->list_offset == src->list_offset);
-
-       if (list_empty(src))
-               return;
-
-       dstnode->list_prev->list_next = srcnode->list_next;
-       srcnode->list_next->list_prev = dstnode->list_prev;
-       dstnode->list_prev = srcnode->list_prev;
-       srcnode->list_prev->list_next = dstnode;
-
-       /* empty src list */
-       srcnode->list_next = srcnode->list_prev = srcnode;
-}
-
-void
-list_link_replace(list_node_t *lold, list_node_t *lnew)
-{
-       ASSERT(list_link_active(lold));
-       ASSERT(!list_link_active(lnew));
-
-       lnew->list_next = lold->list_next;
-       lnew->list_prev = lold->list_prev;
-       lold->list_prev->list_next = lnew;
-       lold->list_next->list_prev = lnew;
-       lold->list_next = lold->list_prev = NULL;
-}
-
-void
-list_link_init(list_node_t *ln)
-{
-       ln->list_next = NULL;
-       ln->list_prev = NULL;
-}
-
-int
-list_link_active(list_node_t *ln)
-{
-       return (ln->list_next != NULL);
-}
-
-int
-list_is_empty(list_t *list)
-{
-       return (list_empty(list));
-}
diff --git a/zfs/lib/libspl/mkdirp.c b/zfs/lib/libspl/mkdirp.c
deleted file mode 100644 (file)
index 2f09188..0000000
+++ /dev/null
@@ -1,212 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*     Copyright (c) 1988 AT&T */
-/*       All Rights Reserved   */
-
-/*
- * Creates directory and it's parents if the parents do not
- * exist yet.
- *
- * Returns -1 if fails for reasons other than non-existing
- * parents.
- * Does NOT simplify pathnames with . or .. in them.
- */
-
-#include <sys/types.h>
-#include <libgen.h>
-#include <stdlib.h>
-#include <unistd.h>
-#include <errno.h>
-#include <string.h>
-#include <sys/stat.h>
-
-static char *simplify(const char *str);
-
-int
-mkdirp(const char *d, mode_t mode)
-{
-       char  *endptr, *ptr, *slash, *str;
-
-       str = simplify(d);
-
-       /* If space couldn't be allocated for the simplified names, return. */
-
-       if (str == NULL)
-               return (-1);
-
-               /* Try to make the directory */
-
-       if (mkdir(str, mode) == 0) {
-               free(str);
-               return (0);
-       }
-       if (errno != ENOENT) {
-               free(str);
-               return (-1);
-       }
-       endptr = strrchr(str, '\0');
-       slash = strrchr(str, '/');
-
-               /* Search upward for the non-existing parent */
-
-       while (slash != NULL) {
-
-               ptr = slash;
-               *ptr = '\0';
-
-                       /* If reached an existing parent, break */
-
-               if (access(str, F_OK) == 0)
-                       break;
-
-                       /* If non-existing parent */
-
-               else {
-                       slash = strrchr(str, '/');
-
-                               /* If under / or current directory, make it. */
-
-                       if (slash == NULL || slash == str) {
-                               if (mkdir(str, mode) != 0 && errno != EEXIST) {
-                                       free(str);
-                                       return (-1);
-                               }
-                               break;
-                       }
-               }
-       }
-
-       /* Create directories starting from upmost non-existing parent */
-
-       while ((ptr = strchr(str, '\0')) != endptr) {
-               *ptr = '/';
-               if (mkdir(str, mode) != 0 && errno != EEXIST) {
-                       /*
-                        *  If the mkdir fails because str already
-                        *  exists (EEXIST), then str has the form
-                        *  "existing-dir/..", and this is really
-                        *  ok. (Remember, this loop is creating the
-                        *  portion of the path that didn't exist)
-                        */
-                       free(str);
-                       return (-1);
-               }
-       }
-       free(str);
-       return (0);
-}
-
-/*
- *     simplify - given a pathname, simplify that path by removing
- *                duplicate contiguous slashes.
- *
- *                A simplified copy of the argument is returned to the
- *                caller, or NULL is returned on error.
- *
- *                The caller should handle error reporting based upon the
- *                returned vlaue, and should free the returned value,
- *                when appropriate.
- */
-
-static char *
-simplify(const char *str)
-{
-       int i;
-       size_t mbPathlen;       /* length of multi-byte path */
-       size_t wcPathlen;       /* length of wide-character path */
-       wchar_t *wptr;          /* scratch pointer */
-       wchar_t *wcPath;        /* wide-character version of the path */
-       char *mbPath;           /* The copy fo the path to be returned */
-
-       /*
-        *  bail out if there is nothing there.
-        */
-
-       if (!str) {
-               errno = ENOENT;
-               return (NULL);
-       }
-
-       /*
-        *  Get a copy of the argument.
-        */
-
-       if ((mbPath = strdup(str)) == NULL) {
-               return (NULL);
-       }
-
-       /*
-        *  convert the multi-byte version of the path to a
-        *  wide-character rendering, for doing our figuring.
-        */
-
-       mbPathlen = strlen(mbPath);
-
-       if ((wcPath = calloc(sizeof (wchar_t), mbPathlen+1)) == NULL) {
-               free(mbPath);
-               return (NULL);
-       }
-
-       if ((wcPathlen = mbstowcs(wcPath, mbPath, mbPathlen)) == (size_t)-1) {
-               free(mbPath);
-               free(wcPath);
-               return (NULL);
-       }
-
-       /*
-        *  remove duplicate slashes first ("//../" -> "/")
-        */
-
-       for (wptr = wcPath, i = 0; i < wcPathlen; i++) {
-               *wptr++ = wcPath[i];
-
-               if (wcPath[i] == '/') {
-                       i++;
-
-                       while (wcPath[i] == '/') {
-                               i++;
-                       }
-
-                       i--;
-               }
-       }
-
-       *wptr = '\0';
-
-       /*
-        *  now convert back to the multi-byte format.
-        */
-
-       if (wcstombs(mbPath, wcPath, mbPathlen) == (size_t)-1) {
-               free(mbPath);
-               free(wcPath);
-               return (NULL);
-       }
-
-       free(wcPath);
-       return (mbPath);
-}
diff --git a/zfs/lib/libspl/strlcat.c b/zfs/lib/libspl/strlcat.c
deleted file mode 100644 (file)
index a001df7..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <string.h>
-#include <sys/types.h>
-
-/*
- * Appends src to the dstsize buffer at dst. The append will never
- * overflow the destination buffer and the buffer will always be null
- * terminated. Never reference beyond &dst[dstsize-1] when computing
- * the length of the pre-existing string.
- */
-
-size_t
-strlcat(char *dst, const char *src, size_t dstsize)
-{
-       char *df = dst;
-       size_t left = dstsize;
-       size_t l1;
-       size_t l2 = strlen(src);
-       size_t copied;
-
-       while (left-- != 0 && *df != '\0')
-               df++;
-       l1 = df - dst;
-       if (dstsize == l1)
-               return (l1 + l2);
-
-       copied = l1 + l2 >= dstsize ? dstsize - l1 - 1 : l2;
-       (void) memcpy(dst + l1, src, copied);
-       dst[l1+copied] = '\0';
-       return (l1 + l2);
-}
diff --git a/zfs/lib/libspl/strlcpy.c b/zfs/lib/libspl/strlcpy.c
deleted file mode 100644 (file)
index 2d0daae..0000000
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <string.h>
-#include <sys/types.h>
-
-/*
- * Copies src to the dstsize buffer at dst. The copy will never
- * overflow the destination buffer and the buffer will always be null
- * terminated.
- */
-
-size_t
-strlcpy(char *dst, const char *src, size_t len)
-{
-       size_t slen = strlen(src);
-       size_t copied;
-
-       if (len == 0)
-               return (slen);
-
-       if (slen >= len)
-               copied = len - 1;
-       else
-               copied = slen;
-       (void) memcpy(dst, src, copied);
-       dst[copied] = '\0';
-       return (slen);
-}
diff --git a/zfs/lib/libspl/strnlen.c b/zfs/lib/libspl/strnlen.c
deleted file mode 100644 (file)
index 9fb8227..0000000
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2008 Sun Microsystems, Inc.
- * All rights reserved.  Use is subject to license terms.
- */
-
-#include <string.h>
-#include <sys/types.h>
-
-/*
- * Returns the number of non-NULL bytes in string argument,
- * but not more than maxlen.  Does not look past str + maxlen.
- */
-size_t
-strnlen(const char *str, size_t maxlen)
-{
-       const char *ptr;
-
-       ptr = memchr(str, 0, maxlen);
-       if (ptr == NULL)
-               return (maxlen);
-
-       return (ptr - str);
-}
diff --git a/zfs/lib/libspl/timestamp.c b/zfs/lib/libspl/timestamp.c
deleted file mode 100644 (file)
index a4f4cf4..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <stdio.h>
-#include <time.h>
-#include <langinfo.h>
-#include "statcommon.h"
-
-/*
- * Print timestamp as decimal reprentation of time_t value (-T u was specified)
- * or in date(1) format (-T d was specified).
- */
-void
-print_timestamp(uint_t timestamp_fmt)
-{
-       time_t t = time(NULL);
-       static char *fmt = NULL;
-
-       /* We only need to retrieve this once per invocation */
-       if (fmt == NULL)
-               fmt = nl_langinfo(_DATE_FMT);
-
-       if (timestamp_fmt == UDATE) {
-               (void) printf("%ld\n", t);
-       } else if (timestamp_fmt == DDATE) {
-               char dstr[64];
-               int len;
-
-               len = strftime(dstr, sizeof (dstr), fmt, localtime(&t));
-               if (len > 0)
-                       (void) printf("%s\n", dstr);
-       }
-}
diff --git a/zfs/lib/libspl/xdr.c b/zfs/lib/libspl/xdr.c
deleted file mode 100644 (file)
index 288a338..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- *
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- *     Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T
- *       All Rights Reserved
- *
- * Portions of this source code were derived from Berkeley 4.3 BSD
- * under license from the Regents of the University of California.
- */
-
-#include <rpc/xdr.h>
-
-/*
- * As of glibc-2.5-25 there is not support for xdr_control().  The
- * xdrmem implementation from OpenSolaris is used here.
- *
- * FIXME: Not well tested it may not work as expected.
- */
-bool_t
-xdr_control(XDR *xdrs, int request, void *info)
-{
-       xdr_bytesrec_t *xptr;
-       int32_t *int32p;
-       int len;
-
-       switch (request) {
-       case XDR_GET_BYTES_AVAIL:
-               xptr = (xdr_bytesrec_t *)info;
-               xptr->xc_is_last_record = TRUE;
-               xptr->xc_num_avail = xdrs->x_handy;
-               return (TRUE);
-
-       case XDR_PEEK:
-               /*
-                * Return the next 4 byte unit in the XDR stream.
-                */
-               if (xdrs->x_handy < sizeof (int32_t))
-                       return (FALSE);
-               int32p = (int32_t *)info;
-               *int32p = (int32_t)ntohl((uint32_t)
-                   (*((int32_t *)(xdrs->x_private))));
-               return (TRUE);
-
-       case XDR_SKIPBYTES:
-               /*
-                * Skip the next N bytes in the XDR stream.
-                */
-               int32p = (int32_t *)info;
-               len = RNDUP((int)(*int32p));
-               if ((xdrs->x_handy -= len) < 0)
-                       return (FALSE);
-               xdrs->x_private += len;
-               return (TRUE);
-
-       }
-       return (FALSE);
-}
diff --git a/zfs/lib/libspl/zone.c b/zfs/lib/libspl/zone.c
deleted file mode 100644 (file)
index 5ca93b2..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2006 Ricardo Correia.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <zone.h>
-#include <string.h>
-#include <errno.h>
-
-zoneid_t
-getzoneid()
-{
-       return (GLOBAL_ZONEID);
-}
-
-zoneid_t
-getzoneidbyname(const char *name)
-{
-       if (name == NULL)
-               return (GLOBAL_ZONEID);
-
-       if (strcmp(name, GLOBAL_ZONEID_NAME) == 0)
-               return (GLOBAL_ZONEID);
-
-       return (EINVAL);
-}
-
-ssize_t
-getzonenamebyid(zoneid_t id, char *buf, size_t buflen)
-{
-       if (id != GLOBAL_ZONEID)
-               return (EINVAL);
-
-       ssize_t ret = strlen(GLOBAL_ZONEID_NAME) + 1;
-
-       if (buf == NULL || buflen == 0)
-               return (ret);
-
-       strncpy(buf, GLOBAL_ZONEID_NAME, buflen);
-       buf[buflen - 1] = '\0';
-
-       return (ret);
-}
diff --git a/zfs/lib/libunicode/Makefile.am b/zfs/lib/libunicode/Makefile.am
deleted file mode 100644 (file)
index 9bacae2..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-VPATH = $(top_srcdir)/module/unicode
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-noinst_LTLIBRARIES = libunicode.la
-
-USER_C =
-
-KERNEL_C = \
-       u8_textprep.c \
-       uconv.c
-
-nodist_libunicode_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libunicode/Makefile.in b/zfs/lib/libunicode/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libuutil/Makefile.am b/zfs/lib/libuutil/Makefile.am
deleted file mode 100644 (file)
index 4d54485..0000000
+++ /dev/null
@@ -1,36 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-lib_LTLIBRARIES = libuutil.la
-
-USER_C = \
-       uu_alloc.c \
-       uu_avl.c \
-       uu_dprintf.c \
-       uu_ident.c \
-       uu_list.c \
-       uu_misc.c \
-       uu_open.c \
-       uu_pname.c \
-       uu_string.c \
-       uu_strtoint.c
-
-KERNEL_C =
-
-nodist_libuutil_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-libuutil_la_LIBADD = \
-       $(top_builddir)/lib/libavl/libavl.la \
-       $(top_builddir)/lib/libspl/libspl.la \
-       $(top_builddir)/lib/libefi/libefi.la
-
-libuutil_la_LDFLAGS = -pthread -version-info 1:1:0
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libuutil/Makefile.in b/zfs/lib/libuutil/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libuutil/uu_alloc.c b/zfs/lib/libuutil/uu_alloc.c
deleted file mode 100644 (file)
index 2bef759..0000000
+++ /dev/null
@@ -1,135 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include "libuutil_common.h"
-
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-
-void *
-uu_zalloc(size_t n)
-{
-       void *p = malloc(n);
-
-       if (p == NULL) {
-               uu_set_error(UU_ERROR_SYSTEM);
-               return (NULL);
-       }
-
-       (void) memset(p, 0, n);
-
-       return (p);
-}
-
-void
-uu_free(void *p)
-{
-       free(p);
-}
-
-char *
-uu_strdup(const char *str)
-{
-       char *buf = NULL;
-
-       if (str != NULL) {
-               size_t sz;
-
-               sz = strlen(str) + 1;
-               buf = uu_zalloc(sz);
-               if (buf != NULL)
-                       (void) memcpy(buf, str, sz);
-       }
-       return (buf);
-}
-
-/*
- * Duplicate up to n bytes of a string.  Kind of sort of like
- * strdup(strlcpy(s, n)).
- */
-char *
-uu_strndup(const char *s, size_t n)
-{
-       size_t len;
-       char *p;
-
-       len = strnlen(s, n);
-       p = uu_zalloc(len + 1);
-       if (p == NULL)
-               return (NULL);
-
-       if (len > 0)
-               (void) memcpy(p, s, len);
-       p[len] = '\0';
-
-       return (p);
-}
-
-/*
- * Duplicate a block of memory.  Combines malloc with memcpy, much as
- * strdup combines malloc, strlen, and strcpy.
- */
-void *
-uu_memdup(const void *buf, size_t sz)
-{
-       void *p;
-
-       p = uu_zalloc(sz);
-       if (p == NULL)
-               return (NULL);
-       (void) memcpy(p, buf, sz);
-       return (p);
-}
-
-char *
-uu_msprintf(const char *format, ...)
-{
-       va_list args;
-       char attic[1];
-       uint_t M, m;
-       char *b;
-
-       va_start(args, format);
-       M = vsnprintf(attic, 1, format, args);
-       va_end(args);
-
-       for (;;) {
-               m = M;
-               if ((b = uu_zalloc(m + 1)) == NULL)
-                       return (NULL);
-
-               va_start(args, format);
-               M = vsnprintf(b, m + 1, format, args);
-               va_end(args);
-
-               if (M == m)
-                       break;          /* sizes match */
-
-               uu_free(b);
-       }
-
-       return (b);
-}
diff --git a/zfs/lib/libuutil/uu_avl.c b/zfs/lib/libuutil/uu_avl.c
deleted file mode 100644 (file)
index 0400088..0000000
+++ /dev/null
@@ -1,569 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include "libuutil_common.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/avl.h>
-
-static uu_avl_pool_t   uu_null_apool = { &uu_null_apool, &uu_null_apool };
-static pthread_mutex_t uu_apool_list_lock = PTHREAD_MUTEX_INITIALIZER;
-
-/*
- * The index mark change on every insert and delete, to catch stale
- * references.
- *
- * We leave the low bit alone, since the avl code uses it.
- */
-#define        INDEX_MAX               (sizeof (uintptr_t) - 2)
-#define        INDEX_NEXT(m)           (((m) == INDEX_MAX)? 2 : ((m) + 2) & INDEX_MAX)
-
-#define        INDEX_DECODE(i)         ((i) & ~INDEX_MAX)
-#define        INDEX_ENCODE(p, n)      (((n) & ~INDEX_MAX) | (p)->ua_index)
-#define        INDEX_VALID(p, i)       (((i) & INDEX_MAX) == (p)->ua_index)
-#define        INDEX_CHECK(i)          (((i) & INDEX_MAX) != 0)
-
-/*
- * When an element is inactive (not in a tree), we keep a marked pointer to
- * its containing pool in its first word, and a NULL pointer in its second.
- *
- * On insert, we use these to verify that it comes from the correct pool.
- */
-#define        NODE_ARRAY(p, n)        ((uintptr_t *)((uintptr_t)(n) + \
-                                   (pp)->uap_nodeoffset))
-
-#define        POOL_TO_MARKER(pp) (((uintptr_t)(pp) | 1))
-
-#define        DEAD_MARKER             0xc4
-
-uu_avl_pool_t *
-uu_avl_pool_create(const char *name, size_t objsize, size_t nodeoffset,
-    uu_compare_fn_t *compare_func, uint32_t flags)
-{
-       uu_avl_pool_t *pp, *next, *prev;
-
-       if (name == NULL ||
-           uu_check_name(name, UU_NAME_DOMAIN) == -1 ||
-           nodeoffset + sizeof (uu_avl_node_t) > objsize ||
-           compare_func == NULL) {
-               uu_set_error(UU_ERROR_INVALID_ARGUMENT);
-               return (NULL);
-       }
-
-       if (flags & ~UU_AVL_POOL_DEBUG) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (NULL);
-       }
-
-       pp = uu_zalloc(sizeof (uu_avl_pool_t));
-       if (pp == NULL) {
-               uu_set_error(UU_ERROR_NO_MEMORY);
-               return (NULL);
-       }
-
-       (void) strlcpy(pp->uap_name, name, sizeof (pp->uap_name));
-       pp->uap_nodeoffset = nodeoffset;
-       pp->uap_objsize = objsize;
-       pp->uap_cmp = compare_func;
-       if (flags & UU_AVL_POOL_DEBUG)
-               pp->uap_debug = 1;
-       pp->uap_last_index = 0;
-
-       (void) pthread_mutex_init(&pp->uap_lock, NULL);
-
-       pp->uap_null_avl.ua_next_enc = UU_PTR_ENCODE(&pp->uap_null_avl);
-       pp->uap_null_avl.ua_prev_enc = UU_PTR_ENCODE(&pp->uap_null_avl);
-
-       (void) pthread_mutex_lock(&uu_apool_list_lock);
-       pp->uap_next = next = &uu_null_apool;
-       pp->uap_prev = prev = next->uap_prev;
-       next->uap_prev = pp;
-       prev->uap_next = pp;
-       (void) pthread_mutex_unlock(&uu_apool_list_lock);
-
-       return (pp);
-}
-
-void
-uu_avl_pool_destroy(uu_avl_pool_t *pp)
-{
-       if (pp->uap_debug) {
-               if (pp->uap_null_avl.ua_next_enc !=
-                   UU_PTR_ENCODE(&pp->uap_null_avl) ||
-                   pp->uap_null_avl.ua_prev_enc !=
-                   UU_PTR_ENCODE(&pp->uap_null_avl)) {
-                       uu_panic("uu_avl_pool_destroy: Pool \"%.*s\" (%p) has "
-                           "outstanding avls, or is corrupt.\n",
-                           (int)sizeof (pp->uap_name), pp->uap_name,
-                           (void *)pp);
-               }
-       }
-       (void) pthread_mutex_lock(&uu_apool_list_lock);
-       pp->uap_next->uap_prev = pp->uap_prev;
-       pp->uap_prev->uap_next = pp->uap_next;
-       (void) pthread_mutex_unlock(&uu_apool_list_lock);
-       pp->uap_prev = NULL;
-       pp->uap_next = NULL;
-       uu_free(pp);
-}
-
-void
-uu_avl_node_init(void *base, uu_avl_node_t *np, uu_avl_pool_t *pp)
-{
-       uintptr_t *na = (uintptr_t *)np;
-
-       if (pp->uap_debug) {
-               uintptr_t offset = (uintptr_t)np - (uintptr_t)base;
-               if (offset + sizeof (*np) > pp->uap_objsize) {
-                       uu_panic("uu_avl_node_init(%p, %p, %p (\"%s\")): "
-                           "offset %ld doesn't fit in object (size %ld)\n",
-                           base, (void *)np, (void *)pp, pp->uap_name,
-                           (long)offset, (long)pp->uap_objsize);
-               }
-               if (offset != pp->uap_nodeoffset) {
-                       uu_panic("uu_avl_node_init(%p, %p, %p (\"%s\")): "
-                           "offset %ld doesn't match pool's offset (%ld)\n",
-                           base, (void *)np, (void *)pp, pp->uap_name,
-                           (long)offset, (long)pp->uap_objsize);
-               }
-       }
-
-       na[0] = POOL_TO_MARKER(pp);
-       na[1] = 0;
-}
-
-void
-uu_avl_node_fini(void *base, uu_avl_node_t *np, uu_avl_pool_t *pp)
-{
-       uintptr_t *na = (uintptr_t *)np;
-
-       if (pp->uap_debug) {
-               if (na[0] == DEAD_MARKER && na[1] == DEAD_MARKER) {
-                       uu_panic("uu_avl_node_fini(%p, %p, %p (\"%s\")): "
-                           "node already finied\n",
-                           base, (void *)np, (void *)pp, pp->uap_name);
-               }
-               if (na[0] != POOL_TO_MARKER(pp) || na[1] != 0) {
-                       uu_panic("uu_avl_node_fini(%p, %p, %p (\"%s\")): "
-                           "node corrupt, in tree, or in different pool\n",
-                           base, (void *)np, (void *)pp, pp->uap_name);
-               }
-       }
-
-       na[0] = DEAD_MARKER;
-       na[1] = DEAD_MARKER;
-       na[2] = DEAD_MARKER;
-}
-
-struct uu_avl_node_compare_info {
-       uu_compare_fn_t *ac_compare;
-       void            *ac_private;
-       void            *ac_right;
-       void            *ac_found;
-};
-
-static int
-uu_avl_node_compare(const void *l, const void *r)
-{
-       struct uu_avl_node_compare_info *info =
-           (struct uu_avl_node_compare_info *)l;
-
-       int res = info->ac_compare(r, info->ac_right, info->ac_private);
-
-       if (res == 0) {
-               if (info->ac_found == NULL)
-                       info->ac_found = (void *)r;
-               return (-1);
-       }
-       if (res < 0)
-               return (1);
-       return (-1);
-}
-
-uu_avl_t *
-uu_avl_create(uu_avl_pool_t *pp, void *parent, uint32_t flags)
-{
-       uu_avl_t *ap, *next, *prev;
-
-       if (flags & ~UU_AVL_DEBUG) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (NULL);
-       }
-
-       ap = uu_zalloc(sizeof (*ap));
-       if (ap == NULL) {
-               uu_set_error(UU_ERROR_NO_MEMORY);
-               return (NULL);
-       }
-
-       ap->ua_pool = pp;
-       ap->ua_parent_enc = UU_PTR_ENCODE(parent);
-       ap->ua_debug = pp->uap_debug || (flags & UU_AVL_DEBUG);
-       ap->ua_index = (pp->uap_last_index = INDEX_NEXT(pp->uap_last_index));
-
-       avl_create(&ap->ua_tree, &uu_avl_node_compare, pp->uap_objsize,
-           pp->uap_nodeoffset);
-
-       ap->ua_null_walk.uaw_next = &ap->ua_null_walk;
-       ap->ua_null_walk.uaw_prev = &ap->ua_null_walk;
-
-       (void) pthread_mutex_lock(&pp->uap_lock);
-       next = &pp->uap_null_avl;
-       prev = UU_PTR_DECODE(next->ua_prev_enc);
-       ap->ua_next_enc = UU_PTR_ENCODE(next);
-       ap->ua_prev_enc = UU_PTR_ENCODE(prev);
-       next->ua_prev_enc = UU_PTR_ENCODE(ap);
-       prev->ua_next_enc = UU_PTR_ENCODE(ap);
-       (void) pthread_mutex_unlock(&pp->uap_lock);
-
-       return (ap);
-}
-
-void
-uu_avl_destroy(uu_avl_t *ap)
-{
-       uu_avl_pool_t *pp = ap->ua_pool;
-
-       if (ap->ua_debug) {
-               if (avl_numnodes(&ap->ua_tree) != 0) {
-                       uu_panic("uu_avl_destroy(%p): tree not empty\n",
-                           (void *)ap);
-               }
-               if (ap->ua_null_walk.uaw_next != &ap->ua_null_walk ||
-                   ap->ua_null_walk.uaw_prev != &ap->ua_null_walk) {
-                       uu_panic("uu_avl_destroy(%p):  outstanding walkers\n",
-                           (void *)ap);
-               }
-       }
-       (void) pthread_mutex_lock(&pp->uap_lock);
-       UU_AVL_PTR(ap->ua_next_enc)->ua_prev_enc = ap->ua_prev_enc;
-       UU_AVL_PTR(ap->ua_prev_enc)->ua_next_enc = ap->ua_next_enc;
-       (void) pthread_mutex_unlock(&pp->uap_lock);
-       ap->ua_prev_enc = UU_PTR_ENCODE(NULL);
-       ap->ua_next_enc = UU_PTR_ENCODE(NULL);
-
-       ap->ua_pool = NULL;
-       avl_destroy(&ap->ua_tree);
-
-       uu_free(ap);
-}
-
-size_t
-uu_avl_numnodes(uu_avl_t *ap)
-{
-       return (avl_numnodes(&ap->ua_tree));
-}
-
-void *
-uu_avl_first(uu_avl_t *ap)
-{
-       return (avl_first(&ap->ua_tree));
-}
-
-void *
-uu_avl_last(uu_avl_t *ap)
-{
-       return (avl_last(&ap->ua_tree));
-}
-
-void *
-uu_avl_next(uu_avl_t *ap, void *node)
-{
-       return (AVL_NEXT(&ap->ua_tree, node));
-}
-
-void *
-uu_avl_prev(uu_avl_t *ap, void *node)
-{
-       return (AVL_PREV(&ap->ua_tree, node));
-}
-
-static void
-_avl_walk_init(uu_avl_walk_t *wp, uu_avl_t *ap, uint32_t flags)
-{
-       uu_avl_walk_t *next, *prev;
-
-       int robust = (flags & UU_WALK_ROBUST);
-       int direction = (flags & UU_WALK_REVERSE)? -1 : 1;
-
-       (void) memset(wp, 0, sizeof (*wp));
-       wp->uaw_avl = ap;
-       wp->uaw_robust = robust;
-       wp->uaw_dir = direction;
-
-       if (direction > 0)
-               wp->uaw_next_result = avl_first(&ap->ua_tree);
-       else
-               wp->uaw_next_result = avl_last(&ap->ua_tree);
-
-       if (ap->ua_debug || robust) {
-               wp->uaw_next = next = &ap->ua_null_walk;
-               wp->uaw_prev = prev = next->uaw_prev;
-               next->uaw_prev = wp;
-               prev->uaw_next = wp;
-       }
-}
-
-static void *
-_avl_walk_advance(uu_avl_walk_t *wp, uu_avl_t *ap)
-{
-       void *np = wp->uaw_next_result;
-
-       avl_tree_t *t = &ap->ua_tree;
-
-       if (np == NULL)
-               return (NULL);
-
-       wp->uaw_next_result = (wp->uaw_dir > 0)? AVL_NEXT(t, np) :
-           AVL_PREV(t, np);
-
-       return (np);
-}
-
-static void
-_avl_walk_fini(uu_avl_walk_t *wp)
-{
-       if (wp->uaw_next != NULL) {
-               wp->uaw_next->uaw_prev = wp->uaw_prev;
-               wp->uaw_prev->uaw_next = wp->uaw_next;
-               wp->uaw_next = NULL;
-               wp->uaw_prev = NULL;
-       }
-       wp->uaw_avl = NULL;
-       wp->uaw_next_result = NULL;
-}
-
-uu_avl_walk_t *
-uu_avl_walk_start(uu_avl_t *ap, uint32_t flags)
-{
-       uu_avl_walk_t *wp;
-
-       if (flags & ~(UU_WALK_ROBUST | UU_WALK_REVERSE)) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (NULL);
-       }
-
-       wp = uu_zalloc(sizeof (*wp));
-       if (wp == NULL) {
-               uu_set_error(UU_ERROR_NO_MEMORY);
-               return (NULL);
-       }
-
-       _avl_walk_init(wp, ap, flags);
-       return (wp);
-}
-
-void *
-uu_avl_walk_next(uu_avl_walk_t *wp)
-{
-       return (_avl_walk_advance(wp, wp->uaw_avl));
-}
-
-void
-uu_avl_walk_end(uu_avl_walk_t *wp)
-{
-       _avl_walk_fini(wp);
-       uu_free(wp);
-}
-
-int
-uu_avl_walk(uu_avl_t *ap, uu_walk_fn_t *func, void *private, uint32_t flags)
-{
-       void *e;
-       uu_avl_walk_t my_walk;
-
-       int status = UU_WALK_NEXT;
-
-       if (flags & ~(UU_WALK_ROBUST | UU_WALK_REVERSE)) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (-1);
-       }
-
-       _avl_walk_init(&my_walk, ap, flags);
-       while (status == UU_WALK_NEXT &&
-           (e = _avl_walk_advance(&my_walk, ap)) != NULL)
-               status = (*func)(e, private);
-       _avl_walk_fini(&my_walk);
-
-       if (status >= 0)
-               return (0);
-       uu_set_error(UU_ERROR_CALLBACK_FAILED);
-       return (-1);
-}
-
-void
-uu_avl_remove(uu_avl_t *ap, void *elem)
-{
-       uu_avl_walk_t *wp;
-       uu_avl_pool_t *pp = ap->ua_pool;
-       uintptr_t *na = NODE_ARRAY(pp, elem);
-
-       if (ap->ua_debug) {
-               /*
-                * invalidate outstanding uu_avl_index_ts.
-                */
-               ap->ua_index = INDEX_NEXT(ap->ua_index);
-       }
-
-       /*
-        * Robust walkers most be advanced, if we are removing the node
-        * they are currently using.  In debug mode, non-robust walkers
-        * are also on the walker list.
-        */
-       for (wp = ap->ua_null_walk.uaw_next; wp != &ap->ua_null_walk;
-           wp = wp->uaw_next) {
-               if (wp->uaw_robust) {
-                       if (elem == wp->uaw_next_result)
-                               (void) _avl_walk_advance(wp, ap);
-               } else if (wp->uaw_next_result != NULL) {
-                       uu_panic("uu_avl_remove(%p, %p): active non-robust "
-                           "walker\n", (void *)ap, elem);
-               }
-       }
-
-       avl_remove(&ap->ua_tree, elem);
-
-       na[0] = POOL_TO_MARKER(pp);
-       na[1] = 0;
-}
-
-void *
-uu_avl_teardown(uu_avl_t *ap, void **cookie)
-{
-       void *elem = avl_destroy_nodes(&ap->ua_tree, cookie);
-
-       if (elem != NULL) {
-               uu_avl_pool_t *pp = ap->ua_pool;
-               uintptr_t *na = NODE_ARRAY(pp, elem);
-
-               na[0] = POOL_TO_MARKER(pp);
-               na[1] = 0;
-       }
-       return (elem);
-}
-
-void *
-uu_avl_find(uu_avl_t *ap, void *elem, void *private, uu_avl_index_t *out)
-{
-       struct uu_avl_node_compare_info info;
-       void *result;
-
-       info.ac_compare = ap->ua_pool->uap_cmp;
-       info.ac_private = private;
-       info.ac_right = elem;
-       info.ac_found = NULL;
-
-       result = avl_find(&ap->ua_tree, &info, out);
-       if (out != NULL)
-               *out = INDEX_ENCODE(ap, *out);
-
-       if (ap->ua_debug && result != NULL)
-               uu_panic("uu_avl_find: internal error: avl_find succeeded\n");
-
-       return (info.ac_found);
-}
-
-void
-uu_avl_insert(uu_avl_t *ap, void *elem, uu_avl_index_t idx)
-{
-       if (ap->ua_debug) {
-               uu_avl_pool_t *pp = ap->ua_pool;
-               uintptr_t *na = NODE_ARRAY(pp, elem);
-
-               if (na[1] != 0)
-                       uu_panic("uu_avl_insert(%p, %p, %p): node already "
-                           "in tree, or corrupt\n",
-                           (void *)ap, elem, (void *)idx);
-               if (na[0] == 0)
-                       uu_panic("uu_avl_insert(%p, %p, %p): node not "
-                           "initialized\n",
-                           (void *)ap, elem, (void *)idx);
-               if (na[0] != POOL_TO_MARKER(pp))
-                       uu_panic("uu_avl_insert(%p, %p, %p): node from "
-                           "other pool, or corrupt\n",
-                           (void *)ap, elem, (void *)idx);
-
-               if (!INDEX_VALID(ap, idx))
-                       uu_panic("uu_avl_insert(%p, %p, %p): %s\n",
-                           (void *)ap, elem, (void *)idx,
-                           INDEX_CHECK(idx)? "outdated index" :
-                           "invalid index");
-
-               /*
-                * invalidate outstanding uu_avl_index_ts.
-                */
-               ap->ua_index = INDEX_NEXT(ap->ua_index);
-       }
-       avl_insert(&ap->ua_tree, elem, INDEX_DECODE(idx));
-}
-
-void *
-uu_avl_nearest_next(uu_avl_t *ap, uu_avl_index_t idx)
-{
-       if (ap->ua_debug && !INDEX_VALID(ap, idx))
-               uu_panic("uu_avl_nearest_next(%p, %p): %s\n",
-                   (void *)ap, (void *)idx, INDEX_CHECK(idx)?
-                   "outdated index" : "invalid index");
-       return (avl_nearest(&ap->ua_tree, INDEX_DECODE(idx), AVL_AFTER));
-}
-
-void *
-uu_avl_nearest_prev(uu_avl_t *ap, uu_avl_index_t idx)
-{
-       if (ap->ua_debug && !INDEX_VALID(ap, idx))
-               uu_panic("uu_avl_nearest_prev(%p, %p): %s\n",
-                   (void *)ap, (void *)idx, INDEX_CHECK(idx)?
-                   "outdated index" : "invalid index");
-       return (avl_nearest(&ap->ua_tree, INDEX_DECODE(idx), AVL_BEFORE));
-}
-
-/*
- * called from uu_lockup() and uu_release(), as part of our fork1()-safety.
- */
-void
-uu_avl_lockup(void)
-{
-       uu_avl_pool_t *pp;
-
-       (void) pthread_mutex_lock(&uu_apool_list_lock);
-       for (pp = uu_null_apool.uap_next; pp != &uu_null_apool;
-           pp = pp->uap_next)
-               (void) pthread_mutex_lock(&pp->uap_lock);
-}
-
-void
-uu_avl_release(void)
-{
-       uu_avl_pool_t *pp;
-
-       for (pp = uu_null_apool.uap_next; pp != &uu_null_apool;
-           pp = pp->uap_next)
-               (void) pthread_mutex_unlock(&pp->uap_lock);
-       (void) pthread_mutex_unlock(&uu_apool_list_lock);
-}
diff --git a/zfs/lib/libuutil/uu_dprintf.c b/zfs/lib/libuutil/uu_dprintf.c
deleted file mode 100644 (file)
index 5d5fb84..0000000
+++ /dev/null
@@ -1,128 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include "libuutil_common.h"
-
-#include <errno.h>
-#include <libintl.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-
-#define        FACILITY_FMT    "%s (%s): "
-
-#if !defined(TEXT_DOMAIN)
-#define        TEXT_DOMAIN "SYS_TEST"
-#endif
-
-static const char *
-strseverity(uu_dprintf_severity_t severity)
-{
-       switch (severity) {
-       case UU_DPRINTF_SILENT:
-               return (dgettext(TEXT_DOMAIN, "silent"));
-       case UU_DPRINTF_FATAL:
-               return (dgettext(TEXT_DOMAIN, "FATAL"));
-       case UU_DPRINTF_WARNING:
-               return (dgettext(TEXT_DOMAIN, "WARNING"));
-       case UU_DPRINTF_NOTICE:
-               return (dgettext(TEXT_DOMAIN, "note"));
-       case UU_DPRINTF_INFO:
-               return (dgettext(TEXT_DOMAIN, "info"));
-       case UU_DPRINTF_DEBUG:
-               return (dgettext(TEXT_DOMAIN, "debug"));
-       default:
-               return (dgettext(TEXT_DOMAIN, "unspecified"));
-       }
-}
-
-uu_dprintf_t *
-uu_dprintf_create(const char *name, uu_dprintf_severity_t severity,
-    uint_t flags)
-{
-       uu_dprintf_t *D;
-
-       if (uu_check_name(name, UU_NAME_DOMAIN) == -1) {
-               uu_set_error(UU_ERROR_INVALID_ARGUMENT);
-               return (NULL);
-       }
-
-       if ((D = uu_zalloc(sizeof (uu_dprintf_t))) == NULL)
-               return (NULL);
-
-       if (name != NULL) {
-               D->uud_name = strdup(name);
-               if (D->uud_name == NULL) {
-                       uu_free(D);
-                       return (NULL);
-               }
-       } else {
-               D->uud_name = NULL;
-       }
-
-       D->uud_severity = severity;
-       D->uud_flags = flags;
-
-       return (D);
-}
-
-/*PRINTFLIKE3*/
-void
-uu_dprintf(uu_dprintf_t *D, uu_dprintf_severity_t severity,
-    const char *format, ...)
-{
-       va_list alist;
-
-       /* XXX Assert that severity is not UU_DPRINTF_SILENT. */
-
-       if (severity > D->uud_severity)
-               return;
-
-       (void) fprintf(stderr, FACILITY_FMT, D->uud_name,
-           strseverity(severity));
-
-       va_start(alist, format);
-       (void) vfprintf(stderr, format, alist);
-       va_end(alist);
-}
-
-void
-uu_dprintf_destroy(uu_dprintf_t *D)
-{
-       if (D->uud_name)
-               free(D->uud_name);
-
-       uu_free(D);
-}
-
-const char *
-uu_dprintf_getname(uu_dprintf_t *D)
-{
-       return (D->uud_name);
-}
diff --git a/zfs/lib/libuutil/uu_ident.c b/zfs/lib/libuutil/uu_ident.c
deleted file mode 100644 (file)
index 3821393..0000000
+++ /dev/null
@@ -1,122 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include "libuutil_common.h"
-
-#include <string.h>
-
-/*
- * We require names of the form:
- *     [provider,]identifier[/[provider,]identifier]...
- *
- * Where provider is either a stock symbol (SUNW) or a java-style reversed
- * domain name (com.sun).
- *
- * Both providers and identifiers must start with a letter, and may
- * only contain alphanumerics, dashes, and underlines.  Providers
- * may also contain periods.
- *
- * Note that we do _not_ use the macros in <ctype.h>, since they are affected
- * by the current locale settings.
- */
-
-#define        IS_ALPHA(c) \
-       (((c) >= 'a' && (c) <= 'z') || ((c) >= 'A' && (c) <= 'Z'))
-
-#define        IS_DIGIT(c) \
-       ((c) >= '0' && (c) <= '9')
-
-static int
-is_valid_ident(const char *s, const char *e, int allowdot)
-{
-       char c;
-
-       if (s >= e)
-               return (0);             /* name is empty */
-
-       c = *s++;
-       if (!IS_ALPHA(c))
-               return (0);             /* does not start with letter */
-
-       while (s < e && (c = *s++) != 0) {
-               if (IS_ALPHA(c) || IS_DIGIT(c) || c == '-' || c == '_' ||
-                   (allowdot && c == '.'))
-                       continue;
-               return (0);             /* invalid character */
-       }
-       return (1);
-}
-
-static int
-is_valid_component(const char *b, const char *e, uint_t flags)
-{
-       char *sp;
-
-       if (flags & UU_NAME_DOMAIN) {
-               sp = strchr(b, ',');
-               if (sp != NULL && sp < e) {
-                       if (!is_valid_ident(b, sp, 1))
-                               return (0);
-                       b = sp + 1;
-               }
-       }
-
-       return (is_valid_ident(b, e, 0));
-}
-
-int
-uu_check_name(const char *name, uint_t flags)
-{
-       const char *end = name + strlen(name);
-       const char *p;
-
-       if (flags & ~(UU_NAME_DOMAIN | UU_NAME_PATH)) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (-1);
-       }
-
-       if (!(flags & UU_NAME_PATH)) {
-               if (!is_valid_component(name, end, flags))
-                       goto bad;
-               return (0);
-       }
-
-       while ((p = strchr(name, '/')) != NULL) {
-               if (!is_valid_component(name, p - 1, flags))
-                       goto bad;
-               name = p + 1;
-       }
-       if (!is_valid_component(name, end, flags))
-               goto bad;
-
-       return (0);
-
-bad:
-       uu_set_error(UU_ERROR_INVALID_ARGUMENT);
-       return (-1);
-}
diff --git a/zfs/lib/libuutil/uu_list.c b/zfs/lib/libuutil/uu_list.c
deleted file mode 100644 (file)
index c3a447d..0000000
+++ /dev/null
@@ -1,718 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include "libuutil_common.h"
-
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <sys/time.h>
-
-#define        ELEM_TO_NODE(lp, e) \
-       ((uu_list_node_impl_t *)((uintptr_t)(e) + (lp)->ul_offset))
-
-#define        NODE_TO_ELEM(lp, n) \
-       ((void *)((uintptr_t)(n) - (lp)->ul_offset))
-
-/*
- * uu_list_index_ts define a location for insertion.  They are simply a
- * pointer to the object after the insertion point.  We store a mark
- * in the low-bits of the index, to help prevent mistakes.
- *
- * When debugging, the index mark changes on every insert and delete, to
- * catch stale references.
- */
-#define        INDEX_MAX               (sizeof (uintptr_t) - 1)
-#define        INDEX_NEXT(m)           (((m) == INDEX_MAX)? 1 : ((m) + 1) & INDEX_MAX)
-
-#define        INDEX_TO_NODE(i)        ((uu_list_node_impl_t *)((i) & ~INDEX_MAX))
-#define        NODE_TO_INDEX(p, n)     (((uintptr_t)(n) & ~INDEX_MAX) | (p)->ul_index)
-#define        INDEX_VALID(p, i)       (((i) & INDEX_MAX) == (p)->ul_index)
-#define        INDEX_CHECK(i)          (((i) & INDEX_MAX) != 0)
-
-#define        POOL_TO_MARKER(pp) ((void *)((uintptr_t)(pp) | 1))
-
-static uu_list_pool_t  uu_null_lpool = { &uu_null_lpool, &uu_null_lpool };
-static pthread_mutex_t uu_lpool_list_lock = PTHREAD_MUTEX_INITIALIZER;
-
-uu_list_pool_t *
-uu_list_pool_create(const char *name, size_t objsize,
-    size_t nodeoffset, uu_compare_fn_t *compare_func, uint32_t flags)
-{
-       uu_list_pool_t *pp, *next, *prev;
-
-       if (name == NULL ||
-           uu_check_name(name, UU_NAME_DOMAIN) == -1 ||
-           nodeoffset + sizeof (uu_list_node_t) > objsize) {
-               uu_set_error(UU_ERROR_INVALID_ARGUMENT);
-               return (NULL);
-       }
-
-       if (flags & ~UU_LIST_POOL_DEBUG) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (NULL);
-       }
-
-       pp = uu_zalloc(sizeof (uu_list_pool_t));
-       if (pp == NULL) {
-               uu_set_error(UU_ERROR_NO_MEMORY);
-               return (NULL);
-       }
-
-       (void) strlcpy(pp->ulp_name, name, sizeof (pp->ulp_name));
-       pp->ulp_nodeoffset = nodeoffset;
-       pp->ulp_objsize = objsize;
-       pp->ulp_cmp = compare_func;
-       if (flags & UU_LIST_POOL_DEBUG)
-               pp->ulp_debug = 1;
-       pp->ulp_last_index = 0;
-
-       (void) pthread_mutex_init(&pp->ulp_lock, NULL);
-
-       pp->ulp_null_list.ul_next_enc = UU_PTR_ENCODE(&pp->ulp_null_list);
-       pp->ulp_null_list.ul_prev_enc = UU_PTR_ENCODE(&pp->ulp_null_list);
-
-       (void) pthread_mutex_lock(&uu_lpool_list_lock);
-       pp->ulp_next = next = &uu_null_lpool;
-       pp->ulp_prev = prev = next->ulp_prev;
-       next->ulp_prev = pp;
-       prev->ulp_next = pp;
-       (void) pthread_mutex_unlock(&uu_lpool_list_lock);
-
-       return (pp);
-}
-
-void
-uu_list_pool_destroy(uu_list_pool_t *pp)
-{
-       if (pp->ulp_debug) {
-               if (pp->ulp_null_list.ul_next_enc !=
-                   UU_PTR_ENCODE(&pp->ulp_null_list) ||
-                   pp->ulp_null_list.ul_prev_enc !=
-                   UU_PTR_ENCODE(&pp->ulp_null_list)) {
-                       uu_panic("uu_list_pool_destroy: Pool \"%.*s\" (%p) has "
-                           "outstanding lists, or is corrupt.\n",
-                           (int)sizeof (pp->ulp_name), pp->ulp_name,
-                           (void *)pp);
-               }
-       }
-       (void) pthread_mutex_lock(&uu_lpool_list_lock);
-       pp->ulp_next->ulp_prev = pp->ulp_prev;
-       pp->ulp_prev->ulp_next = pp->ulp_next;
-       (void) pthread_mutex_unlock(&uu_lpool_list_lock);
-       pp->ulp_prev = NULL;
-       pp->ulp_next = NULL;
-       uu_free(pp);
-}
-
-void
-uu_list_node_init(void *base, uu_list_node_t *np_arg, uu_list_pool_t *pp)
-{
-       uu_list_node_impl_t *np = (uu_list_node_impl_t *)np_arg;
-
-       if (pp->ulp_debug) {
-               uintptr_t offset = (uintptr_t)np - (uintptr_t)base;
-               if (offset + sizeof (*np) > pp->ulp_objsize) {
-                       uu_panic("uu_list_node_init(%p, %p, %p (\"%s\")): "
-                           "offset %ld doesn't fit in object (size %ld)\n",
-                           base, (void *)np, (void *)pp, pp->ulp_name,
-                           (long)offset, (long)pp->ulp_objsize);
-               }
-               if (offset != pp->ulp_nodeoffset) {
-                       uu_panic("uu_list_node_init(%p, %p, %p (\"%s\")): "
-                           "offset %ld doesn't match pool's offset (%ld)\n",
-                           base, (void *)np, (void *)pp, pp->ulp_name,
-                           (long)offset, (long)pp->ulp_objsize);
-               }
-       }
-       np->uln_next = POOL_TO_MARKER(pp);
-       np->uln_prev = NULL;
-}
-
-void
-uu_list_node_fini(void *base, uu_list_node_t *np_arg, uu_list_pool_t *pp)
-{
-       uu_list_node_impl_t *np = (uu_list_node_impl_t *)np_arg;
-
-       if (pp->ulp_debug) {
-               if (np->uln_next == NULL &&
-                   np->uln_prev == NULL) {
-                       uu_panic("uu_list_node_fini(%p, %p, %p (\"%s\")): "
-                           "node already finied\n",
-                           base, (void *)np_arg, (void *)pp, pp->ulp_name);
-               }
-               if (np->uln_next != POOL_TO_MARKER(pp) ||
-                   np->uln_prev != NULL) {
-                       uu_panic("uu_list_node_fini(%p, %p, %p (\"%s\")): "
-                           "node corrupt or on list\n",
-                           base, (void *)np_arg, (void *)pp, pp->ulp_name);
-               }
-       }
-       np->uln_next = NULL;
-       np->uln_prev = NULL;
-}
-
-uu_list_t *
-uu_list_create(uu_list_pool_t *pp, void *parent, uint32_t flags)
-{
-       uu_list_t *lp, *next, *prev;
-
-       if (flags & ~(UU_LIST_DEBUG | UU_LIST_SORTED)) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (NULL);
-       }
-
-       if ((flags & UU_LIST_SORTED) && pp->ulp_cmp == NULL) {
-               if (pp->ulp_debug)
-                       uu_panic("uu_list_create(%p, ...): requested "
-                           "UU_LIST_SORTED, but pool has no comparison func\n",
-                           (void *)pp);
-               uu_set_error(UU_ERROR_NOT_SUPPORTED);
-               return (NULL);
-       }
-
-       lp = uu_zalloc(sizeof (*lp));
-       if (lp == NULL) {
-               uu_set_error(UU_ERROR_NO_MEMORY);
-               return (NULL);
-       }
-
-       lp->ul_pool = pp;
-       lp->ul_parent_enc = UU_PTR_ENCODE(parent);
-       lp->ul_offset = pp->ulp_nodeoffset;
-       lp->ul_debug = pp->ulp_debug || (flags & UU_LIST_DEBUG);
-       lp->ul_sorted = (flags & UU_LIST_SORTED);
-       lp->ul_numnodes = 0;
-       lp->ul_index = (pp->ulp_last_index = INDEX_NEXT(pp->ulp_last_index));
-
-       lp->ul_null_node.uln_next = &lp->ul_null_node;
-       lp->ul_null_node.uln_prev = &lp->ul_null_node;
-
-       lp->ul_null_walk.ulw_next = &lp->ul_null_walk;
-       lp->ul_null_walk.ulw_prev = &lp->ul_null_walk;
-
-       (void) pthread_mutex_lock(&pp->ulp_lock);
-       next = &pp->ulp_null_list;
-       prev = UU_PTR_DECODE(next->ul_prev_enc);
-       lp->ul_next_enc = UU_PTR_ENCODE(next);
-       lp->ul_prev_enc = UU_PTR_ENCODE(prev);
-       next->ul_prev_enc = UU_PTR_ENCODE(lp);
-       prev->ul_next_enc = UU_PTR_ENCODE(lp);
-       (void) pthread_mutex_unlock(&pp->ulp_lock);
-
-       return (lp);
-}
-
-void
-uu_list_destroy(uu_list_t *lp)
-{
-       uu_list_pool_t *pp = lp->ul_pool;
-
-       if (lp->ul_debug) {
-               if (lp->ul_null_node.uln_next != &lp->ul_null_node ||
-                   lp->ul_null_node.uln_prev != &lp->ul_null_node) {
-                       uu_panic("uu_list_destroy(%p):  list not empty\n",
-                           (void *)lp);
-               }
-               if (lp->ul_numnodes != 0) {
-                       uu_panic("uu_list_destroy(%p):  numnodes is nonzero, "
-                           "but list is empty\n", (void *)lp);
-               }
-               if (lp->ul_null_walk.ulw_next != &lp->ul_null_walk ||
-                   lp->ul_null_walk.ulw_prev != &lp->ul_null_walk) {
-                       uu_panic("uu_list_destroy(%p):  outstanding walkers\n",
-                           (void *)lp);
-               }
-       }
-
-       (void) pthread_mutex_lock(&pp->ulp_lock);
-       UU_LIST_PTR(lp->ul_next_enc)->ul_prev_enc = lp->ul_prev_enc;
-       UU_LIST_PTR(lp->ul_prev_enc)->ul_next_enc = lp->ul_next_enc;
-       (void) pthread_mutex_unlock(&pp->ulp_lock);
-       lp->ul_prev_enc = UU_PTR_ENCODE(NULL);
-       lp->ul_next_enc = UU_PTR_ENCODE(NULL);
-       lp->ul_pool = NULL;
-       uu_free(lp);
-}
-
-static void
-list_insert(uu_list_t *lp, uu_list_node_impl_t *np, uu_list_node_impl_t *prev,
-    uu_list_node_impl_t *next)
-{
-       if (lp->ul_debug) {
-               if (next->uln_prev != prev || prev->uln_next != next)
-                       uu_panic("insert(%p): internal error: %p and %p not "
-                           "neighbors\n", (void *)lp, (void *)next,
-                           (void *)prev);
-
-               if (np->uln_next != POOL_TO_MARKER(lp->ul_pool) ||
-                   np->uln_prev != NULL) {
-                       uu_panic("insert(%p): elem %p node %p corrupt, "
-                           "not initialized, or already in a list.\n",
-                           (void *)lp, NODE_TO_ELEM(lp, np), (void *)np);
-               }
-               /*
-                * invalidate outstanding uu_list_index_ts.
-                */
-               lp->ul_index = INDEX_NEXT(lp->ul_index);
-       }
-       np->uln_next = next;
-       np->uln_prev = prev;
-       next->uln_prev = np;
-       prev->uln_next = np;
-
-       lp->ul_numnodes++;
-}
-
-void
-uu_list_insert(uu_list_t *lp, void *elem, uu_list_index_t idx)
-{
-       uu_list_node_impl_t *np;
-
-       np = INDEX_TO_NODE(idx);
-       if (np == NULL)
-               np = &lp->ul_null_node;
-
-       if (lp->ul_debug) {
-               if (!INDEX_VALID(lp, idx))
-                       uu_panic("uu_list_insert(%p, %p, %p): %s\n",
-                           (void *)lp, elem, (void *)idx,
-                           INDEX_CHECK(idx)? "outdated index" :
-                           "invalid index");
-               if (np->uln_prev == NULL)
-                       uu_panic("uu_list_insert(%p, %p, %p): out-of-date "
-                           "index\n", (void *)lp, elem, (void *)idx);
-       }
-
-       list_insert(lp, ELEM_TO_NODE(lp, elem), np->uln_prev, np);
-}
-
-void *
-uu_list_find(uu_list_t *lp, void *elem, void *private, uu_list_index_t *out)
-{
-       int sorted = lp->ul_sorted;
-       uu_compare_fn_t *func = lp->ul_pool->ulp_cmp;
-       uu_list_node_impl_t *np;
-
-       if (func == NULL) {
-               if (out != NULL)
-                       *out = 0;
-               uu_set_error(UU_ERROR_NOT_SUPPORTED);
-               return (NULL);
-       }
-       for (np = lp->ul_null_node.uln_next; np != &lp->ul_null_node;
-           np = np->uln_next) {
-               void *ep = NODE_TO_ELEM(lp, np);
-               int cmp = func(ep, elem, private);
-               if (cmp == 0) {
-                       if (out != NULL)
-                               *out = NODE_TO_INDEX(lp, np);
-                       return (ep);
-               }
-               if (sorted && cmp > 0) {
-                       if (out != NULL)
-                               *out = NODE_TO_INDEX(lp, np);
-                       return (NULL);
-               }
-       }
-       if (out != NULL)
-               *out = NODE_TO_INDEX(lp, 0);
-       return (NULL);
-}
-
-void *
-uu_list_nearest_next(uu_list_t *lp, uu_list_index_t idx)
-{
-       uu_list_node_impl_t *np = INDEX_TO_NODE(idx);
-
-       if (np == NULL)
-               np = &lp->ul_null_node;
-
-       if (lp->ul_debug) {
-               if (!INDEX_VALID(lp, idx))
-                       uu_panic("uu_list_nearest_next(%p, %p): %s\n",
-                           (void *)lp, (void *)idx,
-                           INDEX_CHECK(idx)? "outdated index" :
-                           "invalid index");
-               if (np->uln_prev == NULL)
-                       uu_panic("uu_list_nearest_next(%p, %p): out-of-date "
-                           "index\n", (void *)lp, (void *)idx);
-       }
-
-       if (np == &lp->ul_null_node)
-               return (NULL);
-       else
-               return (NODE_TO_ELEM(lp, np));
-}
-
-void *
-uu_list_nearest_prev(uu_list_t *lp, uu_list_index_t idx)
-{
-       uu_list_node_impl_t *np = INDEX_TO_NODE(idx);
-
-       if (np == NULL)
-               np = &lp->ul_null_node;
-
-       if (lp->ul_debug) {
-               if (!INDEX_VALID(lp, idx))
-                       uu_panic("uu_list_nearest_prev(%p, %p): %s\n",
-                           (void *)lp, (void *)idx, INDEX_CHECK(idx)?
-                           "outdated index" : "invalid index");
-               if (np->uln_prev == NULL)
-                       uu_panic("uu_list_nearest_prev(%p, %p): out-of-date "
-                           "index\n", (void *)lp, (void *)idx);
-       }
-
-       if ((np = np->uln_prev) == &lp->ul_null_node)
-               return (NULL);
-       else
-               return (NODE_TO_ELEM(lp, np));
-}
-
-static void
-list_walk_init(uu_list_walk_t *wp, uu_list_t *lp, uint32_t flags)
-{
-       uu_list_walk_t *next, *prev;
-
-       int robust = (flags & UU_WALK_ROBUST);
-       int direction = (flags & UU_WALK_REVERSE)? -1 : 1;
-
-       (void) memset(wp, 0, sizeof (*wp));
-       wp->ulw_list = lp;
-       wp->ulw_robust = robust;
-       wp->ulw_dir = direction;
-       if (direction > 0)
-               wp->ulw_next_result = lp->ul_null_node.uln_next;
-       else
-               wp->ulw_next_result = lp->ul_null_node.uln_prev;
-
-       if (lp->ul_debug || robust) {
-               /*
-                * Add this walker to the list's list of walkers so
-                * uu_list_remove() can advance us if somebody tries to
-                * remove ulw_next_result.
-                */
-               wp->ulw_next = next = &lp->ul_null_walk;
-               wp->ulw_prev = prev = next->ulw_prev;
-               next->ulw_prev = wp;
-               prev->ulw_next = wp;
-       }
-}
-
-static uu_list_node_impl_t *
-list_walk_advance(uu_list_walk_t *wp, uu_list_t *lp)
-{
-       uu_list_node_impl_t *np = wp->ulw_next_result;
-       uu_list_node_impl_t *next;
-
-       if (np == &lp->ul_null_node)
-               return (NULL);
-
-       next = (wp->ulw_dir > 0)? np->uln_next : np->uln_prev;
-
-       wp->ulw_next_result = next;
-       return (np);
-}
-
-static void
-list_walk_fini(uu_list_walk_t *wp)
-{
-       /* GLXXX debugging? */
-       if (wp->ulw_next != NULL) {
-               wp->ulw_next->ulw_prev = wp->ulw_prev;
-               wp->ulw_prev->ulw_next = wp->ulw_next;
-               wp->ulw_next = NULL;
-               wp->ulw_prev = NULL;
-       }
-       wp->ulw_list = NULL;
-       wp->ulw_next_result = NULL;
-}
-
-uu_list_walk_t *
-uu_list_walk_start(uu_list_t *lp, uint32_t flags)
-{
-       uu_list_walk_t *wp;
-
-       if (flags & ~(UU_WALK_ROBUST | UU_WALK_REVERSE)) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (NULL);
-       }
-
-       wp = uu_zalloc(sizeof (*wp));
-       if (wp == NULL) {
-               uu_set_error(UU_ERROR_NO_MEMORY);
-               return (NULL);
-       }
-
-       list_walk_init(wp, lp, flags);
-       return (wp);
-}
-
-void *
-uu_list_walk_next(uu_list_walk_t *wp)
-{
-       uu_list_t *lp = wp->ulw_list;
-       uu_list_node_impl_t *np = list_walk_advance(wp, lp);
-
-       if (np == NULL)
-               return (NULL);
-
-       return (NODE_TO_ELEM(lp, np));
-}
-
-void
-uu_list_walk_end(uu_list_walk_t *wp)
-{
-       list_walk_fini(wp);
-       uu_free(wp);
-}
-
-int
-uu_list_walk(uu_list_t *lp, uu_walk_fn_t *func, void *private, uint32_t flags)
-{
-       uu_list_node_impl_t *np;
-
-       int status = UU_WALK_NEXT;
-
-       int robust = (flags & UU_WALK_ROBUST);
-       int reverse = (flags & UU_WALK_REVERSE);
-
-       if (flags & ~(UU_WALK_ROBUST | UU_WALK_REVERSE)) {
-               uu_set_error(UU_ERROR_UNKNOWN_FLAG);
-               return (-1);
-       }
-
-       if (lp->ul_debug || robust) {
-               uu_list_walk_t my_walk;
-               void *e;
-
-               list_walk_init(&my_walk, lp, flags);
-               while (status == UU_WALK_NEXT &&
-                   (e = uu_list_walk_next(&my_walk)) != NULL)
-                       status = (*func)(e, private);
-               list_walk_fini(&my_walk);
-       } else {
-               if (!reverse) {
-                       for (np = lp->ul_null_node.uln_next;
-                           status == UU_WALK_NEXT && np != &lp->ul_null_node;
-                           np = np->uln_next) {
-                               status = (*func)(NODE_TO_ELEM(lp, np), private);
-                       }
-               } else {
-                       for (np = lp->ul_null_node.uln_prev;
-                           status == UU_WALK_NEXT && np != &lp->ul_null_node;
-                           np = np->uln_prev) {
-                               status = (*func)(NODE_TO_ELEM(lp, np), private);
-                       }
-               }
-       }
-       if (status >= 0)
-               return (0);
-       uu_set_error(UU_ERROR_CALLBACK_FAILED);
-       return (-1);
-}
-
-void
-uu_list_remove(uu_list_t *lp, void *elem)
-{
-       uu_list_node_impl_t *np = ELEM_TO_NODE(lp, elem);
-       uu_list_walk_t *wp;
-
-       if (lp->ul_debug) {
-               if (np->uln_prev == NULL)
-                       uu_panic("uu_list_remove(%p, %p): elem not on list\n",
-                           (void *)lp, elem);
-               /*
-                * invalidate outstanding uu_list_index_ts.
-                */
-               lp->ul_index = INDEX_NEXT(lp->ul_index);
-       }
-
-       /*
-        * robust walkers must be advanced.  In debug mode, non-robust
-        * walkers are also on the list.  If there are any, it's an error.
-        */
-       for (wp = lp->ul_null_walk.ulw_next; wp != &lp->ul_null_walk;
-           wp = wp->ulw_next) {
-               if (wp->ulw_robust) {
-                       if (np == wp->ulw_next_result)
-                               (void) list_walk_advance(wp, lp);
-               } else if (wp->ulw_next_result != NULL) {
-                       uu_panic("uu_list_remove(%p, %p): active non-robust "
-                           "walker\n", (void *)lp, elem);
-               }
-       }
-
-       np->uln_next->uln_prev = np->uln_prev;
-       np->uln_prev->uln_next = np->uln_next;
-
-       lp->ul_numnodes--;
-
-       np->uln_next = POOL_TO_MARKER(lp->ul_pool);
-       np->uln_prev = NULL;
-}
-
-void *
-uu_list_teardown(uu_list_t *lp, void **cookie)
-{
-       void *ep;
-
-       /*
-        * XXX: disable list modification until list is empty
-        */
-       if (lp->ul_debug && *cookie != NULL)
-               uu_panic("uu_list_teardown(%p, %p): unexpected cookie\n",
-                   (void *)lp, (void *)cookie);
-
-       ep = uu_list_first(lp);
-       if (ep)
-               uu_list_remove(lp, ep);
-       return (ep);
-}
-
-int
-uu_list_insert_before(uu_list_t *lp, void *target, void *elem)
-{
-       uu_list_node_impl_t *np = ELEM_TO_NODE(lp, target);
-
-       if (target == NULL)
-               np = &lp->ul_null_node;
-
-       if (lp->ul_debug) {
-               if (np->uln_prev == NULL)
-                       uu_panic("uu_list_insert_before(%p, %p, %p): %p is "
-                           "not currently on a list\n",
-                           (void *)lp, target, elem, target);
-       }
-       if (lp->ul_sorted) {
-               if (lp->ul_debug)
-                       uu_panic("uu_list_insert_before(%p, ...): list is "
-                           "UU_LIST_SORTED\n", (void *)lp);
-               uu_set_error(UU_ERROR_NOT_SUPPORTED);
-               return (-1);
-       }
-
-       list_insert(lp, ELEM_TO_NODE(lp, elem), np->uln_prev, np);
-       return (0);
-}
-
-int
-uu_list_insert_after(uu_list_t *lp, void *target, void *elem)
-{
-       uu_list_node_impl_t *np = ELEM_TO_NODE(lp, target);
-
-       if (target == NULL)
-               np = &lp->ul_null_node;
-
-       if (lp->ul_debug) {
-               if (np->uln_prev == NULL)
-                       uu_panic("uu_list_insert_after(%p, %p, %p): %p is "
-                           "not currently on a list\n",
-                           (void *)lp, target, elem, target);
-       }
-       if (lp->ul_sorted) {
-               if (lp->ul_debug)
-                       uu_panic("uu_list_insert_after(%p, ...): list is "
-                           "UU_LIST_SORTED\n", (void *)lp);
-               uu_set_error(UU_ERROR_NOT_SUPPORTED);
-               return (-1);
-       }
-
-       list_insert(lp, ELEM_TO_NODE(lp, elem), np, np->uln_next);
-       return (0);
-}
-
-size_t
-uu_list_numnodes(uu_list_t *lp)
-{
-       return (lp->ul_numnodes);
-}
-
-void *
-uu_list_first(uu_list_t *lp)
-{
-       uu_list_node_impl_t *n = lp->ul_null_node.uln_next;
-       if (n == &lp->ul_null_node)
-               return (NULL);
-       return (NODE_TO_ELEM(lp, n));
-}
-
-void *
-uu_list_last(uu_list_t *lp)
-{
-       uu_list_node_impl_t *n = lp->ul_null_node.uln_prev;
-       if (n == &lp->ul_null_node)
-               return (NULL);
-       return (NODE_TO_ELEM(lp, n));
-}
-
-void *
-uu_list_next(uu_list_t *lp, void *elem)
-{
-       uu_list_node_impl_t *n = ELEM_TO_NODE(lp, elem);
-
-       n = n->uln_next;
-       if (n == &lp->ul_null_node)
-               return (NULL);
-       return (NODE_TO_ELEM(lp, n));
-}
-
-void *
-uu_list_prev(uu_list_t *lp, void *elem)
-{
-       uu_list_node_impl_t *n = ELEM_TO_NODE(lp, elem);
-
-       n = n->uln_prev;
-       if (n == &lp->ul_null_node)
-               return (NULL);
-       return (NODE_TO_ELEM(lp, n));
-}
-
-/*
- * called from uu_lockup() and uu_release(), as part of our fork1()-safety.
- */
-void
-uu_list_lockup(void)
-{
-       uu_list_pool_t *pp;
-
-       (void) pthread_mutex_lock(&uu_lpool_list_lock);
-       for (pp = uu_null_lpool.ulp_next; pp != &uu_null_lpool;
-           pp = pp->ulp_next)
-               (void) pthread_mutex_lock(&pp->ulp_lock);
-}
-
-void
-uu_list_release(void)
-{
-       uu_list_pool_t *pp;
-
-       for (pp = uu_null_lpool.ulp_next; pp != &uu_null_lpool;
-           pp = pp->ulp_next)
-               (void) pthread_mutex_unlock(&pp->ulp_lock);
-       (void) pthread_mutex_unlock(&uu_lpool_list_lock);
-}
diff --git a/zfs/lib/libuutil/uu_misc.c b/zfs/lib/libuutil/uu_misc.c
deleted file mode 100644 (file)
index 67f757c..0000000
+++ /dev/null
@@ -1,279 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include "libuutil_common.h"
-
-#include <assert.h>
-#include <errno.h>
-#include <libintl.h>
-#include <pthread.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/debug.h>
-#include <unistd.h>
-#include <ctype.h>
-
-#if !defined(TEXT_DOMAIN)
-#define        TEXT_DOMAIN "SYS_TEST"
-#endif
-
-/*
- * All of the old code under !defined(PTHREAD_ONCE_KEY_NP)
- * is here to enable the building of a native version of
- * libuutil.so when the build machine has not yet been upgraded
- * to a version of libc that provides pthread_key_create_once_np().
- * It should all be deleted when solaris_nevada ships.
- * The code is not MT-safe in a relaxed memory model.
- */
-
-#if defined(PTHREAD_ONCE_KEY_NP)
-static pthread_key_t   uu_error_key = PTHREAD_ONCE_KEY_NP;
-#else  /* PTHREAD_ONCE_KEY_NP */
-static pthread_key_t   uu_error_key = 0;
-static pthread_mutex_t uu_key_lock = PTHREAD_MUTEX_INITIALIZER;
-#endif /* PTHREAD_ONCE_KEY_NP */
-
-static int             uu_error_key_setup = 0;
-
-static pthread_mutex_t uu_panic_lock = PTHREAD_MUTEX_INITIALIZER;
-/* LINTED static unused */
-static const char      *uu_panic_format;
-/* LINTED static unused */
-static va_list         uu_panic_args;
-static pthread_t       uu_panic_thread;
-
-static uint32_t                _uu_main_error;
-static __thread int    _uu_main_thread = 0;
-
-void
-uu_set_error(uint_t code)
-{
-       if (_uu_main_thread) {
-               _uu_main_error = code;
-               return;
-       }
-#if defined(PTHREAD_ONCE_KEY_NP)
-       if (pthread_key_create_once_np(&uu_error_key, NULL) != 0)
-               uu_error_key_setup = -1;
-       else
-               uu_error_key_setup = 1;
-#else  /* PTHREAD_ONCE_KEY_NP */
-       if (uu_error_key_setup == 0) {
-               (void) pthread_mutex_lock(&uu_key_lock);
-               if (uu_error_key_setup == 0) {
-                       if (pthread_key_create(&uu_error_key, NULL) != 0)
-                               uu_error_key_setup = -1;
-                       else
-                               uu_error_key_setup = 1;
-               }
-               (void) pthread_mutex_unlock(&uu_key_lock);
-       }
-#endif /* PTHREAD_ONCE_KEY_NP */
-       if (uu_error_key_setup > 0)
-               (void) pthread_setspecific(uu_error_key,
-                   (void *)(uintptr_t)code);
-}
-
-uint32_t
-uu_error(void)
-{
-       if (_uu_main_thread)
-               return (_uu_main_error);
-
-       if (uu_error_key_setup < 0)     /* can't happen? */
-               return (UU_ERROR_UNKNOWN);
-
-       /*
-        * Because UU_ERROR_NONE == 0, if uu_set_error() was
-        * never called, then this will return UU_ERROR_NONE:
-        */
-       return ((uint32_t)(uintptr_t)pthread_getspecific(uu_error_key));
-}
-
-const char *
-uu_strerror(uint32_t code)
-{
-       const char *str;
-
-       switch (code) {
-       case UU_ERROR_NONE:
-               str = dgettext(TEXT_DOMAIN, "No error");
-               break;
-
-       case UU_ERROR_INVALID_ARGUMENT:
-               str = dgettext(TEXT_DOMAIN, "Invalid argument");
-               break;
-
-       case UU_ERROR_UNKNOWN_FLAG:
-               str = dgettext(TEXT_DOMAIN, "Unknown flag passed");
-               break;
-
-       case UU_ERROR_NO_MEMORY:
-               str = dgettext(TEXT_DOMAIN, "Out of memory");
-               break;
-
-       case UU_ERROR_CALLBACK_FAILED:
-               str = dgettext(TEXT_DOMAIN, "Callback-initiated failure");
-               break;
-
-       case UU_ERROR_NOT_SUPPORTED:
-               str = dgettext(TEXT_DOMAIN, "Operation not supported");
-               break;
-
-       case UU_ERROR_EMPTY:
-               str = dgettext(TEXT_DOMAIN, "No value provided");
-               break;
-
-       case UU_ERROR_UNDERFLOW:
-               str = dgettext(TEXT_DOMAIN, "Value too small");
-               break;
-
-       case UU_ERROR_OVERFLOW:
-               str = dgettext(TEXT_DOMAIN, "Value too large");
-               break;
-
-       case UU_ERROR_INVALID_CHAR:
-               str = dgettext(TEXT_DOMAIN,
-                   "Value contains unexpected character");
-               break;
-
-       case UU_ERROR_INVALID_DIGIT:
-               str = dgettext(TEXT_DOMAIN,
-                   "Value contains digit not in base");
-               break;
-
-       case UU_ERROR_SYSTEM:
-               str = dgettext(TEXT_DOMAIN, "Underlying system error");
-               break;
-
-       case UU_ERROR_UNKNOWN:
-               str = dgettext(TEXT_DOMAIN, "Error status not known");
-               break;
-
-       default:
-               errno = ESRCH;
-               str = NULL;
-               break;
-       }
-       return (str);
-}
-
-void
-uu_panic(const char *format, ...)
-{
-       va_list args;
-
-       va_start(args, format);
-
-       (void) pthread_mutex_lock(&uu_panic_lock);
-       if (uu_panic_thread == 0) {
-               uu_panic_thread = pthread_self();
-               uu_panic_format = format;
-               va_copy(uu_panic_args, args);
-       }
-       (void) pthread_mutex_unlock(&uu_panic_lock);
-
-       (void) vfprintf(stderr, format, args);
-
-       if (uu_panic_thread == pthread_self())
-               abort();
-       else
-               for (;;)
-                       (void) pause();
-}
-
-static void
-uu_lockup(void)
-{
-       (void) pthread_mutex_lock(&uu_panic_lock);
-#if !defined(PTHREAD_ONCE_KEY_NP)
-       (void) pthread_mutex_lock(&uu_key_lock);
-#endif
-       uu_avl_lockup();
-       uu_list_lockup();
-}
-
-static void
-uu_release(void)
-{
-       (void) pthread_mutex_unlock(&uu_panic_lock);
-#if !defined(PTHREAD_ONCE_KEY_NP)
-       (void) pthread_mutex_unlock(&uu_key_lock);
-#endif
-       uu_avl_release();
-       uu_list_release();
-}
-
-static void
-uu_release_child(void)
-{
-       uu_panic_format = NULL;
-       uu_panic_thread = 0;
-
-       uu_release();
-}
-
-#ifdef __GNUC__
-static void
-uu_init(void) __attribute__((constructor));
-#else
-#pragma init(uu_init)
-#endif
-
-static void
-uu_init(void)
-{
-       _uu_main_thread = 1;
-       (void) pthread_atfork(uu_lockup, uu_release, uu_release_child);
-}
-
-/*
- * Dump a block of memory in hex+ascii, for debugging
- */
-void
-uu_dump(FILE *out, const char *prefix, const void *buf, size_t len)
-{
-       const unsigned char *p = buf;
-       int i;
-
-       for (i = 0; i < len; i += 16) {
-               int j;
-
-               (void) fprintf(out, "%s", prefix);
-               for (j = 0; j < 16 && i + j < len; j++) {
-                       (void) fprintf(out, "%2.2x ", p[i + j]);
-               }
-               for (; j < 16; j++) {
-                       (void) fprintf(out, "   ");
-               }
-               for (j = 0; j < 16 && i + j < len; j++) {
-                       (void) fprintf(out, "%c",
-                           isprint(p[i + j]) ? p[i + j] : '.');
-               }
-               (void) fprintf(out, "\n");
-       }
-}
diff --git a/zfs/lib/libuutil/uu_open.c b/zfs/lib/libuutil/uu_open.c
deleted file mode 100644 (file)
index cf5c545..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include "libuutil_common.h"
-
-#include <sys/time.h>
-
-#include <errno.h>
-#include <fcntl.h>
-#include <limits.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#ifdef _LP64
-#define        TMPPATHFMT      "%s/uu%ld"
-#else /* _LP64 */
-#define        TMPPATHFMT      "%s/uu%lld"
-#endif /* _LP64 */
-
-/*ARGSUSED*/
-int
-uu_open_tmp(const char *dir, uint_t uflags)
-{
-       int f;
-       char *fname = uu_zalloc(PATH_MAX);
-
-       if (fname == NULL)
-               return (-1);
-
-       for (;;) {
-               (void) snprintf(fname, PATH_MAX, "%s/uu%lld", dir, gethrtime());
-
-               f = open(fname, O_CREAT | O_EXCL | O_RDWR, 0600);
-
-               if (f >= 0 || errno != EEXIST)
-                       break;
-       }
-
-       if (f >= 0)
-               (void) unlink(fname);
-
-       uu_free(fname);
-
-       return (f);
-}
diff --git a/zfs/lib/libuutil/uu_pname.c b/zfs/lib/libuutil/uu_pname.c
deleted file mode 100644 (file)
index a6a0f22..0000000
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include "libuutil_common.h"
-
-#include <libintl.h>
-#include <limits.h>
-#include <string.h>
-#include <stdlib.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <errno.h>
-#include <wchar.h>
-#include <unistd.h>
-
-static const char PNAME_FMT[] = "%s: ";
-static const char ERRNO_FMT[] = ": %s\n";
-
-static const char *pname;
-
-static void
-uu_die_internal(int status, const char *format, va_list alist) __NORETURN;
-
-int uu_exit_ok_value = EXIT_SUCCESS;
-int uu_exit_fatal_value = EXIT_FAILURE;
-int uu_exit_usage_value = 2;
-
-int *
-uu_exit_ok(void)
-{
-       return (&uu_exit_ok_value);
-}
-
-int *
-uu_exit_fatal(void)
-{
-       return (&uu_exit_fatal_value);
-}
-
-int *
-uu_exit_usage(void)
-{
-       return (&uu_exit_usage_value);
-}
-
-void
-uu_alt_exit(int profile)
-{
-       switch (profile) {
-       case UU_PROFILE_DEFAULT:
-               uu_exit_ok_value = EXIT_SUCCESS;
-               uu_exit_fatal_value = EXIT_FAILURE;
-               uu_exit_usage_value = 2;
-               break;
-       case UU_PROFILE_LAUNCHER:
-               uu_exit_ok_value = EXIT_SUCCESS;
-               uu_exit_fatal_value = 124;
-               uu_exit_usage_value = 125;
-               break;
-       }
-}
-
-static void
-uu_warn_internal(int err, const char *format, va_list alist)
-{
-       if (pname != NULL)
-               (void) fprintf(stderr, PNAME_FMT, pname);
-
-       (void) vfprintf(stderr, format, alist);
-
-       if (strrchr(format, '\n') == NULL)
-               (void) fprintf(stderr, ERRNO_FMT, strerror(err));
-}
-
-void
-uu_vwarn(const char *format, va_list alist)
-{
-       uu_warn_internal(errno, format, alist);
-}
-
-/*PRINTFLIKE1*/
-void
-uu_warn(const char *format, ...)
-{
-       va_list alist;
-       va_start(alist, format);
-       uu_warn_internal(errno, format, alist);
-       va_end(alist);
-}
-
-static void
-uu_die_internal(int status, const char *format, va_list alist)
-{
-       uu_warn_internal(errno, format, alist);
-#ifdef DEBUG
-       {
-               char *cp;
-
-               if (!issetugid()) {
-                       cp = getenv("UU_DIE_ABORTS");
-                       if (cp != NULL && *cp != '\0')
-                               abort();
-               }
-       }
-#endif
-       exit(status);
-}
-
-void
-uu_vdie(const char *format, va_list alist)
-{
-       uu_die_internal(UU_EXIT_FATAL, format, alist);
-}
-
-/*PRINTFLIKE1*/
-void
-uu_die(const char *format, ...)
-{
-       va_list alist;
-       va_start(alist, format);
-       uu_die_internal(UU_EXIT_FATAL, format, alist);
-       va_end(alist);
-}
-
-void
-uu_vxdie(int status, const char *format, va_list alist)
-{
-       uu_die_internal(status, format, alist);
-}
-
-/*PRINTFLIKE2*/
-void
-uu_xdie(int status, const char *format, ...)
-{
-       va_list alist;
-       va_start(alist, format);
-       uu_die_internal(status, format, alist);
-       va_end(alist);
-}
-
-const char *
-uu_setpname(char *arg0)
-{
-       /*
-        * Having a NULL argv[0], while uncommon, is possible.  It
-        * makes more sense to handle this event in uu_setpname rather
-        * than in each of its consumers.
-        */
-       if (arg0 == NULL) {
-               pname = getexecname();
-               if (pname == NULL)
-                       pname = "unknown_command";
-               return (pname);
-       }
-
-       /*
-        * Guard against '/' at end of command invocation.
-        */
-       for (;;) {
-               char *p = strrchr(arg0, '/');
-               if (p == NULL) {
-                       pname = arg0;
-                       break;
-               } else {
-                       if (*(p + 1) == '\0') {
-                               *p = '\0';
-                               continue;
-                       }
-
-                       pname = p + 1;
-                       break;
-               }
-       }
-
-       return (pname);
-}
-
-const char *
-uu_getpname(void)
-{
-       return (pname);
-}
diff --git a/zfs/lib/libuutil/uu_string.c b/zfs/lib/libuutil/uu_string.c
deleted file mode 100644 (file)
index 66afba0..0000000
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * String helper functions
- */
-
-#include <string.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include <malloc.h>
-#include <ctype.h>
-#include "libuutil.h"
-
-/* Return true if strings are equal */
-boolean_t
-uu_streq(const char *a, const char *b)
-{
-       return (strcmp(a, b) == 0);
-}
-
-/* Return true if strings are equal, case-insensitively */
-boolean_t
-uu_strcaseeq(const char *a, const char *b)
-{
-       return (strcasecmp(a, b) == 0);
-}
-
-/* Return true if string a Begins With string b */
-boolean_t
-uu_strbw(const char *a, const char *b)
-{
-       return (strncmp(a, b, strlen(b)) == 0);
-}
diff --git a/zfs/lib/libuutil/uu_strtoint.c b/zfs/lib/libuutil/uu_strtoint.c
deleted file mode 100644 (file)
index 494e0a5..0000000
+++ /dev/null
@@ -1,300 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License, Version 1.0 only
- * (the "License").  You may not use this file except in compliance
- * with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-
-
-#include "libuutil_common.h"
-
-#include <limits.h>
-#include <ctype.h>
-
-#define        MAX_BASE        36
-
-#define        IS_DIGIT(x)     ((x) >= '0' && (x) <= '9')
-
-#define        CTOI(x) (((x) >= '0' && (x) <= '9') ? (x) - '0' : \
-           ((x) >= 'a' && (x) <= 'z') ? (x) + 10 - 'a' : (x) + 10 - 'A')
-
-static int
-strtoint(const char *s_arg, uint64_t *out, uint32_t base, int sign)
-{
-       const unsigned char *s = (const unsigned char *)s_arg;
-
-       uint64_t val = 0;
-       uint64_t multmax;
-
-       unsigned c, i;
-
-       int neg = 0;
-
-       int bad_digit = 0;
-       int bad_char = 0;
-       int overflow = 0;
-
-       if (s == NULL || base == 1 || base > MAX_BASE) {
-               uu_set_error(UU_ERROR_INVALID_ARGUMENT);
-               return (-1);
-       }
-
-       while ((c = *s) != 0 && isspace(c))
-               s++;
-
-       switch (c) {
-       case '-':
-               if (!sign)
-                       overflow = 1;           /* becomes underflow below */
-               neg = 1;
-               /*FALLTHRU*/
-       case '+':
-               c = *++s;
-               break;
-       default:
-               break;
-       }
-
-       if (c == '\0') {
-               uu_set_error(UU_ERROR_EMPTY);
-               return (-1);
-       }
-
-       if (base == 0) {
-               if (c != '0')
-                       base = 10;
-               else if (s[1] == 'x' || s[1] == 'X')
-                       base = 16;
-               else
-                       base = 8;
-       }
-
-       if (base == 16 && c == '0' && (s[1] == 'x' || s[1] == 'X'))
-               c = *(s += 2);
-
-       if ((val = CTOI(c)) >= base) {
-               if (IS_DIGIT(c))
-                       bad_digit = 1;
-               else
-                       bad_char = 1;
-               val = 0;
-       }
-
-       multmax = (uint64_t)UINT64_MAX / (uint64_t)base;
-
-       for (c = *++s; c != '\0'; c = *++s) {
-               if ((i = CTOI(c)) >= base) {
-                       if (isspace(c))
-                               break;
-                       if (IS_DIGIT(c))
-                               bad_digit = 1;
-                       else
-                               bad_char = 1;
-                       i = 0;
-               }
-
-               if (val > multmax)
-                       overflow = 1;
-
-               val *= base;
-               if ((uint64_t)UINT64_MAX - val < (uint64_t)i)
-                       overflow = 1;
-
-               val += i;
-       }
-
-       while ((c = *s) != 0) {
-               if (!isspace(c))
-                       bad_char = 1;
-               s++;
-       }
-
-       if (sign) {
-               if (neg) {
-                       if (val > -(uint64_t)INT64_MIN)
-                               overflow = 1;
-               } else {
-                       if (val > INT64_MAX)
-                               overflow = 1;
-               }
-       }
-
-       if (neg)
-               val = -val;
-
-       if (bad_char | bad_digit | overflow) {
-               if (bad_char)
-                       uu_set_error(UU_ERROR_INVALID_CHAR);
-               else if (bad_digit)
-                       uu_set_error(UU_ERROR_INVALID_DIGIT);
-               else if (overflow) {
-                       if (neg)
-                               uu_set_error(UU_ERROR_UNDERFLOW);
-                       else
-                               uu_set_error(UU_ERROR_OVERFLOW);
-               }
-               return (-1);
-       }
-
-       *out = val;
-       return (0);
-}
-
-int
-uu_strtoint(const char *s, void *v, size_t sz, int base,
-    int64_t min, int64_t max)
-{
-       uint64_t val_u;
-       int64_t val;
-
-       if (min > max)
-               goto bad_argument;
-
-       switch (sz) {
-       case 1:
-               if (max > INT8_MAX || min < INT8_MIN)
-                       goto bad_argument;
-               break;
-       case 2:
-               if (max > INT16_MAX || min < INT16_MIN)
-                       goto bad_argument;
-               break;
-       case 4:
-               if (max > INT32_MAX || min < INT32_MIN)
-                       goto bad_argument;
-               break;
-       case 8:
-               if (max > INT64_MAX || min < INT64_MIN)
-                       goto bad_argument;
-               break;
-       default:
-               goto bad_argument;
-       }
-
-       if (min == 0 && max == 0) {
-               min = -(1ULL << (8 * sz - 1));
-               max = (1ULL << (8 * sz - 1)) - 1;
-       }
-
-       if (strtoint(s, &val_u, base, 1) == -1)
-               return (-1);
-
-       val = (int64_t)val_u;
-
-       if (val < min) {
-               uu_set_error(UU_ERROR_UNDERFLOW);
-               return (-1);
-       } else if (val > max) {
-               uu_set_error(UU_ERROR_OVERFLOW);
-               return (-1);
-       }
-
-       switch (sz) {
-       case 1:
-               *(int8_t *)v = val;
-               return (0);
-       case 2:
-               *(int16_t *)v = val;
-               return (0);
-       case 4:
-               *(int32_t *)v = val;
-               return (0);
-       case 8:
-               *(int64_t *)v = val;
-               return (0);
-       default:
-               break;          /* fall through to bad_argument */
-       }
-
-bad_argument:
-       uu_set_error(UU_ERROR_INVALID_ARGUMENT);
-       return (-1);
-}
-
-int
-uu_strtouint(const char *s, void *v, size_t sz, int base,
-    uint64_t min, uint64_t max)
-{
-       uint64_t val;
-
-       if (min > max)
-               goto bad_argument;
-
-       switch (sz) {
-       case 1:
-               if (max > UINT8_MAX)
-                       goto bad_argument;
-               break;
-       case 2:
-               if (max > UINT16_MAX)
-                       goto bad_argument;
-               break;
-       case 4:
-               if (max > UINT32_MAX)
-                       goto bad_argument;
-               break;
-       case 8:
-               if (max > UINT64_MAX)
-                       goto bad_argument;
-               break;
-       default:
-               goto bad_argument;
-       }
-
-       if (min == 0 && max == 0) {
-               /* we have to be careful, since << can overflow */
-               max = (1ULL << (8 * sz - 1)) * 2 - 1;
-       }
-
-       if (strtoint(s, &val, base, 0) == -1)
-               return (-1);
-
-       if (val < min) {
-               uu_set_error(UU_ERROR_UNDERFLOW);
-               return (-1);
-       } else if (val > max) {
-               uu_set_error(UU_ERROR_OVERFLOW);
-               return (-1);
-       }
-
-       switch (sz) {
-       case 1:
-               *(uint8_t *)v = val;
-               return (0);
-       case 2:
-               *(uint16_t *)v = val;
-               return (0);
-       case 4:
-               *(uint32_t *)v = val;
-               return (0);
-       case 8:
-               *(uint64_t *)v = val;
-               return (0);
-       default:
-               break;          /* shouldn't happen, fall through */
-       }
-
-bad_argument:
-       uu_set_error(UU_ERROR_INVALID_ARGUMENT);
-       return (-1);
-}
diff --git a/zfs/lib/libzfs/.gitignore b/zfs/lib/libzfs/.gitignore
deleted file mode 100644 (file)
index d719bc1..0000000
+++ /dev/null
@@ -1,2 +0,0 @@
-/libzfs.pc
-/libzfs_core.pc
diff --git a/zfs/lib/libzfs/Makefile.am b/zfs/lib/libzfs/Makefile.am
deleted file mode 100644 (file)
index b0c6987..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-libzfs_pcdir = $(datarootdir)/pkgconfig
-libzfs_pc_DATA = libzfs.pc libzfs_core.pc
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-lib_LTLIBRARIES = libzfs.la
-
-USER_C = \
-       libzfs_changelist.c \
-       libzfs_config.c \
-       libzfs_dataset.c \
-       libzfs_diff.c \
-       libzfs_fru.c \
-       libzfs_graph.c \
-       libzfs_import.c \
-       libzfs_iter.c \
-       libzfs_mount.c \
-       libzfs_pool.c \
-       libzfs_sendrecv.c \
-       libzfs_status.c \
-       libzfs_util.c
-
-KERNEL_C =
-
-nodist_libzfs_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-libzfs_la_LIBADD = \
-       $(top_builddir)/lib/libzfs_core/libzfs_core.la \
-       $(top_builddir)/lib/libshare/libshare.la \
-       $(top_builddir)/lib/libnvpair/libnvpair.la \
-       $(top_builddir)/lib/libzpool/libzpool.la
-
-libzfs_la_LIBADD += -lm -ldl $(LIBBLKID)
-libzfs_la_LDFLAGS = -version-info 2:0:0
-
-EXTRA_DIST = $(libzfs_pc_DATA) $(USER_C)
diff --git a/zfs/lib/libzfs/Makefile.in b/zfs/lib/libzfs/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
index 0e83f7a64be00e61c95d4a432457b6f080c94f56..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,12 +1,2 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libzfs
-Description: LibZFS library
-Version: @VERSION@
-URL: http://zfsonlinux.org
-Requires: libzfs_core
-Cflags: -I${includedir}/libzfs -I${includedir}/libspl
-Libs: -L${libdir} -lzfs
+%:
+       #
diff --git a/zfs/lib/libzfs/libzfs_changelist.c b/zfs/lib/libzfs/libzfs_changelist.c
deleted file mode 100644 (file)
index 0bcfc04..0000000
+++ /dev/null
@@ -1,695 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- *
- * Portions Copyright 2007 Ramprakash Jelari
- */
-
-#include <libintl.h>
-#include <libuutil.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <unistd.h>
-#include <zone.h>
-
-#include <libzfs.h>
-
-#include "libzfs_impl.h"
-
-/*
- * Structure to keep track of dataset state.  Before changing the 'sharenfs' or
- * 'mountpoint' property, we record whether the filesystem was previously
- * mounted/shared.  This prior state dictates whether we remount/reshare the
- * dataset after the property has been changed.
- *
- * The interface consists of the following sequence of functions:
- *
- *     changelist_gather()
- *     changelist_prefix()
- *     < change property >
- *     changelist_postfix()
- *     changelist_free()
- *
- * Other interfaces:
- *
- * changelist_remove() - remove a node from a gathered list
- * changelist_rename() - renames all datasets appropriately when doing a rename
- * changelist_unshare() - unshares all the nodes in a given changelist
- * changelist_haszonedchild() - check if there is any child exported to
- *                             a local zone
- */
-typedef struct prop_changenode {
-       zfs_handle_t            *cn_handle;
-       int                     cn_shared;
-       int                     cn_mounted;
-       int                     cn_zoned;
-       boolean_t               cn_needpost;    /* is postfix() needed? */
-       uu_list_node_t          cn_listnode;
-} prop_changenode_t;
-
-struct prop_changelist {
-       zfs_prop_t              cl_prop;
-       zfs_prop_t              cl_realprop;
-       zfs_prop_t              cl_shareprop;  /* used with sharenfs/sharesmb */
-       uu_list_pool_t          *cl_pool;
-       uu_list_t               *cl_list;
-       boolean_t               cl_waslegacy;
-       boolean_t               cl_allchildren;
-       boolean_t               cl_alldependents;
-       int                     cl_mflags;      /* Mount flags */
-       int                     cl_gflags;      /* Gather request flags */
-       boolean_t               cl_haszonedchild;
-       boolean_t               cl_sorted;
-};
-
-/*
- * If the property is 'mountpoint', go through and unmount filesystems as
- * necessary.  We don't do the same for 'sharenfs', because we can just re-share
- * with different options without interrupting service. We do handle 'sharesmb'
- * since there may be old resource names that need to be removed.
- */
-int
-changelist_prefix(prop_changelist_t *clp)
-{
-       prop_changenode_t *cn;
-       int ret = 0;
-
-       if (clp->cl_prop != ZFS_PROP_MOUNTPOINT &&
-           clp->cl_prop != ZFS_PROP_SHARESMB)
-               return (0);
-
-       for (cn = uu_list_first(clp->cl_list); cn != NULL;
-           cn = uu_list_next(clp->cl_list, cn)) {
-
-               /* if a previous loop failed, set the remaining to false */
-               if (ret == -1) {
-                       cn->cn_needpost = B_FALSE;
-                       continue;
-               }
-
-               /*
-                * If we are in the global zone, but this dataset is exported
-                * to a local zone, do nothing.
-                */
-               if (getzoneid() == GLOBAL_ZONEID && cn->cn_zoned)
-                       continue;
-
-               if (!ZFS_IS_VOLUME(cn->cn_handle)) {
-                       /*
-                        * Do the property specific processing.
-                        */
-                       switch (clp->cl_prop) {
-                       case ZFS_PROP_MOUNTPOINT:
-                               if (zfs_unmount(cn->cn_handle, NULL,
-                                   clp->cl_mflags) != 0) {
-                                       ret = -1;
-                                       cn->cn_needpost = B_FALSE;
-                               }
-                               break;
-                       case ZFS_PROP_SHARESMB:
-                               (void) zfs_unshare_smb(cn->cn_handle, NULL);
-                               break;
-                       default:
-                               break;
-                       }
-               }
-       }
-
-       if (ret == -1)
-               (void) changelist_postfix(clp);
-
-       return (ret);
-}
-
-/*
- * If the property is 'mountpoint' or 'sharenfs', go through and remount and/or
- * reshare the filesystems as necessary.  In changelist_gather() we recorded
- * whether the filesystem was previously shared or mounted.  The action we take
- * depends on the previous state, and whether the value was previously 'legacy'.
- * For non-legacy properties, we only remount/reshare the filesystem if it was
- * previously mounted/shared.  Otherwise, we always remount/reshare the
- * filesystem.
- */
-int
-changelist_postfix(prop_changelist_t *clp)
-{
-       prop_changenode_t *cn;
-       char shareopts[ZFS_MAXPROPLEN];
-       int errors = 0;
-       libzfs_handle_t *hdl;
-
-       /*
-        * If we're changing the mountpoint, attempt to destroy the underlying
-        * mountpoint.  All other datasets will have inherited from this dataset
-        * (in which case their mountpoints exist in the filesystem in the new
-        * location), or have explicit mountpoints set (in which case they won't
-        * be in the changelist).
-        */
-       if ((cn = uu_list_last(clp->cl_list)) == NULL)
-               return (0);
-
-       if (clp->cl_prop == ZFS_PROP_MOUNTPOINT)
-               remove_mountpoint(cn->cn_handle);
-
-       /*
-        * It is possible that the changelist_prefix() used libshare
-        * to unshare some entries. Since libshare caches data, an
-        * attempt to reshare during postfix can fail unless libshare
-        * is uninitialized here so that it will reinitialize later.
-        */
-       if (cn->cn_handle != NULL) {
-               hdl = cn->cn_handle->zfs_hdl;
-               assert(hdl != NULL);
-               zfs_uninit_libshare(hdl);
-       }
-
-       /*
-        * We walk the datasets in reverse, because we want to mount any parent
-        * datasets before mounting the children.  We walk all datasets even if
-        * there are errors.
-        */
-       for (cn = uu_list_last(clp->cl_list); cn != NULL;
-           cn = uu_list_prev(clp->cl_list, cn)) {
-
-               boolean_t sharenfs;
-               boolean_t sharesmb;
-               boolean_t mounted;
-
-               /*
-                * If we are in the global zone, but this dataset is exported
-                * to a local zone, do nothing.
-                */
-               if (getzoneid() == GLOBAL_ZONEID && cn->cn_zoned)
-                       continue;
-
-               /* Only do post-processing if it's required */
-               if (!cn->cn_needpost)
-                       continue;
-               cn->cn_needpost = B_FALSE;
-
-               zfs_refresh_properties(cn->cn_handle);
-
-               if (ZFS_IS_VOLUME(cn->cn_handle))
-                       continue;
-
-               /*
-                * Remount if previously mounted or mountpoint was legacy,
-                * or sharenfs or sharesmb  property is set.
-                */
-               sharenfs = ((zfs_prop_get(cn->cn_handle, ZFS_PROP_SHARENFS,
-                   shareopts, sizeof (shareopts), NULL, NULL, 0,
-                   B_FALSE) == 0) && (strcmp(shareopts, "off") != 0));
-
-               sharesmb = ((zfs_prop_get(cn->cn_handle, ZFS_PROP_SHARESMB,
-                   shareopts, sizeof (shareopts), NULL, NULL, 0,
-                   B_FALSE) == 0) && (strcmp(shareopts, "off") != 0));
-
-               mounted = zfs_is_mounted(cn->cn_handle, NULL);
-
-               if (!mounted && (cn->cn_mounted ||
-                   ((sharenfs || sharesmb || clp->cl_waslegacy) &&
-                   (zfs_prop_get_int(cn->cn_handle,
-                   ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_ON)))) {
-
-                       if (zfs_mount(cn->cn_handle, NULL, 0) != 0)
-                               errors++;
-                       else
-                               mounted = TRUE;
-               }
-
-               /*
-                * If the file system is mounted we always re-share even
-                * if the filesystem is currently shared, so that we can
-                * adopt any new options.
-                */
-               if (sharenfs && mounted)
-                       errors += zfs_share_nfs(cn->cn_handle);
-               else if (cn->cn_shared || clp->cl_waslegacy)
-                       errors += zfs_unshare_nfs(cn->cn_handle, NULL);
-               if (sharesmb && mounted)
-                       errors += zfs_share_smb(cn->cn_handle);
-               else if (cn->cn_shared || clp->cl_waslegacy)
-                       errors += zfs_unshare_smb(cn->cn_handle, NULL);
-       }
-
-       return (errors ? -1 : 0);
-}
-
-/*
- * Is this "dataset" a child of "parent"?
- */
-boolean_t
-isa_child_of(const char *dataset, const char *parent)
-{
-       int len;
-
-       len = strlen(parent);
-
-       if (strncmp(dataset, parent, len) == 0 &&
-           (dataset[len] == '@' || dataset[len] == '/' ||
-           dataset[len] == '\0'))
-               return (B_TRUE);
-       else
-               return (B_FALSE);
-
-}
-
-/*
- * If we rename a filesystem, child filesystem handles are no longer valid
- * since we identify each dataset by its name in the ZFS namespace.  As a
- * result, we have to go through and fix up all the names appropriately.  We
- * could do this automatically if libzfs kept track of all open handles, but
- * this is a lot less work.
- */
-void
-changelist_rename(prop_changelist_t *clp, const char *src, const char *dst)
-{
-       prop_changenode_t *cn;
-       char newname[ZFS_MAXNAMELEN];
-
-       for (cn = uu_list_first(clp->cl_list); cn != NULL;
-           cn = uu_list_next(clp->cl_list, cn)) {
-               /*
-                * Do not rename a clone that's not in the source hierarchy.
-                */
-               if (!isa_child_of(cn->cn_handle->zfs_name, src))
-                       continue;
-
-               /*
-                * Destroy the previous mountpoint if needed.
-                */
-               remove_mountpoint(cn->cn_handle);
-
-               (void) strlcpy(newname, dst, sizeof (newname));
-               (void) strcat(newname, cn->cn_handle->zfs_name + strlen(src));
-
-               (void) strlcpy(cn->cn_handle->zfs_name, newname,
-                   sizeof (cn->cn_handle->zfs_name));
-       }
-}
-
-/*
- * Given a gathered changelist for the 'sharenfs' or 'sharesmb' property,
- * unshare all the datasets in the list.
- */
-int
-changelist_unshare(prop_changelist_t *clp, zfs_share_proto_t *proto)
-{
-       prop_changenode_t *cn;
-       int ret = 0;
-
-       if (clp->cl_prop != ZFS_PROP_SHARENFS &&
-           clp->cl_prop != ZFS_PROP_SHARESMB)
-               return (0);
-
-       for (cn = uu_list_first(clp->cl_list); cn != NULL;
-           cn = uu_list_next(clp->cl_list, cn)) {
-               if (zfs_unshare_proto(cn->cn_handle, NULL, proto) != 0)
-                       ret = -1;
-       }
-
-       return (ret);
-}
-
-/*
- * Check if there is any child exported to a local zone in a given changelist.
- * This information has already been recorded while gathering the changelist
- * via changelist_gather().
- */
-int
-changelist_haszonedchild(prop_changelist_t *clp)
-{
-       return (clp->cl_haszonedchild);
-}
-
-/*
- * Remove a node from a gathered list.
- */
-void
-changelist_remove(prop_changelist_t *clp, const char *name)
-{
-       prop_changenode_t *cn;
-
-       for (cn = uu_list_first(clp->cl_list); cn != NULL;
-           cn = uu_list_next(clp->cl_list, cn)) {
-
-               if (strcmp(cn->cn_handle->zfs_name, name) == 0) {
-                       uu_list_remove(clp->cl_list, cn);
-                       zfs_close(cn->cn_handle);
-                       free(cn);
-                       return;
-               }
-       }
-}
-
-/*
- * Release any memory associated with a changelist.
- */
-void
-changelist_free(prop_changelist_t *clp)
-{
-       prop_changenode_t *cn;
-       void *cookie;
-
-       if (clp->cl_list) {
-               cookie = NULL;
-               while ((cn = uu_list_teardown(clp->cl_list, &cookie)) != NULL) {
-                       zfs_close(cn->cn_handle);
-                       free(cn);
-               }
-
-               uu_list_destroy(clp->cl_list);
-       }
-       if (clp->cl_pool)
-               uu_list_pool_destroy(clp->cl_pool);
-
-       free(clp);
-}
-
-static int
-change_one(zfs_handle_t *zhp, void *data)
-{
-       prop_changelist_t *clp = data;
-       char property[ZFS_MAXPROPLEN];
-       char where[64];
-       prop_changenode_t *cn;
-       zprop_source_t sourcetype;
-       zprop_source_t share_sourcetype;
-
-       /*
-        * We only want to unmount/unshare those filesystems that may inherit
-        * from the target filesystem.  If we find any filesystem with a
-        * locally set mountpoint, we ignore any children since changing the
-        * property will not affect them.  If this is a rename, we iterate
-        * over all children regardless, since we need them unmounted in
-        * order to do the rename.  Also, if this is a volume and we're doing
-        * a rename, then always add it to the changelist.
-        */
-
-       if (!(ZFS_IS_VOLUME(zhp) && clp->cl_realprop == ZFS_PROP_NAME) &&
-           zfs_prop_get(zhp, clp->cl_prop, property,
-           sizeof (property), &sourcetype, where, sizeof (where),
-           B_FALSE) != 0) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       /*
-        * If we are "watching" sharenfs or sharesmb
-        * then check out the companion property which is tracked
-        * in cl_shareprop
-        */
-       if (clp->cl_shareprop != ZPROP_INVAL &&
-           zfs_prop_get(zhp, clp->cl_shareprop, property,
-           sizeof (property), &share_sourcetype, where, sizeof (where),
-           B_FALSE) != 0) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if (clp->cl_alldependents || clp->cl_allchildren ||
-           sourcetype == ZPROP_SRC_DEFAULT ||
-           sourcetype == ZPROP_SRC_INHERITED ||
-           (clp->cl_shareprop != ZPROP_INVAL &&
-           (share_sourcetype == ZPROP_SRC_DEFAULT ||
-           share_sourcetype == ZPROP_SRC_INHERITED))) {
-               if ((cn = zfs_alloc(zfs_get_handle(zhp),
-                   sizeof (prop_changenode_t))) == NULL) {
-                       zfs_close(zhp);
-                       return (-1);
-               }
-
-               cn->cn_handle = zhp;
-               cn->cn_mounted = (clp->cl_gflags & CL_GATHER_MOUNT_ALWAYS) ||
-                   zfs_is_mounted(zhp, NULL);
-               cn->cn_shared = zfs_is_shared(zhp);
-               cn->cn_zoned = zfs_prop_get_int(zhp, ZFS_PROP_ZONED);
-               cn->cn_needpost = B_TRUE;
-
-               /* Indicate if any child is exported to a local zone. */
-               if (getzoneid() == GLOBAL_ZONEID && cn->cn_zoned)
-                       clp->cl_haszonedchild = B_TRUE;
-
-               uu_list_node_init(cn, &cn->cn_listnode, clp->cl_pool);
-
-               if (clp->cl_sorted) {
-                       uu_list_index_t idx;
-
-                       (void) uu_list_find(clp->cl_list, cn, NULL,
-                           &idx);
-                       uu_list_insert(clp->cl_list, cn, idx);
-               } else {
-                       /*
-                        * Add this child to beginning of the list. Children
-                        * below this one in the hierarchy will get added above
-                        * this one in the list. This produces a list in
-                        * reverse dataset name order.
-                        * This is necessary when the original mountpoint
-                        * is legacy or none.
-                        */
-                       ASSERT(!clp->cl_alldependents);
-                       verify(uu_list_insert_before(clp->cl_list,
-                           uu_list_first(clp->cl_list), cn) == 0);
-               }
-
-               if (!clp->cl_alldependents)
-                       return (zfs_iter_children(zhp, change_one, data));
-       } else {
-               zfs_close(zhp);
-       }
-
-       return (0);
-}
-
-/*ARGSUSED*/
-static int
-compare_mountpoints(const void *a, const void *b, void *unused)
-{
-       const prop_changenode_t *ca = a;
-       const prop_changenode_t *cb = b;
-
-       char mounta[MAXPATHLEN];
-       char mountb[MAXPATHLEN];
-
-       boolean_t hasmounta, hasmountb;
-
-       /*
-        * When unsharing or unmounting filesystems, we need to do it in
-        * mountpoint order.  This allows the user to have a mountpoint
-        * hierarchy that is different from the dataset hierarchy, and still
-        * allow it to be changed.  However, if either dataset doesn't have a
-        * mountpoint (because it is a volume or a snapshot), we place it at the
-        * end of the list, because it doesn't affect our change at all.
-        */
-       hasmounta = (zfs_prop_get(ca->cn_handle, ZFS_PROP_MOUNTPOINT, mounta,
-           sizeof (mounta), NULL, NULL, 0, B_FALSE) == 0);
-       hasmountb = (zfs_prop_get(cb->cn_handle, ZFS_PROP_MOUNTPOINT, mountb,
-           sizeof (mountb), NULL, NULL, 0, B_FALSE) == 0);
-
-       if (!hasmounta && hasmountb)
-               return (-1);
-       else if (hasmounta && !hasmountb)
-               return (1);
-       else if (!hasmounta && !hasmountb)
-               return (0);
-       else
-               return (strcmp(mountb, mounta));
-}
-
-/*
- * Given a ZFS handle and a property, construct a complete list of datasets
- * that need to be modified as part of this process.  For anything but the
- * 'mountpoint' and 'sharenfs' properties, this just returns an empty list.
- * Otherwise, we iterate over all children and look for any datasets that
- * inherit the property.  For each such dataset, we add it to the list and
- * mark whether it was shared beforehand.
- */
-prop_changelist_t *
-changelist_gather(zfs_handle_t *zhp, zfs_prop_t prop, int gather_flags,
-    int mnt_flags)
-{
-       prop_changelist_t *clp;
-       prop_changenode_t *cn;
-       zfs_handle_t *temp;
-       char property[ZFS_MAXPROPLEN];
-       uu_compare_fn_t *compare = NULL;
-       boolean_t legacy = B_FALSE;
-
-       if ((clp = zfs_alloc(zhp->zfs_hdl, sizeof (prop_changelist_t))) == NULL)
-               return (NULL);
-
-       /*
-        * For mountpoint-related tasks, we want to sort everything by
-        * mountpoint, so that we mount and unmount them in the appropriate
-        * order, regardless of their position in the hierarchy.
-        */
-       if (prop == ZFS_PROP_NAME || prop == ZFS_PROP_ZONED ||
-           prop == ZFS_PROP_MOUNTPOINT || prop == ZFS_PROP_SHARENFS ||
-           prop == ZFS_PROP_SHARESMB) {
-
-               if (zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT,
-                   property, sizeof (property),
-                   NULL, NULL, 0, B_FALSE) == 0 &&
-                   (strcmp(property, "legacy") == 0 ||
-                   strcmp(property, "none") == 0)) {
-
-                       legacy = B_TRUE;
-               }
-               if (!legacy) {
-                       compare = compare_mountpoints;
-                       clp->cl_sorted = B_TRUE;
-               }
-       }
-
-       clp->cl_pool = uu_list_pool_create("changelist_pool",
-           sizeof (prop_changenode_t),
-           offsetof(prop_changenode_t, cn_listnode),
-           compare, 0);
-       if (clp->cl_pool == NULL) {
-               assert(uu_error() == UU_ERROR_NO_MEMORY);
-               (void) zfs_error(zhp->zfs_hdl, EZFS_NOMEM, "internal error");
-               changelist_free(clp);
-               return (NULL);
-       }
-
-       clp->cl_list = uu_list_create(clp->cl_pool, NULL,
-           clp->cl_sorted ? UU_LIST_SORTED : 0);
-       clp->cl_gflags = gather_flags;
-       clp->cl_mflags = mnt_flags;
-
-       if (clp->cl_list == NULL) {
-               assert(uu_error() == UU_ERROR_NO_MEMORY);
-               (void) zfs_error(zhp->zfs_hdl, EZFS_NOMEM, "internal error");
-               changelist_free(clp);
-               return (NULL);
-       }
-
-       /*
-        * If this is a rename or the 'zoned' property, we pretend we're
-        * changing the mountpoint and flag it so we can catch all children in
-        * change_one().
-        *
-        * Flag cl_alldependents to catch all children plus the dependents
-        * (clones) that are not in the hierarchy.
-        */
-       if (prop == ZFS_PROP_NAME) {
-               clp->cl_prop = ZFS_PROP_MOUNTPOINT;
-               clp->cl_alldependents = B_TRUE;
-       } else if (prop == ZFS_PROP_ZONED) {
-               clp->cl_prop = ZFS_PROP_MOUNTPOINT;
-               clp->cl_allchildren = B_TRUE;
-       } else if (prop == ZFS_PROP_CANMOUNT) {
-               clp->cl_prop = ZFS_PROP_MOUNTPOINT;
-       } else if (prop == ZFS_PROP_VOLSIZE) {
-               clp->cl_prop = ZFS_PROP_MOUNTPOINT;
-       } else {
-               clp->cl_prop = prop;
-       }
-       clp->cl_realprop = prop;
-
-       if (clp->cl_prop != ZFS_PROP_MOUNTPOINT &&
-           clp->cl_prop != ZFS_PROP_SHARENFS &&
-           clp->cl_prop != ZFS_PROP_SHARESMB)
-               return (clp);
-
-       /*
-        * If watching SHARENFS or SHARESMB then
-        * also watch its companion property.
-        */
-       if (clp->cl_prop == ZFS_PROP_SHARENFS)
-               clp->cl_shareprop = ZFS_PROP_SHARESMB;
-       else if (clp->cl_prop == ZFS_PROP_SHARESMB)
-               clp->cl_shareprop = ZFS_PROP_SHARENFS;
-
-       if (clp->cl_alldependents) {
-               if (zfs_iter_dependents(zhp, B_TRUE, change_one, clp) != 0) {
-                       changelist_free(clp);
-                       return (NULL);
-               }
-       } else if (zfs_iter_children(zhp, change_one, clp) != 0) {
-               changelist_free(clp);
-               return (NULL);
-       }
-
-       /*
-        * We have to re-open ourselves because we auto-close all the handles
-        * and can't tell the difference.
-        */
-       if ((temp = zfs_open(zhp->zfs_hdl, zfs_get_name(zhp),
-           ZFS_TYPE_DATASET)) == NULL) {
-               changelist_free(clp);
-               return (NULL);
-       }
-
-       /*
-        * Always add ourself to the list.  We add ourselves to the end so that
-        * we're the last to be unmounted.
-        */
-       if ((cn = zfs_alloc(zhp->zfs_hdl,
-           sizeof (prop_changenode_t))) == NULL) {
-               zfs_close(temp);
-               changelist_free(clp);
-               return (NULL);
-       }
-
-       cn->cn_handle = temp;
-       cn->cn_mounted = (clp->cl_gflags & CL_GATHER_MOUNT_ALWAYS) ||
-           zfs_is_mounted(temp, NULL);
-       cn->cn_shared = zfs_is_shared(temp);
-       cn->cn_zoned = zfs_prop_get_int(zhp, ZFS_PROP_ZONED);
-       cn->cn_needpost = B_TRUE;
-
-       uu_list_node_init(cn, &cn->cn_listnode, clp->cl_pool);
-       if (clp->cl_sorted) {
-               uu_list_index_t idx;
-               (void) uu_list_find(clp->cl_list, cn, NULL, &idx);
-               uu_list_insert(clp->cl_list, cn, idx);
-       } else {
-               /*
-                * Add the target dataset to the end of the list.
-                * The list is not really unsorted. The list will be
-                * in reverse dataset name order. This is necessary
-                * when the original mountpoint is legacy or none.
-                */
-               verify(uu_list_insert_after(clp->cl_list,
-                   uu_list_last(clp->cl_list), cn) == 0);
-       }
-
-       /*
-        * If the mountpoint property was previously 'legacy', or 'none',
-        * record it as the behavior of changelist_postfix() will be different.
-        */
-       if ((clp->cl_prop == ZFS_PROP_MOUNTPOINT) && legacy) {
-               /*
-                * do not automatically mount ex-legacy datasets if
-                * we specifically set canmount to noauto
-                */
-               if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) !=
-                   ZFS_CANMOUNT_NOAUTO)
-                       clp->cl_waslegacy = B_TRUE;
-       }
-
-       return (clp);
-}
diff --git a/zfs/lib/libzfs/libzfs_config.c b/zfs/lib/libzfs/libzfs_config.c
deleted file mode 100644 (file)
index 4175635..0000000
+++ /dev/null
@@ -1,453 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-/*
- * The pool configuration repository is stored in /etc/zfs/zpool.cache as a
- * single packed nvlist.  While it would be nice to just read in this
- * file from userland, this wouldn't work from a local zone.  So we have to have
- * a zpool ioctl to return the complete configuration for all pools.  In the
- * global zone, this will be identical to reading the file and unpacking it in
- * userland.
- */
-
-#include <errno.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <stddef.h>
-#include <string.h>
-#include <unistd.h>
-#include <libintl.h>
-#include <libuutil.h>
-
-#include "libzfs_impl.h"
-
-typedef struct config_node {
-       char            *cn_name;
-       nvlist_t        *cn_config;
-       uu_avl_node_t   cn_avl;
-} config_node_t;
-
-/* ARGSUSED */
-static int
-config_node_compare(const void *a, const void *b, void *unused)
-{
-       int ret;
-
-       const config_node_t *ca = (config_node_t *)a;
-       const config_node_t *cb = (config_node_t *)b;
-
-       ret = strcmp(ca->cn_name, cb->cn_name);
-
-       if (ret < 0)
-               return (-1);
-       else if (ret > 0)
-               return (1);
-       else
-               return (0);
-}
-
-void
-namespace_clear(libzfs_handle_t *hdl)
-{
-       if (hdl->libzfs_ns_avl) {
-               config_node_t *cn;
-               void *cookie = NULL;
-
-               while ((cn = uu_avl_teardown(hdl->libzfs_ns_avl,
-                   &cookie)) != NULL) {
-                       nvlist_free(cn->cn_config);
-                       free(cn->cn_name);
-                       free(cn);
-               }
-
-               uu_avl_destroy(hdl->libzfs_ns_avl);
-               hdl->libzfs_ns_avl = NULL;
-       }
-
-       if (hdl->libzfs_ns_avlpool) {
-               uu_avl_pool_destroy(hdl->libzfs_ns_avlpool);
-               hdl->libzfs_ns_avlpool = NULL;
-       }
-}
-
-/*
- * Loads the pool namespace, or re-loads it if the cache has changed.
- */
-static int
-namespace_reload(libzfs_handle_t *hdl)
-{
-       nvlist_t *config;
-       config_node_t *cn;
-       nvpair_t *elem;
-       zfs_cmd_t zc = {"\0"};
-       void *cookie;
-
-       if (hdl->libzfs_ns_gen == 0) {
-               /*
-                * This is the first time we've accessed the configuration
-                * cache.  Initialize the AVL tree and then fall through to the
-                * common code.
-                */
-               if ((hdl->libzfs_ns_avlpool = uu_avl_pool_create("config_pool",
-                   sizeof (config_node_t),
-                   offsetof(config_node_t, cn_avl),
-                   config_node_compare, UU_DEFAULT)) == NULL)
-                       return (no_memory(hdl));
-
-               if ((hdl->libzfs_ns_avl = uu_avl_create(hdl->libzfs_ns_avlpool,
-                   NULL, UU_DEFAULT)) == NULL)
-                       return (no_memory(hdl));
-       }
-
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0)
-               return (-1);
-
-       for (;;) {
-               zc.zc_cookie = hdl->libzfs_ns_gen;
-               if (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_CONFIGS, &zc) != 0) {
-                       switch (errno) {
-                       case EEXIST:
-                               /*
-                                * The namespace hasn't changed.
-                                */
-                               zcmd_free_nvlists(&zc);
-                               return (0);
-
-                       case ENOMEM:
-                               if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                                       zcmd_free_nvlists(&zc);
-                                       return (-1);
-                               }
-                               break;
-
-                       default:
-                               zcmd_free_nvlists(&zc);
-                               return (zfs_standard_error(hdl, errno,
-                                   dgettext(TEXT_DOMAIN, "failed to read "
-                                   "pool configuration")));
-                       }
-               } else {
-                       hdl->libzfs_ns_gen = zc.zc_cookie;
-                       break;
-               }
-       }
-
-       if (zcmd_read_dst_nvlist(hdl, &zc, &config) != 0) {
-               zcmd_free_nvlists(&zc);
-               return (-1);
-       }
-
-       zcmd_free_nvlists(&zc);
-
-       /*
-        * Clear out any existing configuration information.
-        */
-       cookie = NULL;
-       while ((cn = uu_avl_teardown(hdl->libzfs_ns_avl, &cookie)) != NULL) {
-               nvlist_free(cn->cn_config);
-               free(cn->cn_name);
-               free(cn);
-       }
-
-       elem = NULL;
-       while ((elem = nvlist_next_nvpair(config, elem)) != NULL) {
-               nvlist_t *child;
-               uu_avl_index_t where;
-
-               if ((cn = zfs_alloc(hdl, sizeof (config_node_t))) == NULL) {
-                       nvlist_free(config);
-                       return (-1);
-               }
-
-               if ((cn->cn_name = zfs_strdup(hdl,
-                   nvpair_name(elem))) == NULL) {
-                       free(cn);
-                       nvlist_free(config);
-                       return (-1);
-               }
-
-               verify(nvpair_value_nvlist(elem, &child) == 0);
-               if (nvlist_dup(child, &cn->cn_config, 0) != 0) {
-                       free(cn->cn_name);
-                       free(cn);
-                       nvlist_free(config);
-                       return (no_memory(hdl));
-               }
-               verify(uu_avl_find(hdl->libzfs_ns_avl, cn, NULL, &where)
-                   == NULL);
-
-               uu_avl_insert(hdl->libzfs_ns_avl, cn, where);
-       }
-
-       nvlist_free(config);
-       return (0);
-}
-
-/*
- * Retrieve the configuration for the given pool.  The configuration is a nvlist
- * describing the vdevs, as well as the statistics associated with each one.
- */
-nvlist_t *
-zpool_get_config(zpool_handle_t *zhp, nvlist_t **oldconfig)
-{
-       if (oldconfig)
-               *oldconfig = zhp->zpool_old_config;
-       return (zhp->zpool_config);
-}
-
-/*
- * Retrieves a list of enabled features and their refcounts and caches it in
- * the pool handle.
- */
-nvlist_t *
-zpool_get_features(zpool_handle_t *zhp)
-{
-       nvlist_t *config, *features;
-
-       config = zpool_get_config(zhp, NULL);
-
-       if (config == NULL || !nvlist_exists(config,
-           ZPOOL_CONFIG_FEATURE_STATS)) {
-               int error;
-               boolean_t missing = B_FALSE;
-
-               error = zpool_refresh_stats(zhp, &missing);
-
-               if (error != 0 || missing)
-                       return (NULL);
-
-               config = zpool_get_config(zhp, NULL);
-       }
-
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_FEATURE_STATS,
-           &features) == 0);
-
-       return (features);
-}
-
-/*
- * Refresh the vdev statistics associated with the given pool.  This is used in
- * iostat to show configuration changes and determine the delta from the last
- * time the function was called.  This function can fail, in case the pool has
- * been destroyed.
- */
-int
-zpool_refresh_stats(zpool_handle_t *zhp, boolean_t *missing)
-{
-       zfs_cmd_t zc = {"\0"};
-       int error;
-       nvlist_t *config;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       *missing = B_FALSE;
-       (void) strcpy(zc.zc_name, zhp->zpool_name);
-
-       if (zhp->zpool_config_size == 0)
-               zhp->zpool_config_size = 1 << 16;
-
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size) != 0)
-               return (-1);
-
-       for (;;) {
-               if (ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_POOL_STATS,
-                   &zc) == 0) {
-                       /*
-                        * The real error is returned in the zc_cookie field.
-                        */
-                       error = zc.zc_cookie;
-                       break;
-               }
-
-               if (errno == ENOMEM) {
-                       if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                               zcmd_free_nvlists(&zc);
-                               return (-1);
-                       }
-               } else {
-                       zcmd_free_nvlists(&zc);
-                       if (errno == ENOENT || errno == EINVAL)
-                               *missing = B_TRUE;
-                       zhp->zpool_state = POOL_STATE_UNAVAIL;
-                       return (0);
-               }
-       }
-
-       if (zcmd_read_dst_nvlist(hdl, &zc, &config) != 0) {
-               zcmd_free_nvlists(&zc);
-               return (-1);
-       }
-
-       zcmd_free_nvlists(&zc);
-
-       zhp->zpool_config_size = zc.zc_nvlist_dst_size;
-
-       if (zhp->zpool_config != NULL) {
-               uint64_t oldtxg, newtxg;
-
-               verify(nvlist_lookup_uint64(zhp->zpool_config,
-                   ZPOOL_CONFIG_POOL_TXG, &oldtxg) == 0);
-               verify(nvlist_lookup_uint64(config,
-                   ZPOOL_CONFIG_POOL_TXG, &newtxg) == 0);
-
-               if (zhp->zpool_old_config != NULL)
-                       nvlist_free(zhp->zpool_old_config);
-
-               if (oldtxg != newtxg) {
-                       nvlist_free(zhp->zpool_config);
-                       zhp->zpool_old_config = NULL;
-               } else {
-                       zhp->zpool_old_config = zhp->zpool_config;
-               }
-       }
-
-       zhp->zpool_config = config;
-       if (error)
-               zhp->zpool_state = POOL_STATE_UNAVAIL;
-       else
-               zhp->zpool_state = POOL_STATE_ACTIVE;
-
-       return (0);
-}
-
-/*
- * If the __ZFS_POOL_RESTRICT environment variable is set we only iterate over
- * pools it lists.
- *
- * This is an undocumented feature for use during testing only.
- *
- * This function returns B_TRUE if the pool should be skipped
- * during iteration.
- */
-static boolean_t
-check_restricted(const char *poolname)
-{
-       static boolean_t initialized = B_FALSE;
-       static char *restricted = NULL;
-
-       const char *cur, *end;
-       int len, namelen;
-
-       if (!initialized) {
-               initialized = B_TRUE;
-               restricted = getenv("__ZFS_POOL_RESTRICT");
-       }
-
-       if (NULL == restricted)
-               return (B_FALSE);
-
-       cur = restricted;
-       namelen = strlen(poolname);
-       do {
-               end = strchr(cur, ' ');
-               len = (NULL == end) ? strlen(cur) : (end - cur);
-
-               if (len == namelen && 0 == strncmp(cur, poolname, len)) {
-                       return (B_FALSE);
-               }
-
-               cur += (len + 1);
-       } while (NULL != end);
-
-       return (B_TRUE);
-}
-
-/*
- * Iterate over all pools in the system.
- */
-int
-zpool_iter(libzfs_handle_t *hdl, zpool_iter_f func, void *data)
-{
-       config_node_t *cn;
-       zpool_handle_t *zhp;
-       int ret;
-
-       /*
-        * If someone makes a recursive call to zpool_iter(), we want to avoid
-        * refreshing the namespace because that will invalidate the parent
-        * context.  We allow recursive calls, but simply re-use the same
-        * namespace AVL tree.
-        */
-       if (!hdl->libzfs_pool_iter && namespace_reload(hdl) != 0)
-               return (-1);
-
-       hdl->libzfs_pool_iter++;
-       for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL;
-           cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) {
-
-               if (check_restricted(cn->cn_name))
-                       continue;
-
-               if (zpool_open_silent(hdl, cn->cn_name, &zhp) != 0) {
-                       hdl->libzfs_pool_iter--;
-                       return (-1);
-               }
-
-               if (zhp == NULL)
-                       continue;
-
-               if ((ret = func(zhp, data)) != 0) {
-                       hdl->libzfs_pool_iter--;
-                       return (ret);
-               }
-       }
-       hdl->libzfs_pool_iter--;
-
-       return (0);
-}
-
-/*
- * Iterate over root datasets, calling the given function for each.  The zfs
- * handle passed each time must be explicitly closed by the callback.
- */
-int
-zfs_iter_root(libzfs_handle_t *hdl, zfs_iter_f func, void *data)
-{
-       config_node_t *cn;
-       zfs_handle_t *zhp;
-       int ret;
-
-       if (namespace_reload(hdl) != 0)
-               return (-1);
-
-       for (cn = uu_avl_first(hdl->libzfs_ns_avl); cn != NULL;
-           cn = uu_avl_next(hdl->libzfs_ns_avl, cn)) {
-
-               if (check_restricted(cn->cn_name))
-                       continue;
-
-               if ((zhp = make_dataset_handle(hdl, cn->cn_name)) == NULL)
-                       continue;
-
-               if ((ret = func(zhp, data)) != 0)
-                       return (ret);
-       }
-
-       return (0);
-}
index 2b6a86bfa4e8fe13298aeeb0c5f50d1ec966ee48..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,11 +1,2 @@
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
-includedir=@includedir@
-
-Name: libzfs_core
-Description: LibZFS core library
-Version: @VERSION@
-URL: http://zfsonlinux.org
-Cflags: -I${includedir}/libzfs -I${includedir}/libspl
-Libs: -L${libdir} -lzfs_core
+%:
+       #
diff --git a/zfs/lib/libzfs/libzfs_dataset.c b/zfs/lib/libzfs/libzfs_dataset.c
deleted file mode 100644 (file)
index 088ee35..0000000
+++ /dev/null
@@ -1,4680 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
- * Copyright (c) 2012 DEY Storage Systems, Inc.  All rights reserved.
- * Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
- * Copyright (c) 2013 Martin Matuska. All rights reserved.
- * Copyright (c) 2013 Steven Hartland. All rights reserved.
- * Copyright 2013 Nexenta Systems, Inc. All rights reserved.
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <libintl.h>
-#include <math.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <stddef.h>
-#include <zone.h>
-#include <fcntl.h>
-#include <sys/mntent.h>
-#include <sys/mount.h>
-#include <priv.h>
-#include <pwd.h>
-#include <grp.h>
-#include <stddef.h>
-#include <ucred.h>
-#ifdef HAVE_IDMAP
-#include <idmap.h>
-#include <aclutils.h>
-#include <directory.h>
-#endif /* HAVE_IDMAP */
-
-#include <sys/dnode.h>
-#include <sys/spa.h>
-#include <sys/zap.h>
-#include <libzfs.h>
-
-#include "zfs_namecheck.h"
-#include "zfs_prop.h"
-#include "libzfs_impl.h"
-#include "zfs_deleg.h"
-
-static int userquota_propname_decode(const char *propname, boolean_t zoned,
-    zfs_userquota_prop_t *typep, char *domain, int domainlen, uint64_t *ridp);
-
-/*
- * Given a single type (not a mask of types), return the type in a human
- * readable form.
- */
-const char *
-zfs_type_to_name(zfs_type_t type)
-{
-       switch (type) {
-       case ZFS_TYPE_FILESYSTEM:
-               return (dgettext(TEXT_DOMAIN, "filesystem"));
-       case ZFS_TYPE_SNAPSHOT:
-               return (dgettext(TEXT_DOMAIN, "snapshot"));
-       case ZFS_TYPE_VOLUME:
-               return (dgettext(TEXT_DOMAIN, "volume"));
-       default:
-               break;
-       }
-
-       return (NULL);
-}
-
-/*
- * Validate a ZFS path.  This is used even before trying to open the dataset, to
- * provide a more meaningful error message.  We call zfs_error_aux() to
- * explain exactly why the name was not valid.
- */
-int
-zfs_validate_name(libzfs_handle_t *hdl, const char *path, int type,
-    boolean_t modifying)
-{
-       namecheck_err_t why;
-       char what;
-
-       (void) zfs_prop_get_table();
-       if (dataset_namecheck(path, &why, &what) != 0) {
-               if (hdl != NULL) {
-                       switch (why) {
-                       case NAME_ERR_TOOLONG:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "name is too long"));
-                               break;
-
-                       case NAME_ERR_LEADING_SLASH:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "leading slash in name"));
-                               break;
-
-                       case NAME_ERR_EMPTY_COMPONENT:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "empty component in name"));
-                               break;
-
-                       case NAME_ERR_TRAILING_SLASH:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "trailing slash in name"));
-                               break;
-
-                       case NAME_ERR_INVALCHAR:
-                               zfs_error_aux(hdl,
-                                   dgettext(TEXT_DOMAIN, "invalid character "
-                                   "'%c' in name"), what);
-                               break;
-
-                       case NAME_ERR_MULTIPLE_AT:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "multiple '@' delimiters in name"));
-                               break;
-
-                       case NAME_ERR_NOLETTER:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "pool doesn't begin with a letter"));
-                               break;
-
-                       case NAME_ERR_RESERVED:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "name is reserved"));
-                               break;
-
-                       case NAME_ERR_DISKLIKE:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "reserved disk name"));
-                               break;
-                       default:
-                               break;
-                       }
-               }
-
-               return (0);
-       }
-
-       if (!(type & ZFS_TYPE_SNAPSHOT) && strchr(path, '@') != NULL) {
-               if (hdl != NULL)
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "snapshot delimiter '@' in filesystem name"));
-               return (0);
-       }
-
-       if (type == ZFS_TYPE_SNAPSHOT && strchr(path, '@') == NULL) {
-               if (hdl != NULL)
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "missing '@' delimiter in snapshot name"));
-               return (0);
-       }
-
-       if (modifying && strchr(path, '%') != NULL) {
-               if (hdl != NULL)
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid character %c in name"), '%');
-               return (0);
-       }
-
-       return (-1);
-}
-
-int
-zfs_name_valid(const char *name, zfs_type_t type)
-{
-       if (type == ZFS_TYPE_POOL)
-               return (zpool_name_valid(NULL, B_FALSE, name));
-       return (zfs_validate_name(NULL, name, type, B_FALSE));
-}
-
-/*
- * This function takes the raw DSL properties, and filters out the user-defined
- * properties into a separate nvlist.
- */
-static nvlist_t *
-process_user_props(zfs_handle_t *zhp, nvlist_t *props)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       nvpair_t *elem;
-       nvlist_t *propval;
-       nvlist_t *nvl;
-
-       if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0) {
-               (void) no_memory(hdl);
-               return (NULL);
-       }
-
-       elem = NULL;
-       while ((elem = nvlist_next_nvpair(props, elem)) != NULL) {
-               if (!zfs_prop_user(nvpair_name(elem)))
-                       continue;
-
-               verify(nvpair_value_nvlist(elem, &propval) == 0);
-               if (nvlist_add_nvlist(nvl, nvpair_name(elem), propval) != 0) {
-                       nvlist_free(nvl);
-                       (void) no_memory(hdl);
-                       return (NULL);
-               }
-       }
-
-       return (nvl);
-}
-
-static zpool_handle_t *
-zpool_add_handle(zfs_handle_t *zhp, const char *pool_name)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       zpool_handle_t *zph;
-
-       if ((zph = zpool_open_canfail(hdl, pool_name)) != NULL) {
-               if (hdl->libzfs_pool_handles != NULL)
-                       zph->zpool_next = hdl->libzfs_pool_handles;
-               hdl->libzfs_pool_handles = zph;
-       }
-       return (zph);
-}
-
-static zpool_handle_t *
-zpool_find_handle(zfs_handle_t *zhp, const char *pool_name, int len)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       zpool_handle_t *zph = hdl->libzfs_pool_handles;
-
-       while ((zph != NULL) &&
-           (strncmp(pool_name, zpool_get_name(zph), len) != 0))
-               zph = zph->zpool_next;
-       return (zph);
-}
-
-/*
- * Returns a handle to the pool that contains the provided dataset.
- * If a handle to that pool already exists then that handle is returned.
- * Otherwise, a new handle is created and added to the list of handles.
- */
-static zpool_handle_t *
-zpool_handle(zfs_handle_t *zhp)
-{
-       char *pool_name;
-       int len;
-       zpool_handle_t *zph;
-
-       len = strcspn(zhp->zfs_name, "/@#") + 1;
-       pool_name = zfs_alloc(zhp->zfs_hdl, len);
-       (void) strlcpy(pool_name, zhp->zfs_name, len);
-
-       zph = zpool_find_handle(zhp, pool_name, len);
-       if (zph == NULL)
-               zph = zpool_add_handle(zhp, pool_name);
-
-       free(pool_name);
-       return (zph);
-}
-
-void
-zpool_free_handles(libzfs_handle_t *hdl)
-{
-       zpool_handle_t *next, *zph = hdl->libzfs_pool_handles;
-
-       while (zph != NULL) {
-               next = zph->zpool_next;
-               zpool_close(zph);
-               zph = next;
-       }
-       hdl->libzfs_pool_handles = NULL;
-}
-
-/*
- * Utility function to gather stats (objset and zpl) for the given object.
- */
-static int
-get_stats_ioctl(zfs_handle_t *zhp, zfs_cmd_t *zc)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-
-       (void) strlcpy(zc->zc_name, zhp->zfs_name, sizeof (zc->zc_name));
-
-       while (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, zc) != 0) {
-               if (errno == ENOMEM) {
-                       if (zcmd_expand_dst_nvlist(hdl, zc) != 0) {
-                               return (-1);
-                       }
-               } else {
-                       return (-1);
-               }
-       }
-       return (0);
-}
-
-/*
- * Utility function to get the received properties of the given object.
- */
-static int
-get_recvd_props_ioctl(zfs_handle_t *zhp)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       nvlist_t *recvdprops;
-       zfs_cmd_t zc = {"\0"};
-       int err;
-
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0)
-               return (-1);
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       while (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_RECVD_PROPS, &zc) != 0) {
-               if (errno == ENOMEM) {
-                       if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                               return (-1);
-                       }
-               } else {
-                       zcmd_free_nvlists(&zc);
-                       return (-1);
-               }
-       }
-
-       err = zcmd_read_dst_nvlist(zhp->zfs_hdl, &zc, &recvdprops);
-       zcmd_free_nvlists(&zc);
-       if (err != 0)
-               return (-1);
-
-       nvlist_free(zhp->zfs_recvd_props);
-       zhp->zfs_recvd_props = recvdprops;
-
-       return (0);
-}
-
-static int
-put_stats_zhdl(zfs_handle_t *zhp, zfs_cmd_t *zc)
-{
-       nvlist_t *allprops, *userprops;
-
-       zhp->zfs_dmustats = zc->zc_objset_stats; /* structure assignment */
-
-       if (zcmd_read_dst_nvlist(zhp->zfs_hdl, zc, &allprops) != 0) {
-               return (-1);
-       }
-
-       /*
-        * XXX Why do we store the user props separately, in addition to
-        * storing them in zfs_props?
-        */
-       if ((userprops = process_user_props(zhp, allprops)) == NULL) {
-               nvlist_free(allprops);
-               return (-1);
-       }
-
-       nvlist_free(zhp->zfs_props);
-       nvlist_free(zhp->zfs_user_props);
-
-       zhp->zfs_props = allprops;
-       zhp->zfs_user_props = userprops;
-
-       return (0);
-}
-
-static int
-get_stats(zfs_handle_t *zhp)
-{
-       int rc = 0;
-       zfs_cmd_t zc = {"\0"};
-
-       if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
-               return (-1);
-       if (get_stats_ioctl(zhp, &zc) != 0)
-               rc = -1;
-       else if (put_stats_zhdl(zhp, &zc) != 0)
-               rc = -1;
-       zcmd_free_nvlists(&zc);
-       return (rc);
-}
-
-/*
- * Refresh the properties currently stored in the handle.
- */
-void
-zfs_refresh_properties(zfs_handle_t *zhp)
-{
-       (void) get_stats(zhp);
-}
-
-/*
- * Makes a handle from the given dataset name.  Used by zfs_open() and
- * zfs_iter_* to create child handles on the fly.
- */
-static int
-make_dataset_handle_common(zfs_handle_t *zhp, zfs_cmd_t *zc)
-{
-       if (put_stats_zhdl(zhp, zc) != 0)
-               return (-1);
-
-       /*
-        * We've managed to open the dataset and gather statistics.  Determine
-        * the high-level type.
-        */
-       if (zhp->zfs_dmustats.dds_type == DMU_OST_ZVOL)
-               zhp->zfs_head_type = ZFS_TYPE_VOLUME;
-       else if (zhp->zfs_dmustats.dds_type == DMU_OST_ZFS)
-               zhp->zfs_head_type = ZFS_TYPE_FILESYSTEM;
-       else if (zhp->zfs_dmustats.dds_type == DMU_OST_OTHER)
-               return (-1);
-       else
-               abort();
-
-       if (zhp->zfs_dmustats.dds_is_snapshot)
-               zhp->zfs_type = ZFS_TYPE_SNAPSHOT;
-       else if (zhp->zfs_dmustats.dds_type == DMU_OST_ZVOL)
-               zhp->zfs_type = ZFS_TYPE_VOLUME;
-       else if (zhp->zfs_dmustats.dds_type == DMU_OST_ZFS)
-               zhp->zfs_type = ZFS_TYPE_FILESYSTEM;
-       else
-               abort();        /* we should never see any other types */
-
-       if ((zhp->zpool_hdl = zpool_handle(zhp)) == NULL)
-               return (-1);
-
-       return (0);
-}
-
-zfs_handle_t *
-make_dataset_handle(libzfs_handle_t *hdl, const char *path)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
-
-       if (zhp == NULL)
-               return (NULL);
-
-       zhp->zfs_hdl = hdl;
-       (void) strlcpy(zhp->zfs_name, path, sizeof (zhp->zfs_name));
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0) {
-               free(zhp);
-               return (NULL);
-       }
-       if (get_stats_ioctl(zhp, &zc) == -1) {
-               zcmd_free_nvlists(&zc);
-               free(zhp);
-               return (NULL);
-       }
-       if (make_dataset_handle_common(zhp, &zc) == -1) {
-               free(zhp);
-               zhp = NULL;
-       }
-       zcmd_free_nvlists(&zc);
-       return (zhp);
-}
-
-zfs_handle_t *
-make_dataset_handle_zc(libzfs_handle_t *hdl, zfs_cmd_t *zc)
-{
-       zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
-
-       if (zhp == NULL)
-               return (NULL);
-
-       zhp->zfs_hdl = hdl;
-       (void) strlcpy(zhp->zfs_name, zc->zc_name, sizeof (zhp->zfs_name));
-       if (make_dataset_handle_common(zhp, zc) == -1) {
-               free(zhp);
-               return (NULL);
-       }
-       return (zhp);
-}
-
-zfs_handle_t *
-make_dataset_simple_handle_zc(zfs_handle_t *pzhp, zfs_cmd_t *zc)
-{
-       zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
-
-       if (zhp == NULL)
-               return (NULL);
-
-       zhp->zfs_hdl = pzhp->zfs_hdl;
-       (void) strlcpy(zhp->zfs_name, zc->zc_name, sizeof (zhp->zfs_name));
-       zhp->zfs_head_type = pzhp->zfs_type;
-       zhp->zfs_type = ZFS_TYPE_SNAPSHOT;
-       zhp->zpool_hdl = zpool_handle(zhp);
-
-       return (zhp);
-}
-
-zfs_handle_t *
-zfs_handle_dup(zfs_handle_t *zhp_orig)
-{
-       zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
-
-       if (zhp == NULL)
-               return (NULL);
-
-       zhp->zfs_hdl = zhp_orig->zfs_hdl;
-       zhp->zpool_hdl = zhp_orig->zpool_hdl;
-       (void) strlcpy(zhp->zfs_name, zhp_orig->zfs_name,
-           sizeof (zhp->zfs_name));
-       zhp->zfs_type = zhp_orig->zfs_type;
-       zhp->zfs_head_type = zhp_orig->zfs_head_type;
-       zhp->zfs_dmustats = zhp_orig->zfs_dmustats;
-       if (zhp_orig->zfs_props != NULL) {
-               if (nvlist_dup(zhp_orig->zfs_props, &zhp->zfs_props, 0) != 0) {
-                       (void) no_memory(zhp->zfs_hdl);
-                       zfs_close(zhp);
-                       return (NULL);
-               }
-       }
-       if (zhp_orig->zfs_user_props != NULL) {
-               if (nvlist_dup(zhp_orig->zfs_user_props,
-                   &zhp->zfs_user_props, 0) != 0) {
-                       (void) no_memory(zhp->zfs_hdl);
-                       zfs_close(zhp);
-                       return (NULL);
-               }
-       }
-       if (zhp_orig->zfs_recvd_props != NULL) {
-               if (nvlist_dup(zhp_orig->zfs_recvd_props,
-                   &zhp->zfs_recvd_props, 0)) {
-                       (void) no_memory(zhp->zfs_hdl);
-                       zfs_close(zhp);
-                       return (NULL);
-               }
-       }
-       zhp->zfs_mntcheck = zhp_orig->zfs_mntcheck;
-       if (zhp_orig->zfs_mntopts != NULL) {
-               zhp->zfs_mntopts = zfs_strdup(zhp_orig->zfs_hdl,
-                   zhp_orig->zfs_mntopts);
-       }
-       zhp->zfs_props_table = zhp_orig->zfs_props_table;
-       return (zhp);
-}
-
-boolean_t
-zfs_bookmark_exists(const char *path)
-{
-       nvlist_t *bmarks;
-       nvlist_t *props;
-       char fsname[ZFS_MAXNAMELEN];
-       char *bmark_name;
-       char *pound;
-       int err;
-       boolean_t rv;
-
-
-       (void) strlcpy(fsname, path, sizeof (fsname));
-       pound = strchr(fsname, '#');
-       if (pound == NULL)
-               return (B_FALSE);
-
-       *pound = '\0';
-       bmark_name = pound + 1;
-       props = fnvlist_alloc();
-       err = lzc_get_bookmarks(fsname, props, &bmarks);
-       nvlist_free(props);
-       if (err != 0) {
-               nvlist_free(bmarks);
-               return (B_FALSE);
-       }
-
-       rv = nvlist_exists(bmarks, bmark_name);
-       nvlist_free(bmarks);
-       return (rv);
-}
-
-zfs_handle_t *
-make_bookmark_handle(zfs_handle_t *parent, const char *path,
-    nvlist_t *bmark_props)
-{
-       zfs_handle_t *zhp = calloc(sizeof (zfs_handle_t), 1);
-
-       if (zhp == NULL)
-               return (NULL);
-
-       /* Fill in the name. */
-       zhp->zfs_hdl = parent->zfs_hdl;
-       (void) strlcpy(zhp->zfs_name, path, sizeof (zhp->zfs_name));
-
-       /* Set the property lists. */
-       if (nvlist_dup(bmark_props, &zhp->zfs_props, 0) != 0) {
-               free(zhp);
-               return (NULL);
-       }
-
-       /* Set the types. */
-       zhp->zfs_head_type = parent->zfs_head_type;
-       zhp->zfs_type = ZFS_TYPE_BOOKMARK;
-
-       if ((zhp->zpool_hdl = zpool_handle(zhp)) == NULL) {
-               nvlist_free(zhp->zfs_props);
-               free(zhp);
-               return (NULL);
-       }
-
-       return (zhp);
-}
-
-/*
- * Opens the given snapshot, filesystem, or volume.   The 'types'
- * argument is a mask of acceptable types.  The function will print an
- * appropriate error message and return NULL if it can't be opened.
- */
-zfs_handle_t *
-zfs_open(libzfs_handle_t *hdl, const char *path, int types)
-{
-       zfs_handle_t *zhp;
-       char errbuf[1024];
-
-       (void) snprintf(errbuf, sizeof (errbuf),
-           dgettext(TEXT_DOMAIN, "cannot open '%s'"), path);
-
-       /*
-        * Validate the name before we even try to open it.
-        */
-       if (!zfs_validate_name(hdl, path, ZFS_TYPE_DATASET, B_FALSE)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "invalid dataset name"));
-               (void) zfs_error(hdl, EZFS_INVALIDNAME, errbuf);
-               return (NULL);
-       }
-
-       /*
-        * Try to get stats for the dataset, which will tell us if it exists.
-        */
-       errno = 0;
-       if ((zhp = make_dataset_handle(hdl, path)) == NULL) {
-               (void) zfs_standard_error(hdl, errno, errbuf);
-               return (NULL);
-       }
-
-       if (!(types & zhp->zfs_type)) {
-               (void) zfs_error(hdl, EZFS_BADTYPE, errbuf);
-               zfs_close(zhp);
-               return (NULL);
-       }
-
-       return (zhp);
-}
-
-/*
- * Release a ZFS handle.  Nothing to do but free the associated memory.
- */
-void
-zfs_close(zfs_handle_t *zhp)
-{
-       if (zhp->zfs_mntopts)
-               free(zhp->zfs_mntopts);
-       nvlist_free(zhp->zfs_props);
-       nvlist_free(zhp->zfs_user_props);
-       nvlist_free(zhp->zfs_recvd_props);
-       free(zhp);
-}
-
-typedef struct mnttab_node {
-       struct mnttab mtn_mt;
-       avl_node_t mtn_node;
-} mnttab_node_t;
-
-static int
-libzfs_mnttab_cache_compare(const void *arg1, const void *arg2)
-{
-       const mnttab_node_t *mtn1 = arg1;
-       const mnttab_node_t *mtn2 = arg2;
-       int rv;
-
-       rv = strcmp(mtn1->mtn_mt.mnt_special, mtn2->mtn_mt.mnt_special);
-
-       if (rv == 0)
-               return (0);
-       return (rv > 0 ? 1 : -1);
-}
-
-void
-libzfs_mnttab_init(libzfs_handle_t *hdl)
-{
-       assert(avl_numnodes(&hdl->libzfs_mnttab_cache) == 0);
-       avl_create(&hdl->libzfs_mnttab_cache, libzfs_mnttab_cache_compare,
-           sizeof (mnttab_node_t), offsetof(mnttab_node_t, mtn_node));
-}
-
-int
-libzfs_mnttab_update(libzfs_handle_t *hdl)
-{
-       struct mnttab entry;
-
-       /* Reopen MNTTAB to prevent reading stale data from open file */
-       if (freopen(MNTTAB, "r", hdl->libzfs_mnttab) == NULL)
-               return (ENOENT);
-
-       while (getmntent(hdl->libzfs_mnttab, &entry) == 0) {
-               mnttab_node_t *mtn;
-               avl_index_t where;
-
-               if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0)
-                       continue;
-
-               mtn = zfs_alloc(hdl, sizeof (mnttab_node_t));
-               mtn->mtn_mt.mnt_special = zfs_strdup(hdl, entry.mnt_special);
-               mtn->mtn_mt.mnt_mountp = zfs_strdup(hdl, entry.mnt_mountp);
-               mtn->mtn_mt.mnt_fstype = zfs_strdup(hdl, entry.mnt_fstype);
-               mtn->mtn_mt.mnt_mntopts = zfs_strdup(hdl, entry.mnt_mntopts);
-
-               /* Exclude duplicate mounts */
-               if (avl_find(&hdl->libzfs_mnttab_cache, mtn, &where) != NULL) {
-                       free(mtn->mtn_mt.mnt_special);
-                       free(mtn->mtn_mt.mnt_mountp);
-                       free(mtn->mtn_mt.mnt_fstype);
-                       free(mtn->mtn_mt.mnt_mntopts);
-                       free(mtn);
-                       continue;
-               }
-
-               avl_add(&hdl->libzfs_mnttab_cache, mtn);
-       }
-
-       return (0);
-}
-
-void
-libzfs_mnttab_fini(libzfs_handle_t *hdl)
-{
-       void *cookie = NULL;
-       mnttab_node_t *mtn;
-
-       while ((mtn = avl_destroy_nodes(&hdl->libzfs_mnttab_cache, &cookie))) {
-               free(mtn->mtn_mt.mnt_special);
-               free(mtn->mtn_mt.mnt_mountp);
-               free(mtn->mtn_mt.mnt_fstype);
-               free(mtn->mtn_mt.mnt_mntopts);
-               free(mtn);
-       }
-       avl_destroy(&hdl->libzfs_mnttab_cache);
-}
-
-void
-libzfs_mnttab_cache(libzfs_handle_t *hdl, boolean_t enable)
-{
-       hdl->libzfs_mnttab_enable = enable;
-}
-
-int
-libzfs_mnttab_find(libzfs_handle_t *hdl, const char *fsname,
-    struct mnttab *entry)
-{
-       mnttab_node_t find;
-       mnttab_node_t *mtn;
-       int error;
-
-       if (!hdl->libzfs_mnttab_enable) {
-               struct mnttab srch = { 0 };
-
-               if (avl_numnodes(&hdl->libzfs_mnttab_cache))
-                       libzfs_mnttab_fini(hdl);
-
-               /* Reopen MNTTAB to prevent reading stale data from open file */
-               if (freopen(MNTTAB, "r", hdl->libzfs_mnttab) == NULL)
-                       return (ENOENT);
-
-               srch.mnt_special = (char *)fsname;
-               srch.mnt_fstype = MNTTYPE_ZFS;
-               if (getmntany(hdl->libzfs_mnttab, entry, &srch) == 0)
-                       return (0);
-               else
-                       return (ENOENT);
-       }
-
-       if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0)
-               if ((error = libzfs_mnttab_update(hdl)) != 0)
-                       return (error);
-
-       find.mtn_mt.mnt_special = (char *)fsname;
-       mtn = avl_find(&hdl->libzfs_mnttab_cache, &find, NULL);
-       if (mtn) {
-               *entry = mtn->mtn_mt;
-               return (0);
-       }
-       return (ENOENT);
-}
-
-void
-libzfs_mnttab_add(libzfs_handle_t *hdl, const char *special,
-    const char *mountp, const char *mntopts)
-{
-       mnttab_node_t *mtn;
-
-       if (avl_numnodes(&hdl->libzfs_mnttab_cache) == 0)
-               return;
-       mtn = zfs_alloc(hdl, sizeof (mnttab_node_t));
-       mtn->mtn_mt.mnt_special = zfs_strdup(hdl, special);
-       mtn->mtn_mt.mnt_mountp = zfs_strdup(hdl, mountp);
-       mtn->mtn_mt.mnt_fstype = zfs_strdup(hdl, MNTTYPE_ZFS);
-       mtn->mtn_mt.mnt_mntopts = zfs_strdup(hdl, mntopts);
-       avl_add(&hdl->libzfs_mnttab_cache, mtn);
-}
-
-void
-libzfs_mnttab_remove(libzfs_handle_t *hdl, const char *fsname)
-{
-       mnttab_node_t find;
-       mnttab_node_t *ret;
-
-       find.mtn_mt.mnt_special = (char *)fsname;
-       if ((ret = avl_find(&hdl->libzfs_mnttab_cache, (void *)&find, NULL))) {
-               avl_remove(&hdl->libzfs_mnttab_cache, ret);
-               free(ret->mtn_mt.mnt_special);
-               free(ret->mtn_mt.mnt_mountp);
-               free(ret->mtn_mt.mnt_fstype);
-               free(ret->mtn_mt.mnt_mntopts);
-               free(ret);
-       }
-}
-
-int
-zfs_spa_version(zfs_handle_t *zhp, int *spa_version)
-{
-       zpool_handle_t *zpool_handle = zhp->zpool_hdl;
-
-       if (zpool_handle == NULL)
-               return (-1);
-
-       *spa_version = zpool_get_prop_int(zpool_handle,
-           ZPOOL_PROP_VERSION, NULL);
-       return (0);
-}
-
-/*
- * The choice of reservation property depends on the SPA version.
- */
-static int
-zfs_which_resv_prop(zfs_handle_t *zhp, zfs_prop_t *resv_prop)
-{
-       int spa_version;
-
-       if (zfs_spa_version(zhp, &spa_version) < 0)
-               return (-1);
-
-       if (spa_version >= SPA_VERSION_REFRESERVATION)
-               *resv_prop = ZFS_PROP_REFRESERVATION;
-       else
-               *resv_prop = ZFS_PROP_RESERVATION;
-
-       return (0);
-}
-
-/*
- * Given an nvlist of properties to set, validates that they are correct, and
- * parses any numeric properties (index, boolean, etc) if they are specified as
- * strings.
- */
-nvlist_t *
-zfs_valid_proplist(libzfs_handle_t *hdl, zfs_type_t type, nvlist_t *nvl,
-    uint64_t zoned, zfs_handle_t *zhp, const char *errbuf)
-{
-       nvpair_t *elem;
-       uint64_t intval;
-       char *strval;
-       zfs_prop_t prop;
-       nvlist_t *ret;
-       int chosen_normal = -1;
-       int chosen_utf = -1;
-
-       if (nvlist_alloc(&ret, NV_UNIQUE_NAME, 0) != 0) {
-               (void) no_memory(hdl);
-               return (NULL);
-       }
-
-       /*
-        * Make sure this property is valid and applies to this type.
-        */
-
-       elem = NULL;
-       while ((elem = nvlist_next_nvpair(nvl, elem)) != NULL) {
-               const char *propname = nvpair_name(elem);
-
-               prop = zfs_name_to_prop(propname);
-               if (prop == ZPROP_INVAL && zfs_prop_user(propname)) {
-                       /*
-                        * This is a user property: make sure it's a
-                        * string, and that it's less than ZAP_MAXNAMELEN.
-                        */
-                       if (nvpair_type(elem) != DATA_TYPE_STRING) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "'%s' must be a string"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       if (strlen(nvpair_name(elem)) >= ZAP_MAXNAMELEN) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property name '%s' is too long"),
-                                   propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       (void) nvpair_value_string(elem, &strval);
-                       if (nvlist_add_string(ret, propname, strval) != 0) {
-                               (void) no_memory(hdl);
-                               goto error;
-                       }
-                       continue;
-               }
-
-               /*
-                * Currently, only user properties can be modified on
-                * snapshots.
-                */
-               if (type == ZFS_TYPE_SNAPSHOT) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "this property can not be modified for snapshots"));
-                       (void) zfs_error(hdl, EZFS_PROPTYPE, errbuf);
-                       goto error;
-               }
-
-               if (prop == ZPROP_INVAL && zfs_prop_userquota(propname)) {
-                       zfs_userquota_prop_t uqtype;
-                       char newpropname[128];
-                       char domain[128];
-                       uint64_t rid;
-                       uint64_t valary[3];
-
-                       if (userquota_propname_decode(propname, zoned,
-                           &uqtype, domain, sizeof (domain), &rid) != 0) {
-                               zfs_error_aux(hdl,
-                                   dgettext(TEXT_DOMAIN,
-                                   "'%s' has an invalid user/group name"),
-                                   propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       if (uqtype != ZFS_PROP_USERQUOTA &&
-                           uqtype != ZFS_PROP_GROUPQUOTA) {
-                               zfs_error_aux(hdl,
-                                   dgettext(TEXT_DOMAIN, "'%s' is readonly"),
-                                   propname);
-                               (void) zfs_error(hdl, EZFS_PROPREADONLY,
-                                   errbuf);
-                               goto error;
-                       }
-
-                       if (nvpair_type(elem) == DATA_TYPE_STRING) {
-                               (void) nvpair_value_string(elem, &strval);
-                               if (strcmp(strval, "none") == 0) {
-                                       intval = 0;
-                               } else if (zfs_nicestrtonum(hdl,
-                                   strval, &intval) != 0) {
-                                       (void) zfs_error(hdl,
-                                           EZFS_BADPROP, errbuf);
-                                       goto error;
-                               }
-                       } else if (nvpair_type(elem) ==
-                           DATA_TYPE_UINT64) {
-                               (void) nvpair_value_uint64(elem, &intval);
-                               if (intval == 0) {
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "use 'none' to disable "
-                                           "userquota/groupquota"));
-                                       goto error;
-                               }
-                       } else {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "'%s' must be a number"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       /*
-                        * Encode the prop name as
-                        * userquota@<hex-rid>-domain, to make it easy
-                        * for the kernel to decode.
-                        */
-                       (void) snprintf(newpropname, sizeof (newpropname),
-                           "%s%llx-%s", zfs_userquota_prop_prefixes[uqtype],
-                           (longlong_t)rid, domain);
-                       valary[0] = uqtype;
-                       valary[1] = rid;
-                       valary[2] = intval;
-                       if (nvlist_add_uint64_array(ret, newpropname,
-                           valary, 3) != 0) {
-                               (void) no_memory(hdl);
-                               goto error;
-                       }
-                       continue;
-               } else if (prop == ZPROP_INVAL && zfs_prop_written(propname)) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "'%s' is readonly"),
-                           propname);
-                       (void) zfs_error(hdl, EZFS_PROPREADONLY, errbuf);
-                       goto error;
-               }
-
-               if (prop == ZPROP_INVAL) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid property '%s'"), propname);
-                       (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                       goto error;
-               }
-
-               if (!zfs_prop_valid_for_type(prop, type, B_FALSE)) {
-                       zfs_error_aux(hdl,
-                           dgettext(TEXT_DOMAIN, "'%s' does not "
-                           "apply to datasets of this type"), propname);
-                       (void) zfs_error(hdl, EZFS_PROPTYPE, errbuf);
-                       goto error;
-               }
-
-               if (zfs_prop_readonly(prop) &&
-                   (!zfs_prop_setonce(prop) || zhp != NULL)) {
-                       zfs_error_aux(hdl,
-                           dgettext(TEXT_DOMAIN, "'%s' is readonly"),
-                           propname);
-                       (void) zfs_error(hdl, EZFS_PROPREADONLY, errbuf);
-                       goto error;
-               }
-
-               if (zprop_parse_value(hdl, elem, prop, type, ret,
-                   &strval, &intval, errbuf) != 0)
-                       goto error;
-
-               /*
-                * Perform some additional checks for specific properties.
-                */
-               switch (prop) {
-               case ZFS_PROP_VERSION:
-               {
-                       int version;
-
-                       if (zhp == NULL)
-                               break;
-                       version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
-                       if (intval < version) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "Can not downgrade; already at version %u"),
-                                   version);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-                       break;
-               }
-
-               case ZFS_PROP_VOLBLOCKSIZE:
-               case ZFS_PROP_RECORDSIZE:
-               {
-                       int maxbs = SPA_MAXBLOCKSIZE;
-                       char buf[64];
-
-                       if (zhp != NULL) {
-                               maxbs = zpool_get_prop_int(zhp->zpool_hdl,
-                                   ZPOOL_PROP_MAXBLOCKSIZE, NULL);
-                       }
-                       /*
-                        * The value must be a power of two between
-                        * SPA_MINBLOCKSIZE and maxbs.
-                        */
-                       if (intval < SPA_MINBLOCKSIZE ||
-                           intval > maxbs || !ISP2(intval)) {
-                               zfs_nicenum(maxbs, buf, sizeof (buf));
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "'%s' must be power of 2 from 512B "
-                                   "to %s"), propname, buf);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-                       break;
-               }
-               case ZFS_PROP_MLSLABEL:
-               {
-#ifdef HAVE_MLSLABEL
-                       /*
-                        * Verify the mlslabel string and convert to
-                        * internal hex label string.
-                        */
-
-                       m_label_t *new_sl;
-                       char *hex = NULL;       /* internal label string */
-
-                       /* Default value is already OK. */
-                       if (strcasecmp(strval, ZFS_MLSLABEL_DEFAULT) == 0)
-                               break;
-
-                       /* Verify the label can be converted to binary form */
-                       if (((new_sl = m_label_alloc(MAC_LABEL)) == NULL) ||
-                           (str_to_label(strval, &new_sl, MAC_LABEL,
-                           L_NO_CORRECTION, NULL) == -1)) {
-                               goto badlabel;
-                       }
-
-                       /* Now translate to hex internal label string */
-                       if (label_to_str(new_sl, &hex, M_INTERNAL,
-                           DEF_NAMES) != 0) {
-                               if (hex)
-                                       free(hex);
-                               goto badlabel;
-                       }
-                       m_label_free(new_sl);
-
-                       /* If string is already in internal form, we're done. */
-                       if (strcmp(strval, hex) == 0) {
-                               free(hex);
-                               break;
-                       }
-
-                       /* Replace the label string with the internal form. */
-                       (void) nvlist_remove(ret, zfs_prop_to_name(prop),
-                           DATA_TYPE_STRING);
-                       verify(nvlist_add_string(ret, zfs_prop_to_name(prop),
-                           hex) == 0);
-                       free(hex);
-
-                       break;
-
-badlabel:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid mlslabel '%s'"), strval);
-                       (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                       m_label_free(new_sl);   /* OK if null */
-                       goto error;
-#else
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "mlslabels are unsupported"));
-                       (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                       goto error;
-#endif /* HAVE_MLSLABEL */
-               }
-
-               case ZFS_PROP_MOUNTPOINT:
-               {
-                       namecheck_err_t why;
-
-                       if (strcmp(strval, ZFS_MOUNTPOINT_NONE) == 0 ||
-                           strcmp(strval, ZFS_MOUNTPOINT_LEGACY) == 0)
-                               break;
-
-                       if (mountpoint_namecheck(strval, &why)) {
-                               switch (why) {
-                               case NAME_ERR_LEADING_SLASH:
-                                       zfs_error_aux(hdl,
-                                           dgettext(TEXT_DOMAIN,
-                                           "'%s' must be an absolute path, "
-                                           "'none', or 'legacy'"), propname);
-                                       break;
-                               case NAME_ERR_TOOLONG:
-                                       zfs_error_aux(hdl,
-                                           dgettext(TEXT_DOMAIN,
-                                           "component of '%s' is too long"),
-                                           propname);
-                                       break;
-                               default:
-                                       break;
-                               }
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-               }
-
-                       /*FALLTHRU*/
-
-               case ZFS_PROP_SHARESMB:
-               case ZFS_PROP_SHARENFS:
-                       /*
-                        * For the mountpoint and sharenfs or sharesmb
-                        * properties, check if it can be set in a
-                        * global/non-global zone based on
-                        * the zoned property value:
-                        *
-                        *              global zone         non-global zone
-                        * --------------------------------------------------
-                        * zoned=on     mountpoint (no)     mountpoint (yes)
-                        *              sharenfs (no)       sharenfs (no)
-                        *              sharesmb (no)       sharesmb (no)
-                        *
-                        * zoned=off    mountpoint (yes)        N/A
-                        *              sharenfs (yes)
-                        *              sharesmb (yes)
-                        */
-                       if (zoned) {
-                               if (getzoneid() == GLOBAL_ZONEID) {
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "'%s' cannot be set on "
-                                           "dataset in a non-global zone"),
-                                           propname);
-                                       (void) zfs_error(hdl, EZFS_ZONED,
-                                           errbuf);
-                                       goto error;
-                               } else if (prop == ZFS_PROP_SHARENFS ||
-                                   prop == ZFS_PROP_SHARESMB) {
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "'%s' cannot be set in "
-                                           "a non-global zone"), propname);
-                                       (void) zfs_error(hdl, EZFS_ZONED,
-                                           errbuf);
-                                       goto error;
-                               }
-                       } else if (getzoneid() != GLOBAL_ZONEID) {
-                               /*
-                                * If zoned property is 'off', this must be in
-                                * a global zone. If not, something is wrong.
-                                */
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "'%s' cannot be set while dataset "
-                                   "'zoned' property is set"), propname);
-                               (void) zfs_error(hdl, EZFS_ZONED, errbuf);
-                               goto error;
-                       }
-
-                       /*
-                        * At this point, it is legitimate to set the
-                        * property. Now we want to make sure that the
-                        * property value is valid if it is sharenfs.
-                        */
-                       if ((prop == ZFS_PROP_SHARENFS ||
-                           prop == ZFS_PROP_SHARESMB) &&
-                           strcmp(strval, "on") != 0 &&
-                           strcmp(strval, "off") != 0) {
-                               zfs_share_proto_t proto;
-
-                               if (prop == ZFS_PROP_SHARESMB)
-                                       proto = PROTO_SMB;
-                               else
-                                       proto = PROTO_NFS;
-
-                               /*
-                                * Must be an valid sharing protocol
-                                * option string so init the libshare
-                                * in order to enable the parser and
-                                * then parse the options. We use the
-                                * control API since we don't care about
-                                * the current configuration and don't
-                                * want the overhead of loading it
-                                * until we actually do something.
-                                */
-
-                               if (zfs_init_libshare(hdl,
-                                   SA_INIT_CONTROL_API) != SA_OK) {
-                                       /*
-                                        * An error occurred so we can't do
-                                        * anything
-                                        */
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "'%s' cannot be set: problem "
-                                           "in share initialization"),
-                                           propname);
-                                       (void) zfs_error(hdl, EZFS_BADPROP,
-                                           errbuf);
-                                       goto error;
-                               }
-
-                               if (zfs_parse_options(strval, proto) != SA_OK) {
-                                       /*
-                                        * There was an error in parsing so
-                                        * deal with it by issuing an error
-                                        * message and leaving after
-                                        * uninitializing the the libshare
-                                        * interface.
-                                        */
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "'%s' cannot be set to invalid "
-                                           "options"), propname);
-                                       (void) zfs_error(hdl, EZFS_BADPROP,
-                                           errbuf);
-                                       zfs_uninit_libshare(hdl);
-                                       goto error;
-                               }
-                               zfs_uninit_libshare(hdl);
-                       }
-
-                       break;
-               case ZFS_PROP_UTF8ONLY:
-                       chosen_utf = (int)intval;
-                       break;
-               case ZFS_PROP_NORMALIZE:
-                       chosen_normal = (int)intval;
-                       break;
-               default:
-                       break;
-               }
-
-               /*
-                * For changes to existing volumes, we have some additional
-                * checks to enforce.
-                */
-               if (type == ZFS_TYPE_VOLUME && zhp != NULL) {
-                       uint64_t volsize = zfs_prop_get_int(zhp,
-                           ZFS_PROP_VOLSIZE);
-                       uint64_t blocksize = zfs_prop_get_int(zhp,
-                           ZFS_PROP_VOLBLOCKSIZE);
-                       char buf[64];
-
-                       switch (prop) {
-                       case ZFS_PROP_RESERVATION:
-                       case ZFS_PROP_REFRESERVATION:
-                               if (intval > volsize) {
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "'%s' is greater than current "
-                                           "volume size"), propname);
-                                       (void) zfs_error(hdl, EZFS_BADPROP,
-                                           errbuf);
-                                       goto error;
-                               }
-                               break;
-
-                       case ZFS_PROP_VOLSIZE:
-                               if (intval % blocksize != 0) {
-                                       zfs_nicenum(blocksize, buf,
-                                           sizeof (buf));
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "'%s' must be a multiple of "
-                                           "volume block size (%s)"),
-                                           propname, buf);
-                                       (void) zfs_error(hdl, EZFS_BADPROP,
-                                           errbuf);
-                                       goto error;
-                               }
-
-                               if (intval == 0) {
-                                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                           "'%s' cannot be zero"),
-                                           propname);
-                                       (void) zfs_error(hdl, EZFS_BADPROP,
-                                           errbuf);
-                                       goto error;
-                               }
-                               break;
-                       default:
-                               break;
-                       }
-               }
-       }
-
-       /*
-        * If normalization was chosen, but no UTF8 choice was made,
-        * enforce rejection of non-UTF8 names.
-        *
-        * If normalization was chosen, but rejecting non-UTF8 names
-        * was explicitly not chosen, it is an error.
-        */
-       if (chosen_normal > 0 && chosen_utf < 0) {
-               if (nvlist_add_uint64(ret,
-                   zfs_prop_to_name(ZFS_PROP_UTF8ONLY), 1) != 0) {
-                       (void) no_memory(hdl);
-                       goto error;
-               }
-       } else if (chosen_normal > 0 && chosen_utf == 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "'%s' must be set 'on' if normalization chosen"),
-                   zfs_prop_to_name(ZFS_PROP_UTF8ONLY));
-               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-               goto error;
-       }
-       return (ret);
-
-error:
-       nvlist_free(ret);
-       return (NULL);
-}
-
-int
-zfs_add_synthetic_resv(zfs_handle_t *zhp, nvlist_t *nvl)
-{
-       uint64_t old_volsize;
-       uint64_t new_volsize;
-       uint64_t old_reservation;
-       uint64_t new_reservation;
-       zfs_prop_t resv_prop;
-
-       /*
-        * If this is an existing volume, and someone is setting the volsize,
-        * make sure that it matches the reservation, or add it if necessary.
-        */
-       old_volsize = zfs_prop_get_int(zhp, ZFS_PROP_VOLSIZE);
-       if (zfs_which_resv_prop(zhp, &resv_prop) < 0)
-               return (-1);
-       old_reservation = zfs_prop_get_int(zhp, resv_prop);
-       if ((zvol_volsize_to_reservation(old_volsize, zhp->zfs_props) !=
-           old_reservation) || nvlist_lookup_uint64(nvl,
-           zfs_prop_to_name(resv_prop), &new_reservation) != ENOENT) {
-               return (0);
-       }
-       if (nvlist_lookup_uint64(nvl, zfs_prop_to_name(ZFS_PROP_VOLSIZE),
-           &new_volsize) != 0)
-               return (-1);
-       new_reservation = zvol_volsize_to_reservation(new_volsize,
-           zhp->zfs_props);
-       if (nvlist_add_uint64(nvl, zfs_prop_to_name(resv_prop),
-           new_reservation) != 0) {
-               (void) no_memory(zhp->zfs_hdl);
-               return (-1);
-       }
-       return (1);
-}
-
-void
-zfs_setprop_error(libzfs_handle_t *hdl, zfs_prop_t prop, int err,
-    char *errbuf)
-{
-       switch (err) {
-
-       case ENOSPC:
-               /*
-                * For quotas and reservations, ENOSPC indicates
-                * something different; setting a quota or reservation
-                * doesn't use any disk space.
-                */
-               switch (prop) {
-               case ZFS_PROP_QUOTA:
-               case ZFS_PROP_REFQUOTA:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "size is less than current used or "
-                           "reserved space"));
-                       (void) zfs_error(hdl, EZFS_PROPSPACE, errbuf);
-                       break;
-
-               case ZFS_PROP_RESERVATION:
-               case ZFS_PROP_REFRESERVATION:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "size is greater than available space"));
-                       (void) zfs_error(hdl, EZFS_PROPSPACE, errbuf);
-                       break;
-
-               default:
-                       (void) zfs_standard_error(hdl, err, errbuf);
-                       break;
-               }
-               break;
-
-       case EBUSY:
-               (void) zfs_standard_error(hdl, EBUSY, errbuf);
-               break;
-
-       case EROFS:
-               (void) zfs_error(hdl, EZFS_DSREADONLY, errbuf);
-               break;
-
-       case E2BIG:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "property value too long"));
-               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-               break;
-
-       case ENOTSUP:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "pool and or dataset must be upgraded to set this "
-                   "property or value"));
-               (void) zfs_error(hdl, EZFS_BADVERSION, errbuf);
-               break;
-
-       case ERANGE:
-               if (prop == ZFS_PROP_COMPRESSION ||
-                   prop == ZFS_PROP_RECORDSIZE) {
-                       (void) zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "property setting is not allowed on "
-                           "bootable datasets"));
-                       (void) zfs_error(hdl, EZFS_NOTSUP, errbuf);
-               } else {
-                       (void) zfs_standard_error(hdl, err, errbuf);
-               }
-               break;
-
-       case EINVAL:
-               if (prop == ZPROP_INVAL) {
-                       (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-               } else {
-                       (void) zfs_standard_error(hdl, err, errbuf);
-               }
-               break;
-
-       case EOVERFLOW:
-               /*
-                * This platform can't address a volume this big.
-                */
-#ifdef _ILP32
-               if (prop == ZFS_PROP_VOLSIZE) {
-                       (void) zfs_error(hdl, EZFS_VOLTOOBIG, errbuf);
-                       break;
-               }
-#endif
-               /* FALLTHROUGH */
-       default:
-               (void) zfs_standard_error(hdl, err, errbuf);
-       }
-}
-
-static boolean_t
-zfs_is_namespace_prop(zfs_prop_t prop)
-{
-       switch (prop) {
-
-       case ZFS_PROP_ATIME:
-       case ZFS_PROP_RELATIME:
-       case ZFS_PROP_DEVICES:
-       case ZFS_PROP_EXEC:
-       case ZFS_PROP_SETUID:
-       case ZFS_PROP_READONLY:
-       case ZFS_PROP_XATTR:
-       case ZFS_PROP_NBMAND:
-               return (B_TRUE);
-
-       default:
-               return (B_FALSE);
-       }
-}
-
-/*
- * Given a property name and value, set the property for the given dataset.
- */
-int
-zfs_prop_set(zfs_handle_t *zhp, const char *propname, const char *propval)
-{
-       zfs_cmd_t zc = {"\0"};
-       int ret = -1;
-       prop_changelist_t *cl = NULL;
-       char errbuf[1024];
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       nvlist_t *nvl = NULL, *realprops;
-       zfs_prop_t prop;
-       boolean_t do_prefix = B_TRUE;
-       int added_resv = 0;
-
-       (void) snprintf(errbuf, sizeof (errbuf),
-           dgettext(TEXT_DOMAIN, "cannot set property for '%s'"),
-           zhp->zfs_name);
-
-       if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0 ||
-           nvlist_add_string(nvl, propname, propval) != 0) {
-               (void) no_memory(hdl);
-               goto error;
-       }
-
-       if ((realprops = zfs_valid_proplist(hdl, zhp->zfs_type, nvl,
-           zfs_prop_get_int(zhp, ZFS_PROP_ZONED), zhp, errbuf)) == NULL)
-               goto error;
-
-       nvlist_free(nvl);
-       nvl = realprops;
-
-       prop = zfs_name_to_prop(propname);
-
-       if (prop == ZFS_PROP_VOLSIZE) {
-               if ((added_resv = zfs_add_synthetic_resv(zhp, nvl)) == -1)
-                       goto error;
-       }
-
-       if ((cl = changelist_gather(zhp, prop, 0, 0)) == NULL)
-               goto error;
-
-       if (prop == ZFS_PROP_MOUNTPOINT && changelist_haszonedchild(cl)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "child dataset with inherited mountpoint is used "
-                   "in a non-global zone"));
-               ret = zfs_error(hdl, EZFS_ZONED, errbuf);
-               goto error;
-       }
-
-       /*
-        * We don't want to unmount & remount the dataset when changing
-        * its canmount property to 'on' or 'noauto'.  We only use
-        * the changelist logic to unmount when setting canmount=off.
-        */
-       if (prop == ZFS_PROP_CANMOUNT) {
-               uint64_t idx;
-               int err = zprop_string_to_index(prop, propval, &idx,
-                   ZFS_TYPE_DATASET);
-               if (err == 0 && idx != ZFS_CANMOUNT_OFF)
-                       do_prefix = B_FALSE;
-       }
-
-       if (do_prefix && (ret = changelist_prefix(cl)) != 0)
-               goto error;
-
-       /*
-        * Execute the corresponding ioctl() to set this property.
-        */
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       if (zcmd_write_src_nvlist(hdl, &zc, nvl) != 0)
-               goto error;
-
-       ret = zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc);
-
-       if (ret != 0) {
-               zfs_setprop_error(hdl, prop, errno, errbuf);
-               if (added_resv && errno == ENOSPC) {
-                       /* clean up the volsize property we tried to set */
-                       uint64_t old_volsize = zfs_prop_get_int(zhp,
-                           ZFS_PROP_VOLSIZE);
-                       nvlist_free(nvl);
-                       zcmd_free_nvlists(&zc);
-                       if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0)
-                               goto error;
-                       if (nvlist_add_uint64(nvl,
-                           zfs_prop_to_name(ZFS_PROP_VOLSIZE),
-                           old_volsize) != 0)
-                               goto error;
-                       if (zcmd_write_src_nvlist(hdl, &zc, nvl) != 0)
-                               goto error;
-                       (void) zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc);
-               }
-       } else {
-               if (do_prefix)
-                       ret = changelist_postfix(cl);
-
-               if (ret == 0) {
-                       /*
-                        * Refresh the statistics so the new property
-                        * value is reflected.
-                        */
-                       (void) get_stats(zhp);
-
-                       /*
-                        * Remount the filesystem to propagate the change
-                        * if one of the options handled by the generic
-                        * Linux namespace layer has been modified.
-                        */
-                       if (zfs_is_namespace_prop(prop) &&
-                           zfs_is_mounted(zhp, NULL))
-                               ret = zfs_mount(zhp, MNTOPT_REMOUNT, 0);
-               }
-       }
-
-error:
-       nvlist_free(nvl);
-       zcmd_free_nvlists(&zc);
-       if (cl)
-               changelist_free(cl);
-       return (ret);
-}
-
-/*
- * Given a property, inherit the value from the parent dataset, or if received
- * is TRUE, revert to the received value, if any.
- */
-int
-zfs_prop_inherit(zfs_handle_t *zhp, const char *propname, boolean_t received)
-{
-       zfs_cmd_t zc = {"\0"};
-       int ret;
-       prop_changelist_t *cl;
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       char errbuf[1024];
-       zfs_prop_t prop;
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot inherit %s for '%s'"), propname, zhp->zfs_name);
-
-       zc.zc_cookie = received;
-       if ((prop = zfs_name_to_prop(propname)) == ZPROP_INVAL) {
-               /*
-                * For user properties, the amount of work we have to do is very
-                * small, so just do it here.
-                */
-               if (!zfs_prop_user(propname)) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid property"));
-                       return (zfs_error(hdl, EZFS_BADPROP, errbuf));
-               }
-
-               (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-               (void) strlcpy(zc.zc_value, propname, sizeof (zc.zc_value));
-
-               if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_INHERIT_PROP, &zc) != 0)
-                       return (zfs_standard_error(hdl, errno, errbuf));
-
-               return (0);
-       }
-
-       /*
-        * Verify that this property is inheritable.
-        */
-       if (zfs_prop_readonly(prop))
-               return (zfs_error(hdl, EZFS_PROPREADONLY, errbuf));
-
-       if (!zfs_prop_inheritable(prop) && !received)
-               return (zfs_error(hdl, EZFS_PROPNONINHERIT, errbuf));
-
-       /*
-        * Check to see if the value applies to this type
-        */
-       if (!zfs_prop_valid_for_type(prop, zhp->zfs_type, B_FALSE))
-               return (zfs_error(hdl, EZFS_PROPTYPE, errbuf));
-
-       /*
-        * Normalize the name, to get rid of shorthand abbreviations.
-        */
-       propname = zfs_prop_to_name(prop);
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-       (void) strlcpy(zc.zc_value, propname, sizeof (zc.zc_value));
-
-       if (prop == ZFS_PROP_MOUNTPOINT && getzoneid() == GLOBAL_ZONEID &&
-           zfs_prop_get_int(zhp, ZFS_PROP_ZONED)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "dataset is used in a non-global zone"));
-               return (zfs_error(hdl, EZFS_ZONED, errbuf));
-       }
-
-       /*
-        * Determine datasets which will be affected by this change, if any.
-        */
-       if ((cl = changelist_gather(zhp, prop, 0, 0)) == NULL)
-               return (-1);
-
-       if (prop == ZFS_PROP_MOUNTPOINT && changelist_haszonedchild(cl)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "child dataset with inherited mountpoint is used "
-                   "in a non-global zone"));
-               ret = zfs_error(hdl, EZFS_ZONED, errbuf);
-               goto error;
-       }
-
-       if ((ret = changelist_prefix(cl)) != 0)
-               goto error;
-
-       if ((ret = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_INHERIT_PROP, &zc)) != 0) {
-               return (zfs_standard_error(hdl, errno, errbuf));
-       } else {
-
-               if ((ret = changelist_postfix(cl)) != 0)
-                       goto error;
-
-               /*
-                * Refresh the statistics so the new property is reflected.
-                */
-               (void) get_stats(zhp);
-
-               /*
-                * Remount the filesystem to propagate the change
-                * if one of the options handled by the generic
-                * Linux namespace layer has been modified.
-                */
-               if (zfs_is_namespace_prop(prop) &&
-                   zfs_is_mounted(zhp, NULL))
-                       ret = zfs_mount(zhp, MNTOPT_REMOUNT, 0);
-       }
-
-error:
-       changelist_free(cl);
-       return (ret);
-}
-
-/*
- * True DSL properties are stored in an nvlist.  The following two functions
- * extract them appropriately.
- */
-uint64_t
-getprop_uint64(zfs_handle_t *zhp, zfs_prop_t prop, char **source)
-{
-       nvlist_t *nv;
-       uint64_t value;
-
-       *source = NULL;
-       if (nvlist_lookup_nvlist(zhp->zfs_props,
-           zfs_prop_to_name(prop), &nv) == 0) {
-               verify(nvlist_lookup_uint64(nv, ZPROP_VALUE, &value) == 0);
-               (void) nvlist_lookup_string(nv, ZPROP_SOURCE, source);
-       } else {
-               verify(!zhp->zfs_props_table ||
-                   zhp->zfs_props_table[prop] == B_TRUE);
-               value = zfs_prop_default_numeric(prop);
-               *source = "";
-       }
-
-       return (value);
-}
-
-static char *
-getprop_string(zfs_handle_t *zhp, zfs_prop_t prop, char **source)
-{
-       nvlist_t *nv;
-       char *value;
-
-       *source = NULL;
-       if (nvlist_lookup_nvlist(zhp->zfs_props,
-           zfs_prop_to_name(prop), &nv) == 0) {
-               verify(nvlist_lookup_string(nv, ZPROP_VALUE, &value) == 0);
-               (void) nvlist_lookup_string(nv, ZPROP_SOURCE, source);
-       } else {
-               verify(!zhp->zfs_props_table ||
-                   zhp->zfs_props_table[prop] == B_TRUE);
-               if ((value = (char *)zfs_prop_default_string(prop)) == NULL)
-                       value = "";
-               *source = "";
-       }
-
-       return (value);
-}
-
-static boolean_t
-zfs_is_recvd_props_mode(zfs_handle_t *zhp)
-{
-       return (zhp->zfs_props == zhp->zfs_recvd_props);
-}
-
-static void
-zfs_set_recvd_props_mode(zfs_handle_t *zhp, uint64_t *cookie)
-{
-       *cookie = (uint64_t)(uintptr_t)zhp->zfs_props;
-       zhp->zfs_props = zhp->zfs_recvd_props;
-}
-
-static void
-zfs_unset_recvd_props_mode(zfs_handle_t *zhp, uint64_t *cookie)
-{
-       zhp->zfs_props = (nvlist_t *)(uintptr_t)*cookie;
-       *cookie = 0;
-}
-
-/*
- * Internal function for getting a numeric property.  Both zfs_prop_get() and
- * zfs_prop_get_int() are built using this interface.
- *
- * Certain properties can be overridden using 'mount -o'.  In this case, scan
- * the contents of the /etc/mtab entry, searching for the appropriate options.
- * If they differ from the on-disk values, report the current values and mark
- * the source "temporary".
- */
-static int
-get_numeric_property(zfs_handle_t *zhp, zfs_prop_t prop, zprop_source_t *src,
-    char **source, uint64_t *val)
-{
-       zfs_cmd_t zc = {"\0"};
-       nvlist_t *zplprops = NULL;
-       struct mnttab mnt;
-       char *mntopt_on = NULL;
-       char *mntopt_off = NULL;
-       boolean_t received = zfs_is_recvd_props_mode(zhp);
-
-       *source = NULL;
-
-       /*
-        * If the property is being fetched for a snapshot, check whether
-        * the property is valid for the snapshot's head dataset type.
-        */
-       if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT &&
-               !zfs_prop_valid_for_type(prop, zhp->zfs_head_type, B_TRUE)) {
-                       *val = zfs_prop_default_numeric(prop);
-                       return (-1);
-       }
-
-       switch (prop) {
-       case ZFS_PROP_ATIME:
-               mntopt_on = MNTOPT_ATIME;
-               mntopt_off = MNTOPT_NOATIME;
-               break;
-
-       case ZFS_PROP_RELATIME:
-               mntopt_on = MNTOPT_RELATIME;
-               mntopt_off = MNTOPT_NORELATIME;
-               break;
-
-       case ZFS_PROP_DEVICES:
-               mntopt_on = MNTOPT_DEVICES;
-               mntopt_off = MNTOPT_NODEVICES;
-               break;
-
-       case ZFS_PROP_EXEC:
-               mntopt_on = MNTOPT_EXEC;
-               mntopt_off = MNTOPT_NOEXEC;
-               break;
-
-       case ZFS_PROP_READONLY:
-               mntopt_on = MNTOPT_RO;
-               mntopt_off = MNTOPT_RW;
-               break;
-
-       case ZFS_PROP_SETUID:
-               mntopt_on = MNTOPT_SETUID;
-               mntopt_off = MNTOPT_NOSETUID;
-               break;
-
-       case ZFS_PROP_XATTR:
-               mntopt_on = MNTOPT_XATTR;
-               mntopt_off = MNTOPT_NOXATTR;
-               break;
-
-       case ZFS_PROP_NBMAND:
-               mntopt_on = MNTOPT_NBMAND;
-               mntopt_off = MNTOPT_NONBMAND;
-               break;
-       default:
-               break;
-       }
-
-       /*
-        * Because looking up the mount options is potentially expensive
-        * (iterating over all of /etc/mtab), we defer its calculation until
-        * we're looking up a property which requires its presence.
-        */
-       if (!zhp->zfs_mntcheck &&
-           (mntopt_on != NULL || prop == ZFS_PROP_MOUNTED)) {
-               libzfs_handle_t *hdl = zhp->zfs_hdl;
-               struct mnttab entry;
-
-               if (libzfs_mnttab_find(hdl, zhp->zfs_name, &entry) == 0) {
-                       zhp->zfs_mntopts = zfs_strdup(hdl,
-                           entry.mnt_mntopts);
-                       if (zhp->zfs_mntopts == NULL)
-                               return (-1);
-               }
-
-               zhp->zfs_mntcheck = B_TRUE;
-       }
-
-       if (zhp->zfs_mntopts == NULL)
-               mnt.mnt_mntopts = "";
-       else
-               mnt.mnt_mntopts = zhp->zfs_mntopts;
-
-       switch (prop) {
-       case ZFS_PROP_ATIME:
-       case ZFS_PROP_RELATIME:
-       case ZFS_PROP_DEVICES:
-       case ZFS_PROP_EXEC:
-       case ZFS_PROP_READONLY:
-       case ZFS_PROP_SETUID:
-       case ZFS_PROP_XATTR:
-       case ZFS_PROP_NBMAND:
-               *val = getprop_uint64(zhp, prop, source);
-
-               if (received)
-                       break;
-
-               if (hasmntopt(&mnt, mntopt_on) && !*val) {
-                       *val = B_TRUE;
-                       if (src)
-                               *src = ZPROP_SRC_TEMPORARY;
-               } else if (hasmntopt(&mnt, mntopt_off) && *val) {
-                       *val = B_FALSE;
-                       if (src)
-                               *src = ZPROP_SRC_TEMPORARY;
-               }
-               break;
-
-       case ZFS_PROP_CANMOUNT:
-       case ZFS_PROP_VOLSIZE:
-       case ZFS_PROP_QUOTA:
-       case ZFS_PROP_REFQUOTA:
-       case ZFS_PROP_RESERVATION:
-       case ZFS_PROP_REFRESERVATION:
-       case ZFS_PROP_FILESYSTEM_LIMIT:
-       case ZFS_PROP_SNAPSHOT_LIMIT:
-       case ZFS_PROP_FILESYSTEM_COUNT:
-       case ZFS_PROP_SNAPSHOT_COUNT:
-               *val = getprop_uint64(zhp, prop, source);
-
-               if (*source == NULL) {
-                       /* not default, must be local */
-                       *source = zhp->zfs_name;
-               }
-               break;
-
-       case ZFS_PROP_MOUNTED:
-               *val = (zhp->zfs_mntopts != NULL);
-               break;
-
-       case ZFS_PROP_NUMCLONES:
-               *val = zhp->zfs_dmustats.dds_num_clones;
-               break;
-
-       case ZFS_PROP_VERSION:
-       case ZFS_PROP_NORMALIZE:
-       case ZFS_PROP_UTF8ONLY:
-       case ZFS_PROP_CASE:
-               if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
-                       return (-1);
-               (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-               if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_OBJSET_ZPLPROPS, &zc)) {
-                       zcmd_free_nvlists(&zc);
-                       if (prop == ZFS_PROP_VERSION &&
-                           zhp->zfs_type == ZFS_TYPE_VOLUME)
-                               *val = zfs_prop_default_numeric(prop);
-                       return (-1);
-               }
-               if (zcmd_read_dst_nvlist(zhp->zfs_hdl, &zc, &zplprops) != 0 ||
-                   nvlist_lookup_uint64(zplprops, zfs_prop_to_name(prop),
-                   val) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       return (-1);
-               }
-               if (zplprops)
-                       nvlist_free(zplprops);
-               zcmd_free_nvlists(&zc);
-               break;
-
-       case ZFS_PROP_INCONSISTENT:
-               *val = zhp->zfs_dmustats.dds_inconsistent;
-               break;
-
-       default:
-               switch (zfs_prop_get_type(prop)) {
-               case PROP_TYPE_NUMBER:
-               case PROP_TYPE_INDEX:
-                       *val = getprop_uint64(zhp, prop, source);
-                       /*
-                        * If we tried to use a default value for a
-                        * readonly property, it means that it was not
-                        * present.
-                        */
-                       if (zfs_prop_readonly(prop) &&
-                           *source != NULL && (*source)[0] == '\0') {
-                               *source = NULL;
-                       }
-                       break;
-
-               case PROP_TYPE_STRING:
-               default:
-                       zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
-                           "cannot get non-numeric property"));
-                       return (zfs_error(zhp->zfs_hdl, EZFS_BADPROP,
-                           dgettext(TEXT_DOMAIN, "internal error")));
-               }
-       }
-
-       return (0);
-}
-
-/*
- * Calculate the source type, given the raw source string.
- */
-static void
-get_source(zfs_handle_t *zhp, zprop_source_t *srctype, char *source,
-    char *statbuf, size_t statlen)
-{
-       if (statbuf == NULL || *srctype == ZPROP_SRC_TEMPORARY)
-               return;
-
-       if (source == NULL) {
-               *srctype = ZPROP_SRC_NONE;
-       } else if (source[0] == '\0') {
-               *srctype = ZPROP_SRC_DEFAULT;
-       } else if (strstr(source, ZPROP_SOURCE_VAL_RECVD) != NULL) {
-               *srctype = ZPROP_SRC_RECEIVED;
-       } else {
-               if (strcmp(source, zhp->zfs_name) == 0) {
-                       *srctype = ZPROP_SRC_LOCAL;
-               } else {
-                       (void) strlcpy(statbuf, source, statlen);
-                       *srctype = ZPROP_SRC_INHERITED;
-               }
-       }
-
-}
-
-int
-zfs_prop_get_recvd(zfs_handle_t *zhp, const char *propname, char *propbuf,
-    size_t proplen, boolean_t literal)
-{
-       zfs_prop_t prop;
-       int err = 0;
-
-       if (zhp->zfs_recvd_props == NULL)
-               if (get_recvd_props_ioctl(zhp) != 0)
-                       return (-1);
-
-       prop = zfs_name_to_prop(propname);
-
-       if (prop != ZPROP_INVAL) {
-               uint64_t cookie;
-               if (!nvlist_exists(zhp->zfs_recvd_props, propname))
-                       return (-1);
-               zfs_set_recvd_props_mode(zhp, &cookie);
-               err = zfs_prop_get(zhp, prop, propbuf, proplen,
-                   NULL, NULL, 0, literal);
-               zfs_unset_recvd_props_mode(zhp, &cookie);
-       } else {
-               nvlist_t *propval;
-               char *recvdval;
-               if (nvlist_lookup_nvlist(zhp->zfs_recvd_props,
-                   propname, &propval) != 0)
-                       return (-1);
-               verify(nvlist_lookup_string(propval, ZPROP_VALUE,
-                   &recvdval) == 0);
-               (void) strlcpy(propbuf, recvdval, proplen);
-       }
-
-       return (err == 0 ? 0 : -1);
-}
-
-static int
-get_clones_string(zfs_handle_t *zhp, char *propbuf, size_t proplen)
-{
-       nvlist_t *value;
-       nvpair_t *pair;
-
-       value = zfs_get_clones_nvl(zhp);
-       if (value == NULL)
-               return (-1);
-
-       propbuf[0] = '\0';
-       for (pair = nvlist_next_nvpair(value, NULL); pair != NULL;
-           pair = nvlist_next_nvpair(value, pair)) {
-               if (propbuf[0] != '\0')
-                       (void) strlcat(propbuf, ",", proplen);
-               (void) strlcat(propbuf, nvpair_name(pair), proplen);
-       }
-
-       return (0);
-}
-
-struct get_clones_arg {
-       uint64_t numclones;
-       nvlist_t *value;
-       const char *origin;
-       char buf[ZFS_MAXNAMELEN];
-};
-
-int
-get_clones_cb(zfs_handle_t *zhp, void *arg)
-{
-       struct get_clones_arg *gca = arg;
-
-       if (gca->numclones == 0) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, gca->buf, sizeof (gca->buf),
-           NULL, NULL, 0, B_TRUE) != 0)
-               goto out;
-       if (strcmp(gca->buf, gca->origin) == 0) {
-               fnvlist_add_boolean(gca->value, zfs_get_name(zhp));
-               gca->numclones--;
-       }
-
-out:
-       (void) zfs_iter_children(zhp, get_clones_cb, gca);
-       zfs_close(zhp);
-       return (0);
-}
-
-nvlist_t *
-zfs_get_clones_nvl(zfs_handle_t *zhp)
-{
-       nvlist_t *nv, *value;
-
-       if (nvlist_lookup_nvlist(zhp->zfs_props,
-           zfs_prop_to_name(ZFS_PROP_CLONES), &nv) != 0) {
-               struct get_clones_arg gca;
-
-               /*
-                * if this is a snapshot, then the kernel wasn't able
-                * to get the clones.  Do it by slowly iterating.
-                */
-               if (zhp->zfs_type != ZFS_TYPE_SNAPSHOT)
-                       return (NULL);
-               if (nvlist_alloc(&nv, NV_UNIQUE_NAME, 0) != 0)
-                       return (NULL);
-               if (nvlist_alloc(&value, NV_UNIQUE_NAME, 0) != 0) {
-                       nvlist_free(nv);
-                       return (NULL);
-               }
-
-               gca.numclones = zfs_prop_get_int(zhp, ZFS_PROP_NUMCLONES);
-               gca.value = value;
-               gca.origin = zhp->zfs_name;
-
-               if (gca.numclones != 0) {
-                       zfs_handle_t *root;
-                       char pool[ZFS_MAXNAMELEN];
-                       char *cp = pool;
-
-                       /* get the pool name */
-                       (void) strlcpy(pool, zhp->zfs_name, sizeof (pool));
-                       (void) strsep(&cp, "/@");
-                       root = zfs_open(zhp->zfs_hdl, pool,
-                           ZFS_TYPE_FILESYSTEM);
-
-                       (void) get_clones_cb(root, &gca);
-               }
-
-               if (gca.numclones != 0 ||
-                   nvlist_add_nvlist(nv, ZPROP_VALUE, value) != 0 ||
-                   nvlist_add_nvlist(zhp->zfs_props,
-                   zfs_prop_to_name(ZFS_PROP_CLONES), nv) != 0) {
-                       nvlist_free(nv);
-                       nvlist_free(value);
-                       return (NULL);
-               }
-               nvlist_free(nv);
-               nvlist_free(value);
-               verify(0 == nvlist_lookup_nvlist(zhp->zfs_props,
-                   zfs_prop_to_name(ZFS_PROP_CLONES), &nv));
-       }
-
-       verify(nvlist_lookup_nvlist(nv, ZPROP_VALUE, &value) == 0);
-
-       return (value);
-}
-
-/*
- * Retrieve a property from the given object.  If 'literal' is specified, then
- * numbers are left as exact values.  Otherwise, numbers are converted to a
- * human-readable form.
- *
- * Returns 0 on success, or -1 on error.
- */
-int
-zfs_prop_get(zfs_handle_t *zhp, zfs_prop_t prop, char *propbuf, size_t proplen,
-    zprop_source_t *src, char *statbuf, size_t statlen, boolean_t literal)
-{
-       char *source = NULL;
-       uint64_t val;
-       char *str;
-       const char *strval;
-       boolean_t received = zfs_is_recvd_props_mode(zhp);
-
-       /*
-        * Check to see if this property applies to our object
-        */
-       if (!zfs_prop_valid_for_type(prop, zhp->zfs_type, B_FALSE))
-               return (-1);
-
-       if (received && zfs_prop_readonly(prop))
-               return (-1);
-
-       if (src)
-               *src = ZPROP_SRC_NONE;
-
-       switch (prop) {
-       case ZFS_PROP_CREATION:
-               /*
-                * 'creation' is a time_t stored in the statistics.  We convert
-                * this into a string unless 'literal' is specified.
-                */
-               {
-                       val = getprop_uint64(zhp, prop, &source);
-                       time_t time = (time_t)val;
-                       struct tm t;
-
-                       if (literal ||
-                           localtime_r(&time, &t) == NULL ||
-                           strftime(propbuf, proplen, "%a %b %e %k:%M %Y",
-                           &t) == 0)
-                               (void) snprintf(propbuf, proplen, "%llu",
-                                   (u_longlong_t) val);
-               }
-               break;
-
-       case ZFS_PROP_MOUNTPOINT:
-               /*
-                * Getting the precise mountpoint can be tricky.
-                *
-                *  - for 'none' or 'legacy', return those values.
-                *  - for inherited mountpoints, we want to take everything
-                *    after our ancestor and append it to the inherited value.
-                *
-                * If the pool has an alternate root, we want to prepend that
-                * root to any values we return.
-                */
-
-               str = getprop_string(zhp, prop, &source);
-
-               if (str[0] == '/') {
-                       char buf[MAXPATHLEN];
-                       char *root = buf;
-                       const char *relpath;
-
-                       /*
-                        * If we inherit the mountpoint, even from a dataset
-                        * with a received value, the source will be the path of
-                        * the dataset we inherit from. If source is
-                        * ZPROP_SOURCE_VAL_RECVD, the received value is not
-                        * inherited.
-                        */
-                       if (strcmp(source, ZPROP_SOURCE_VAL_RECVD) == 0) {
-                               relpath = "";
-                       } else {
-                               relpath = zhp->zfs_name + strlen(source);
-                               if (relpath[0] == '/')
-                                       relpath++;
-                       }
-
-                       if ((zpool_get_prop(zhp->zpool_hdl,
-                           ZPOOL_PROP_ALTROOT, buf, MAXPATHLEN, NULL)) ||
-                           (strcmp(root, "-") == 0))
-                               root[0] = '\0';
-                       /*
-                        * Special case an alternate root of '/'. This will
-                        * avoid having multiple leading slashes in the
-                        * mountpoint path.
-                        */
-                       if (strcmp(root, "/") == 0)
-                               root++;
-
-                       /*
-                        * If the mountpoint is '/' then skip over this
-                        * if we are obtaining either an alternate root or
-                        * an inherited mountpoint.
-                        */
-                       if (str[1] == '\0' && (root[0] != '\0' ||
-                           relpath[0] != '\0'))
-                               str++;
-
-                       if (relpath[0] == '\0')
-                               (void) snprintf(propbuf, proplen, "%s%s",
-                                   root, str);
-                       else
-                               (void) snprintf(propbuf, proplen, "%s%s%s%s",
-                                   root, str, relpath[0] == '@' ? "" : "/",
-                                   relpath);
-               } else {
-                       /* 'legacy' or 'none' */
-                       (void) strlcpy(propbuf, str, proplen);
-               }
-
-               break;
-
-       case ZFS_PROP_ORIGIN:
-               (void) strlcpy(propbuf, getprop_string(zhp, prop, &source),
-                   proplen);
-               /*
-                * If there is no parent at all, return failure to indicate that
-                * it doesn't apply to this dataset.
-                */
-               if (propbuf[0] == '\0')
-                       return (-1);
-               break;
-
-       case ZFS_PROP_CLONES:
-               if (get_clones_string(zhp, propbuf, proplen) != 0)
-                       return (-1);
-               break;
-
-       case ZFS_PROP_QUOTA:
-       case ZFS_PROP_REFQUOTA:
-       case ZFS_PROP_RESERVATION:
-       case ZFS_PROP_REFRESERVATION:
-
-               if (get_numeric_property(zhp, prop, src, &source, &val) != 0)
-                       return (-1);
-
-               /*
-                * If quota or reservation is 0, we translate this into 'none'
-                * (unless literal is set), and indicate that it's the default
-                * value.  Otherwise, we print the number nicely and indicate
-                * that its set locally.
-                */
-               if (val == 0) {
-                       if (literal)
-                               (void) strlcpy(propbuf, "0", proplen);
-                       else
-                               (void) strlcpy(propbuf, "none", proplen);
-               } else {
-                       if (literal)
-                               (void) snprintf(propbuf, proplen, "%llu",
-                                   (u_longlong_t)val);
-                       else
-                               zfs_nicenum(val, propbuf, proplen);
-               }
-               break;
-
-       case ZFS_PROP_FILESYSTEM_LIMIT:
-       case ZFS_PROP_SNAPSHOT_LIMIT:
-       case ZFS_PROP_FILESYSTEM_COUNT:
-       case ZFS_PROP_SNAPSHOT_COUNT:
-
-               if (get_numeric_property(zhp, prop, src, &source, &val) != 0)
-                       return (-1);
-
-               /*
-                * If limit is UINT64_MAX, we translate this into 'none' (unless
-                * literal is set), and indicate that it's the default value.
-                * Otherwise, we print the number nicely and indicate that it's
-                * set locally.
-                */
-               if (literal) {
-                       (void) snprintf(propbuf, proplen, "%llu",
-                           (u_longlong_t)val);
-               } else if (val == UINT64_MAX) {
-                       (void) strlcpy(propbuf, "none", proplen);
-               } else {
-                       zfs_nicenum(val, propbuf, proplen);
-               }
-               break;
-
-       case ZFS_PROP_REFRATIO:
-       case ZFS_PROP_COMPRESSRATIO:
-               if (get_numeric_property(zhp, prop, src, &source, &val) != 0)
-                       return (-1);
-               (void) snprintf(propbuf, proplen, "%llu.%02llux",
-                   (u_longlong_t)(val / 100),
-                   (u_longlong_t)(val % 100));
-               break;
-
-       case ZFS_PROP_TYPE:
-               switch (zhp->zfs_type) {
-               case ZFS_TYPE_FILESYSTEM:
-                       str = "filesystem";
-                       break;
-               case ZFS_TYPE_VOLUME:
-                       str = "volume";
-                       break;
-               case ZFS_TYPE_SNAPSHOT:
-                       str = "snapshot";
-                       break;
-               case ZFS_TYPE_BOOKMARK:
-                       str = "bookmark";
-                       break;
-               default:
-                       abort();
-               }
-               (void) snprintf(propbuf, proplen, "%s", str);
-               break;
-
-       case ZFS_PROP_MOUNTED:
-               /*
-                * The 'mounted' property is a pseudo-property that described
-                * whether the filesystem is currently mounted.  Even though
-                * it's a boolean value, the typical values of "on" and "off"
-                * don't make sense, so we translate to "yes" and "no".
-                */
-               if (get_numeric_property(zhp, ZFS_PROP_MOUNTED,
-                   src, &source, &val) != 0)
-                       return (-1);
-               if (val)
-                       (void) strlcpy(propbuf, "yes", proplen);
-               else
-                       (void) strlcpy(propbuf, "no", proplen);
-               break;
-
-       case ZFS_PROP_NAME:
-               /*
-                * The 'name' property is a pseudo-property derived from the
-                * dataset name.  It is presented as a real property to simplify
-                * consumers.
-                */
-               (void) strlcpy(propbuf, zhp->zfs_name, proplen);
-               break;
-
-       case ZFS_PROP_MLSLABEL:
-               {
-#ifdef HAVE_MLSLABEL
-                       m_label_t *new_sl = NULL;
-                       char *ascii = NULL;     /* human readable label */
-
-                       (void) strlcpy(propbuf,
-                           getprop_string(zhp, prop, &source), proplen);
-
-                       if (literal || (strcasecmp(propbuf,
-                           ZFS_MLSLABEL_DEFAULT) == 0))
-                               break;
-
-                       /*
-                        * Try to translate the internal hex string to
-                        * human-readable output.  If there are any
-                        * problems just use the hex string.
-                        */
-
-                       if (str_to_label(propbuf, &new_sl, MAC_LABEL,
-                           L_NO_CORRECTION, NULL) == -1) {
-                               m_label_free(new_sl);
-                               break;
-                       }
-
-                       if (label_to_str(new_sl, &ascii, M_LABEL,
-                           DEF_NAMES) != 0) {
-                               if (ascii)
-                                       free(ascii);
-                               m_label_free(new_sl);
-                               break;
-                       }
-                       m_label_free(new_sl);
-
-                       (void) strlcpy(propbuf, ascii, proplen);
-                       free(ascii);
-#else
-                       (void) strlcpy(propbuf,
-                           getprop_string(zhp, prop, &source), proplen);
-#endif /* HAVE_MLSLABEL */
-               }
-               break;
-
-       case ZFS_PROP_GUID:
-               /*
-                * GUIDs are stored as numbers, but they are identifiers.
-                * We don't want them to be pretty printed, because pretty
-                * printing mangles the ID into a truncated and useless value.
-                */
-               if (get_numeric_property(zhp, prop, src, &source, &val) != 0)
-                       return (-1);
-               (void) snprintf(propbuf, proplen, "%llu", (u_longlong_t)val);
-               break;
-
-       default:
-               switch (zfs_prop_get_type(prop)) {
-               case PROP_TYPE_NUMBER:
-                       if (get_numeric_property(zhp, prop, src,
-                           &source, &val) != 0)
-                               return (-1);
-                       if (literal)
-                               (void) snprintf(propbuf, proplen, "%llu",
-                                   (u_longlong_t)val);
-                       else
-                               zfs_nicenum(val, propbuf, proplen);
-                       break;
-
-               case PROP_TYPE_STRING:
-                       (void) strlcpy(propbuf,
-                           getprop_string(zhp, prop, &source), proplen);
-                       break;
-
-               case PROP_TYPE_INDEX:
-                       if (get_numeric_property(zhp, prop, src,
-                           &source, &val) != 0)
-                               return (-1);
-                       if (zfs_prop_index_to_string(prop, val, &strval) != 0)
-                               return (-1);
-                       (void) strlcpy(propbuf, strval, proplen);
-                       break;
-
-               default:
-                       abort();
-               }
-       }
-
-       get_source(zhp, src, source, statbuf, statlen);
-
-       return (0);
-}
-
-/*
- * Utility function to get the given numeric property.  Does no validation that
- * the given property is the appropriate type; should only be used with
- * hard-coded property types.
- */
-uint64_t
-zfs_prop_get_int(zfs_handle_t *zhp, zfs_prop_t prop)
-{
-       char *source;
-       uint64_t val;
-
-       (void) get_numeric_property(zhp, prop, NULL, &source, &val);
-
-       return (val);
-}
-
-int
-zfs_prop_set_int(zfs_handle_t *zhp, zfs_prop_t prop, uint64_t val)
-{
-       char buf[64];
-
-       (void) snprintf(buf, sizeof (buf), "%llu", (longlong_t)val);
-       return (zfs_prop_set(zhp, zfs_prop_to_name(prop), buf));
-}
-
-/*
- * Similar to zfs_prop_get(), but returns the value as an integer.
- */
-int
-zfs_prop_get_numeric(zfs_handle_t *zhp, zfs_prop_t prop, uint64_t *value,
-    zprop_source_t *src, char *statbuf, size_t statlen)
-{
-       char *source;
-
-       /*
-        * Check to see if this property applies to our object
-        */
-       if (!zfs_prop_valid_for_type(prop, zhp->zfs_type, B_FALSE)) {
-               return (zfs_error_fmt(zhp->zfs_hdl, EZFS_PROPTYPE,
-                   dgettext(TEXT_DOMAIN, "cannot get property '%s'"),
-                   zfs_prop_to_name(prop)));
-       }
-
-       if (src)
-               *src = ZPROP_SRC_NONE;
-
-       if (get_numeric_property(zhp, prop, src, &source, value) != 0)
-               return (-1);
-
-       get_source(zhp, src, source, statbuf, statlen);
-
-       return (0);
-}
-
-#ifdef HAVE_IDMAP
-static int
-idmap_id_to_numeric_domain_rid(uid_t id, boolean_t isuser,
-    char **domainp, idmap_rid_t *ridp)
-{
-       idmap_get_handle_t *get_hdl = NULL;
-       idmap_stat status;
-       int err = EINVAL;
-
-       if (idmap_get_create(&get_hdl) != IDMAP_SUCCESS)
-               goto out;
-
-       if (isuser) {
-               err = idmap_get_sidbyuid(get_hdl, id,
-                   IDMAP_REQ_FLG_USE_CACHE, domainp, ridp, &status);
-       } else {
-               err = idmap_get_sidbygid(get_hdl, id,
-                   IDMAP_REQ_FLG_USE_CACHE, domainp, ridp, &status);
-       }
-       if (err == IDMAP_SUCCESS &&
-           idmap_get_mappings(get_hdl) == IDMAP_SUCCESS &&
-           status == IDMAP_SUCCESS)
-               err = 0;
-       else
-               err = EINVAL;
-out:
-       if (get_hdl)
-               idmap_get_destroy(get_hdl);
-       return (err);
-}
-#endif /* HAVE_IDMAP */
-
-/*
- * convert the propname into parameters needed by kernel
- * Eg: userquota@ahrens -> ZFS_PROP_USERQUOTA, "", 126829
- * Eg: userused@matt@domain -> ZFS_PROP_USERUSED, "S-1-123-456", 789
- * Eg: groupquota@staff -> ZFS_PROP_GROUPQUOTA, "", 1234
- * Eg: groupused@staff -> ZFS_PROP_GROUPUSED, "", 1234
- */
-static int
-userquota_propname_decode(const char *propname, boolean_t zoned,
-    zfs_userquota_prop_t *typep, char *domain, int domainlen, uint64_t *ridp)
-{
-       zfs_userquota_prop_t type;
-       char *cp;
-       boolean_t isuser;
-       boolean_t isgroup;
-       struct passwd *pw;
-       struct group *gr;
-
-       domain[0] = '\0';
-
-       /* Figure out the property type ({user|group}{quota|space}) */
-       for (type = 0; type < ZFS_NUM_USERQUOTA_PROPS; type++) {
-               if (strncmp(propname, zfs_userquota_prop_prefixes[type],
-                   strlen(zfs_userquota_prop_prefixes[type])) == 0)
-                       break;
-       }
-       if (type == ZFS_NUM_USERQUOTA_PROPS)
-               return (EINVAL);
-       *typep = type;
-
-       isuser = (type == ZFS_PROP_USERQUOTA || type == ZFS_PROP_USERUSED);
-       isgroup = (type == ZFS_PROP_GROUPQUOTA || type == ZFS_PROP_GROUPUSED);
-
-       cp = strchr(propname, '@') + 1;
-
-       if (isuser && (pw = getpwnam(cp)) != NULL) {
-               if (zoned && getzoneid() == GLOBAL_ZONEID)
-                       return (ENOENT);
-               *ridp = pw->pw_uid;
-       } else if (isgroup && (gr = getgrnam(cp)) != NULL) {
-               if (zoned && getzoneid() == GLOBAL_ZONEID)
-                       return (ENOENT);
-               *ridp = gr->gr_gid;
-       } else if (strchr(cp, '@')) {
-#ifdef HAVE_IDMAP
-               /*
-                * It's a SID name (eg "user@domain") that needs to be
-                * turned into S-1-domainID-RID.
-                */
-               directory_error_t e;
-               char *numericsid = NULL;
-               char *end;
-
-               if (zoned && getzoneid() == GLOBAL_ZONEID)
-                       return (ENOENT);
-               if (isuser) {
-                       e = directory_sid_from_user_name(NULL,
-                           cp, &numericsid);
-               } else {
-                       e = directory_sid_from_group_name(NULL,
-                           cp, &numericsid);
-               }
-               if (e != NULL) {
-                       directory_error_free(e);
-                       return (ENOENT);
-               }
-               if (numericsid == NULL)
-                       return (ENOENT);
-               cp = numericsid;
-               (void) strlcpy(domain, cp, domainlen);
-               cp = strrchr(domain, '-');
-               *cp = '\0';
-               cp++;
-
-               errno = 0;
-               *ridp = strtoull(cp, &end, 10);
-               free(numericsid);
-
-               if (errno != 0 || *end != '\0')
-                       return (EINVAL);
-#else
-               return (ENOSYS);
-#endif /* HAVE_IDMAP */
-       } else {
-               /* It's a user/group ID (eg "12345"). */
-               uid_t id;
-               char *end;
-               id = strtoul(cp, &end, 10);
-               if (*end != '\0')
-                       return (EINVAL);
-               if (id > MAXUID) {
-#ifdef HAVE_IDMAP
-                       /* It's an ephemeral ID. */
-                       idmap_rid_t rid;
-                       char *mapdomain;
-
-                       if (idmap_id_to_numeric_domain_rid(id, isuser,
-                           &mapdomain, &rid) != 0)
-                               return (ENOENT);
-                       (void) strlcpy(domain, mapdomain, domainlen);
-                       *ridp = rid;
-#else
-                       return (ENOSYS);
-#endif /* HAVE_IDMAP */
-               } else {
-                       *ridp = id;
-               }
-       }
-
-       return (0);
-}
-
-static int
-zfs_prop_get_userquota_common(zfs_handle_t *zhp, const char *propname,
-    uint64_t *propvalue, zfs_userquota_prop_t *typep)
-{
-       int err;
-       zfs_cmd_t zc = {"\0"};
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       err = userquota_propname_decode(propname,
-           zfs_prop_get_int(zhp, ZFS_PROP_ZONED),
-           typep, zc.zc_value, sizeof (zc.zc_value), &zc.zc_guid);
-       zc.zc_objset_type = *typep;
-       if (err)
-               return (err);
-
-       err = ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_USERSPACE_ONE, &zc);
-       if (err)
-               return (err);
-
-       *propvalue = zc.zc_cookie;
-       return (0);
-}
-
-int
-zfs_prop_get_userquota_int(zfs_handle_t *zhp, const char *propname,
-    uint64_t *propvalue)
-{
-       zfs_userquota_prop_t type;
-
-       return (zfs_prop_get_userquota_common(zhp, propname, propvalue,
-           &type));
-}
-
-int
-zfs_prop_get_userquota(zfs_handle_t *zhp, const char *propname,
-    char *propbuf, int proplen, boolean_t literal)
-{
-       int err;
-       uint64_t propvalue;
-       zfs_userquota_prop_t type;
-
-       err = zfs_prop_get_userquota_common(zhp, propname, &propvalue,
-           &type);
-
-       if (err)
-               return (err);
-
-       if (literal) {
-               (void) snprintf(propbuf, proplen, "%llu",
-                   (u_longlong_t)propvalue);
-       } else if (propvalue == 0 &&
-           (type == ZFS_PROP_USERQUOTA || type == ZFS_PROP_GROUPQUOTA)) {
-               (void) strlcpy(propbuf, "none", proplen);
-       } else {
-               zfs_nicenum(propvalue, propbuf, proplen);
-       }
-       return (0);
-}
-
-int
-zfs_prop_get_written_int(zfs_handle_t *zhp, const char *propname,
-    uint64_t *propvalue)
-{
-       int err;
-       zfs_cmd_t zc = {"\0"};
-       const char *snapname;
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       snapname = strchr(propname, '@') + 1;
-       if (strchr(snapname, '@')) {
-               (void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
-       } else {
-               /* snapname is the short name, append it to zhp's fsname */
-               char *cp;
-
-               (void) strlcpy(zc.zc_value, zhp->zfs_name,
-                   sizeof (zc.zc_value));
-               cp = strchr(zc.zc_value, '@');
-               if (cp != NULL)
-                       *cp = '\0';
-               (void) strlcat(zc.zc_value, "@", sizeof (zc.zc_value));
-               (void) strlcat(zc.zc_value, snapname, sizeof (zc.zc_value));
-       }
-
-       err = ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_SPACE_WRITTEN, &zc);
-       if (err)
-               return (err);
-
-       *propvalue = zc.zc_cookie;
-       return (0);
-}
-
-int
-zfs_prop_get_written(zfs_handle_t *zhp, const char *propname,
-    char *propbuf, int proplen, boolean_t literal)
-{
-       int err;
-       uint64_t propvalue;
-
-       err = zfs_prop_get_written_int(zhp, propname, &propvalue);
-
-       if (err)
-               return (err);
-
-       if (literal) {
-               (void) snprintf(propbuf, proplen, "%llu",
-                   (u_longlong_t)propvalue);
-       } else {
-               zfs_nicenum(propvalue, propbuf, proplen);
-       }
-
-       return (0);
-}
-
-/*
- * Returns the name of the given zfs handle.
- */
-const char *
-zfs_get_name(const zfs_handle_t *zhp)
-{
-       return (zhp->zfs_name);
-}
-
-/*
- * Returns the type of the given zfs handle.
- */
-zfs_type_t
-zfs_get_type(const zfs_handle_t *zhp)
-{
-       return (zhp->zfs_type);
-}
-
-/*
- * Is one dataset name a child dataset of another?
- *
- * Needs to handle these cases:
- * Dataset 1   "a/foo"         "a/foo"         "a/foo"         "a/foo"
- * Dataset 2   "a/fo"          "a/foobar"      "a/bar/baz"     "a/foo/bar"
- * Descendant? No.             No.             No.             Yes.
- */
-static boolean_t
-is_descendant(const char *ds1, const char *ds2)
-{
-       size_t d1len = strlen(ds1);
-
-       /* ds2 can't be a descendant if it's smaller */
-       if (strlen(ds2) < d1len)
-               return (B_FALSE);
-
-       /* otherwise, compare strings and verify that there's a '/' char */
-       return (ds2[d1len] == '/' && (strncmp(ds1, ds2, d1len) == 0));
-}
-
-/*
- * Given a complete name, return just the portion that refers to the parent.
- * Will return -1 if there is no parent (path is just the name of the
- * pool).
- */
-static int
-parent_name(const char *path, char *buf, size_t buflen)
-{
-       char *slashp;
-
-       (void) strlcpy(buf, path, buflen);
-
-       if ((slashp = strrchr(buf, '/')) == NULL)
-               return (-1);
-       *slashp = '\0';
-
-       return (0);
-}
-
-/*
- * If accept_ancestor is false, then check to make sure that the given path has
- * a parent, and that it exists.  If accept_ancestor is true, then find the
- * closest existing ancestor for the given path.  In prefixlen return the
- * length of already existing prefix of the given path.  We also fetch the
- * 'zoned' property, which is used to validate property settings when creating
- * new datasets.
- */
-static int
-check_parents(libzfs_handle_t *hdl, const char *path, uint64_t *zoned,
-    boolean_t accept_ancestor, int *prefixlen)
-{
-       zfs_cmd_t zc = {"\0"};
-       char parent[ZFS_MAXNAMELEN];
-       char *slash;
-       zfs_handle_t *zhp;
-       char errbuf[1024];
-       uint64_t is_zoned;
-
-       (void) snprintf(errbuf, sizeof (errbuf),
-           dgettext(TEXT_DOMAIN, "cannot create '%s'"), path);
-
-       /* get parent, and check to see if this is just a pool */
-       if (parent_name(path, parent, sizeof (parent)) != 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "missing dataset name"));
-               return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-       }
-
-       /* check to see if the pool exists */
-       if ((slash = strchr(parent, '/')) == NULL)
-               slash = parent + strlen(parent);
-       (void) strncpy(zc.zc_name, parent, slash - parent);
-       zc.zc_name[slash - parent] = '\0';
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0 &&
-           errno == ENOENT) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "no such pool '%s'"), zc.zc_name);
-               return (zfs_error(hdl, EZFS_NOENT, errbuf));
-       }
-
-       /* check to see if the parent dataset exists */
-       while ((zhp = make_dataset_handle(hdl, parent)) == NULL) {
-               if (errno == ENOENT && accept_ancestor) {
-                       /*
-                        * Go deeper to find an ancestor, give up on top level.
-                        */
-                       if (parent_name(parent, parent, sizeof (parent)) != 0) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "no such pool '%s'"), zc.zc_name);
-                               return (zfs_error(hdl, EZFS_NOENT, errbuf));
-                       }
-               } else if (errno == ENOENT) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "parent does not exist"));
-                       return (zfs_error(hdl, EZFS_NOENT, errbuf));
-               } else
-                       return (zfs_standard_error(hdl, errno, errbuf));
-       }
-
-       is_zoned = zfs_prop_get_int(zhp, ZFS_PROP_ZONED);
-       if (zoned != NULL)
-               *zoned = is_zoned;
-
-       /* we are in a non-global zone, but parent is in the global zone */
-       if (getzoneid() != GLOBAL_ZONEID && !is_zoned) {
-               (void) zfs_standard_error(hdl, EPERM, errbuf);
-               zfs_close(zhp);
-               return (-1);
-       }
-
-       /* make sure parent is a filesystem */
-       if (zfs_get_type(zhp) != ZFS_TYPE_FILESYSTEM) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "parent is not a filesystem"));
-               (void) zfs_error(hdl, EZFS_BADTYPE, errbuf);
-               zfs_close(zhp);
-               return (-1);
-       }
-
-       zfs_close(zhp);
-       if (prefixlen != NULL)
-               *prefixlen = strlen(parent);
-       return (0);
-}
-
-/*
- * Finds whether the dataset of the given type(s) exists.
- */
-boolean_t
-zfs_dataset_exists(libzfs_handle_t *hdl, const char *path, zfs_type_t types)
-{
-       zfs_handle_t *zhp;
-
-       if (!zfs_validate_name(hdl, path, types, B_FALSE))
-               return (B_FALSE);
-
-       /*
-        * Try to get stats for the dataset, which will tell us if it exists.
-        */
-       if ((zhp = make_dataset_handle(hdl, path)) != NULL) {
-               int ds_type = zhp->zfs_type;
-
-               zfs_close(zhp);
-               if (types & ds_type)
-                       return (B_TRUE);
-       }
-       return (B_FALSE);
-}
-
-/*
- * Given a path to 'target', create all the ancestors between
- * the prefixlen portion of the path, and the target itself.
- * Fail if the initial prefixlen-ancestor does not already exist.
- */
-int
-create_parents(libzfs_handle_t *hdl, char *target, int prefixlen)
-{
-       zfs_handle_t *h;
-       char *cp;
-       const char *opname;
-
-       /* make sure prefix exists */
-       cp = target + prefixlen;
-       if (*cp != '/') {
-               assert(strchr(cp, '/') == NULL);
-               h = zfs_open(hdl, target, ZFS_TYPE_FILESYSTEM);
-       } else {
-               *cp = '\0';
-               h = zfs_open(hdl, target, ZFS_TYPE_FILESYSTEM);
-               *cp = '/';
-       }
-       if (h == NULL)
-               return (-1);
-       zfs_close(h);
-
-       /*
-        * Attempt to create, mount, and share any ancestor filesystems,
-        * up to the prefixlen-long one.
-        */
-       for (cp = target + prefixlen + 1;
-           (cp = strchr(cp, '/')); *cp = '/', cp++) {
-
-               *cp = '\0';
-
-               h = make_dataset_handle(hdl, target);
-               if (h) {
-                       /* it already exists, nothing to do here */
-                       zfs_close(h);
-                       continue;
-               }
-
-               if (zfs_create(hdl, target, ZFS_TYPE_FILESYSTEM,
-                   NULL) != 0) {
-                       opname = dgettext(TEXT_DOMAIN, "create");
-                       goto ancestorerr;
-               }
-
-               h = zfs_open(hdl, target, ZFS_TYPE_FILESYSTEM);
-               if (h == NULL) {
-                       opname = dgettext(TEXT_DOMAIN, "open");
-                       goto ancestorerr;
-               }
-
-               if (zfs_mount(h, NULL, 0) != 0) {
-                       opname = dgettext(TEXT_DOMAIN, "mount");
-                       goto ancestorerr;
-               }
-
-               if (zfs_share(h) != 0) {
-                       opname = dgettext(TEXT_DOMAIN, "share");
-                       goto ancestorerr;
-               }
-
-               zfs_close(h);
-       }
-
-       return (0);
-
-ancestorerr:
-       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-           "failed to %s ancestor '%s'"), opname, target);
-       return (-1);
-}
-
-/*
- * Creates non-existing ancestors of the given path.
- */
-int
-zfs_create_ancestors(libzfs_handle_t *hdl, const char *path)
-{
-       int prefix;
-       char *path_copy;
-       int rc = 0;
-
-       if (check_parents(hdl, path, NULL, B_TRUE, &prefix) != 0)
-               return (-1);
-
-       if ((path_copy = strdup(path)) != NULL) {
-               rc = create_parents(hdl, path_copy, prefix);
-               free(path_copy);
-       }
-       if (path_copy == NULL || rc != 0)
-               return (-1);
-
-       return (0);
-}
-
-/*
- * Create a new filesystem or volume.
- */
-int
-zfs_create(libzfs_handle_t *hdl, const char *path, zfs_type_t type,
-    nvlist_t *props)
-{
-       int ret;
-       uint64_t size = 0;
-       uint64_t blocksize = zfs_prop_default_numeric(ZFS_PROP_VOLBLOCKSIZE);
-       char errbuf[1024];
-       uint64_t zoned;
-       dmu_objset_type_t ost;
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot create '%s'"), path);
-
-       /* validate the path, taking care to note the extended error message */
-       if (!zfs_validate_name(hdl, path, type, B_TRUE))
-               return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-
-       /* validate parents exist */
-       if (check_parents(hdl, path, &zoned, B_FALSE, NULL) != 0)
-               return (-1);
-
-       /*
-        * The failure modes when creating a dataset of a different type over
-        * one that already exists is a little strange.  In particular, if you
-        * try to create a dataset on top of an existing dataset, the ioctl()
-        * will return ENOENT, not EEXIST.  To prevent this from happening, we
-        * first try to see if the dataset exists.
-        */
-       if (zfs_dataset_exists(hdl, path, ZFS_TYPE_DATASET)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "dataset already exists"));
-               return (zfs_error(hdl, EZFS_EXISTS, errbuf));
-       }
-
-       if (type == ZFS_TYPE_VOLUME)
-               ost = DMU_OST_ZVOL;
-       else
-               ost = DMU_OST_ZFS;
-
-       if (props && (props = zfs_valid_proplist(hdl, type, props,
-           zoned, NULL, errbuf)) == 0)
-               return (-1);
-
-       if (type == ZFS_TYPE_VOLUME) {
-               /*
-                * If we are creating a volume, the size and block size must
-                * satisfy a few restraints.  First, the blocksize must be a
-                * valid block size between SPA_{MIN,MAX}BLOCKSIZE.  Second, the
-                * volsize must be a multiple of the block size, and cannot be
-                * zero.
-                */
-               if (props == NULL || nvlist_lookup_uint64(props,
-                   zfs_prop_to_name(ZFS_PROP_VOLSIZE), &size) != 0) {
-                       nvlist_free(props);
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "missing volume size"));
-                       return (zfs_error(hdl, EZFS_BADPROP, errbuf));
-               }
-
-               if ((ret = nvlist_lookup_uint64(props,
-                   zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE),
-                   &blocksize)) != 0) {
-                       if (ret == ENOENT) {
-                               blocksize = zfs_prop_default_numeric(
-                                   ZFS_PROP_VOLBLOCKSIZE);
-                       } else {
-                               nvlist_free(props);
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "missing volume block size"));
-                               return (zfs_error(hdl, EZFS_BADPROP, errbuf));
-                       }
-               }
-
-               if (size == 0) {
-                       nvlist_free(props);
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "volume size cannot be zero"));
-                       return (zfs_error(hdl, EZFS_BADPROP, errbuf));
-               }
-
-               if (size % blocksize != 0) {
-                       nvlist_free(props);
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "volume size must be a multiple of volume block "
-                           "size"));
-                       return (zfs_error(hdl, EZFS_BADPROP, errbuf));
-               }
-       }
-
-       /* create the dataset */
-       ret = lzc_create(path, ost, props);
-       nvlist_free(props);
-
-       /* check for failure */
-       if (ret != 0) {
-               char parent[ZFS_MAXNAMELEN];
-               char buf[64];
-
-               (void) parent_name(path, parent, sizeof (parent));
-
-               switch (errno) {
-               case ENOENT:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "no such parent '%s'"), parent);
-                       return (zfs_error(hdl, EZFS_NOENT, errbuf));
-
-               case EINVAL:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "parent '%s' is not a filesystem"), parent);
-                       return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
-
-               case EDOM:
-                       zfs_nicenum(SPA_MAXBLOCKSIZE, buf, sizeof (buf));
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "volume block size must be power of 2 from "
-                           "512B to %s"), buf);
-
-                       return (zfs_error(hdl, EZFS_BADPROP, errbuf));
-
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded to set this "
-                           "property or value"));
-                       return (zfs_error(hdl, EZFS_BADVERSION, errbuf));
-#ifdef _ILP32
-               case EOVERFLOW:
-                       /*
-                        * This platform can't address a volume this big.
-                        */
-                       if (type == ZFS_TYPE_VOLUME)
-                               return (zfs_error(hdl, EZFS_VOLTOOBIG,
-                                   errbuf));
-#endif
-                       /* FALLTHROUGH */
-               default:
-                       return (zfs_standard_error(hdl, errno, errbuf));
-               }
-       }
-
-       return (0);
-}
-
-/*
- * Destroys the given dataset.  The caller must make sure that the filesystem
- * isn't mounted, and that there are no active dependents. If the file system
- * does not exist this function does nothing.
- */
-int
-zfs_destroy(zfs_handle_t *zhp, boolean_t defer)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       if (zhp->zfs_type == ZFS_TYPE_BOOKMARK) {
-               nvlist_t *nv = fnvlist_alloc();
-               fnvlist_add_boolean(nv, zhp->zfs_name);
-               int error = lzc_destroy_bookmarks(nv, NULL);
-               fnvlist_free(nv);
-               if (error != 0) {
-                       return (zfs_standard_error_fmt(zhp->zfs_hdl, errno,
-                           dgettext(TEXT_DOMAIN, "cannot destroy '%s'"),
-                           zhp->zfs_name));
-               }
-               return (0);
-       }
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       if (ZFS_IS_VOLUME(zhp)) {
-               zc.zc_objset_type = DMU_OST_ZVOL;
-       } else {
-               zc.zc_objset_type = DMU_OST_ZFS;
-       }
-
-       zc.zc_defer_destroy = defer;
-       if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_DESTROY, &zc) != 0 &&
-           errno != ENOENT) {
-               return (zfs_standard_error_fmt(zhp->zfs_hdl, errno,
-                   dgettext(TEXT_DOMAIN, "cannot destroy '%s'"),
-                   zhp->zfs_name));
-       }
-
-       remove_mountpoint(zhp);
-
-       return (0);
-}
-
-struct destroydata {
-       nvlist_t *nvl;
-       const char *snapname;
-};
-
-static int
-zfs_check_snap_cb(zfs_handle_t *zhp, void *arg)
-{
-       struct destroydata *dd = arg;
-       char name[ZFS_MAXNAMELEN];
-       int rv = 0;
-
-       (void) snprintf(name, sizeof (name),
-           "%s@%s", zhp->zfs_name, dd->snapname);
-
-       if (lzc_exists(name))
-               verify(nvlist_add_boolean(dd->nvl, name) == 0);
-
-       rv = zfs_iter_filesystems(zhp, zfs_check_snap_cb, dd);
-       zfs_close(zhp);
-       return (rv);
-}
-
-/*
- * Destroys all snapshots with the given name in zhp & descendants.
- */
-int
-zfs_destroy_snaps(zfs_handle_t *zhp, char *snapname, boolean_t defer)
-{
-       int ret;
-       struct destroydata dd = { 0 };
-
-       dd.snapname = snapname;
-       verify(nvlist_alloc(&dd.nvl, NV_UNIQUE_NAME, 0) == 0);
-       (void) zfs_check_snap_cb(zfs_handle_dup(zhp), &dd);
-
-       if (nvlist_empty(dd.nvl)) {
-               ret = zfs_standard_error_fmt(zhp->zfs_hdl, ENOENT,
-                   dgettext(TEXT_DOMAIN, "cannot destroy '%s@%s'"),
-                   zhp->zfs_name, snapname);
-       } else {
-               ret = zfs_destroy_snaps_nvl(zhp->zfs_hdl, dd.nvl, defer);
-       }
-       nvlist_free(dd.nvl);
-       return (ret);
-}
-
-/*
- * Destroys all the snapshots named in the nvlist.
- */
-int
-zfs_destroy_snaps_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, boolean_t defer)
-{
-       int ret;
-       nvlist_t *errlist;
-       nvpair_t *pair;
-
-       ret = lzc_destroy_snaps(snaps, defer, &errlist);
-
-       if (ret == 0)
-               return (0);
-
-       if (nvlist_empty(errlist)) {
-               char errbuf[1024];
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN, "cannot destroy snapshots"));
-
-               ret = zfs_standard_error(hdl, ret, errbuf);
-       }
-       for (pair = nvlist_next_nvpair(errlist, NULL);
-           pair != NULL; pair = nvlist_next_nvpair(errlist, pair)) {
-               char errbuf[1024];
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN, "cannot destroy snapshot %s"),
-                   nvpair_name(pair));
-
-               switch (fnvpair_value_int32(pair)) {
-               case EEXIST:
-                       zfs_error_aux(hdl,
-                           dgettext(TEXT_DOMAIN, "snapshot is cloned"));
-                       ret = zfs_error(hdl, EZFS_EXISTS, errbuf);
-                       break;
-               default:
-                       ret = zfs_standard_error(hdl, errno, errbuf);
-                       break;
-               }
-       }
-
-       return (ret);
-}
-
-/*
- * Clones the given dataset.  The target must be of the same type as the source.
- */
-int
-zfs_clone(zfs_handle_t *zhp, const char *target, nvlist_t *props)
-{
-       char parent[ZFS_MAXNAMELEN];
-       int ret;
-       char errbuf[1024];
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       uint64_t zoned;
-
-       assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot create '%s'"), target);
-
-       /* validate the target/clone name */
-       if (!zfs_validate_name(hdl, target, ZFS_TYPE_FILESYSTEM, B_TRUE))
-               return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-
-       /* validate parents exist */
-       if (check_parents(hdl, target, &zoned, B_FALSE, NULL) != 0)
-               return (-1);
-
-       (void) parent_name(target, parent, sizeof (parent));
-
-       /* do the clone */
-
-       if (props) {
-               zfs_type_t type;
-               if (ZFS_IS_VOLUME(zhp)) {
-                       type = ZFS_TYPE_VOLUME;
-               } else {
-                       type = ZFS_TYPE_FILESYSTEM;
-               }
-               if ((props = zfs_valid_proplist(hdl, type, props, zoned,
-                   zhp, errbuf)) == NULL)
-                       return (-1);
-       }
-
-       ret = lzc_clone(target, zhp->zfs_name, props);
-       nvlist_free(props);
-
-       if (ret != 0) {
-               switch (errno) {
-
-               case ENOENT:
-                       /*
-                        * The parent doesn't exist.  We should have caught this
-                        * above, but there may a race condition that has since
-                        * destroyed the parent.
-                        *
-                        * At this point, we don't know whether it's the source
-                        * that doesn't exist anymore, or whether the target
-                        * dataset doesn't exist.
-                        */
-                       zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
-                           "no such parent '%s'"), parent);
-                       return (zfs_error(zhp->zfs_hdl, EZFS_NOENT, errbuf));
-
-               case EXDEV:
-                       zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
-                           "source and target pools differ"));
-                       return (zfs_error(zhp->zfs_hdl, EZFS_CROSSTARGET,
-                           errbuf));
-
-               default:
-                       return (zfs_standard_error(zhp->zfs_hdl, errno,
-                           errbuf));
-               }
-       }
-
-       return (ret);
-}
-
-/*
- * Promotes the given clone fs to be the clone parent.
- */
-int
-zfs_promote(zfs_handle_t *zhp)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       zfs_cmd_t zc = {"\0"};
-       char parent[MAXPATHLEN];
-       int ret;
-       char errbuf[1024];
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot promote '%s'"), zhp->zfs_name);
-
-       if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "snapshots can not be promoted"));
-               return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
-       }
-
-       (void) strlcpy(parent, zhp->zfs_dmustats.dds_origin, sizeof (parent));
-       if (parent[0] == '\0') {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "not a cloned filesystem"));
-               return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
-       }
-
-       (void) strlcpy(zc.zc_value, zhp->zfs_dmustats.dds_origin,
-           sizeof (zc.zc_value));
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-       ret = zfs_ioctl(hdl, ZFS_IOC_PROMOTE, &zc);
-
-       if (ret != 0) {
-               int save_errno = errno;
-
-               switch (save_errno) {
-               case EEXIST:
-                       /* There is a conflicting snapshot name. */
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "conflicting snapshot '%s' from parent '%s'"),
-                           zc.zc_string, parent);
-                       return (zfs_error(hdl, EZFS_EXISTS, errbuf));
-
-               default:
-                       return (zfs_standard_error(hdl, save_errno, errbuf));
-               }
-       }
-       return (ret);
-}
-
-typedef struct snapdata {
-       nvlist_t *sd_nvl;
-       const char *sd_snapname;
-} snapdata_t;
-
-static int
-zfs_snapshot_cb(zfs_handle_t *zhp, void *arg)
-{
-       snapdata_t *sd = arg;
-       char name[ZFS_MAXNAMELEN];
-       int rv = 0;
-
-       if (zfs_prop_get_int(zhp, ZFS_PROP_INCONSISTENT) == 0) {
-               (void) snprintf(name, sizeof (name),
-                   "%s@%s", zfs_get_name(zhp), sd->sd_snapname);
-
-               fnvlist_add_boolean(sd->sd_nvl, name);
-
-               rv = zfs_iter_filesystems(zhp, zfs_snapshot_cb, sd);
-       }
-       zfs_close(zhp);
-
-       return (rv);
-}
-
-/*
- * Creates snapshots.  The keys in the snaps nvlist are the snapshots to be
- * created.
- */
-int
-zfs_snapshot_nvl(libzfs_handle_t *hdl, nvlist_t *snaps, nvlist_t *props)
-{
-       int ret;
-       char errbuf[1024];
-       nvpair_t *elem;
-       nvlist_t *errors;
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot create snapshots "));
-
-       elem = NULL;
-       while ((elem = nvlist_next_nvpair(snaps, elem)) != NULL) {
-               const char *snapname = nvpair_name(elem);
-
-               /* validate the target name */
-               if (!zfs_validate_name(hdl, snapname, ZFS_TYPE_SNAPSHOT,
-                   B_TRUE)) {
-                       (void) snprintf(errbuf, sizeof (errbuf),
-                           dgettext(TEXT_DOMAIN,
-                           "cannot create snapshot '%s'"), snapname);
-                       return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-               }
-       }
-
-       if (props != NULL &&
-           (props = zfs_valid_proplist(hdl, ZFS_TYPE_SNAPSHOT,
-           props, B_FALSE, NULL, errbuf)) == NULL) {
-               return (-1);
-       }
-
-       ret = lzc_snapshot(snaps, props, &errors);
-
-       if (ret != 0) {
-               boolean_t printed = B_FALSE;
-               for (elem = nvlist_next_nvpair(errors, NULL);
-                   elem != NULL;
-                   elem = nvlist_next_nvpair(errors, elem)) {
-                       (void) snprintf(errbuf, sizeof (errbuf),
-                           dgettext(TEXT_DOMAIN,
-                           "cannot create snapshot '%s'"), nvpair_name(elem));
-                       (void) zfs_standard_error(hdl,
-                           fnvpair_value_int32(elem), errbuf);
-                       printed = B_TRUE;
-               }
-               if (!printed) {
-                       switch (ret) {
-                       case EXDEV:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "multiple snapshots of same "
-                                   "fs not allowed"));
-                               (void) zfs_error(hdl, EZFS_EXISTS, errbuf);
-
-                               break;
-                       default:
-                               (void) zfs_standard_error(hdl, ret, errbuf);
-                       }
-               }
-       }
-
-       nvlist_free(props);
-       nvlist_free(errors);
-       return (ret);
-}
-
-int
-zfs_snapshot(libzfs_handle_t *hdl, const char *path, boolean_t recursive,
-    nvlist_t *props)
-{
-       int ret;
-       snapdata_t sd = { 0 };
-       char fsname[ZFS_MAXNAMELEN];
-       char *cp;
-       zfs_handle_t *zhp;
-       char errbuf[1024];
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot snapshot %s"), path);
-
-       if (!zfs_validate_name(hdl, path, ZFS_TYPE_SNAPSHOT, B_TRUE))
-               return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-
-       (void) strlcpy(fsname, path, sizeof (fsname));
-       cp = strchr(fsname, '@');
-       *cp = '\0';
-       sd.sd_snapname = cp + 1;
-
-       if ((zhp = zfs_open(hdl, fsname, ZFS_TYPE_FILESYSTEM |
-           ZFS_TYPE_VOLUME)) == NULL) {
-               return (-1);
-       }
-
-       verify(nvlist_alloc(&sd.sd_nvl, NV_UNIQUE_NAME, 0) == 0);
-       if (recursive) {
-               (void) zfs_snapshot_cb(zfs_handle_dup(zhp), &sd);
-       } else {
-               fnvlist_add_boolean(sd.sd_nvl, path);
-       }
-
-       ret = zfs_snapshot_nvl(hdl, sd.sd_nvl, props);
-       nvlist_free(sd.sd_nvl);
-       zfs_close(zhp);
-       return (ret);
-}
-
-/*
- * Destroy any more recent snapshots.  We invoke this callback on any dependents
- * of the snapshot first.  If the 'cb_dependent' member is non-zero, then this
- * is a dependent and we should just destroy it without checking the transaction
- * group.
- */
-typedef struct rollback_data {
-       const char      *cb_target;             /* the snapshot */
-       uint64_t        cb_create;              /* creation time reference */
-       boolean_t       cb_error;
-       boolean_t       cb_force;
-} rollback_data_t;
-
-static int
-rollback_destroy_dependent(zfs_handle_t *zhp, void *data)
-{
-       rollback_data_t *cbp = data;
-       prop_changelist_t *clp;
-
-       /* We must destroy this clone; first unmount it */
-       clp = changelist_gather(zhp, ZFS_PROP_NAME, 0,
-           cbp->cb_force ? MS_FORCE: 0);
-       if (clp == NULL || changelist_prefix(clp) != 0) {
-               cbp->cb_error = B_TRUE;
-               zfs_close(zhp);
-               return (0);
-       }
-       if (zfs_destroy(zhp, B_FALSE) != 0)
-               cbp->cb_error = B_TRUE;
-       else
-               changelist_remove(clp, zhp->zfs_name);
-       (void) changelist_postfix(clp);
-       changelist_free(clp);
-
-       zfs_close(zhp);
-       return (0);
-}
-
-static int
-rollback_destroy(zfs_handle_t *zhp, void *data)
-{
-       rollback_data_t *cbp = data;
-
-       if (zfs_prop_get_int(zhp, ZFS_PROP_CREATETXG) > cbp->cb_create) {
-               cbp->cb_error |= zfs_iter_dependents(zhp, B_FALSE,
-                   rollback_destroy_dependent, cbp);
-
-               cbp->cb_error |= zfs_destroy(zhp, B_FALSE);
-       }
-
-       zfs_close(zhp);
-       return (0);
-}
-
-/*
- * Given a dataset, rollback to a specific snapshot, discarding any
- * data changes since then and making it the active dataset.
- *
- * Any snapshots and bookmarks more recent than the target are
- * destroyed, along with their dependents (i.e. clones).
- */
-int
-zfs_rollback(zfs_handle_t *zhp, zfs_handle_t *snap, boolean_t force)
-{
-       rollback_data_t cb = { 0 };
-       int err;
-       boolean_t restore_resv = 0;
-       uint64_t old_volsize = 0, new_volsize;
-       zfs_prop_t resv_prop = { 0 };
-
-       assert(zhp->zfs_type == ZFS_TYPE_FILESYSTEM ||
-           zhp->zfs_type == ZFS_TYPE_VOLUME);
-
-       /*
-        * Destroy all recent snapshots and their dependents.
-        */
-       cb.cb_force = force;
-       cb.cb_target = snap->zfs_name;
-       cb.cb_create = zfs_prop_get_int(snap, ZFS_PROP_CREATETXG);
-       (void) zfs_iter_snapshots(zhp, B_FALSE, rollback_destroy, &cb);
-       (void) zfs_iter_bookmarks(zhp, rollback_destroy, &cb);
-
-       if (cb.cb_error)
-               return (-1);
-
-       /*
-        * Now that we have verified that the snapshot is the latest,
-        * rollback to the given snapshot.
-        */
-
-       if (zhp->zfs_type == ZFS_TYPE_VOLUME) {
-               if (zfs_which_resv_prop(zhp, &resv_prop) < 0)
-                       return (-1);
-               old_volsize = zfs_prop_get_int(zhp, ZFS_PROP_VOLSIZE);
-               restore_resv =
-                   (old_volsize == zfs_prop_get_int(zhp, resv_prop));
-       }
-
-       /*
-        * We rely on zfs_iter_children() to verify that there are no
-        * newer snapshots for the given dataset.  Therefore, we can
-        * simply pass the name on to the ioctl() call.  There is still
-        * an unlikely race condition where the user has taken a
-        * snapshot since we verified that this was the most recent.
-        */
-       err = lzc_rollback(zhp->zfs_name, NULL, 0);
-       if (err != 0) {
-               (void) zfs_standard_error_fmt(zhp->zfs_hdl, errno,
-                   dgettext(TEXT_DOMAIN, "cannot rollback '%s'"),
-                   zhp->zfs_name);
-               return (err);
-       }
-
-       /*
-        * For volumes, if the pre-rollback volsize matched the pre-
-        * rollback reservation and the volsize has changed then set
-        * the reservation property to the post-rollback volsize.
-        * Make a new handle since the rollback closed the dataset.
-        */
-       if ((zhp->zfs_type == ZFS_TYPE_VOLUME) &&
-           (zhp = make_dataset_handle(zhp->zfs_hdl, zhp->zfs_name))) {
-               if (restore_resv) {
-                       new_volsize = zfs_prop_get_int(zhp, ZFS_PROP_VOLSIZE);
-                       if (old_volsize != new_volsize)
-                               err = zfs_prop_set_int(zhp, resv_prop,
-                                   new_volsize);
-               }
-               zfs_close(zhp);
-       }
-       return (err);
-}
-
-/*
- * Renames the given dataset.
- */
-int
-zfs_rename(zfs_handle_t *zhp, const char *target, boolean_t recursive,
-    boolean_t force_unmount)
-{
-       int ret;
-       zfs_cmd_t zc = {"\0"};
-       char *delim;
-       prop_changelist_t *cl = NULL;
-       zfs_handle_t *zhrp = NULL;
-       char *parentname = NULL;
-       char parent[ZFS_MAXNAMELEN];
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       char errbuf[1024];
-
-       /* if we have the same exact name, just return success */
-       if (strcmp(zhp->zfs_name, target) == 0)
-               return (0);
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot rename to '%s'"), target);
-
-       /*
-        * Make sure the target name is valid
-        */
-       if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
-               if ((strchr(target, '@') == NULL) ||
-                   *target == '@') {
-                       /*
-                        * Snapshot target name is abbreviated,
-                        * reconstruct full dataset name
-                        */
-                       (void) strlcpy(parent, zhp->zfs_name,
-                           sizeof (parent));
-                       delim = strchr(parent, '@');
-                       if (strchr(target, '@') == NULL)
-                               *(++delim) = '\0';
-                       else
-                               *delim = '\0';
-                       (void) strlcat(parent, target, sizeof (parent));
-                       target = parent;
-               } else {
-                       /*
-                        * Make sure we're renaming within the same dataset.
-                        */
-                       delim = strchr(target, '@');
-                       if (strncmp(zhp->zfs_name, target, delim - target)
-                           != 0 || zhp->zfs_name[delim - target] != '@') {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "snapshots must be part of same "
-                                   "dataset"));
-                               return (zfs_error(hdl, EZFS_CROSSTARGET,
-                                   errbuf));
-                       }
-               }
-               if (!zfs_validate_name(hdl, target, zhp->zfs_type, B_TRUE))
-                       return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-       } else {
-               if (recursive) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "recursive rename must be a snapshot"));
-                       return (zfs_error(hdl, EZFS_BADTYPE, errbuf));
-               }
-
-               if (!zfs_validate_name(hdl, target, zhp->zfs_type, B_TRUE))
-                       return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-
-               /* validate parents */
-               if (check_parents(hdl, target, NULL, B_FALSE, NULL) != 0)
-                       return (-1);
-
-               /* make sure we're in the same pool */
-               verify((delim = strchr(target, '/')) != NULL);
-               if (strncmp(zhp->zfs_name, target, delim - target) != 0 ||
-                   zhp->zfs_name[delim - target] != '/') {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "datasets must be within same pool"));
-                       return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf));
-               }
-
-               /* new name cannot be a child of the current dataset name */
-               if (is_descendant(zhp->zfs_name, target)) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "New dataset name cannot be a descendant of "
-                           "current dataset name"));
-                       return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-               }
-       }
-
-       (void) snprintf(errbuf, sizeof (errbuf),
-           dgettext(TEXT_DOMAIN, "cannot rename '%s'"), zhp->zfs_name);
-
-       if (getzoneid() == GLOBAL_ZONEID &&
-           zfs_prop_get_int(zhp, ZFS_PROP_ZONED)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "dataset is used in a non-global zone"));
-               return (zfs_error(hdl, EZFS_ZONED, errbuf));
-       }
-
-       if (recursive) {
-
-               parentname = zfs_strdup(zhp->zfs_hdl, zhp->zfs_name);
-               if (parentname == NULL) {
-                       ret = -1;
-                       goto error;
-               }
-               delim = strchr(parentname, '@');
-               *delim = '\0';
-               zhrp = zfs_open(zhp->zfs_hdl, parentname, ZFS_TYPE_DATASET);
-               if (zhrp == NULL) {
-                       ret = -1;
-                       goto error;
-               }
-
-       } else {
-               if ((cl = changelist_gather(zhp, ZFS_PROP_NAME, 0,
-                   force_unmount ? MS_FORCE : 0)) == NULL)
-                       return (-1);
-
-               if (changelist_haszonedchild(cl)) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "child dataset with inherited mountpoint is used "
-                           "in a non-global zone"));
-                       (void) zfs_error(hdl, EZFS_ZONED, errbuf);
-                       ret = -1;
-                       goto error;
-               }
-
-               if ((ret = changelist_prefix(cl)) != 0)
-                       goto error;
-       }
-
-       if (ZFS_IS_VOLUME(zhp))
-               zc.zc_objset_type = DMU_OST_ZVOL;
-       else
-               zc.zc_objset_type = DMU_OST_ZFS;
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-       (void) strlcpy(zc.zc_value, target, sizeof (zc.zc_value));
-
-       zc.zc_cookie = recursive;
-
-       if ((ret = zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_RENAME, &zc)) != 0) {
-               /*
-                * if it was recursive, the one that actually failed will
-                * be in zc.zc_name
-                */
-               (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-                   "cannot rename '%s'"), zc.zc_name);
-
-               if (recursive && errno == EEXIST) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "a child dataset already has a snapshot "
-                           "with the new name"));
-                       (void) zfs_error(hdl, EZFS_EXISTS, errbuf);
-               } else {
-                       (void) zfs_standard_error(zhp->zfs_hdl, errno, errbuf);
-               }
-
-               /*
-                * On failure, we still want to remount any filesystems that
-                * were previously mounted, so we don't alter the system state.
-                */
-               if (!recursive)
-                       (void) changelist_postfix(cl);
-       } else {
-               if (!recursive) {
-                       changelist_rename(cl, zfs_get_name(zhp), target);
-                       ret = changelist_postfix(cl);
-               }
-       }
-
-error:
-       if (parentname) {
-               free(parentname);
-       }
-       if (zhrp) {
-               zfs_close(zhrp);
-       }
-       if (cl) {
-               changelist_free(cl);
-       }
-       return (ret);
-}
-
-nvlist_t *
-zfs_get_user_props(zfs_handle_t *zhp)
-{
-       return (zhp->zfs_user_props);
-}
-
-/*
- * This function is used by 'zfs list' to determine the exact set of columns to
- * display, and their maximum widths.  This does two main things:
- *
- *      - If this is a list of all properties, then expand the list to include
- *        all native properties, and set a flag so that for each dataset we look
- *        for new unique user properties and add them to the list.
- *
- *      - For non fixed-width properties, keep track of the maximum width seen
- *        so that we can size the column appropriately. If the user has
- *        requested received property values, we also need to compute the width
- *        of the RECEIVED column.
- */
-int
-zfs_expand_proplist(zfs_handle_t *zhp, zprop_list_t **plp, boolean_t received,
-    boolean_t literal)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       zprop_list_t *entry;
-       zprop_list_t **last, **start;
-       nvlist_t *userprops, *propval;
-       nvpair_t *elem;
-       char *strval;
-       char buf[ZFS_MAXPROPLEN];
-
-       if (zprop_expand_list(hdl, plp, ZFS_TYPE_DATASET) != 0)
-               return (-1);
-
-       userprops = zfs_get_user_props(zhp);
-
-       entry = *plp;
-       if (entry->pl_all && nvlist_next_nvpair(userprops, NULL) != NULL) {
-               /*
-                * Go through and add any user properties as necessary.  We
-                * start by incrementing our list pointer to the first
-                * non-native property.
-                */
-               start = plp;
-               while (*start != NULL) {
-                       if ((*start)->pl_prop == ZPROP_INVAL)
-                               break;
-                       start = &(*start)->pl_next;
-               }
-
-               elem = NULL;
-               while ((elem = nvlist_next_nvpair(userprops, elem)) != NULL) {
-                       /*
-                        * See if we've already found this property in our list.
-                        */
-                       for (last = start; *last != NULL;
-                           last = &(*last)->pl_next) {
-                               if (strcmp((*last)->pl_user_prop,
-                                   nvpair_name(elem)) == 0)
-                                       break;
-                       }
-
-                       if (*last == NULL) {
-                               if ((entry = zfs_alloc(hdl,
-                                   sizeof (zprop_list_t))) == NULL ||
-                                   ((entry->pl_user_prop = zfs_strdup(hdl,
-                                   nvpair_name(elem)))) == NULL) {
-                                       free(entry);
-                                       return (-1);
-                               }
-
-                               entry->pl_prop = ZPROP_INVAL;
-                               entry->pl_width = strlen(nvpair_name(elem));
-                               entry->pl_all = B_TRUE;
-                               *last = entry;
-                       }
-               }
-       }
-
-       /*
-        * Now go through and check the width of any non-fixed columns
-        */
-       for (entry = *plp; entry != NULL; entry = entry->pl_next) {
-               if (entry->pl_fixed && !literal)
-                       continue;
-
-               if (entry->pl_prop != ZPROP_INVAL) {
-                       if (zfs_prop_get(zhp, entry->pl_prop,
-                           buf, sizeof (buf), NULL, NULL, 0, literal) == 0) {
-                               if (strlen(buf) > entry->pl_width)
-                                       entry->pl_width = strlen(buf);
-                       }
-                       if (received && zfs_prop_get_recvd(zhp,
-                           zfs_prop_to_name(entry->pl_prop),
-                           buf, sizeof (buf), literal) == 0)
-                               if (strlen(buf) > entry->pl_recvd_width)
-                                       entry->pl_recvd_width = strlen(buf);
-               } else {
-                       if (nvlist_lookup_nvlist(userprops, entry->pl_user_prop,
-                           &propval) == 0) {
-                               verify(nvlist_lookup_string(propval,
-                                   ZPROP_VALUE, &strval) == 0);
-                               if (strlen(strval) > entry->pl_width)
-                                       entry->pl_width = strlen(strval);
-                       }
-                       if (received && zfs_prop_get_recvd(zhp,
-                           entry->pl_user_prop,
-                           buf, sizeof (buf), literal) == 0)
-                               if (strlen(buf) > entry->pl_recvd_width)
-                                       entry->pl_recvd_width = strlen(buf);
-               }
-       }
-
-       return (0);
-}
-
-void
-zfs_prune_proplist(zfs_handle_t *zhp, uint8_t *props)
-{
-       nvpair_t *curr;
-
-       /*
-        * Keep a reference to the props-table against which we prune the
-        * properties.
-        */
-       zhp->zfs_props_table = props;
-
-       curr = nvlist_next_nvpair(zhp->zfs_props, NULL);
-
-       while (curr) {
-               zfs_prop_t zfs_prop = zfs_name_to_prop(nvpair_name(curr));
-               nvpair_t *next = nvlist_next_nvpair(zhp->zfs_props, curr);
-
-               /*
-                * User properties will result in ZPROP_INVAL, and since we
-                * only know how to prune standard ZFS properties, we always
-                * leave these in the list.  This can also happen if we
-                * encounter an unknown DSL property (when running older
-                * software, for example).
-                */
-               if (zfs_prop != ZPROP_INVAL && props[zfs_prop] == B_FALSE)
-                       (void) nvlist_remove(zhp->zfs_props,
-                           nvpair_name(curr), nvpair_type(curr));
-               curr = next;
-       }
-}
-
-static int
-zfs_smb_acl_mgmt(libzfs_handle_t *hdl, char *dataset, char *path,
-    zfs_smb_acl_op_t cmd, char *resource1, char *resource2)
-{
-       zfs_cmd_t zc = {"\0"};
-       nvlist_t *nvlist = NULL;
-       int error;
-
-       (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
-       (void) strlcpy(zc.zc_value, path, sizeof (zc.zc_value));
-       zc.zc_cookie = (uint64_t)cmd;
-
-       if (cmd == ZFS_SMB_ACL_RENAME) {
-               if (nvlist_alloc(&nvlist, NV_UNIQUE_NAME, 0) != 0) {
-                       (void) no_memory(hdl);
-                       return (-1);
-               }
-       }
-
-       switch (cmd) {
-       case ZFS_SMB_ACL_ADD:
-       case ZFS_SMB_ACL_REMOVE:
-               (void) strlcpy(zc.zc_string, resource1, sizeof (zc.zc_string));
-               break;
-       case ZFS_SMB_ACL_RENAME:
-               if (nvlist_add_string(nvlist, ZFS_SMB_ACL_SRC,
-                   resource1) != 0) {
-                               (void) no_memory(hdl);
-                               return (-1);
-               }
-               if (nvlist_add_string(nvlist, ZFS_SMB_ACL_TARGET,
-                   resource2) != 0) {
-                               (void) no_memory(hdl);
-                               return (-1);
-               }
-               if (zcmd_write_src_nvlist(hdl, &zc, nvlist) != 0) {
-                       nvlist_free(nvlist);
-                       return (-1);
-               }
-               break;
-       case ZFS_SMB_ACL_PURGE:
-               break;
-       default:
-               return (-1);
-       }
-       error = ioctl(hdl->libzfs_fd, ZFS_IOC_SMB_ACL, &zc);
-       if (nvlist)
-               nvlist_free(nvlist);
-       return (error);
-}
-
-int
-zfs_smb_acl_add(libzfs_handle_t *hdl, char *dataset,
-    char *path, char *resource)
-{
-       return (zfs_smb_acl_mgmt(hdl, dataset, path, ZFS_SMB_ACL_ADD,
-           resource, NULL));
-}
-
-int
-zfs_smb_acl_remove(libzfs_handle_t *hdl, char *dataset,
-    char *path, char *resource)
-{
-       return (zfs_smb_acl_mgmt(hdl, dataset, path, ZFS_SMB_ACL_REMOVE,
-           resource, NULL));
-}
-
-int
-zfs_smb_acl_purge(libzfs_handle_t *hdl, char *dataset, char *path)
-{
-       return (zfs_smb_acl_mgmt(hdl, dataset, path, ZFS_SMB_ACL_PURGE,
-           NULL, NULL));
-}
-
-int
-zfs_smb_acl_rename(libzfs_handle_t *hdl, char *dataset, char *path,
-    char *oldname, char *newname)
-{
-       return (zfs_smb_acl_mgmt(hdl, dataset, path, ZFS_SMB_ACL_RENAME,
-           oldname, newname));
-}
-
-int
-zfs_userspace(zfs_handle_t *zhp, zfs_userquota_prop_t type,
-    zfs_userspace_cb_t func, void *arg)
-{
-       zfs_cmd_t zc = {"\0"};
-       zfs_useracct_t buf[100];
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       int ret;
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       zc.zc_objset_type = type;
-       zc.zc_nvlist_dst = (uintptr_t)buf;
-
-       for (;;) {
-               zfs_useracct_t *zua = buf;
-
-               zc.zc_nvlist_dst_size = sizeof (buf);
-               if (zfs_ioctl(hdl, ZFS_IOC_USERSPACE_MANY, &zc) != 0) {
-                       char errbuf[ZFS_MAXNAMELEN + 32];
-
-                       (void) snprintf(errbuf, sizeof (errbuf),
-                           dgettext(TEXT_DOMAIN,
-                           "cannot get used/quota for %s"), zc.zc_name);
-                       return (zfs_standard_error_fmt(hdl, errno, errbuf));
-               }
-               if (zc.zc_nvlist_dst_size == 0)
-                       break;
-
-               while (zc.zc_nvlist_dst_size > 0) {
-                       if ((ret = func(arg, zua->zu_domain, zua->zu_rid,
-                           zua->zu_space)) != 0)
-                               return (ret);
-                       zua++;
-                       zc.zc_nvlist_dst_size -= sizeof (zfs_useracct_t);
-               }
-       }
-
-       return (0);
-}
-
-struct holdarg {
-       nvlist_t *nvl;
-       const char *snapname;
-       const char *tag;
-       boolean_t recursive;
-       int error;
-};
-
-static int
-zfs_hold_one(zfs_handle_t *zhp, void *arg)
-{
-       struct holdarg *ha = arg;
-       char name[ZFS_MAXNAMELEN];
-       int rv = 0;
-
-       (void) snprintf(name, sizeof (name),
-           "%s@%s", zhp->zfs_name, ha->snapname);
-
-       if (lzc_exists(name))
-               fnvlist_add_string(ha->nvl, name, ha->tag);
-
-       if (ha->recursive)
-               rv = zfs_iter_filesystems(zhp, zfs_hold_one, ha);
-       zfs_close(zhp);
-       return (rv);
-}
-
-int
-zfs_hold(zfs_handle_t *zhp, const char *snapname, const char *tag,
-    boolean_t recursive, int cleanup_fd)
-{
-       int ret;
-       struct holdarg ha;
-
-       ha.nvl = fnvlist_alloc();
-       ha.snapname = snapname;
-       ha.tag = tag;
-       ha.recursive = recursive;
-       (void) zfs_hold_one(zfs_handle_dup(zhp), &ha);
-
-       if (nvlist_empty(ha.nvl)) {
-               char errbuf[1024];
-
-               fnvlist_free(ha.nvl);
-               ret = ENOENT;
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "cannot hold snapshot '%s@%s'"),
-                   zhp->zfs_name, snapname);
-               (void) zfs_standard_error(zhp->zfs_hdl, ret, errbuf);
-               return (ret);
-       }
-
-       ret = zfs_hold_nvl(zhp, cleanup_fd, ha.nvl);
-       fnvlist_free(ha.nvl);
-
-       return (ret);
-}
-
-int
-zfs_hold_nvl(zfs_handle_t *zhp, int cleanup_fd, nvlist_t *holds)
-{
-       int ret;
-       nvlist_t *errors;
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       char errbuf[1024];
-       nvpair_t *elem;
-
-       errors = NULL;
-       ret = lzc_hold(holds, cleanup_fd, &errors);
-
-       if (ret == 0) {
-               /* There may be errors even in the success case. */
-               fnvlist_free(errors);
-               return (0);
-       }
-
-       if (nvlist_empty(errors)) {
-               /* no hold-specific errors */
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN, "cannot hold"));
-               switch (ret) {
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded"));
-                       (void) zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                       break;
-               case EINVAL:
-                       (void) zfs_error(hdl, EZFS_BADTYPE, errbuf);
-                       break;
-               default:
-                       (void) zfs_standard_error(hdl, ret, errbuf);
-               }
-       }
-
-       for (elem = nvlist_next_nvpair(errors, NULL);
-           elem != NULL;
-           elem = nvlist_next_nvpair(errors, elem)) {
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "cannot hold snapshot '%s'"), nvpair_name(elem));
-               switch (fnvpair_value_int32(elem)) {
-               case E2BIG:
-                       /*
-                        * Temporary tags wind up having the ds object id
-                        * prepended. So even if we passed the length check
-                        * above, it's still possible for the tag to wind
-                        * up being slightly too long.
-                        */
-                       (void) zfs_error(hdl, EZFS_TAGTOOLONG, errbuf);
-                       break;
-               case EINVAL:
-                       (void) zfs_error(hdl, EZFS_BADTYPE, errbuf);
-                       break;
-               case EEXIST:
-                       (void) zfs_error(hdl, EZFS_REFTAG_HOLD, errbuf);
-                       break;
-               default:
-                       (void) zfs_standard_error(hdl,
-                           fnvpair_value_int32(elem), errbuf);
-               }
-       }
-
-       fnvlist_free(errors);
-       return (ret);
-}
-
-static int
-zfs_release_one(zfs_handle_t *zhp, void *arg)
-{
-       struct holdarg *ha = arg;
-       char name[ZFS_MAXNAMELEN];
-       int rv = 0;
-       nvlist_t *existing_holds;
-
-       (void) snprintf(name, sizeof (name),
-           "%s@%s", zhp->zfs_name, ha->snapname);
-
-       if (lzc_get_holds(name, &existing_holds) != 0) {
-               ha->error = ENOENT;
-       } else if (!nvlist_exists(existing_holds, ha->tag)) {
-               ha->error = ESRCH;
-       } else {
-               nvlist_t *torelease = fnvlist_alloc();
-               fnvlist_add_boolean(torelease, ha->tag);
-               fnvlist_add_nvlist(ha->nvl, name, torelease);
-               fnvlist_free(torelease);
-       }
-
-       if (ha->recursive)
-               rv = zfs_iter_filesystems(zhp, zfs_release_one, ha);
-       zfs_close(zhp);
-       return (rv);
-}
-
-int
-zfs_release(zfs_handle_t *zhp, const char *snapname, const char *tag,
-    boolean_t recursive)
-{
-       int ret;
-       struct holdarg ha;
-       nvlist_t *errors = NULL;
-       nvpair_t *elem;
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       char errbuf[1024];
-
-       ha.nvl = fnvlist_alloc();
-       ha.snapname = snapname;
-       ha.tag = tag;
-       ha.recursive = recursive;
-       ha.error = 0;
-       (void) zfs_release_one(zfs_handle_dup(zhp), &ha);
-
-       if (nvlist_empty(ha.nvl)) {
-               fnvlist_free(ha.nvl);
-               ret = ha.error;
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "cannot release hold from snapshot '%s@%s'"),
-                   zhp->zfs_name, snapname);
-               if (ret == ESRCH) {
-                       (void) zfs_error(hdl, EZFS_REFTAG_RELE, errbuf);
-               } else {
-                       (void) zfs_standard_error(hdl, ret, errbuf);
-               }
-               return (ret);
-       }
-
-       ret = lzc_release(ha.nvl, &errors);
-       fnvlist_free(ha.nvl);
-
-       if (ret == 0) {
-               /* There may be errors even in the success case. */
-               fnvlist_free(errors);
-               return (0);
-       }
-
-       if (nvlist_empty(errors)) {
-               /* no hold-specific errors */
-               (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-                   "cannot release"));
-               switch (errno) {
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded"));
-                       (void) zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                       break;
-               default:
-                       (void) zfs_standard_error_fmt(hdl, errno, errbuf);
-               }
-       }
-
-       for (elem = nvlist_next_nvpair(errors, NULL);
-           elem != NULL;
-           elem = nvlist_next_nvpair(errors, elem)) {
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "cannot release hold from snapshot '%s'"),
-                   nvpair_name(elem));
-               switch (fnvpair_value_int32(elem)) {
-               case ESRCH:
-                       (void) zfs_error(hdl, EZFS_REFTAG_RELE, errbuf);
-                       break;
-               case EINVAL:
-                       (void) zfs_error(hdl, EZFS_BADTYPE, errbuf);
-                       break;
-               default:
-                       (void) zfs_standard_error_fmt(hdl,
-                           fnvpair_value_int32(elem), errbuf);
-               }
-       }
-
-       fnvlist_free(errors);
-       return (ret);
-}
-
-int
-zfs_get_fsacl(zfs_handle_t *zhp, nvlist_t **nvl)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       int nvsz = 2048;
-       void *nvbuf;
-       int err = 0;
-       char errbuf[1024];
-
-       assert(zhp->zfs_type == ZFS_TYPE_VOLUME ||
-           zhp->zfs_type == ZFS_TYPE_FILESYSTEM);
-
-tryagain:
-
-       nvbuf = malloc(nvsz);
-       if (nvbuf == NULL) {
-               err = (zfs_error(hdl, EZFS_NOMEM, strerror(errno)));
-               goto out;
-       }
-
-       zc.zc_nvlist_dst_size = nvsz;
-       zc.zc_nvlist_dst = (uintptr_t)nvbuf;
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, ZFS_MAXNAMELEN);
-
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_GET_FSACL, &zc) != 0) {
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN, "cannot get permissions on '%s'"),
-                   zc.zc_name);
-               switch (errno) {
-               case ENOMEM:
-                       free(nvbuf);
-                       nvsz = zc.zc_nvlist_dst_size;
-                       goto tryagain;
-
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded"));
-                       err = zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                       break;
-               case EINVAL:
-                       err = zfs_error(hdl, EZFS_BADTYPE, errbuf);
-                       break;
-               case ENOENT:
-                       err = zfs_error(hdl, EZFS_NOENT, errbuf);
-                       break;
-               default:
-                       err = zfs_standard_error_fmt(hdl, errno, errbuf);
-                       break;
-               }
-       } else {
-               /* success */
-               int rc = nvlist_unpack(nvbuf, zc.zc_nvlist_dst_size, nvl, 0);
-               if (rc) {
-                       (void) snprintf(errbuf, sizeof (errbuf), dgettext(
-                           TEXT_DOMAIN, "cannot get permissions on '%s'"),
-                           zc.zc_name);
-                       err = zfs_standard_error_fmt(hdl, rc, errbuf);
-               }
-       }
-
-       free(nvbuf);
-out:
-       return (err);
-}
-
-int
-zfs_set_fsacl(zfs_handle_t *zhp, boolean_t un, nvlist_t *nvl)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       char *nvbuf;
-       char errbuf[1024];
-       size_t nvsz;
-       int err;
-
-       assert(zhp->zfs_type == ZFS_TYPE_VOLUME ||
-           zhp->zfs_type == ZFS_TYPE_FILESYSTEM);
-
-       err = nvlist_size(nvl, &nvsz, NV_ENCODE_NATIVE);
-       assert(err == 0);
-
-       nvbuf = malloc(nvsz);
-
-       err = nvlist_pack(nvl, &nvbuf, &nvsz, NV_ENCODE_NATIVE, 0);
-       assert(err == 0);
-
-       zc.zc_nvlist_src_size = nvsz;
-       zc.zc_nvlist_src = (uintptr_t)nvbuf;
-       zc.zc_perm_action = un;
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       if (zfs_ioctl(hdl, ZFS_IOC_SET_FSACL, &zc) != 0) {
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN, "cannot set permissions on '%s'"),
-                   zc.zc_name);
-               switch (errno) {
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded"));
-                       err = zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                       break;
-               case EINVAL:
-                       err = zfs_error(hdl, EZFS_BADTYPE, errbuf);
-                       break;
-               case ENOENT:
-                       err = zfs_error(hdl, EZFS_NOENT, errbuf);
-                       break;
-               default:
-                       err = zfs_standard_error_fmt(hdl, errno, errbuf);
-                       break;
-               }
-       }
-
-       free(nvbuf);
-
-       return (err);
-}
-
-int
-zfs_get_holds(zfs_handle_t *zhp, nvlist_t **nvl)
-{
-       int err;
-       char errbuf[1024];
-
-       err = lzc_get_holds(zhp->zfs_name, nvl);
-
-       if (err != 0) {
-               libzfs_handle_t *hdl = zhp->zfs_hdl;
-
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN, "cannot get holds for '%s'"),
-                   zhp->zfs_name);
-               switch (err) {
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded"));
-                       err = zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                       break;
-               case EINVAL:
-                       err = zfs_error(hdl, EZFS_BADTYPE, errbuf);
-                       break;
-               case ENOENT:
-                       err = zfs_error(hdl, EZFS_NOENT, errbuf);
-                       break;
-               default:
-                       err = zfs_standard_error_fmt(hdl, errno, errbuf);
-                       break;
-               }
-       }
-
-       return (err);
-}
-
-/*
- * Convert the zvol's volume size to an appropriate reservation.
- * Note: If this routine is updated, it is necessary to update the ZFS test
- * suite's shell version in reservation.kshlib.
- */
-uint64_t
-zvol_volsize_to_reservation(uint64_t volsize, nvlist_t *props)
-{
-       uint64_t numdb;
-       uint64_t nblocks, volblocksize;
-       int ncopies;
-       char *strval;
-
-       if (nvlist_lookup_string(props,
-           zfs_prop_to_name(ZFS_PROP_COPIES), &strval) == 0)
-               ncopies = atoi(strval);
-       else
-               ncopies = 1;
-       if (nvlist_lookup_uint64(props,
-           zfs_prop_to_name(ZFS_PROP_VOLBLOCKSIZE),
-           &volblocksize) != 0)
-               volblocksize = ZVOL_DEFAULT_BLOCKSIZE;
-       nblocks = volsize/volblocksize;
-       /* start with metadnode L0-L6 */
-       numdb = 7;
-       /* calculate number of indirects */
-       while (nblocks > 1) {
-               nblocks += DNODES_PER_LEVEL - 1;
-               nblocks /= DNODES_PER_LEVEL;
-               numdb += nblocks;
-       }
-       numdb *= MIN(SPA_DVAS_PER_BP, ncopies + 1);
-       volsize *= ncopies;
-       /*
-        * this is exactly DN_MAX_INDBLKSHIFT when metadata isn't
-        * compressed, but in practice they compress down to about
-        * 1100 bytes
-        */
-       numdb *= 1ULL << DN_MAX_INDBLKSHIFT;
-       volsize += numdb;
-       return (volsize);
-}
diff --git a/zfs/lib/libzfs/libzfs_diff.c b/zfs/lib/libzfs/libzfs_diff.c
deleted file mode 100644 (file)
index b5fa585..0000000
+++ /dev/null
@@ -1,834 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2015 Nexenta Systems, Inc. All rights reserved.
- */
-
-/*
- * zfs diff support
- */
-#include <ctype.h>
-#include <errno.h>
-#include <libintl.h>
-#include <string.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
-#include <attr.h>
-#include <stddef.h>
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <stropts.h>
-#include <pthread.h>
-#include <sys/zfs_ioctl.h>
-#include <libzfs.h>
-#include "libzfs_impl.h"
-
-#define        ZDIFF_SNAPDIR           "/.zfs/snapshot/"
-#define        ZDIFF_SHARESDIR         "/.zfs/shares/"
-#define        ZDIFF_PREFIX            "zfs-diff-%d"
-
-#define        ZDIFF_ADDED     '+'
-#define        ZDIFF_MODIFIED  'M'
-#define        ZDIFF_REMOVED   '-'
-#define        ZDIFF_RENAMED   'R'
-
-static boolean_t
-do_name_cmp(const char *fpath, const char *tpath)
-{
-       char *fname, *tname;
-       fname = strrchr(fpath, '/') + 1;
-       tname = strrchr(tpath, '/') + 1;
-       return (strcmp(fname, tname) == 0);
-}
-
-typedef struct differ_info {
-       zfs_handle_t *zhp;
-       char *fromsnap;
-       char *frommnt;
-       char *tosnap;
-       char *tomnt;
-       char *ds;
-       char *dsmnt;
-       char *tmpsnap;
-       char errbuf[1024];
-       boolean_t isclone;
-       boolean_t scripted;
-       boolean_t classify;
-       boolean_t timestamped;
-       uint64_t shares;
-       int zerr;
-       int cleanupfd;
-       int outputfd;
-       int datafd;
-} differ_info_t;
-
-/*
- * Given a {dsname, object id}, get the object path
- */
-static int
-get_stats_for_obj(differ_info_t *di, const char *dsname, uint64_t obj,
-    char *pn, int maxlen, zfs_stat_t *sb)
-{
-       zfs_cmd_t zc = {"\0"};
-       int error;
-
-       (void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name));
-       zc.zc_obj = obj;
-
-       errno = 0;
-       error = ioctl(di->zhp->zfs_hdl->libzfs_fd, ZFS_IOC_OBJ_TO_STATS, &zc);
-       di->zerr = errno;
-
-       /* we can get stats even if we failed to get a path */
-       (void) memcpy(sb, &zc.zc_stat, sizeof (zfs_stat_t));
-       if (error == 0) {
-               ASSERT(di->zerr == 0);
-               (void) strlcpy(pn, zc.zc_value, maxlen);
-               return (0);
-       }
-
-       if (di->zerr == EPERM) {
-               (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "The sys_config privilege or diff delegated permission "
-                   "is needed\nto discover path names"));
-               return (-1);
-       } else {
-               (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "Unable to determine path or stats for "
-                   "object %lld in %s"), (longlong_t)obj, dsname);
-               return (-1);
-       }
-}
-
-/*
- * stream_bytes
- *
- * Prints a file name out a character at a time.  If the character is
- * not in the range of what we consider "printable" ASCII, display it
- * as an escaped 4-digit octal value.  ASCII values less than a space
- * are all control characters and we declare the upper end as the
- * DELete character.  This also is the last 7-bit ASCII character.
- * We choose to treat all 8-bit ASCII as not printable for this
- * application.
- */
-static void
-stream_bytes(FILE *fp, const char *string)
-{
-       while (*string) {
-               if (*string > ' ' && *string != '\\' && *string < '\177')
-                       (void) fprintf(fp, "%c", *string++);
-               else
-                       (void) fprintf(fp, "\\%04o", (unsigned char)*string++);
-       }
-}
-
-static void
-print_what(FILE *fp, mode_t what)
-{
-       char symbol;
-
-       switch (what & S_IFMT) {
-       case S_IFBLK:
-               symbol = 'B';
-               break;
-       case S_IFCHR:
-               symbol = 'C';
-               break;
-       case S_IFDIR:
-               symbol = '/';
-               break;
-#ifdef S_IFDOOR
-       case S_IFDOOR:
-               symbol = '>';
-               break;
-#endif
-       case S_IFIFO:
-               symbol = '|';
-               break;
-       case S_IFLNK:
-               symbol = '@';
-               break;
-#ifdef S_IFPORT
-       case S_IFPORT:
-               symbol = 'P';
-               break;
-#endif
-       case S_IFSOCK:
-               symbol = '=';
-               break;
-       case S_IFREG:
-               symbol = 'F';
-               break;
-       default:
-               symbol = '?';
-               break;
-       }
-       (void) fprintf(fp, "%c", symbol);
-}
-
-static void
-print_cmn(FILE *fp, differ_info_t *di, const char *file)
-{
-       stream_bytes(fp, di->dsmnt);
-       stream_bytes(fp, file);
-}
-
-static void
-print_rename(FILE *fp, differ_info_t *di, const char *old, const char *new,
-    zfs_stat_t *isb)
-{
-       if (di->timestamped)
-               (void) fprintf(fp, "%10lld.%09lld\t",
-                   (longlong_t)isb->zs_ctime[0],
-                   (longlong_t)isb->zs_ctime[1]);
-       (void) fprintf(fp, "%c\t", ZDIFF_RENAMED);
-       if (di->classify) {
-               print_what(fp, isb->zs_mode);
-               (void) fprintf(fp, "\t");
-       }
-       print_cmn(fp, di, old);
-       if (di->scripted)
-               (void) fprintf(fp, "\t");
-       else
-               (void) fprintf(fp, " -> ");
-       print_cmn(fp, di, new);
-       (void) fprintf(fp, "\n");
-}
-
-static void
-print_link_change(FILE *fp, differ_info_t *di, int delta, const char *file,
-    zfs_stat_t *isb)
-{
-       if (di->timestamped)
-               (void) fprintf(fp, "%10lld.%09lld\t",
-                   (longlong_t)isb->zs_ctime[0],
-                   (longlong_t)isb->zs_ctime[1]);
-       (void) fprintf(fp, "%c\t", ZDIFF_MODIFIED);
-       if (di->classify) {
-               print_what(fp, isb->zs_mode);
-               (void) fprintf(fp, "\t");
-       }
-       print_cmn(fp, di, file);
-       (void) fprintf(fp, "\t(%+d)", delta);
-       (void) fprintf(fp, "\n");
-}
-
-static void
-print_file(FILE *fp, differ_info_t *di, char type, const char *file,
-    zfs_stat_t *isb)
-{
-       if (di->timestamped)
-               (void) fprintf(fp, "%10lld.%09lld\t",
-                   (longlong_t)isb->zs_ctime[0],
-                   (longlong_t)isb->zs_ctime[1]);
-       (void) fprintf(fp, "%c\t", type);
-       if (di->classify) {
-               print_what(fp, isb->zs_mode);
-               (void) fprintf(fp, "\t");
-       }
-       print_cmn(fp, di, file);
-       (void) fprintf(fp, "\n");
-}
-
-static int
-write_inuse_diffs_one(FILE *fp, differ_info_t *di, uint64_t dobj)
-{
-       struct zfs_stat fsb, tsb;
-       boolean_t same_name;
-       mode_t fmode, tmode;
-       char fobjname[MAXPATHLEN], tobjname[MAXPATHLEN];
-       int fobjerr, tobjerr;
-       int change;
-
-       if (dobj == di->shares)
-               return (0);
-
-       /*
-        * Check the from and to snapshots for info on the object. If
-        * we get ENOENT, then the object just didn't exist in that
-        * snapshot.  If we get ENOTSUP, then we tried to get
-        * info on a non-ZPL object, which we don't care about anyway.
-        */
-       fobjerr = get_stats_for_obj(di, di->fromsnap, dobj, fobjname,
-           MAXPATHLEN, &fsb);
-       if (fobjerr && di->zerr != ENOENT && di->zerr != ENOTSUP)
-               return (-1);
-
-       tobjerr = get_stats_for_obj(di, di->tosnap, dobj, tobjname,
-           MAXPATHLEN, &tsb);
-       if (tobjerr && di->zerr != ENOENT && di->zerr != ENOTSUP)
-               return (-1);
-
-       /*
-        * Unallocated object sharing the same meta dnode block
-        */
-       if (fobjerr && tobjerr) {
-               ASSERT(di->zerr == ENOENT || di->zerr == ENOTSUP);
-               di->zerr = 0;
-               return (0);
-       }
-
-       di->zerr = 0; /* negate get_stats_for_obj() from side that failed */
-       fmode = fsb.zs_mode & S_IFMT;
-       tmode = tsb.zs_mode & S_IFMT;
-       if (fmode == S_IFDIR || tmode == S_IFDIR || fsb.zs_links == 0 ||
-           tsb.zs_links == 0)
-               change = 0;
-       else
-               change = tsb.zs_links - fsb.zs_links;
-
-       if (fobjerr) {
-               if (change) {
-                       print_link_change(fp, di, change, tobjname, &tsb);
-                       return (0);
-               }
-               print_file(fp, di, ZDIFF_ADDED, tobjname, &tsb);
-               return (0);
-       } else if (tobjerr) {
-               if (change) {
-                       print_link_change(fp, di, change, fobjname, &fsb);
-                       return (0);
-               }
-               print_file(fp, di, ZDIFF_REMOVED, fobjname, &fsb);
-               return (0);
-       }
-
-       if (fmode != tmode && fsb.zs_gen == tsb.zs_gen)
-               tsb.zs_gen++;   /* Force a generational difference */
-       same_name = do_name_cmp(fobjname, tobjname);
-
-       /* Simple modification or no change */
-       if (fsb.zs_gen == tsb.zs_gen) {
-               /* No apparent changes.  Could we assert !this?  */
-               if (fsb.zs_ctime[0] == tsb.zs_ctime[0] &&
-                   fsb.zs_ctime[1] == tsb.zs_ctime[1])
-                       return (0);
-               if (change) {
-                       print_link_change(fp, di, change,
-                           change > 0 ? fobjname : tobjname, &tsb);
-               } else if (same_name) {
-                       print_file(fp, di, ZDIFF_MODIFIED, fobjname, &tsb);
-               } else {
-                       print_rename(fp, di, fobjname, tobjname, &tsb);
-               }
-               return (0);
-       } else {
-               /* file re-created or object re-used */
-               print_file(fp, di, ZDIFF_REMOVED, fobjname, &fsb);
-               print_file(fp, di, ZDIFF_ADDED, tobjname, &tsb);
-               return (0);
-       }
-}
-
-static int
-write_inuse_diffs(FILE *fp, differ_info_t *di, dmu_diff_record_t *dr)
-{
-       uint64_t o;
-       int err;
-
-       for (o = dr->ddr_first; o <= dr->ddr_last; o++) {
-               if ((err = write_inuse_diffs_one(fp, di, o)))
-                       return (err);
-       }
-       return (0);
-}
-
-static int
-describe_free(FILE *fp, differ_info_t *di, uint64_t object, char *namebuf,
-    int maxlen)
-{
-       struct zfs_stat sb;
-
-       if (get_stats_for_obj(di, di->fromsnap, object, namebuf,
-           maxlen, &sb) != 0) {
-               /* Let it slide, if in the delete queue on from side */
-               if (di->zerr == ENOENT && sb.zs_links == 0) {
-                       di->zerr = 0;
-                       return (0);
-               }
-               return (-1);
-       }
-
-       print_file(fp, di, ZDIFF_REMOVED, namebuf, &sb);
-       return (0);
-}
-
-static int
-write_free_diffs(FILE *fp, differ_info_t *di, dmu_diff_record_t *dr)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *lhdl = di->zhp->zfs_hdl;
-       char fobjname[MAXPATHLEN];
-
-       (void) strlcpy(zc.zc_name, di->fromsnap, sizeof (zc.zc_name));
-       zc.zc_obj = dr->ddr_first - 1;
-
-       ASSERT(di->zerr == 0);
-
-       while (zc.zc_obj < dr->ddr_last) {
-               int err;
-
-               err = ioctl(lhdl->libzfs_fd, ZFS_IOC_NEXT_OBJ, &zc);
-               if (err == 0) {
-                       if (zc.zc_obj == di->shares) {
-                               zc.zc_obj++;
-                               continue;
-                       }
-                       if (zc.zc_obj > dr->ddr_last) {
-                               break;
-                       }
-                       err = describe_free(fp, di, zc.zc_obj, fobjname,
-                           MAXPATHLEN);
-                       if (err)
-                               break;
-               } else if (errno == ESRCH) {
-                       break;
-               } else {
-                       (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                           dgettext(TEXT_DOMAIN,
-                           "next allocated object (> %lld) find failure"),
-                           (longlong_t)zc.zc_obj);
-                       di->zerr = errno;
-                       break;
-               }
-       }
-       if (di->zerr)
-               return (-1);
-       return (0);
-}
-
-static void *
-differ(void *arg)
-{
-       differ_info_t *di = arg;
-       dmu_diff_record_t dr;
-       FILE *ofp;
-       int err = 0;
-
-       if ((ofp = fdopen(di->outputfd, "w")) == NULL) {
-               di->zerr = errno;
-               strncpy(di->errbuf, strerror(errno), sizeof (di->errbuf));
-               (void) close(di->datafd);
-               return ((void *)-1);
-       }
-
-       for (;;) {
-               char *cp = (char *)&dr;
-               int len = sizeof (dr);
-               int rv;
-
-               do {
-                       rv = read(di->datafd, cp, len);
-                       cp += rv;
-                       len -= rv;
-               } while (len > 0 && rv > 0);
-
-               if (rv < 0 || (rv == 0 && len != sizeof (dr))) {
-                       di->zerr = EPIPE;
-                       break;
-               } else if (rv == 0) {
-                       /* end of file at a natural breaking point */
-                       break;
-               }
-
-               switch (dr.ddr_type) {
-               case DDR_FREE:
-                       err = write_free_diffs(ofp, di, &dr);
-                       break;
-               case DDR_INUSE:
-                       err = write_inuse_diffs(ofp, di, &dr);
-                       break;
-               default:
-                       di->zerr = EPIPE;
-                       break;
-               }
-
-               if (err || di->zerr)
-                       break;
-       }
-
-       (void) fclose(ofp);
-       (void) close(di->datafd);
-       if (err)
-               return ((void *)-1);
-       if (di->zerr) {
-               ASSERT(di->zerr == EINVAL);
-               (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "Internal error: bad data from diff IOCTL"));
-               return ((void *)-1);
-       }
-       return ((void *)0);
-}
-
-static int
-find_shares_object(differ_info_t *di)
-{
-       char fullpath[MAXPATHLEN];
-       struct stat64 sb = { 0 };
-
-       (void) strlcpy(fullpath, di->dsmnt, MAXPATHLEN);
-       (void) strlcat(fullpath, ZDIFF_SHARESDIR, MAXPATHLEN);
-
-       if (stat64(fullpath, &sb) != 0) {
-               (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                   dgettext(TEXT_DOMAIN, "Cannot stat %s"), fullpath);
-               return (zfs_error(di->zhp->zfs_hdl, EZFS_DIFF, di->errbuf));
-       }
-
-       di->shares = (uint64_t)sb.st_ino;
-       return (0);
-}
-
-static int
-make_temp_snapshot(differ_info_t *di)
-{
-       libzfs_handle_t *hdl = di->zhp->zfs_hdl;
-       zfs_cmd_t zc = {"\0"};
-
-       (void) snprintf(zc.zc_value, sizeof (zc.zc_value),
-           ZDIFF_PREFIX, getpid());
-       (void) strlcpy(zc.zc_name, di->ds, sizeof (zc.zc_name));
-       zc.zc_cleanup_fd = di->cleanupfd;
-
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_TMP_SNAPSHOT, &zc) != 0) {
-               int err = errno;
-               if (err == EPERM) {
-                       (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                           dgettext(TEXT_DOMAIN, "The diff delegated "
-                           "permission is needed in order\nto create a "
-                           "just-in-time snapshot for diffing\n"));
-                       return (zfs_error(hdl, EZFS_DIFF, di->errbuf));
-               } else {
-                       (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                           dgettext(TEXT_DOMAIN, "Cannot create just-in-time "
-                           "snapshot of '%s'"), zc.zc_name);
-                       return (zfs_standard_error(hdl, err, di->errbuf));
-               }
-       }
-
-       di->tmpsnap = zfs_strdup(hdl, zc.zc_value);
-       di->tosnap = zfs_asprintf(hdl, "%s@%s", di->ds, di->tmpsnap);
-       return (0);
-}
-
-static void
-teardown_differ_info(differ_info_t *di)
-{
-       free(di->ds);
-       free(di->dsmnt);
-       free(di->fromsnap);
-       free(di->frommnt);
-       free(di->tosnap);
-       free(di->tmpsnap);
-       free(di->tomnt);
-       (void) close(di->cleanupfd);
-}
-
-static int
-get_snapshot_names(differ_info_t *di, const char *fromsnap,
-    const char *tosnap)
-{
-       libzfs_handle_t *hdl = di->zhp->zfs_hdl;
-       char *atptrf = NULL;
-       char *atptrt = NULL;
-       int fdslen, fsnlen;
-       int tdslen, tsnlen;
-
-       /*
-        * Can accept
-        *    dataset@snap1
-        *    dataset@snap1 dataset@snap2
-        *    dataset@snap1 @snap2
-        *    dataset@snap1 dataset
-        *    @snap1 dataset@snap2
-        */
-       if (tosnap == NULL) {
-               /* only a from snapshot given, must be valid */
-               (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "Badly formed snapshot name %s"), fromsnap);
-
-               if (!zfs_validate_name(hdl, fromsnap, ZFS_TYPE_SNAPSHOT,
-                   B_FALSE)) {
-                       return (zfs_error(hdl, EZFS_INVALIDNAME,
-                           di->errbuf));
-               }
-
-               atptrf = strchr(fromsnap, '@');
-               ASSERT(atptrf != NULL);
-               fdslen = atptrf - fromsnap;
-
-               di->fromsnap = zfs_strdup(hdl, fromsnap);
-               di->ds = zfs_strdup(hdl, fromsnap);
-               di->ds[fdslen] = '\0';
-
-               /* the to snap will be a just-in-time snap of the head */
-               return (make_temp_snapshot(di));
-       }
-
-       (void) snprintf(di->errbuf, sizeof (di->errbuf),
-           dgettext(TEXT_DOMAIN,
-           "Unable to determine which snapshots to compare"));
-
-       atptrf = strchr(fromsnap, '@');
-       atptrt = strchr(tosnap, '@');
-       fdslen = atptrf ? atptrf - fromsnap : strlen(fromsnap);
-       tdslen = atptrt ? atptrt - tosnap : strlen(tosnap);
-       fsnlen = strlen(fromsnap) - fdslen;     /* includes @ sign */
-       tsnlen = strlen(tosnap) - tdslen;       /* includes @ sign */
-
-       if (fsnlen <= 1 || tsnlen == 1 || (fdslen == 0 && tdslen == 0) ||
-           (fsnlen == 0 && tsnlen == 0)) {
-               return (zfs_error(hdl, EZFS_INVALIDNAME, di->errbuf));
-       } else if ((fdslen > 0 && tdslen > 0) &&
-           ((tdslen != fdslen || strncmp(fromsnap, tosnap, fdslen) != 0))) {
-               /*
-                * not the same dataset name, might be okay if
-                * tosnap is a clone of a fromsnap descendant.
-                */
-               char origin[ZFS_MAXNAMELEN];
-               zprop_source_t src;
-               zfs_handle_t *zhp;
-
-               di->ds = zfs_alloc(di->zhp->zfs_hdl, tdslen + 1);
-               (void) strncpy(di->ds, tosnap, tdslen);
-               di->ds[tdslen] = '\0';
-
-               zhp = zfs_open(hdl, di->ds, ZFS_TYPE_FILESYSTEM);
-               while (zhp != NULL) {
-                       if (zfs_prop_get(zhp, ZFS_PROP_ORIGIN, origin,
-                           sizeof (origin), &src, NULL, 0, B_FALSE) != 0) {
-                               (void) zfs_close(zhp);
-                               zhp = NULL;
-                               break;
-                       }
-                       if (strncmp(origin, fromsnap, fsnlen) == 0)
-                               break;
-
-                       (void) zfs_close(zhp);
-                       zhp = zfs_open(hdl, origin, ZFS_TYPE_FILESYSTEM);
-               }
-
-               if (zhp == NULL) {
-                       (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                           dgettext(TEXT_DOMAIN,
-                           "Not an earlier snapshot from the same fs"));
-                       return (zfs_error(hdl, EZFS_INVALIDNAME, di->errbuf));
-               } else {
-                       (void) zfs_close(zhp);
-               }
-
-               di->isclone = B_TRUE;
-               di->fromsnap = zfs_strdup(hdl, fromsnap);
-               if (tsnlen) {
-                       di->tosnap = zfs_strdup(hdl, tosnap);
-               } else {
-                       return (make_temp_snapshot(di));
-               }
-       } else {
-               int dslen = fdslen ? fdslen : tdslen;
-
-               di->ds = zfs_alloc(hdl, dslen + 1);
-               (void) strncpy(di->ds, fdslen ? fromsnap : tosnap, dslen);
-               di->ds[dslen] = '\0';
-
-               di->fromsnap = zfs_asprintf(hdl, "%s%s", di->ds, atptrf);
-               if (tsnlen) {
-                       di->tosnap = zfs_asprintf(hdl, "%s%s", di->ds, atptrt);
-               } else {
-                       return (make_temp_snapshot(di));
-               }
-       }
-       return (0);
-}
-
-static int
-get_mountpoint(differ_info_t *di, char *dsnm, char **mntpt)
-{
-       boolean_t mounted;
-
-       mounted = is_mounted(di->zhp->zfs_hdl, dsnm, mntpt);
-       if (mounted == B_FALSE) {
-               (void) snprintf(di->errbuf, sizeof (di->errbuf),
-                   dgettext(TEXT_DOMAIN,
-                   "Cannot diff an unmounted snapshot"));
-               return (zfs_error(di->zhp->zfs_hdl, EZFS_BADTYPE, di->errbuf));
-       }
-
-       /* Avoid a double slash at the beginning of root-mounted datasets */
-       if (**mntpt == '/' && *(*mntpt + 1) == '\0')
-               **mntpt = '\0';
-       return (0);
-}
-
-static int
-get_mountpoints(differ_info_t *di)
-{
-       char *strptr;
-       char *frommntpt;
-
-       /*
-        * first get the mountpoint for the parent dataset
-        */
-       if (get_mountpoint(di, di->ds, &di->dsmnt) != 0)
-               return (-1);
-
-       strptr = strchr(di->tosnap, '@');
-       ASSERT3P(strptr, !=, NULL);
-       di->tomnt = zfs_asprintf(di->zhp->zfs_hdl, "%s%s%s", di->dsmnt,
-           ZDIFF_SNAPDIR, ++strptr);
-
-       strptr = strchr(di->fromsnap, '@');
-       ASSERT3P(strptr, !=, NULL);
-
-       frommntpt = di->dsmnt;
-       if (di->isclone) {
-               char *mntpt;
-               int err;
-
-               *strptr = '\0';
-               err = get_mountpoint(di, di->fromsnap, &mntpt);
-               *strptr = '@';
-               if (err != 0)
-                       return (-1);
-               frommntpt = mntpt;
-       }
-
-       di->frommnt = zfs_asprintf(di->zhp->zfs_hdl, "%s%s%s", frommntpt,
-           ZDIFF_SNAPDIR, ++strptr);
-
-       if (di->isclone)
-               free(frommntpt);
-
-       return (0);
-}
-
-static int
-setup_differ_info(zfs_handle_t *zhp, const char *fromsnap,
-    const char *tosnap, differ_info_t *di)
-{
-       di->zhp = zhp;
-
-       di->cleanupfd = open(ZFS_DEV, O_RDWR);
-       VERIFY(di->cleanupfd >= 0);
-
-       if (get_snapshot_names(di, fromsnap, tosnap) != 0)
-               return (-1);
-
-       if (get_mountpoints(di) != 0)
-               return (-1);
-
-       if (find_shares_object(di) != 0)
-               return (-1);
-
-       return (0);
-}
-
-int
-zfs_show_diffs(zfs_handle_t *zhp, int outfd, const char *fromsnap,
-    const char *tosnap, int flags)
-{
-       zfs_cmd_t zc = {"\0"};
-       char errbuf[1024];
-       differ_info_t di = { 0 };
-       pthread_t tid;
-       int pipefd[2];
-       int iocerr;
-
-       (void) snprintf(errbuf, sizeof (errbuf),
-           dgettext(TEXT_DOMAIN, "zfs diff failed"));
-
-       if (setup_differ_info(zhp, fromsnap, tosnap, &di)) {
-               teardown_differ_info(&di);
-               return (-1);
-       }
-
-       if (pipe(pipefd)) {
-               zfs_error_aux(zhp->zfs_hdl, strerror(errno));
-               teardown_differ_info(&di);
-               return (zfs_error(zhp->zfs_hdl, EZFS_PIPEFAILED, errbuf));
-       }
-
-       di.scripted = (flags & ZFS_DIFF_PARSEABLE);
-       di.classify = (flags & ZFS_DIFF_CLASSIFY);
-       di.timestamped = (flags & ZFS_DIFF_TIMESTAMP);
-
-       di.outputfd = outfd;
-       di.datafd = pipefd[0];
-
-       if (pthread_create(&tid, NULL, differ, &di)) {
-               zfs_error_aux(zhp->zfs_hdl, strerror(errno));
-               (void) close(pipefd[0]);
-               (void) close(pipefd[1]);
-               teardown_differ_info(&di);
-               return (zfs_error(zhp->zfs_hdl,
-                   EZFS_THREADCREATEFAILED, errbuf));
-       }
-
-       /* do the ioctl() */
-       (void) strlcpy(zc.zc_value, di.fromsnap, strlen(di.fromsnap) + 1);
-       (void) strlcpy(zc.zc_name, di.tosnap, strlen(di.tosnap) + 1);
-       zc.zc_cookie = pipefd[1];
-
-       iocerr = ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_DIFF, &zc);
-       if (iocerr != 0) {
-               (void) snprintf(errbuf, sizeof (errbuf),
-                   dgettext(TEXT_DOMAIN, "Unable to obtain diffs"));
-               if (errno == EPERM) {
-                       zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
-                           "\n   The sys_mount privilege or diff delegated "
-                           "permission is needed\n   to execute the "
-                           "diff ioctl"));
-               } else if (errno == EXDEV) {
-                       zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
-                           "\n   Not an earlier snapshot from the same fs"));
-               } else if (errno != EPIPE || di.zerr == 0) {
-                       zfs_error_aux(zhp->zfs_hdl, strerror(errno));
-               }
-               (void) close(pipefd[1]);
-               (void) pthread_cancel(tid);
-               (void) pthread_join(tid, NULL);
-               teardown_differ_info(&di);
-               if (di.zerr != 0 && di.zerr != EPIPE) {
-                       zfs_error_aux(zhp->zfs_hdl, strerror(di.zerr));
-                       return (zfs_error(zhp->zfs_hdl, EZFS_DIFF, di.errbuf));
-               } else {
-                       return (zfs_error(zhp->zfs_hdl, EZFS_DIFFDATA, errbuf));
-               }
-       }
-
-       (void) close(pipefd[1]);
-       (void) pthread_join(tid, NULL);
-
-       if (di.zerr != 0) {
-               zfs_error_aux(zhp->zfs_hdl, strerror(di.zerr));
-               return (zfs_error(zhp->zfs_hdl, EZFS_DIFF, di.errbuf));
-       }
-       teardown_differ_info(&di);
-       return (0);
-}
diff --git a/zfs/lib/libzfs/libzfs_fru.c b/zfs/lib/libzfs/libzfs_fru.c
deleted file mode 100644 (file)
index 6be927f..0000000
+++ /dev/null
@@ -1,466 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-#include <dlfcn.h>
-#include <errno.h>
-#include <libintl.h>
-#include <link.h>
-#include <pthread.h>
-#include <strings.h>
-#include <unistd.h>
-
-#include <libzfs.h>
-
-#if defined(HAVE_LIBTOPO)
-
-#include <fm/libtopo.h>
-#include <sys/fm/protocol.h>
-#include <sys/systeminfo.h>
-
-#include "libzfs_impl.h"
-
-/*
- * This file is responsible for determining the relationship between I/O
- * devices paths and physical locations.  In the world of MPxIO and external
- * enclosures, the device path is not synonymous with the physical location.
- * If you remove a drive and insert it into a different slot, it will end up
- * with the same path under MPxIO.  If you recable storage enclosures, the
- * device paths may change.  All of this makes it difficult to implement the
- * 'autoreplace' property, which is supposed to automatically manage disk
- * replacement based on physical slot.
- *
- * In order to work around these limitations, we have a per-vdev FRU property
- * that is the libtopo path (minus disk-specific authority information) to the
- * physical location of the device on the system.  This is an optional
- * property, and is only needed when using the 'autoreplace' property or when
- * generating FMA faults against vdevs.
- */
-
-/*
- * Because the FMA packages depend on ZFS, we have to dlopen() libtopo in case
- * it is not present.  We only need this once per library instance, so it is
- * not part of the libzfs handle.
- */
-static void *_topo_dlhandle;
-static topo_hdl_t *(*_topo_open)(int, const char *, int *);
-static void (*_topo_close)(topo_hdl_t *);
-static char *(*_topo_snap_hold)(topo_hdl_t *, const char *, int *);
-static void (*_topo_snap_release)(topo_hdl_t *);
-static topo_walk_t *(*_topo_walk_init)(topo_hdl_t *, const char *,
-    topo_walk_cb_t, void *, int *);
-static int (*_topo_walk_step)(topo_walk_t *, int);
-static void (*_topo_walk_fini)(topo_walk_t *);
-static void (*_topo_hdl_strfree)(topo_hdl_t *, char *);
-static char *(*_topo_node_name)(tnode_t *);
-static int (*_topo_prop_get_string)(tnode_t *, const char *, const char *,
-    char **, int *);
-static int (*_topo_node_fru)(tnode_t *, nvlist_t **, nvlist_t *, int *);
-static int (*_topo_fmri_nvl2str)(topo_hdl_t *, nvlist_t *, char **, int *);
-static int (*_topo_fmri_strcmp_noauth)(topo_hdl_t *, const char *,
-    const char *);
-
-#define        ZFS_FRU_HASH_SIZE       257
-
-static size_t
-fru_strhash(const char *key)
-{
-       ulong_t g, h = 0;
-       const char *p;
-
-       for (p = key; *p != '\0'; p++) {
-               h = (h << 4) + *p;
-
-               if ((g = (h & 0xf0000000)) != 0) {
-                       h ^= (g >> 24);
-                       h ^= g;
-               }
-       }
-
-       return (h % ZFS_FRU_HASH_SIZE);
-}
-
-static int
-libzfs_fru_gather(topo_hdl_t *thp, tnode_t *tn, void *arg)
-{
-       libzfs_handle_t *hdl = arg;
-       nvlist_t *fru;
-       char *devpath, *frustr;
-       int err;
-       libzfs_fru_t *frup;
-       size_t idx;
-
-       /*
-        * If this is the chassis node, and we don't yet have the system
-        * chassis ID, then fill in this value now.
-        */
-       if (hdl->libzfs_chassis_id[0] == '\0' &&
-           strcmp(_topo_node_name(tn), "chassis") == 0) {
-               if (_topo_prop_get_string(tn, FM_FMRI_AUTHORITY,
-                   FM_FMRI_AUTH_CHASSIS, &devpath, &err) == 0)
-                       (void) strlcpy(hdl->libzfs_chassis_id, devpath,
-                           sizeof (hdl->libzfs_chassis_id));
-       }
-
-       /*
-        * Skip non-disk nodes.
-        */
-       if (strcmp(_topo_node_name(tn), "disk") != 0)
-               return (TOPO_WALK_NEXT);
-
-       /*
-        * Get the devfs path and FRU.
-        */
-       if (_topo_prop_get_string(tn, "io", "devfs-path", &devpath, &err) != 0)
-               return (TOPO_WALK_NEXT);
-
-       if (libzfs_fru_lookup(hdl, devpath) != NULL) {
-               _topo_hdl_strfree(thp, devpath);
-               return (TOPO_WALK_NEXT);
-       }
-
-       if (_topo_node_fru(tn, &fru, NULL, &err) != 0) {
-               _topo_hdl_strfree(thp, devpath);
-               return (TOPO_WALK_NEXT);
-       }
-
-       /*
-        * Convert the FRU into a string.
-        */
-       if (_topo_fmri_nvl2str(thp, fru, &frustr, &err) != 0) {
-               nvlist_free(fru);
-               _topo_hdl_strfree(thp, devpath);
-               return (TOPO_WALK_NEXT);
-       }
-
-       nvlist_free(fru);
-
-       /*
-        * Finally, we have a FRU string and device path.  Add it to the hash.
-        */
-       if ((frup = calloc(sizeof (libzfs_fru_t), 1)) == NULL) {
-               _topo_hdl_strfree(thp, devpath);
-               _topo_hdl_strfree(thp, frustr);
-               return (TOPO_WALK_NEXT);
-       }
-
-       if ((frup->zf_device = strdup(devpath)) == NULL ||
-           (frup->zf_fru = strdup(frustr)) == NULL) {
-               free(frup->zf_device);
-               free(frup);
-               _topo_hdl_strfree(thp, devpath);
-               _topo_hdl_strfree(thp, frustr);
-               return (TOPO_WALK_NEXT);
-       }
-
-       _topo_hdl_strfree(thp, devpath);
-       _topo_hdl_strfree(thp, frustr);
-
-       idx = fru_strhash(frup->zf_device);
-       frup->zf_chain = hdl->libzfs_fru_hash[idx];
-       hdl->libzfs_fru_hash[idx] = frup;
-       frup->zf_next = hdl->libzfs_fru_list;
-       hdl->libzfs_fru_list = frup;
-
-       return (TOPO_WALK_NEXT);
-}
-
-/*
- * Called during initialization to setup the dynamic libtopo connection.
- */
-#pragma init(libzfs_init_fru)
-static void
-libzfs_init_fru(void)
-{
-       char path[MAXPATHLEN];
-       char isa[257];
-
-#if defined(_LP64)
-       if (sysinfo(SI_ARCHITECTURE_64, isa, sizeof (isa)) < 0)
-               isa[0] = '\0';
-#else
-       isa[0] = '\0';
-#endif
-       (void) snprintf(path, sizeof (path),
-           "/usr/lib/fm/%s/libtopo.so", isa);
-
-       if ((_topo_dlhandle = dlopen(path, RTLD_LAZY)) == NULL)
-               return;
-
-       _topo_open = (topo_hdl_t *(*)())
-           dlsym(_topo_dlhandle, "topo_open");
-       _topo_close = (void (*)())
-           dlsym(_topo_dlhandle, "topo_close");
-       _topo_snap_hold = (char *(*)())
-           dlsym(_topo_dlhandle, "topo_snap_hold");
-       _topo_snap_release = (void (*)())
-           dlsym(_topo_dlhandle, "topo_snap_release");
-       _topo_walk_init = (topo_walk_t *(*)())
-           dlsym(_topo_dlhandle, "topo_walk_init");
-       _topo_walk_step = (int (*)())
-           dlsym(_topo_dlhandle, "topo_walk_step");
-       _topo_walk_fini = (void (*)())
-           dlsym(_topo_dlhandle, "topo_walk_fini");
-       _topo_hdl_strfree = (void (*)())
-           dlsym(_topo_dlhandle, "topo_hdl_strfree");
-       _topo_node_name = (char *(*)())
-           dlsym(_topo_dlhandle, "topo_node_name");
-       _topo_prop_get_string = (int (*)())
-           dlsym(_topo_dlhandle, "topo_prop_get_string");
-       _topo_node_fru = (int (*)())
-           dlsym(_topo_dlhandle, "topo_node_fru");
-       _topo_fmri_nvl2str = (int (*)())
-           dlsym(_topo_dlhandle, "topo_fmri_nvl2str");
-       _topo_fmri_strcmp_noauth = (int (*)())
-           dlsym(_topo_dlhandle, "topo_fmri_strcmp_noauth");
-
-       if (_topo_open == NULL || _topo_close == NULL ||
-           _topo_snap_hold == NULL || _topo_snap_release == NULL ||
-           _topo_walk_init == NULL || _topo_walk_step == NULL ||
-           _topo_walk_fini == NULL || _topo_hdl_strfree == NULL ||
-           _topo_node_name == NULL || _topo_prop_get_string == NULL ||
-           _topo_node_fru == NULL || _topo_fmri_nvl2str == NULL ||
-           _topo_fmri_strcmp_noauth == NULL) {
-               (void) dlclose(_topo_dlhandle);
-               _topo_dlhandle = NULL;
-       }
-}
-
-/*
- * Refresh the mappings from device path -> FMRI.  We do this by walking the
- * hc topology looking for disk nodes, and recording the io/devfs-path and FRU.
- * Note that we strip out the disk-specific authority information (serial,
- * part, revision, etc) so that we are left with only the identifying
- * characteristics of the slot (hc path and chassis-id).
- */
-void
-libzfs_fru_refresh(libzfs_handle_t *hdl)
-{
-       int err;
-       char *uuid;
-       topo_hdl_t *thp;
-       topo_walk_t *twp;
-
-       if (_topo_dlhandle == NULL)
-               return;
-
-       /*
-        * Clear the FRU hash and initialize our basic structures.
-        */
-       libzfs_fru_clear(hdl, B_FALSE);
-
-       if ((hdl->libzfs_topo_hdl = _topo_open(TOPO_VERSION,
-           NULL, &err)) == NULL)
-               return;
-
-       thp = hdl->libzfs_topo_hdl;
-
-       if ((uuid = _topo_snap_hold(thp, NULL, &err)) == NULL)
-               return;
-
-       _topo_hdl_strfree(thp, uuid);
-
-       if (hdl->libzfs_fru_hash == NULL &&
-           (hdl->libzfs_fru_hash =
-           calloc(ZFS_FRU_HASH_SIZE * sizeof (void *), 1)) == NULL)
-               return;
-
-       /*
-        * We now have a topo snapshot, so iterate over the hc topology looking
-        * for disks to add to the hash.
-        */
-       twp = _topo_walk_init(thp, FM_FMRI_SCHEME_HC,
-           libzfs_fru_gather, hdl, &err);
-       if (twp != NULL) {
-               (void) _topo_walk_step(twp, TOPO_WALK_CHILD);
-               _topo_walk_fini(twp);
-       }
-}
-
-/*
- * Given a devfs path, return the FRU for the device, if known.  This will
- * automatically call libzfs_fru_refresh() if it hasn't already been called by
- * the consumer.  The string returned is valid until the next call to
- * libzfs_fru_refresh().
- */
-const char *
-libzfs_fru_lookup(libzfs_handle_t *hdl, const char *devpath)
-{
-       size_t idx = fru_strhash(devpath);
-       libzfs_fru_t *frup;
-
-       if (hdl->libzfs_fru_hash == NULL)
-               libzfs_fru_refresh(hdl);
-
-       if (hdl->libzfs_fru_hash == NULL)
-               return (NULL);
-
-       for (frup = hdl->libzfs_fru_hash[idx]; frup != NULL;
-           frup = frup->zf_chain) {
-               if (strcmp(devpath, frup->zf_device) == 0)
-                       return (frup->zf_fru);
-       }
-
-       return (NULL);
-}
-
-/*
- * Given a fru path, return the device path.  This will automatically call
- * libzfs_fru_refresh() if it hasn't already been called by the consumer.  The
- * string returned is valid until the next call to libzfs_fru_refresh().
- */
-const char *
-libzfs_fru_devpath(libzfs_handle_t *hdl, const char *fru)
-{
-       libzfs_fru_t *frup;
-       size_t idx;
-
-       if (hdl->libzfs_fru_hash == NULL)
-               libzfs_fru_refresh(hdl);
-
-       if (hdl->libzfs_fru_hash == NULL)
-               return (NULL);
-
-       for (idx = 0; idx < ZFS_FRU_HASH_SIZE; idx++) {
-               for (frup = hdl->libzfs_fru_hash[idx]; frup != NULL;
-                   frup = frup->zf_next) {
-                       if (_topo_fmri_strcmp_noauth(hdl->libzfs_topo_hdl,
-                           fru, frup->zf_fru))
-                               return (frup->zf_device);
-               }
-       }
-
-       return (NULL);
-}
-
-/*
- * Change the stored FRU for the given vdev.
- */
-int
-zpool_fru_set(zpool_handle_t *zhp, uint64_t vdev_guid, const char *fru)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       (void) strncpy(zc.zc_value, fru, sizeof (zc.zc_value));
-       zc.zc_guid = vdev_guid;
-
-       if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_VDEV_SETFRU, &zc) != 0)
-               return (zpool_standard_error_fmt(zhp->zpool_hdl, errno,
-                   dgettext(TEXT_DOMAIN, "cannot set FRU")));
-
-       return (0);
-}
-
-/*
- * Compare to two FRUs, ignoring any authority information.
- */
-boolean_t
-libzfs_fru_compare(libzfs_handle_t *hdl, const char *a, const char *b)
-{
-       if (hdl->libzfs_fru_hash == NULL)
-               libzfs_fru_refresh(hdl);
-
-       if (hdl->libzfs_fru_hash == NULL)
-               return (strcmp(a, b) == 0);
-
-       return (_topo_fmri_strcmp_noauth(hdl->libzfs_topo_hdl, a, b));
-}
-
-/*
- * This special function checks to see whether the FRU indicates it's supposed
- * to be in the system chassis, but the chassis-id doesn't match.  This can
- * happen in a clustered case, where both head nodes have the same logical
- * disk, but opening the device on the other head node is meaningless.
- */
-boolean_t
-libzfs_fru_notself(libzfs_handle_t *hdl, const char *fru)
-{
-       const char *chassisid;
-       size_t len;
-
-       if (hdl->libzfs_fru_hash == NULL)
-               libzfs_fru_refresh(hdl);
-
-       if (hdl->libzfs_chassis_id[0] == '\0')
-               return (B_FALSE);
-
-       if (strstr(fru, "/chassis=0/") == NULL)
-               return (B_FALSE);
-
-       if ((chassisid = strstr(fru, ":chassis-id=")) == NULL)
-               return (B_FALSE);
-
-       chassisid += 12;
-       len = strlen(hdl->libzfs_chassis_id);
-       if (strncmp(chassisid, hdl->libzfs_chassis_id, len) == 0 &&
-           (chassisid[len] == '/' || chassisid[len] == ':'))
-               return (B_FALSE);
-
-       return (B_TRUE);
-}
-
-/*
- * Clear memory associated with the FRU hash.
- */
-void
-libzfs_fru_clear(libzfs_handle_t *hdl, boolean_t final)
-{
-       libzfs_fru_t *frup;
-
-       while ((frup = hdl->libzfs_fru_list) != NULL) {
-               hdl->libzfs_fru_list = frup->zf_next;
-               free(frup->zf_device);
-               free(frup->zf_fru);
-               free(frup);
-       }
-
-       hdl->libzfs_fru_list = NULL;
-
-       if (hdl->libzfs_topo_hdl != NULL) {
-               _topo_snap_release(hdl->libzfs_topo_hdl);
-               _topo_close(hdl->libzfs_topo_hdl);
-               hdl->libzfs_topo_hdl = NULL;
-       }
-
-       if (final) {
-               free(hdl->libzfs_fru_hash);
-       } else if (hdl->libzfs_fru_hash != NULL) {
-               bzero(hdl->libzfs_fru_hash,
-                   ZFS_FRU_HASH_SIZE * sizeof (void *));
-       }
-}
-
-#else /* HAVE_LIBTOPO */
-
-/*
- * Clear memory associated with the FRU hash.
- */
-void
-libzfs_fru_clear(libzfs_handle_t *hdl, boolean_t final)
-{
-}
-
-#endif /* HAVE_LIBTOPO */
diff --git a/zfs/lib/libzfs/libzfs_graph.c b/zfs/lib/libzfs/libzfs_graph.c
deleted file mode 100644 (file)
index 63d9138..0000000
+++ /dev/null
@@ -1,653 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-
-/*
- * Iterate over all children of the current object.  This includes the normal
- * dataset hierarchy, but also arbitrary hierarchies due to clones.  We want to
- * walk all datasets in the pool, and construct a directed graph of the form:
- *
- *                     home
- *                        |
- *                   +----+----+
- *                   |         |
- *                   v         v             ws
- *                  bar       baz             |
- *                             |              |
- *                             v              v
- *                          @yesterday ----> foo
- *
- * In order to construct this graph, we have to walk every dataset in the pool,
- * because the clone parent is stored as a property of the child, not the
- * parent.  The parent only keeps track of the number of clones.
- *
- * In the normal case (without clones) this would be rather expensive.  To avoid
- * unnecessary computation, we first try a walk of the subtree hierarchy
- * starting from the initial node.  At each dataset, we construct a node in the
- * graph and an edge leading from its parent.  If we don't see any snapshots
- * with a non-zero clone count, then we are finished.
- *
- * If we do find a cloned snapshot, then we finish the walk of the current
- * subtree, but indicate that we need to do a complete walk.  We then perform a
- * global walk of all datasets, avoiding the subtree we already processed.
- *
- * At the end of this, we'll end up with a directed graph of all relevant (and
- * possible some irrelevant) datasets in the system.  We need to both find our
- * limiting subgraph and determine a safe ordering in which to destroy the
- * datasets.  We do a topological ordering of our graph starting at our target
- * dataset, and then walk the results in reverse.
- *
- * It's possible for the graph to have cycles if, for example, the user renames
- * a clone to be the parent of its origin snapshot.  The user can request to
- * generate an error in this case, or ignore the cycle and continue.
- *
- * When removing datasets, we want to destroy the snapshots in chronological
- * order (because this is the most efficient method).  In order to accomplish
- * this, we store the creation transaction group with each vertex and keep each
- * vertex's edges sorted according to this value.  The topological sort will
- * automatically walk the snapshots in the correct order.
- */
-
-#include <assert.h>
-#include <libintl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <strings.h>
-#include <unistd.h>
-
-#include <libzfs.h>
-
-#include "libzfs_impl.h"
-#include "zfs_namecheck.h"
-
-#define        MIN_EDGECOUNT   4
-
-/*
- * Vertex structure.  Indexed by dataset name, this structure maintains a list
- * of edges to other vertices.
- */
-struct zfs_edge;
-typedef struct zfs_vertex {
-       char                    zv_dataset[ZFS_MAXNAMELEN];
-       struct zfs_vertex       *zv_next;
-       int                     zv_visited;
-       uint64_t                zv_txg;
-       struct zfs_edge         **zv_edges;
-       int                     zv_edgecount;
-       int                     zv_edgealloc;
-} zfs_vertex_t;
-
-enum {
-       VISIT_SEEN = 1,
-       VISIT_SORT_PRE,
-       VISIT_SORT_POST
-};
-
-/*
- * Edge structure.  Simply maintains a pointer to the destination vertex.  There
- * is no need to store the source vertex, since we only use edges in the context
- * of the source vertex.
- */
-typedef struct zfs_edge {
-       zfs_vertex_t            *ze_dest;
-       struct zfs_edge         *ze_next;
-} zfs_edge_t;
-
-#define        ZFS_GRAPH_SIZE          1027    /* this could be dynamic some day */
-
-/*
- * Graph structure.  Vertices are maintained in a hash indexed by dataset name.
- */
-typedef struct zfs_graph {
-       zfs_vertex_t            **zg_hash;
-       size_t                  zg_size;
-       size_t                  zg_nvertex;
-       const char              *zg_root;
-       int                     zg_clone_count;
-} zfs_graph_t;
-
-/*
- * Allocate a new edge pointing to the target vertex.
- */
-static zfs_edge_t *
-zfs_edge_create(libzfs_handle_t *hdl, zfs_vertex_t *dest)
-{
-       zfs_edge_t *zep = zfs_alloc(hdl, sizeof (zfs_edge_t));
-
-       if (zep == NULL)
-               return (NULL);
-
-       zep->ze_dest = dest;
-
-       return (zep);
-}
-
-/*
- * Destroy an edge.
- */
-static void
-zfs_edge_destroy(zfs_edge_t *zep)
-{
-       free(zep);
-}
-
-/*
- * Allocate a new vertex with the given name.
- */
-static zfs_vertex_t *
-zfs_vertex_create(libzfs_handle_t *hdl, const char *dataset)
-{
-       zfs_vertex_t *zvp = zfs_alloc(hdl, sizeof (zfs_vertex_t));
-
-       if (zvp == NULL)
-               return (NULL);
-
-       assert(strlen(dataset) < ZFS_MAXNAMELEN);
-
-       (void) strlcpy(zvp->zv_dataset, dataset, sizeof (zvp->zv_dataset));
-
-       if ((zvp->zv_edges = zfs_alloc(hdl,
-           MIN_EDGECOUNT * sizeof (void *))) == NULL) {
-               free(zvp);
-               return (NULL);
-       }
-
-       zvp->zv_edgealloc = MIN_EDGECOUNT;
-
-       return (zvp);
-}
-
-/*
- * Destroy a vertex.  Frees up any associated edges.
- */
-static void
-zfs_vertex_destroy(zfs_vertex_t *zvp)
-{
-       int i;
-
-       for (i = 0; i < zvp->zv_edgecount; i++)
-               zfs_edge_destroy(zvp->zv_edges[i]);
-
-       free(zvp->zv_edges);
-       free(zvp);
-}
-
-/*
- * Given a vertex, add an edge to the destination vertex.
- */
-static int
-zfs_vertex_add_edge(libzfs_handle_t *hdl, zfs_vertex_t *zvp,
-    zfs_vertex_t *dest)
-{
-       zfs_edge_t *zep = zfs_edge_create(hdl, dest);
-
-       if (zep == NULL)
-               return (-1);
-
-       if (zvp->zv_edgecount == zvp->zv_edgealloc) {
-               void *ptr;
-
-               if ((ptr = zfs_realloc(hdl, zvp->zv_edges,
-                   zvp->zv_edgealloc * sizeof (void *),
-                   zvp->zv_edgealloc * 2 * sizeof (void *))) == NULL)
-                       return (-1);
-
-               zvp->zv_edges = ptr;
-               zvp->zv_edgealloc *= 2;
-       }
-
-       zvp->zv_edges[zvp->zv_edgecount++] = zep;
-
-       return (0);
-}
-
-static int
-zfs_edge_compare(const void *a, const void *b)
-{
-       const zfs_edge_t *ea = *((zfs_edge_t **)a);
-       const zfs_edge_t *eb = *((zfs_edge_t **)b);
-
-       if (ea->ze_dest->zv_txg < eb->ze_dest->zv_txg)
-               return (-1);
-       if (ea->ze_dest->zv_txg > eb->ze_dest->zv_txg)
-               return (1);
-       return (0);
-}
-
-/*
- * Sort the given vertex edges according to the creation txg of each vertex.
- */
-static void
-zfs_vertex_sort_edges(zfs_vertex_t *zvp)
-{
-       if (zvp->zv_edgecount == 0)
-               return;
-
-       qsort(zvp->zv_edges, zvp->zv_edgecount, sizeof (void *),
-           zfs_edge_compare);
-}
-
-/*
- * Construct a new graph object.  We allow the size to be specified as a
- * parameter so in the future we can size the hash according to the number of
- * datasets in the pool.
- */
-static zfs_graph_t *
-zfs_graph_create(libzfs_handle_t *hdl, const char *dataset, size_t size)
-{
-       zfs_graph_t *zgp = zfs_alloc(hdl, sizeof (zfs_graph_t));
-
-       if (zgp == NULL)
-               return (NULL);
-
-       zgp->zg_size = size;
-       if ((zgp->zg_hash = zfs_alloc(hdl,
-           size * sizeof (zfs_vertex_t *))) == NULL) {
-               free(zgp);
-               return (NULL);
-       }
-
-       zgp->zg_root = dataset;
-       zgp->zg_clone_count = 0;
-
-       return (zgp);
-}
-
-/*
- * Destroy a graph object.  We have to iterate over all the hash chains,
- * destroying each vertex in the process.
- */
-static void
-zfs_graph_destroy(zfs_graph_t *zgp)
-{
-       int i;
-       zfs_vertex_t *current, *next;
-
-       for (i = 0; i < zgp->zg_size; i++) {
-               current = zgp->zg_hash[i];
-               while (current != NULL) {
-                       next = current->zv_next;
-                       zfs_vertex_destroy(current);
-                       current = next;
-               }
-       }
-
-       free(zgp->zg_hash);
-       free(zgp);
-}
-
-/*
- * Graph hash function.  Classic bernstein k=33 hash function, taken from
- * usr/src/cmd/sgs/tools/common/strhash.c
- */
-static size_t
-zfs_graph_hash(zfs_graph_t *zgp, const char *str)
-{
-       size_t hash = 5381;
-       int c;
-
-       while ((c = *str++) != 0)
-               hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
-
-       return (hash % zgp->zg_size);
-}
-
-/*
- * Given a dataset name, finds the associated vertex, creating it if necessary.
- */
-static zfs_vertex_t *
-zfs_graph_lookup(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset,
-    uint64_t txg)
-{
-       size_t idx = zfs_graph_hash(zgp, dataset);
-       zfs_vertex_t *zvp;
-
-       for (zvp = zgp->zg_hash[idx]; zvp != NULL; zvp = zvp->zv_next) {
-               if (strcmp(zvp->zv_dataset, dataset) == 0) {
-                       if (zvp->zv_txg == 0)
-                               zvp->zv_txg = txg;
-                       return (zvp);
-               }
-       }
-
-       if ((zvp = zfs_vertex_create(hdl, dataset)) == NULL)
-               return (NULL);
-
-       zvp->zv_next = zgp->zg_hash[idx];
-       zvp->zv_txg = txg;
-       zgp->zg_hash[idx] = zvp;
-       zgp->zg_nvertex++;
-
-       return (zvp);
-}
-
-/*
- * Given two dataset names, create an edge between them.  For the source vertex,
- * mark 'zv_visited' to indicate that we have seen this vertex, and not simply
- * created it as a destination of another edge.  If 'dest' is NULL, then this
- * is an individual vertex (i.e. the starting vertex), so don't add an edge.
- */
-static int
-zfs_graph_add(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *source,
-    const char *dest, uint64_t txg)
-{
-       zfs_vertex_t *svp, *dvp;
-
-       if ((svp = zfs_graph_lookup(hdl, zgp, source, 0)) == NULL)
-               return (-1);
-       svp->zv_visited = VISIT_SEEN;
-       if (dest != NULL) {
-               dvp = zfs_graph_lookup(hdl, zgp, dest, txg);
-               if (dvp == NULL)
-                       return (-1);
-               if (zfs_vertex_add_edge(hdl, svp, dvp) != 0)
-                       return (-1);
-       }
-
-       return (0);
-}
-
-/*
- * Iterate over all children of the given dataset, adding any vertices
- * as necessary.  Returns -1 if there was an error, or 0 otherwise.
- * This is a simple recursive algorithm - the ZFS namespace typically
- * is very flat.  We manually invoke the necessary ioctl() calls to
- * avoid the overhead and additional semantics of zfs_open().
- */
-static int
-iterate_children(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset)
-{
-       zfs_cmd_t zc = {"\0"};
-       zfs_vertex_t *zvp;
-
-       /*
-        * Look up the source vertex, and avoid it if we've seen it before.
-        */
-       zvp = zfs_graph_lookup(hdl, zgp, dataset, 0);
-       if (zvp == NULL)
-               return (-1);
-       if (zvp->zv_visited == VISIT_SEEN)
-               return (0);
-
-       /*
-        * Iterate over all children
-        */
-       for ((void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
-           ioctl(hdl->libzfs_fd, ZFS_IOC_DATASET_LIST_NEXT, &zc) == 0;
-           (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name))) {
-               /*
-                * Get statistics for this dataset, to determine the type of the
-                * dataset and clone statistics.  If this fails, the dataset has
-                * since been removed, and we're pretty much screwed anyway.
-                */
-               zc.zc_objset_stats.dds_origin[0] = '\0';
-               if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0)
-                       continue;
-
-               if (zc.zc_objset_stats.dds_origin[0] != '\0') {
-                       if (zfs_graph_add(hdl, zgp,
-                           zc.zc_objset_stats.dds_origin, zc.zc_name,
-                           zc.zc_objset_stats.dds_creation_txg) != 0)
-                               return (-1);
-                       /*
-                        * Count origins only if they are contained in the graph
-                        */
-                       if (isa_child_of(zc.zc_objset_stats.dds_origin,
-                           zgp->zg_root))
-                               zgp->zg_clone_count--;
-               }
-
-               /*
-                * Add an edge between the parent and the child.
-                */
-               if (zfs_graph_add(hdl, zgp, dataset, zc.zc_name,
-                   zc.zc_objset_stats.dds_creation_txg) != 0)
-                       return (-1);
-
-               /*
-                * Recursively visit child
-                */
-               if (iterate_children(hdl, zgp, zc.zc_name))
-                       return (-1);
-       }
-
-       /*
-        * Now iterate over all snapshots.
-        */
-       bzero(&zc, sizeof (zc));
-
-       for ((void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
-           ioctl(hdl->libzfs_fd, ZFS_IOC_SNAPSHOT_LIST_NEXT, &zc) == 0;
-           (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name))) {
-
-               /*
-                * Get statistics for this dataset, to determine the type of the
-                * dataset and clone statistics.  If this fails, the dataset has
-                * since been removed, and we're pretty much screwed anyway.
-                */
-               if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0)
-                       continue;
-
-               /*
-                * Add an edge between the parent and the child.
-                */
-               if (zfs_graph_add(hdl, zgp, dataset, zc.zc_name,
-                   zc.zc_objset_stats.dds_creation_txg) != 0)
-                       return (-1);
-
-               zgp->zg_clone_count += zc.zc_objset_stats.dds_num_clones;
-       }
-
-       zvp->zv_visited = VISIT_SEEN;
-
-       return (0);
-}
-
-/*
- * Returns false if there are no snapshots with dependent clones in this
- * subtree or if all of those clones are also in this subtree.  Returns
- * true if there is an error or there are external dependents.
- */
-static boolean_t
-external_dependents(libzfs_handle_t *hdl, zfs_graph_t *zgp, const char *dataset)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       /*
-        * Check whether this dataset is a clone or has clones since
-        * iterate_children() only checks the children.
-        */
-       (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0)
-               return (B_TRUE);
-
-       if (zc.zc_objset_stats.dds_origin[0] != '\0') {
-               if (zfs_graph_add(hdl, zgp,
-                   zc.zc_objset_stats.dds_origin, zc.zc_name,
-                   zc.zc_objset_stats.dds_creation_txg) != 0)
-                       return (B_TRUE);
-               if (isa_child_of(zc.zc_objset_stats.dds_origin, dataset))
-                       zgp->zg_clone_count--;
-       }
-
-       if ((zc.zc_objset_stats.dds_num_clones) ||
-           iterate_children(hdl, zgp, dataset))
-               return (B_TRUE);
-
-       return (zgp->zg_clone_count != 0);
-}
-
-/*
- * Construct a complete graph of all necessary vertices.  First, iterate over
- * only our object's children.  If no cloned snapshots are found, or all of
- * the cloned snapshots are in this subtree then return a graph of the subtree.
- * Otherwise, start at the root of the pool and iterate over all datasets.
- */
-static zfs_graph_t *
-construct_graph(libzfs_handle_t *hdl, const char *dataset)
-{
-       zfs_graph_t *zgp = zfs_graph_create(hdl, dataset, ZFS_GRAPH_SIZE);
-       int ret = 0;
-
-       if (zgp == NULL)
-               return (zgp);
-
-       if ((strchr(dataset, '/') == NULL) ||
-           (external_dependents(hdl, zgp, dataset))) {
-               /*
-                * Determine pool name and try again.
-                */
-               int len = strcspn(dataset, "/@") + 1;
-               char *pool = zfs_alloc(hdl, len);
-
-               if (pool == NULL) {
-                       zfs_graph_destroy(zgp);
-                       return (NULL);
-               }
-               (void) strlcpy(pool, dataset, len);
-
-               if (iterate_children(hdl, zgp, pool) == -1 ||
-                   zfs_graph_add(hdl, zgp, pool, NULL, 0) != 0) {
-                       free(pool);
-                       zfs_graph_destroy(zgp);
-                       return (NULL);
-               }
-               free(pool);
-       }
-
-       if (ret == -1 || zfs_graph_add(hdl, zgp, dataset, NULL, 0) != 0) {
-               zfs_graph_destroy(zgp);
-               return (NULL);
-       }
-
-       return (zgp);
-}
-
-/*
- * Given a graph, do a recursive topological sort into the given array.  This is
- * really just a depth first search, so that the deepest nodes appear first.
- * hijack the 'zv_visited' marker to avoid visiting the same vertex twice.
- */
-static int
-topo_sort(libzfs_handle_t *hdl, boolean_t allowrecursion, char **result,
-    size_t *idx, zfs_vertex_t *zgv)
-{
-       int i;
-
-       if (zgv->zv_visited == VISIT_SORT_PRE && !allowrecursion) {
-               /*
-                * If we've already seen this vertex as part of our depth-first
-                * search, then we have a cyclic dependency, and we must return
-                * an error.
-                */
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "recursive dependency at '%s'"),
-                   zgv->zv_dataset);
-               return (zfs_error(hdl, EZFS_RECURSIVE,
-                   dgettext(TEXT_DOMAIN,
-                   "cannot determine dependent datasets")));
-       } else if (zgv->zv_visited >= VISIT_SORT_PRE) {
-               /*
-                * If we've already processed this as part of the topological
-                * sort, then don't bother doing so again.
-                */
-               return (0);
-       }
-
-       zgv->zv_visited = VISIT_SORT_PRE;
-
-       /* avoid doing a search if we don't have to */
-       zfs_vertex_sort_edges(zgv);
-       for (i = 0; i < zgv->zv_edgecount; i++) {
-               if (topo_sort(hdl, allowrecursion, result, idx,
-                   zgv->zv_edges[i]->ze_dest) != 0)
-                       return (-1);
-       }
-
-       /* we may have visited this in the course of the above */
-       if (zgv->zv_visited == VISIT_SORT_POST)
-               return (0);
-
-       if ((result[*idx] = zfs_alloc(hdl,
-           strlen(zgv->zv_dataset) + 1)) == NULL)
-               return (-1);
-
-       (void) strcpy(result[*idx], zgv->zv_dataset);
-       *idx += 1;
-       zgv->zv_visited = VISIT_SORT_POST;
-       return (0);
-}
-
-/*
- * The only public interface for this file.  Do the dirty work of constructing a
- * child list for the given object.  Construct the graph, do the toplogical
- * sort, and then return the array of strings to the caller.
- *
- * The 'allowrecursion' parameter controls behavior when cycles are found.  If
- * it is set, the the cycle is ignored and the results returned as if the cycle
- * did not exist.  If it is not set, then the routine will generate an error if
- * a cycle is found.
- */
-int
-get_dependents(libzfs_handle_t *hdl, boolean_t allowrecursion,
-    const char *dataset, char ***result, size_t *count)
-{
-       zfs_graph_t *zgp;
-       zfs_vertex_t *zvp;
-
-       if ((zgp = construct_graph(hdl, dataset)) == NULL)
-               return (-1);
-
-       if ((*result = zfs_alloc(hdl,
-           zgp->zg_nvertex * sizeof (char *))) == NULL) {
-               zfs_graph_destroy(zgp);
-               return (-1);
-       }
-
-       if ((zvp = zfs_graph_lookup(hdl, zgp, dataset, 0)) == NULL) {
-               free(*result);
-               zfs_graph_destroy(zgp);
-               return (-1);
-       }
-
-       *count = 0;
-       if (topo_sort(hdl, allowrecursion, *result, count, zvp) != 0) {
-               free(*result);
-               zfs_graph_destroy(zgp);
-               return (-1);
-       }
-
-       /*
-        * Get rid of the last entry, which is our starting vertex and not
-        * strictly a dependent.
-        */
-       assert(*count > 0);
-       free((*result)[*count - 1]);
-       (*count)--;
-
-       zfs_graph_destroy(zgp);
-
-       return (0);
-}
diff --git a/zfs/lib/libzfs/libzfs_import.c b/zfs/lib/libzfs/libzfs_import.c
deleted file mode 100644 (file)
index 5dc1482..0000000
+++ /dev/null
@@ -1,1662 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
- */
-
-/*
- * Pool import support functions.
- *
- * To import a pool, we rely on reading the configuration information from the
- * ZFS label of each device.  If we successfully read the label, then we
- * organize the configuration information in the following hierarchy:
- *
- *     pool guid -> toplevel vdev guid -> label txg
- *
- * Duplicate entries matching this same tuple will be discarded.  Once we have
- * examined every device, we pick the best label txg config for each toplevel
- * vdev.  We then arrange these toplevel vdevs into a complete pool config, and
- * update any paths that have changed.  Finally, we attempt to import the pool
- * using our derived config, and record the results.
- */
-
-#include <ctype.h>
-#include <devid.h>
-#include <dirent.h>
-#include <errno.h>
-#include <libintl.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <sys/vtoc.h>
-#include <sys/dktp/fdisk.h>
-#include <sys/efi_partition.h>
-
-#include <sys/vdev_impl.h>
-#ifdef HAVE_LIBBLKID
-#include <blkid/blkid.h>
-#endif
-
-#include "libzfs.h"
-#include "libzfs_impl.h"
-
-/*
- * Intermediate structures used to gather configuration information.
- */
-typedef struct config_entry {
-       uint64_t                ce_txg;
-       nvlist_t                *ce_config;
-       struct config_entry     *ce_next;
-} config_entry_t;
-
-typedef struct vdev_entry {
-       uint64_t                ve_guid;
-       config_entry_t          *ve_configs;
-       struct vdev_entry       *ve_next;
-} vdev_entry_t;
-
-typedef struct pool_entry {
-       uint64_t                pe_guid;
-       vdev_entry_t            *pe_vdevs;
-       struct pool_entry       *pe_next;
-} pool_entry_t;
-
-typedef struct name_entry {
-       char                    *ne_name;
-       uint64_t                ne_guid;
-       uint64_t                ne_order;
-       uint64_t                ne_num_labels;
-       struct name_entry       *ne_next;
-} name_entry_t;
-
-typedef struct pool_list {
-       pool_entry_t            *pools;
-       name_entry_t            *names;
-} pool_list_t;
-
-static char *
-get_devid(const char *path)
-{
-       int fd;
-       ddi_devid_t devid;
-       char *minor, *ret;
-
-       if ((fd = open(path, O_RDONLY)) < 0)
-               return (NULL);
-
-       minor = NULL;
-       ret = NULL;
-       if (devid_get(fd, &devid) == 0) {
-               if (devid_get_minor_name(fd, &minor) == 0)
-                       ret = devid_str_encode(devid, minor);
-               if (minor != NULL)
-                       devid_str_free(minor);
-               devid_free(devid);
-       }
-       (void) close(fd);
-
-       return (ret);
-}
-
-
-/*
- * Go through and fix up any path and/or devid information for the given vdev
- * configuration.
- */
-static int
-fix_paths(nvlist_t *nv, name_entry_t *names)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       uint64_t guid;
-       name_entry_t *ne, *best;
-       char *path, *devid;
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if (fix_paths(child[c], names) != 0)
-                               return (-1);
-               return (0);
-       }
-
-       /*
-        * This is a leaf (file or disk) vdev.  In either case, go through
-        * the name list and see if we find a matching guid.  If so, replace
-        * the path and see if we can calculate a new devid.
-        *
-        * There may be multiple names associated with a particular guid, in
-        * which case we have overlapping partitions or multiple paths to the
-        * same disk.  In this case we prefer to use the path name which
-        * matches the ZPOOL_CONFIG_PATH.  If no matching entry is found we
-        * use the lowest order device which corresponds to the first match
-        * while traversing the ZPOOL_IMPORT_PATH search path.
-        */
-       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &guid) == 0);
-       if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) != 0)
-               path = NULL;
-
-       best = NULL;
-       for (ne = names; ne != NULL; ne = ne->ne_next) {
-               if (ne->ne_guid == guid) {
-
-                       if (path == NULL) {
-                               best = ne;
-                               break;
-                       }
-
-                       if ((strlen(path) == strlen(ne->ne_name)) &&
-                           strncmp(path, ne->ne_name, strlen(path)) == 0) {
-                               best = ne;
-                               break;
-                       }
-
-                       if (best == NULL) {
-                               best = ne;
-                               continue;
-                       }
-
-                       /* Prefer paths with move vdev labels. */
-                       if (ne->ne_num_labels > best->ne_num_labels) {
-                               best = ne;
-                               continue;
-                       }
-
-                       /* Prefer paths earlier in the search order. */
-                       if (best->ne_num_labels == best->ne_num_labels &&
-                           ne->ne_order < best->ne_order) {
-                               best = ne;
-                               continue;
-                       }
-               }
-       }
-
-       if (best == NULL)
-               return (0);
-
-       if (nvlist_add_string(nv, ZPOOL_CONFIG_PATH, best->ne_name) != 0)
-               return (-1);
-
-       if ((devid = get_devid(best->ne_name)) == NULL) {
-               (void) nvlist_remove_all(nv, ZPOOL_CONFIG_DEVID);
-       } else {
-               if (nvlist_add_string(nv, ZPOOL_CONFIG_DEVID, devid) != 0)
-                       return (-1);
-               devid_str_free(devid);
-       }
-
-       return (0);
-}
-
-/*
- * Add the given configuration to the list of known devices.
- */
-static int
-add_config(libzfs_handle_t *hdl, pool_list_t *pl, const char *path,
-    int order, int num_labels, nvlist_t *config)
-{
-       uint64_t pool_guid, vdev_guid, top_guid, txg, state;
-       pool_entry_t *pe;
-       vdev_entry_t *ve;
-       config_entry_t *ce;
-       name_entry_t *ne;
-
-       /*
-        * If this is a hot spare not currently in use or level 2 cache
-        * device, add it to the list of names to translate, but don't do
-        * anything else.
-        */
-       if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
-           &state) == 0 &&
-           (state == POOL_STATE_SPARE || state == POOL_STATE_L2CACHE) &&
-           nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID, &vdev_guid) == 0) {
-               if ((ne = zfs_alloc(hdl, sizeof (name_entry_t))) == NULL)
-                       return (-1);
-
-               if ((ne->ne_name = zfs_strdup(hdl, path)) == NULL) {
-                       free(ne);
-                       return (-1);
-               }
-               ne->ne_guid = vdev_guid;
-               ne->ne_order = order;
-               ne->ne_num_labels = num_labels;
-               ne->ne_next = pl->names;
-               pl->names = ne;
-               return (0);
-       }
-
-       /*
-        * If we have a valid config but cannot read any of these fields, then
-        * it means we have a half-initialized label.  In vdev_label_init()
-        * we write a label with txg == 0 so that we can identify the device
-        * in case the user refers to the same disk later on.  If we fail to
-        * create the pool, we'll be left with a label in this state
-        * which should not be considered part of a valid pool.
-        */
-       if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
-           &pool_guid) != 0 ||
-           nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID,
-           &vdev_guid) != 0 ||
-           nvlist_lookup_uint64(config, ZPOOL_CONFIG_TOP_GUID,
-           &top_guid) != 0 ||
-           nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_TXG,
-           &txg) != 0 || txg == 0) {
-               nvlist_free(config);
-               return (0);
-       }
-
-       /*
-        * First, see if we know about this pool.  If not, then add it to the
-        * list of known pools.
-        */
-       for (pe = pl->pools; pe != NULL; pe = pe->pe_next) {
-               if (pe->pe_guid == pool_guid)
-                       break;
-       }
-
-       if (pe == NULL) {
-               if ((pe = zfs_alloc(hdl, sizeof (pool_entry_t))) == NULL) {
-                       nvlist_free(config);
-                       return (-1);
-               }
-               pe->pe_guid = pool_guid;
-               pe->pe_next = pl->pools;
-               pl->pools = pe;
-       }
-
-       /*
-        * Second, see if we know about this toplevel vdev.  Add it if its
-        * missing.
-        */
-       for (ve = pe->pe_vdevs; ve != NULL; ve = ve->ve_next) {
-               if (ve->ve_guid == top_guid)
-                       break;
-       }
-
-       if (ve == NULL) {
-               if ((ve = zfs_alloc(hdl, sizeof (vdev_entry_t))) == NULL) {
-                       nvlist_free(config);
-                       return (-1);
-               }
-               ve->ve_guid = top_guid;
-               ve->ve_next = pe->pe_vdevs;
-               pe->pe_vdevs = ve;
-       }
-
-       /*
-        * Third, see if we have a config with a matching transaction group.  If
-        * so, then we do nothing.  Otherwise, add it to the list of known
-        * configs.
-        */
-       for (ce = ve->ve_configs; ce != NULL; ce = ce->ce_next) {
-               if (ce->ce_txg == txg)
-                       break;
-       }
-
-       if (ce == NULL) {
-               if ((ce = zfs_alloc(hdl, sizeof (config_entry_t))) == NULL) {
-                       nvlist_free(config);
-                       return (-1);
-               }
-               ce->ce_txg = txg;
-               ce->ce_config = config;
-               ce->ce_next = ve->ve_configs;
-               ve->ve_configs = ce;
-       } else {
-               nvlist_free(config);
-       }
-
-       /*
-        * At this point we've successfully added our config to the list of
-        * known configs.  The last thing to do is add the vdev guid -> path
-        * mappings so that we can fix up the configuration as necessary before
-        * doing the import.
-        */
-       if ((ne = zfs_alloc(hdl, sizeof (name_entry_t))) == NULL)
-               return (-1);
-
-       if ((ne->ne_name = zfs_strdup(hdl, path)) == NULL) {
-               free(ne);
-               return (-1);
-       }
-
-       ne->ne_guid = vdev_guid;
-       ne->ne_order = order;
-       ne->ne_num_labels = num_labels;
-       ne->ne_next = pl->names;
-       pl->names = ne;
-
-       return (0);
-}
-
-/*
- * Returns true if the named pool matches the given GUID.
- */
-static int
-pool_active(libzfs_handle_t *hdl, const char *name, uint64_t guid,
-    boolean_t *isactive)
-{
-       zpool_handle_t *zhp;
-       uint64_t theguid;
-
-       if (zpool_open_silent(hdl, name, &zhp) != 0)
-               return (-1);
-
-       if (zhp == NULL) {
-               *isactive = B_FALSE;
-               return (0);
-       }
-
-       verify(nvlist_lookup_uint64(zhp->zpool_config, ZPOOL_CONFIG_POOL_GUID,
-           &theguid) == 0);
-
-       zpool_close(zhp);
-
-       *isactive = (theguid == guid);
-       return (0);
-}
-
-static nvlist_t *
-refresh_config(libzfs_handle_t *hdl, nvlist_t *config)
-{
-       nvlist_t *nvl;
-       zfs_cmd_t zc = {"\0"};
-       int err;
-
-       if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0)
-               return (NULL);
-
-       if (zcmd_alloc_dst_nvlist(hdl, &zc,
-           zc.zc_nvlist_conf_size * 2) != 0) {
-               zcmd_free_nvlists(&zc);
-               return (NULL);
-       }
-
-       while ((err = ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_TRYIMPORT,
-           &zc)) != 0 && errno == ENOMEM) {
-               if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       return (NULL);
-               }
-       }
-
-       if (err) {
-               zcmd_free_nvlists(&zc);
-               return (NULL);
-       }
-
-       if (zcmd_read_dst_nvlist(hdl, &zc, &nvl) != 0) {
-               zcmd_free_nvlists(&zc);
-               return (NULL);
-       }
-
-       zcmd_free_nvlists(&zc);
-       return (nvl);
-}
-
-/*
- * Determine if the vdev id is a hole in the namespace.
- */
-boolean_t
-vdev_is_hole(uint64_t *hole_array, uint_t holes, uint_t id)
-{
-       int c;
-
-       for (c = 0; c < holes; c++) {
-
-               /* Top-level is a hole */
-               if (hole_array[c] == id)
-                       return (B_TRUE);
-       }
-       return (B_FALSE);
-}
-
-/*
- * Convert our list of pools into the definitive set of configurations.  We
- * start by picking the best config for each toplevel vdev.  Once that's done,
- * we assemble the toplevel vdevs into a full config for the pool.  We make a
- * pass to fix up any incorrect paths, and then add it to the main list to
- * return to the user.
- */
-static nvlist_t *
-get_configs(libzfs_handle_t *hdl, pool_list_t *pl, boolean_t active_ok)
-{
-       pool_entry_t *pe;
-       vdev_entry_t *ve;
-       config_entry_t *ce;
-       nvlist_t *ret = NULL, *config = NULL, *tmp = NULL, *nvtop, *nvroot;
-       nvlist_t **spares, **l2cache;
-       uint_t i, nspares, nl2cache;
-       boolean_t config_seen;
-       uint64_t best_txg;
-       char *name, *hostname = NULL;
-       uint64_t guid;
-       uint_t children = 0;
-       nvlist_t **child = NULL;
-       uint_t holes;
-       uint64_t *hole_array, max_id;
-       uint_t c;
-       boolean_t isactive;
-       uint64_t hostid;
-       nvlist_t *nvl;
-       boolean_t valid_top_config = B_FALSE;
-
-       if (nvlist_alloc(&ret, 0, 0) != 0)
-               goto nomem;
-
-       for (pe = pl->pools; pe != NULL; pe = pe->pe_next) {
-               uint64_t id, max_txg = 0;
-
-               if (nvlist_alloc(&config, NV_UNIQUE_NAME, 0) != 0)
-                       goto nomem;
-               config_seen = B_FALSE;
-
-               /*
-                * Iterate over all toplevel vdevs.  Grab the pool configuration
-                * from the first one we find, and then go through the rest and
-                * add them as necessary to the 'vdevs' member of the config.
-                */
-               for (ve = pe->pe_vdevs; ve != NULL; ve = ve->ve_next) {
-
-                       /*
-                        * Determine the best configuration for this vdev by
-                        * selecting the config with the latest transaction
-                        * group.
-                        */
-                       best_txg = 0;
-                       for (ce = ve->ve_configs; ce != NULL;
-                           ce = ce->ce_next) {
-
-                               if (ce->ce_txg > best_txg) {
-                                       tmp = ce->ce_config;
-                                       best_txg = ce->ce_txg;
-                               }
-                       }
-
-                       /*
-                        * We rely on the fact that the max txg for the
-                        * pool will contain the most up-to-date information
-                        * about the valid top-levels in the vdev namespace.
-                        */
-                       if (best_txg > max_txg) {
-                               (void) nvlist_remove(config,
-                                   ZPOOL_CONFIG_VDEV_CHILDREN,
-                                   DATA_TYPE_UINT64);
-                               (void) nvlist_remove(config,
-                                   ZPOOL_CONFIG_HOLE_ARRAY,
-                                   DATA_TYPE_UINT64_ARRAY);
-
-                               max_txg = best_txg;
-                               hole_array = NULL;
-                               holes = 0;
-                               max_id = 0;
-                               valid_top_config = B_FALSE;
-
-                               if (nvlist_lookup_uint64(tmp,
-                                   ZPOOL_CONFIG_VDEV_CHILDREN, &max_id) == 0) {
-                                       verify(nvlist_add_uint64(config,
-                                           ZPOOL_CONFIG_VDEV_CHILDREN,
-                                           max_id) == 0);
-                                       valid_top_config = B_TRUE;
-                               }
-
-                               if (nvlist_lookup_uint64_array(tmp,
-                                   ZPOOL_CONFIG_HOLE_ARRAY, &hole_array,
-                                   &holes) == 0) {
-                                       verify(nvlist_add_uint64_array(config,
-                                           ZPOOL_CONFIG_HOLE_ARRAY,
-                                           hole_array, holes) == 0);
-                               }
-                       }
-
-                       if (!config_seen) {
-                               /*
-                                * Copy the relevant pieces of data to the pool
-                                * configuration:
-                                *
-                                *      version
-                                *      pool guid
-                                *      name
-                                *      comment (if available)
-                                *      pool state
-                                *      hostid (if available)
-                                *      hostname (if available)
-                                */
-                               uint64_t state, version;
-                               char *comment = NULL;
-
-                               version = fnvlist_lookup_uint64(tmp,
-                                   ZPOOL_CONFIG_VERSION);
-                               fnvlist_add_uint64(config,
-                                   ZPOOL_CONFIG_VERSION, version);
-                               guid = fnvlist_lookup_uint64(tmp,
-                                   ZPOOL_CONFIG_POOL_GUID);
-                               fnvlist_add_uint64(config,
-                                   ZPOOL_CONFIG_POOL_GUID, guid);
-                               name = fnvlist_lookup_string(tmp,
-                                   ZPOOL_CONFIG_POOL_NAME);
-                               fnvlist_add_string(config,
-                                   ZPOOL_CONFIG_POOL_NAME, name);
-
-                               if (nvlist_lookup_string(tmp,
-                                   ZPOOL_CONFIG_COMMENT, &comment) == 0)
-                                       fnvlist_add_string(config,
-                                           ZPOOL_CONFIG_COMMENT, comment);
-
-                               state = fnvlist_lookup_uint64(tmp,
-                                   ZPOOL_CONFIG_POOL_STATE);
-                               fnvlist_add_uint64(config,
-                                   ZPOOL_CONFIG_POOL_STATE, state);
-
-                               hostid = 0;
-                               if (nvlist_lookup_uint64(tmp,
-                                   ZPOOL_CONFIG_HOSTID, &hostid) == 0) {
-                                       fnvlist_add_uint64(config,
-                                           ZPOOL_CONFIG_HOSTID, hostid);
-                                       hostname = fnvlist_lookup_string(tmp,
-                                           ZPOOL_CONFIG_HOSTNAME);
-                                       fnvlist_add_string(config,
-                                           ZPOOL_CONFIG_HOSTNAME, hostname);
-                               }
-
-                               config_seen = B_TRUE;
-                       }
-
-                       /*
-                        * Add this top-level vdev to the child array.
-                        */
-                       verify(nvlist_lookup_nvlist(tmp,
-                           ZPOOL_CONFIG_VDEV_TREE, &nvtop) == 0);
-                       verify(nvlist_lookup_uint64(nvtop, ZPOOL_CONFIG_ID,
-                           &id) == 0);
-
-                       if (id >= children) {
-                               nvlist_t **newchild;
-
-                               newchild = zfs_alloc(hdl, (id + 1) *
-                                   sizeof (nvlist_t *));
-                               if (newchild == NULL)
-                                       goto nomem;
-
-                               for (c = 0; c < children; c++)
-                                       newchild[c] = child[c];
-
-                               free(child);
-                               child = newchild;
-                               children = id + 1;
-                       }
-                       if (nvlist_dup(nvtop, &child[id], 0) != 0)
-                               goto nomem;
-
-               }
-
-               /*
-                * If we have information about all the top-levels then
-                * clean up the nvlist which we've constructed. This
-                * means removing any extraneous devices that are
-                * beyond the valid range or adding devices to the end
-                * of our array which appear to be missing.
-                */
-               if (valid_top_config) {
-                       if (max_id < children) {
-                               for (c = max_id; c < children; c++)
-                                       nvlist_free(child[c]);
-                               children = max_id;
-                       } else if (max_id > children) {
-                               nvlist_t **newchild;
-
-                               newchild = zfs_alloc(hdl, (max_id) *
-                                   sizeof (nvlist_t *));
-                               if (newchild == NULL)
-                                       goto nomem;
-
-                               for (c = 0; c < children; c++)
-                                       newchild[c] = child[c];
-
-                               free(child);
-                               child = newchild;
-                               children = max_id;
-                       }
-               }
-
-               verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
-                   &guid) == 0);
-
-               /*
-                * The vdev namespace may contain holes as a result of
-                * device removal. We must add them back into the vdev
-                * tree before we process any missing devices.
-                */
-               if (holes > 0) {
-                       ASSERT(valid_top_config);
-
-                       for (c = 0; c < children; c++) {
-                               nvlist_t *holey;
-
-                               if (child[c] != NULL ||
-                                   !vdev_is_hole(hole_array, holes, c))
-                                       continue;
-
-                               if (nvlist_alloc(&holey, NV_UNIQUE_NAME,
-                                   0) != 0)
-                                       goto nomem;
-
-                               /*
-                                * Holes in the namespace are treated as
-                                * "hole" top-level vdevs and have a
-                                * special flag set on them.
-                                */
-                               if (nvlist_add_string(holey,
-                                   ZPOOL_CONFIG_TYPE,
-                                   VDEV_TYPE_HOLE) != 0 ||
-                                   nvlist_add_uint64(holey,
-                                   ZPOOL_CONFIG_ID, c) != 0 ||
-                                   nvlist_add_uint64(holey,
-                                   ZPOOL_CONFIG_GUID, 0ULL) != 0)
-                                       goto nomem;
-                               child[c] = holey;
-                       }
-               }
-
-               /*
-                * Look for any missing top-level vdevs.  If this is the case,
-                * create a faked up 'missing' vdev as a placeholder.  We cannot
-                * simply compress the child array, because the kernel performs
-                * certain checks to make sure the vdev IDs match their location
-                * in the configuration.
-                */
-               for (c = 0; c < children; c++) {
-                       if (child[c] == NULL) {
-                               nvlist_t *missing;
-                               if (nvlist_alloc(&missing, NV_UNIQUE_NAME,
-                                   0) != 0)
-                                       goto nomem;
-                               if (nvlist_add_string(missing,
-                                   ZPOOL_CONFIG_TYPE,
-                                   VDEV_TYPE_MISSING) != 0 ||
-                                   nvlist_add_uint64(missing,
-                                   ZPOOL_CONFIG_ID, c) != 0 ||
-                                   nvlist_add_uint64(missing,
-                                   ZPOOL_CONFIG_GUID, 0ULL) != 0) {
-                                       nvlist_free(missing);
-                                       goto nomem;
-                               }
-                               child[c] = missing;
-                       }
-               }
-
-               /*
-                * Put all of this pool's top-level vdevs into a root vdev.
-                */
-               if (nvlist_alloc(&nvroot, NV_UNIQUE_NAME, 0) != 0)
-                       goto nomem;
-               if (nvlist_add_string(nvroot, ZPOOL_CONFIG_TYPE,
-                   VDEV_TYPE_ROOT) != 0 ||
-                   nvlist_add_uint64(nvroot, ZPOOL_CONFIG_ID, 0ULL) != 0 ||
-                   nvlist_add_uint64(nvroot, ZPOOL_CONFIG_GUID, guid) != 0 ||
-                   nvlist_add_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
-                   child, children) != 0) {
-                       nvlist_free(nvroot);
-                       goto nomem;
-               }
-
-               for (c = 0; c < children; c++)
-                       nvlist_free(child[c]);
-               free(child);
-               children = 0;
-               child = NULL;
-
-               /*
-                * Go through and fix up any paths and/or devids based on our
-                * known list of vdev GUID -> path mappings.
-                */
-               if (fix_paths(nvroot, pl->names) != 0) {
-                       nvlist_free(nvroot);
-                       goto nomem;
-               }
-
-               /*
-                * Add the root vdev to this pool's configuration.
-                */
-               if (nvlist_add_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-                   nvroot) != 0) {
-                       nvlist_free(nvroot);
-                       goto nomem;
-               }
-               nvlist_free(nvroot);
-
-               /*
-                * zdb uses this path to report on active pools that were
-                * imported or created using -R.
-                */
-               if (active_ok)
-                       goto add_pool;
-
-               /*
-                * Determine if this pool is currently active, in which case we
-                * can't actually import it.
-                */
-               verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
-                   &name) == 0);
-               verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
-                   &guid) == 0);
-
-               if (pool_active(hdl, name, guid, &isactive) != 0)
-                       goto error;
-
-               if (isactive) {
-                       nvlist_free(config);
-                       config = NULL;
-                       continue;
-               }
-
-               if ((nvl = refresh_config(hdl, config)) == NULL) {
-                       nvlist_free(config);
-                       config = NULL;
-                       continue;
-               }
-
-               nvlist_free(config);
-               config = nvl;
-
-               /*
-                * Go through and update the paths for spares, now that we have
-                * them.
-                */
-               verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-                   &nvroot) == 0);
-               if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
-                   &spares, &nspares) == 0) {
-                       for (i = 0; i < nspares; i++) {
-                               if (fix_paths(spares[i], pl->names) != 0)
-                                       goto nomem;
-                       }
-               }
-
-               /*
-                * Update the paths for l2cache devices.
-                */
-               if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
-                   &l2cache, &nl2cache) == 0) {
-                       for (i = 0; i < nl2cache; i++) {
-                               if (fix_paths(l2cache[i], pl->names) != 0)
-                                       goto nomem;
-                       }
-               }
-
-               /*
-                * Restore the original information read from the actual label.
-                */
-               (void) nvlist_remove(config, ZPOOL_CONFIG_HOSTID,
-                   DATA_TYPE_UINT64);
-               (void) nvlist_remove(config, ZPOOL_CONFIG_HOSTNAME,
-                   DATA_TYPE_STRING);
-               if (hostid != 0) {
-                       verify(nvlist_add_uint64(config, ZPOOL_CONFIG_HOSTID,
-                           hostid) == 0);
-                       verify(nvlist_add_string(config, ZPOOL_CONFIG_HOSTNAME,
-                           hostname) == 0);
-               }
-
-add_pool:
-               /*
-                * Add this pool to the list of configs.
-                */
-               verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
-                   &name) == 0);
-               if (nvlist_add_nvlist(ret, name, config) != 0)
-                       goto nomem;
-
-               nvlist_free(config);
-               config = NULL;
-       }
-
-       return (ret);
-
-nomem:
-       (void) no_memory(hdl);
-error:
-       nvlist_free(config);
-       nvlist_free(ret);
-       for (c = 0; c < children; c++)
-               nvlist_free(child[c]);
-       free(child);
-
-       return (NULL);
-}
-
-/*
- * Return the offset of the given label.
- */
-static uint64_t
-label_offset(uint64_t size, int l)
-{
-       ASSERT(P2PHASE_TYPED(size, sizeof (vdev_label_t), uint64_t) == 0);
-       return (l * sizeof (vdev_label_t) + (l < VDEV_LABELS / 2 ?
-           0 : size - VDEV_LABELS * sizeof (vdev_label_t)));
-}
-
-/*
- * Given a file descriptor, read the label information and return an nvlist
- * describing the configuration, if there is one.  The number of valid
- * labels found will be returned in num_labels when non-NULL.
- */
-int
-zpool_read_label(int fd, nvlist_t **config, int *num_labels)
-{
-       struct stat64 statbuf;
-       int l, count = 0;
-       vdev_label_t *label;
-       nvlist_t *expected_config = NULL;
-       uint64_t expected_guid = 0, size;
-
-       *config = NULL;
-
-       if (fstat64_blk(fd, &statbuf) == -1)
-               return (0);
-       size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t);
-
-       if ((label = malloc(sizeof (vdev_label_t))) == NULL)
-               return (-1);
-
-       for (l = 0; l < VDEV_LABELS; l++) {
-               uint64_t state, guid, txg;
-
-               if (pread64(fd, label, sizeof (vdev_label_t),
-                   label_offset(size, l)) != sizeof (vdev_label_t))
-                       continue;
-
-               if (nvlist_unpack(label->vl_vdev_phys.vp_nvlist,
-                   sizeof (label->vl_vdev_phys.vp_nvlist), config, 0) != 0)
-                       continue;
-
-               if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_GUID,
-                   &guid) != 0 || guid == 0) {
-                       nvlist_free(*config);
-                       continue;
-               }
-
-               if (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_STATE,
-                   &state) != 0 || state > POOL_STATE_L2CACHE) {
-                       nvlist_free(*config);
-                       continue;
-               }
-
-               if (state != POOL_STATE_SPARE && state != POOL_STATE_L2CACHE &&
-                   (nvlist_lookup_uint64(*config, ZPOOL_CONFIG_POOL_TXG,
-                   &txg) != 0 || txg == 0)) {
-                       nvlist_free(*config);
-                       continue;
-               }
-
-               if (expected_guid) {
-                       if (expected_guid == guid)
-                               count++;
-
-                       nvlist_free(*config);
-               } else {
-                       expected_config = *config;
-                       expected_guid = guid;
-                       count++;
-               }
-       }
-
-       if (num_labels != NULL)
-               *num_labels = count;
-
-       free(label);
-       *config = expected_config;
-
-       return (0);
-}
-
-/*
- * Given a file descriptor, clear (zero) the label information.  This function
- * is used in the appliance stack as part of the ZFS sysevent module and
- * to implement the "zpool labelclear" command.
- */
-int
-zpool_clear_label(int fd)
-{
-       struct stat64 statbuf;
-       int l;
-       vdev_label_t *label;
-       uint64_t size;
-
-       if (fstat64_blk(fd, &statbuf) == -1)
-               return (0);
-       size = P2ALIGN_TYPED(statbuf.st_size, sizeof (vdev_label_t), uint64_t);
-
-       if ((label = calloc(sizeof (vdev_label_t), 1)) == NULL)
-               return (-1);
-
-       for (l = 0; l < VDEV_LABELS; l++) {
-               if (pwrite64(fd, label, sizeof (vdev_label_t),
-                   label_offset(size, l)) != sizeof (vdev_label_t)) {
-                       free(label);
-                       return (-1);
-               }
-       }
-
-       free(label);
-       return (0);
-}
-
-#ifdef HAVE_LIBBLKID
-/*
- * Use libblkid to quickly search for zfs devices
- */
-static int
-zpool_find_import_blkid(libzfs_handle_t *hdl, pool_list_t *pools)
-{
-       blkid_cache cache;
-       blkid_dev_iterate iter;
-       blkid_dev dev;
-       const char *devname;
-       nvlist_t *config;
-       int fd, err, num_labels;
-
-       err = blkid_get_cache(&cache, NULL);
-       if (err != 0) {
-               (void) zfs_error_fmt(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN, "blkid_get_cache() %d"), err);
-               goto err_blkid1;
-       }
-
-       err = blkid_probe_all(cache);
-       if (err != 0) {
-               (void) zfs_error_fmt(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN, "blkid_probe_all() %d"), err);
-               goto err_blkid2;
-       }
-
-       iter = blkid_dev_iterate_begin(cache);
-       if (iter == NULL) {
-               (void) zfs_error_fmt(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN, "blkid_dev_iterate_begin()"));
-               goto err_blkid2;
-       }
-
-       err = blkid_dev_set_search(iter, "TYPE", "zfs_member");
-       if (err != 0) {
-               (void) zfs_error_fmt(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN, "blkid_dev_set_search() %d"), err);
-               goto err_blkid3;
-       }
-
-       while (blkid_dev_next(iter, &dev) == 0) {
-               devname = blkid_dev_devname(dev);
-               if ((fd = open64(devname, O_RDONLY)) < 0)
-                       continue;
-
-               err = zpool_read_label(fd, &config, &num_labels);
-               (void) close(fd);
-
-               if (err != 0) {
-                       (void) no_memory(hdl);
-                       goto err_blkid3;
-               }
-
-               if (config != NULL) {
-                       err = add_config(hdl, pools, devname, 0,
-                           num_labels, config);
-                       if (err != 0)
-                               goto err_blkid3;
-               }
-       }
-
-err_blkid3:
-       blkid_dev_iterate_end(iter);
-err_blkid2:
-       blkid_put_cache(cache);
-err_blkid1:
-       return (err);
-}
-#endif /* HAVE_LIBBLKID */
-
-char *
-zpool_default_import_path[DEFAULT_IMPORT_PATH_SIZE] = {
-       "/dev/disk/by-vdev",    /* Custom rules, use first if they exist */
-       "/dev/mapper",          /* Use multipath devices before components */
-       "/dev/disk/by-uuid",    /* Single unique entry and persistent */
-       "/dev/disk/by-id",      /* May be multiple entries and persistent */
-       "/dev/disk/by-path",    /* Encodes physical location and persistent */
-       "/dev/disk/by-label",   /* Custom persistent labels */
-       "/dev"                  /* UNSAFE device names will change */
-};
-
-/*
- * Given a list of directories to search, find all pools stored on disk.  This
- * includes partial pools which are not available to import.  If no args are
- * given (argc is 0), then the default directory (/dev/dsk) is searched.
- * poolname or guid (but not both) are provided by the caller when trying
- * to import a specific pool.
- */
-static nvlist_t *
-zpool_find_import_impl(libzfs_handle_t *hdl, importargs_t *iarg)
-{
-       int i, num_labels, dirs = iarg->paths;
-       DIR *dirp = NULL;
-       struct dirent64 *dp;
-       char path[MAXPATHLEN];
-       char *end, **dir = iarg->path;
-       size_t pathleft;
-       struct stat64 statbuf;
-       nvlist_t *ret = NULL, *config;
-       int fd;
-       pool_list_t pools = { 0 };
-       pool_entry_t *pe, *penext;
-       vdev_entry_t *ve, *venext;
-       config_entry_t *ce, *cenext;
-       name_entry_t *ne, *nenext;
-
-       verify(iarg->poolname == NULL || iarg->guid == 0);
-
-       if (dirs == 0) {
-#ifdef HAVE_LIBBLKID
-               /* Use libblkid to scan all device for their type */
-               if (zpool_find_import_blkid(hdl, &pools) == 0)
-                       goto skip_scanning;
-
-               (void) zfs_error_fmt(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN, "blkid failure falling back "
-                   "to manual probing"));
-#endif /* HAVE_LIBBLKID */
-
-               dir = zpool_default_import_path;
-               dirs = DEFAULT_IMPORT_PATH_SIZE;
-       }
-
-       /*
-        * Go through and read the label configuration information from every
-        * possible device, organizing the information according to pool GUID
-        * and toplevel GUID.
-        */
-       for (i = 0; i < dirs; i++) {
-               char *rdsk;
-               int dfd;
-
-               /* use realpath to normalize the path */
-               if (realpath(dir[i], path) == 0) {
-
-                       /* it is safe to skip missing search paths */
-                       if (errno == ENOENT)
-                               continue;
-
-                       zfs_error_aux(hdl, strerror(errno));
-                       (void) zfs_error_fmt(hdl, EZFS_BADPATH,
-                           dgettext(TEXT_DOMAIN, "cannot open '%s'"), dir[i]);
-                       goto error;
-               }
-               end = &path[strlen(path)];
-               *end++ = '/';
-               *end = 0;
-               pathleft = &path[sizeof (path)] - end;
-
-               /*
-                * Using raw devices instead of block devices when we're
-                * reading the labels skips a bunch of slow operations during
-                * close(2) processing, so we replace /dev/dsk with /dev/rdsk.
-                */
-               if (strcmp(path, "/dev/dsk/") == 0)
-                       rdsk = "/dev/rdsk/";
-               else
-                       rdsk = path;
-
-               if ((dfd = open64(rdsk, O_RDONLY)) < 0 ||
-                   (dirp = fdopendir(dfd)) == NULL) {
-                       zfs_error_aux(hdl, strerror(errno));
-                       (void) zfs_error_fmt(hdl, EZFS_BADPATH,
-                           dgettext(TEXT_DOMAIN, "cannot open '%s'"),
-                           rdsk);
-                       goto error;
-               }
-
-               /*
-                * This is not MT-safe, but we have no MT consumers of libzfs
-                */
-               while ((dp = readdir64(dirp)) != NULL) {
-                       const char *name = dp->d_name;
-                       if (name[0] == '.' &&
-                           (name[1] == 0 || (name[1] == '.' && name[2] == 0)))
-                               continue;
-
-                       /*
-                        * Skip checking devices with well known prefixes:
-                        * watchdog - A special close is required to avoid
-                        *            triggering it and resetting the system.
-                        * fuse     - Fuse control device.
-                        * ppp      - Generic PPP driver.
-                        * tty*     - Generic serial interface.
-                        * vcs*     - Virtual console memory.
-                        * parport* - Parallel port interface.
-                        * lp*      - Printer interface.
-                        * fd*      - Floppy interface.
-                        * hpet     - High Precision Event Timer, crashes qemu
-                        *            when accessed from a virtual machine.
-                        * core     - Symlink to /proc/kcore, causes a crash
-                        *            when access from Xen dom0.
-                        */
-                       if ((strncmp(name, "watchdog", 8) == 0) ||
-                           (strncmp(name, "fuse", 4) == 0) ||
-                           (strncmp(name, "ppp", 3) == 0) ||
-                           (strncmp(name, "tty", 3) == 0) ||
-                           (strncmp(name, "vcs", 3) == 0) ||
-                           (strncmp(name, "parport", 7) == 0) ||
-                           (strncmp(name, "lp", 2) == 0) ||
-                           (strncmp(name, "fd", 2) == 0) ||
-                           (strncmp(name, "hpet", 4) == 0) ||
-                           (strncmp(name, "core", 4) == 0))
-                               continue;
-
-                       /*
-                        * Ignore failed stats.  We only want regular
-                        * files and block devices.
-                        */
-                       if ((fstatat64(dfd, name, &statbuf, 0) != 0) ||
-                           (!S_ISREG(statbuf.st_mode) &&
-                           !S_ISBLK(statbuf.st_mode)))
-                               continue;
-
-                       if ((fd = openat64(dfd, name, O_RDONLY)) < 0)
-                               continue;
-
-                       if ((zpool_read_label(fd, &config, &num_labels))) {
-                               (void) close(fd);
-                               (void) no_memory(hdl);
-                               goto error;
-                       }
-
-                       (void) close(fd);
-
-                       if (config != NULL) {
-                               boolean_t matched = B_TRUE;
-                               char *pname;
-
-                               if ((iarg->poolname != NULL) &&
-                                   (nvlist_lookup_string(config,
-                                   ZPOOL_CONFIG_POOL_NAME, &pname) == 0)) {
-
-                                       if (strcmp(iarg->poolname, pname))
-                                               matched = B_FALSE;
-
-                               } else if (iarg->guid != 0) {
-                                       uint64_t this_guid;
-
-                                       matched = nvlist_lookup_uint64(config,
-                                           ZPOOL_CONFIG_POOL_GUID,
-                                           &this_guid) == 0 &&
-                                           iarg->guid == this_guid;
-                               }
-                               if (!matched) {
-                                       nvlist_free(config);
-                                       config = NULL;
-                                       continue;
-                               }
-                               /* use the non-raw path for the config */
-                               (void) strlcpy(end, name, pathleft);
-                               if (add_config(hdl, &pools, path, i+1,
-                                   num_labels, config))
-                                       goto error;
-                       }
-               }
-
-               (void) closedir(dirp);
-               dirp = NULL;
-       }
-
-#ifdef HAVE_LIBBLKID
-skip_scanning:
-#endif
-       ret = get_configs(hdl, &pools, iarg->can_be_active);
-
-error:
-       for (pe = pools.pools; pe != NULL; pe = penext) {
-               penext = pe->pe_next;
-               for (ve = pe->pe_vdevs; ve != NULL; ve = venext) {
-                       venext = ve->ve_next;
-                       for (ce = ve->ve_configs; ce != NULL; ce = cenext) {
-                               cenext = ce->ce_next;
-                               if (ce->ce_config)
-                                       nvlist_free(ce->ce_config);
-                               free(ce);
-                       }
-                       free(ve);
-               }
-               free(pe);
-       }
-
-       for (ne = pools.names; ne != NULL; ne = nenext) {
-               nenext = ne->ne_next;
-               if (ne->ne_name)
-                       free(ne->ne_name);
-               free(ne);
-       }
-
-       if (dirp)
-               (void) closedir(dirp);
-
-       return (ret);
-}
-
-nvlist_t *
-zpool_find_import(libzfs_handle_t *hdl, int argc, char **argv)
-{
-       importargs_t iarg = { 0 };
-
-       iarg.paths = argc;
-       iarg.path = argv;
-
-       return (zpool_find_import_impl(hdl, &iarg));
-}
-
-/*
- * Given a cache file, return the contents as a list of importable pools.
- * poolname or guid (but not both) are provided by the caller when trying
- * to import a specific pool.
- */
-nvlist_t *
-zpool_find_import_cached(libzfs_handle_t *hdl, const char *cachefile,
-    char *poolname, uint64_t guid)
-{
-       char *buf;
-       int fd;
-       struct stat64 statbuf;
-       nvlist_t *raw, *src, *dst;
-       nvlist_t *pools;
-       nvpair_t *elem;
-       char *name;
-       uint64_t this_guid;
-       boolean_t active;
-
-       verify(poolname == NULL || guid == 0);
-
-       if ((fd = open(cachefile, O_RDONLY)) < 0) {
-               zfs_error_aux(hdl, "%s", strerror(errno));
-               (void) zfs_error(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN, "failed to open cache file"));
-               return (NULL);
-       }
-
-       if (fstat64(fd, &statbuf) != 0) {
-               zfs_error_aux(hdl, "%s", strerror(errno));
-               (void) close(fd);
-               (void) zfs_error(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN, "failed to get size of cache file"));
-               return (NULL);
-       }
-
-       if ((buf = zfs_alloc(hdl, statbuf.st_size)) == NULL) {
-               (void) close(fd);
-               return (NULL);
-       }
-
-       if (read(fd, buf, statbuf.st_size) != statbuf.st_size) {
-               (void) close(fd);
-               free(buf);
-               (void) zfs_error(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN,
-                   "failed to read cache file contents"));
-               return (NULL);
-       }
-
-       (void) close(fd);
-
-       if (nvlist_unpack(buf, statbuf.st_size, &raw, 0) != 0) {
-               free(buf);
-               (void) zfs_error(hdl, EZFS_BADCACHE,
-                   dgettext(TEXT_DOMAIN,
-                   "invalid or corrupt cache file contents"));
-               return (NULL);
-       }
-
-       free(buf);
-
-       /*
-        * Go through and get the current state of the pools and refresh their
-        * state.
-        */
-       if (nvlist_alloc(&pools, 0, 0) != 0) {
-               (void) no_memory(hdl);
-               nvlist_free(raw);
-               return (NULL);
-       }
-
-       elem = NULL;
-       while ((elem = nvlist_next_nvpair(raw, elem)) != NULL) {
-               src = fnvpair_value_nvlist(elem);
-
-               name = fnvlist_lookup_string(src, ZPOOL_CONFIG_POOL_NAME);
-               if (poolname != NULL && strcmp(poolname, name) != 0)
-                       continue;
-
-               this_guid = fnvlist_lookup_uint64(src, ZPOOL_CONFIG_POOL_GUID);
-               if (guid != 0 && guid != this_guid)
-                       continue;
-
-               if (pool_active(hdl, name, this_guid, &active) != 0) {
-                       nvlist_free(raw);
-                       nvlist_free(pools);
-                       return (NULL);
-               }
-
-               if (active)
-                       continue;
-
-               if ((dst = refresh_config(hdl, src)) == NULL) {
-                       nvlist_free(raw);
-                       nvlist_free(pools);
-                       return (NULL);
-               }
-
-               if (nvlist_add_nvlist(pools, nvpair_name(elem), dst) != 0) {
-                       (void) no_memory(hdl);
-                       nvlist_free(dst);
-                       nvlist_free(raw);
-                       nvlist_free(pools);
-                       return (NULL);
-               }
-               nvlist_free(dst);
-       }
-
-       nvlist_free(raw);
-       return (pools);
-}
-
-static int
-name_or_guid_exists(zpool_handle_t *zhp, void *data)
-{
-       importargs_t *import = data;
-       int found = 0;
-
-       if (import->poolname != NULL) {
-               char *pool_name;
-
-               verify(nvlist_lookup_string(zhp->zpool_config,
-                   ZPOOL_CONFIG_POOL_NAME, &pool_name) == 0);
-               if (strcmp(pool_name, import->poolname) == 0)
-                       found = 1;
-       } else {
-               uint64_t pool_guid;
-
-               verify(nvlist_lookup_uint64(zhp->zpool_config,
-                   ZPOOL_CONFIG_POOL_GUID, &pool_guid) == 0);
-               if (pool_guid == import->guid)
-                       found = 1;
-       }
-
-       zpool_close(zhp);
-       return (found);
-}
-
-nvlist_t *
-zpool_search_import(libzfs_handle_t *hdl, importargs_t *import)
-{
-       verify(import->poolname == NULL || import->guid == 0);
-
-       if (import->unique)
-               import->exists = zpool_iter(hdl, name_or_guid_exists, import);
-
-       if (import->cachefile != NULL)
-               return (zpool_find_import_cached(hdl, import->cachefile,
-                   import->poolname, import->guid));
-
-       return (zpool_find_import_impl(hdl, import));
-}
-
-boolean_t
-find_guid(nvlist_t *nv, uint64_t guid)
-{
-       uint64_t tmp;
-       nvlist_t **child;
-       uint_t c, children;
-
-       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &tmp) == 0);
-       if (tmp == guid)
-               return (B_TRUE);
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if (find_guid(child[c], guid))
-                               return (B_TRUE);
-       }
-
-       return (B_FALSE);
-}
-
-typedef struct aux_cbdata {
-       const char      *cb_type;
-       uint64_t        cb_guid;
-       zpool_handle_t  *cb_zhp;
-} aux_cbdata_t;
-
-static int
-find_aux(zpool_handle_t *zhp, void *data)
-{
-       aux_cbdata_t *cbp = data;
-       nvlist_t **list;
-       uint_t i, count;
-       uint64_t guid;
-       nvlist_t *nvroot;
-
-       verify(nvlist_lookup_nvlist(zhp->zpool_config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-
-       if (nvlist_lookup_nvlist_array(nvroot, cbp->cb_type,
-           &list, &count) == 0) {
-               for (i = 0; i < count; i++) {
-                       verify(nvlist_lookup_uint64(list[i],
-                           ZPOOL_CONFIG_GUID, &guid) == 0);
-                       if (guid == cbp->cb_guid) {
-                               cbp->cb_zhp = zhp;
-                               return (1);
-                       }
-               }
-       }
-
-       zpool_close(zhp);
-       return (0);
-}
-
-/*
- * Determines if the pool is in use.  If so, it returns true and the state of
- * the pool as well as the name of the pool.  Both strings are allocated and
- * must be freed by the caller.
- */
-int
-zpool_in_use(libzfs_handle_t *hdl, int fd, pool_state_t *state, char **namestr,
-    boolean_t *inuse)
-{
-       nvlist_t *config;
-       char *name;
-       boolean_t ret;
-       uint64_t guid, vdev_guid;
-       zpool_handle_t *zhp;
-       nvlist_t *pool_config;
-       uint64_t stateval, isspare;
-       aux_cbdata_t cb = { 0 };
-       boolean_t isactive;
-
-       *inuse = B_FALSE;
-
-       if (zpool_read_label(fd, &config, NULL) != 0) {
-               (void) no_memory(hdl);
-               return (-1);
-       }
-
-       if (config == NULL)
-               return (0);
-
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
-           &stateval) == 0);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_GUID,
-           &vdev_guid) == 0);
-
-       if (stateval != POOL_STATE_SPARE && stateval != POOL_STATE_L2CACHE) {
-               verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
-                   &name) == 0);
-               verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
-                   &guid) == 0);
-       }
-
-       switch (stateval) {
-       case POOL_STATE_EXPORTED:
-               /*
-                * A pool with an exported state may in fact be imported
-                * read-only, so check the in-core state to see if it's
-                * active and imported read-only.  If it is, set
-                * its state to active.
-                */
-               if (pool_active(hdl, name, guid, &isactive) == 0 && isactive &&
-                   (zhp = zpool_open_canfail(hdl, name)) != NULL) {
-                       if (zpool_get_prop_int(zhp, ZPOOL_PROP_READONLY, NULL))
-                               stateval = POOL_STATE_ACTIVE;
-
-                       /*
-                        * All we needed the zpool handle for is the
-                        * readonly prop check.
-                        */
-                       zpool_close(zhp);
-               }
-
-               ret = B_TRUE;
-               break;
-
-       case POOL_STATE_ACTIVE:
-               /*
-                * For an active pool, we have to determine if it's really part
-                * of a currently active pool (in which case the pool will exist
-                * and the guid will be the same), or whether it's part of an
-                * active pool that was disconnected without being explicitly
-                * exported.
-                */
-               if (pool_active(hdl, name, guid, &isactive) != 0) {
-                       nvlist_free(config);
-                       return (-1);
-               }
-
-               if (isactive) {
-                       /*
-                        * Because the device may have been removed while
-                        * offlined, we only report it as active if the vdev is
-                        * still present in the config.  Otherwise, pretend like
-                        * it's not in use.
-                        */
-                       if ((zhp = zpool_open_canfail(hdl, name)) != NULL &&
-                           (pool_config = zpool_get_config(zhp, NULL))
-                           != NULL) {
-                               nvlist_t *nvroot;
-
-                               verify(nvlist_lookup_nvlist(pool_config,
-                                   ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
-                               ret = find_guid(nvroot, vdev_guid);
-                       } else {
-                               ret = B_FALSE;
-                       }
-
-                       /*
-                        * If this is an active spare within another pool, we
-                        * treat it like an unused hot spare.  This allows the
-                        * user to create a pool with a hot spare that currently
-                        * in use within another pool.  Since we return B_TRUE,
-                        * libdiskmgt will continue to prevent generic consumers
-                        * from using the device.
-                        */
-                       if (ret && nvlist_lookup_uint64(config,
-                           ZPOOL_CONFIG_IS_SPARE, &isspare) == 0 && isspare)
-                               stateval = POOL_STATE_SPARE;
-
-                       if (zhp != NULL)
-                               zpool_close(zhp);
-               } else {
-                       stateval = POOL_STATE_POTENTIALLY_ACTIVE;
-                       ret = B_TRUE;
-               }
-               break;
-
-       case POOL_STATE_SPARE:
-               /*
-                * For a hot spare, it can be either definitively in use, or
-                * potentially active.  To determine if it's in use, we iterate
-                * over all pools in the system and search for one with a spare
-                * with a matching guid.
-                *
-                * Due to the shared nature of spares, we don't actually report
-                * the potentially active case as in use.  This means the user
-                * can freely create pools on the hot spares of exported pools,
-                * but to do otherwise makes the resulting code complicated, and
-                * we end up having to deal with this case anyway.
-                */
-               cb.cb_zhp = NULL;
-               cb.cb_guid = vdev_guid;
-               cb.cb_type = ZPOOL_CONFIG_SPARES;
-               if (zpool_iter(hdl, find_aux, &cb) == 1) {
-                       name = (char *)zpool_get_name(cb.cb_zhp);
-                       ret = TRUE;
-               } else {
-                       ret = FALSE;
-               }
-               break;
-
-       case POOL_STATE_L2CACHE:
-
-               /*
-                * Check if any pool is currently using this l2cache device.
-                */
-               cb.cb_zhp = NULL;
-               cb.cb_guid = vdev_guid;
-               cb.cb_type = ZPOOL_CONFIG_L2CACHE;
-               if (zpool_iter(hdl, find_aux, &cb) == 1) {
-                       name = (char *)zpool_get_name(cb.cb_zhp);
-                       ret = TRUE;
-               } else {
-                       ret = FALSE;
-               }
-               break;
-
-       default:
-               ret = B_FALSE;
-       }
-
-
-       if (ret) {
-               if ((*namestr = zfs_strdup(hdl, name)) == NULL) {
-                       if (cb.cb_zhp)
-                               zpool_close(cb.cb_zhp);
-                       nvlist_free(config);
-                       return (-1);
-               }
-               *state = (pool_state_t)stateval;
-       }
-
-       if (cb.cb_zhp)
-               zpool_close(cb.cb_zhp);
-
-       nvlist_free(config);
-       *inuse = ret;
-       return (0);
-}
diff --git a/zfs/lib/libzfs/libzfs_iter.c b/zfs/lib/libzfs/libzfs_iter.c
deleted file mode 100644 (file)
index 5c1cf96..0000000
+++ /dev/null
@@ -1,524 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013 by Delphix. All rights reserved.
- * Copyright 2014 Nexenta Systems, Inc.  All rights reserved.
- */
-
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <stddef.h>
-#include <libintl.h>
-#include <libzfs.h>
-
-#include "libzfs_impl.h"
-
-int
-zfs_iter_clones(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
-       nvlist_t *nvl = zfs_get_clones_nvl(zhp);
-       nvpair_t *pair;
-
-       if (nvl == NULL)
-               return (0);
-
-       for (pair = nvlist_next_nvpair(nvl, NULL); pair != NULL;
-           pair = nvlist_next_nvpair(nvl, pair)) {
-               zfs_handle_t *clone = zfs_open(zhp->zfs_hdl, nvpair_name(pair),
-                   ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-               if (clone != NULL) {
-                       int err = func(clone, data);
-                       if (err != 0)
-                               return (err);
-               }
-       }
-       return (0);
-}
-
-static int
-zfs_do_list_ioctl(zfs_handle_t *zhp, int arg, zfs_cmd_t *zc)
-{
-       int rc;
-       uint64_t        orig_cookie;
-
-       orig_cookie = zc->zc_cookie;
-top:
-       (void) strlcpy(zc->zc_name, zhp->zfs_name, sizeof (zc->zc_name));
-       rc = ioctl(zhp->zfs_hdl->libzfs_fd, arg, zc);
-
-       if (rc == -1) {
-               switch (errno) {
-               case ENOMEM:
-                       /* expand nvlist memory and try again */
-                       if (zcmd_expand_dst_nvlist(zhp->zfs_hdl, zc) != 0) {
-                               zcmd_free_nvlists(zc);
-                               return (-1);
-                       }
-                       zc->zc_cookie = orig_cookie;
-                       goto top;
-               /*
-                * An errno value of ESRCH indicates normal completion.
-                * If ENOENT is returned, then the underlying dataset
-                * has been removed since we obtained the handle.
-                */
-               case ESRCH:
-               case ENOENT:
-                       rc = 1;
-                       break;
-               default:
-                       rc = zfs_standard_error(zhp->zfs_hdl, errno,
-                           dgettext(TEXT_DOMAIN,
-                           "cannot iterate filesystems"));
-                       break;
-               }
-       }
-       return (rc);
-}
-
-/*
- * Iterate over all child filesystems
- */
-int
-zfs_iter_filesystems(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
-       zfs_cmd_t zc = {"\0"};
-       zfs_handle_t *nzhp;
-       int ret;
-
-       if (zhp->zfs_type != ZFS_TYPE_FILESYSTEM)
-               return (0);
-
-       if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
-               return (-1);
-
-       while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_DATASET_LIST_NEXT,
-           &zc)) == 0) {
-               /*
-                * Silently ignore errors, as the only plausible explanation is
-                * that the pool has since been removed.
-                */
-               if ((nzhp = make_dataset_handle_zc(zhp->zfs_hdl,
-                   &zc)) == NULL) {
-                       continue;
-               }
-
-               if ((ret = func(nzhp, data)) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       return (ret);
-               }
-       }
-       zcmd_free_nvlists(&zc);
-       return ((ret < 0) ? ret : 0);
-}
-
-/*
- * Iterate over all snapshots
- */
-int
-zfs_iter_snapshots(zfs_handle_t *zhp, boolean_t simple, zfs_iter_f func,
-    void *data)
-{
-       zfs_cmd_t zc = {"\0"};
-       zfs_handle_t *nzhp;
-       int ret;
-
-       if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT ||
-           zhp->zfs_type == ZFS_TYPE_BOOKMARK)
-               return (0);
-
-       zc.zc_simple = simple;
-
-       if (zcmd_alloc_dst_nvlist(zhp->zfs_hdl, &zc, 0) != 0)
-               return (-1);
-       while ((ret = zfs_do_list_ioctl(zhp, ZFS_IOC_SNAPSHOT_LIST_NEXT,
-           &zc)) == 0) {
-
-               if (simple)
-                       nzhp = make_dataset_simple_handle_zc(zhp, &zc);
-               else
-                       nzhp = make_dataset_handle_zc(zhp->zfs_hdl, &zc);
-               if (nzhp == NULL)
-                       continue;
-
-               if ((ret = func(nzhp, data)) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       return (ret);
-               }
-       }
-       zcmd_free_nvlists(&zc);
-       return ((ret < 0) ? ret : 0);
-}
-
-/*
- * Iterate over all bookmarks
- */
-int
-zfs_iter_bookmarks(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
-       zfs_handle_t *nzhp;
-       nvlist_t *props = NULL;
-       nvlist_t *bmarks = NULL;
-       int err;
-       nvpair_t *pair;
-
-       if ((zfs_get_type(zhp) & (ZFS_TYPE_SNAPSHOT | ZFS_TYPE_BOOKMARK)) != 0)
-               return (0);
-
-       /* Setup the requested properties nvlist. */
-       props = fnvlist_alloc();
-       fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_GUID));
-       fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATETXG));
-       fnvlist_add_boolean(props, zfs_prop_to_name(ZFS_PROP_CREATION));
-
-       if ((err = lzc_get_bookmarks(zhp->zfs_name, props, &bmarks)) != 0)
-               goto out;
-
-       for (pair = nvlist_next_nvpair(bmarks, NULL);
-           pair != NULL; pair = nvlist_next_nvpair(bmarks, pair)) {
-               char name[ZFS_MAXNAMELEN];
-               char *bmark_name;
-               nvlist_t *bmark_props;
-
-               bmark_name = nvpair_name(pair);
-               bmark_props = fnvpair_value_nvlist(pair);
-
-               (void) snprintf(name, sizeof (name), "%s#%s", zhp->zfs_name,
-                   bmark_name);
-
-               nzhp = make_bookmark_handle(zhp, name, bmark_props);
-               if (nzhp == NULL)
-                       continue;
-
-               if ((err = func(nzhp, data)) != 0)
-                       goto out;
-       }
-
-out:
-       fnvlist_free(props);
-       fnvlist_free(bmarks);
-
-       return (err);
-}
-
-/*
- * Routines for dealing with the sorted snapshot functionality
- */
-typedef struct zfs_node {
-       zfs_handle_t    *zn_handle;
-       avl_node_t      zn_avlnode;
-} zfs_node_t;
-
-static int
-zfs_sort_snaps(zfs_handle_t *zhp, void *data)
-{
-       avl_tree_t *avl = data;
-       zfs_node_t *node;
-       zfs_node_t search;
-
-       search.zn_handle = zhp;
-       node = avl_find(avl, &search, NULL);
-       if (node) {
-               /*
-                * If this snapshot was renamed while we were creating the
-                * AVL tree, it's possible that we already inserted it under
-                * its old name. Remove the old handle before adding the new
-                * one.
-                */
-               zfs_close(node->zn_handle);
-               avl_remove(avl, node);
-               free(node);
-       }
-
-       node = zfs_alloc(zhp->zfs_hdl, sizeof (zfs_node_t));
-       node->zn_handle = zhp;
-       avl_add(avl, node);
-
-       return (0);
-}
-
-static int
-zfs_snapshot_compare(const void *larg, const void *rarg)
-{
-       zfs_handle_t *l = ((zfs_node_t *)larg)->zn_handle;
-       zfs_handle_t *r = ((zfs_node_t *)rarg)->zn_handle;
-       uint64_t lcreate, rcreate;
-
-       /*
-        * Sort them according to creation time.  We use the hidden
-        * CREATETXG property to get an absolute ordering of snapshots.
-        */
-       lcreate = zfs_prop_get_int(l, ZFS_PROP_CREATETXG);
-       rcreate = zfs_prop_get_int(r, ZFS_PROP_CREATETXG);
-
-       if (lcreate < rcreate)
-               return (-1);
-       else if (lcreate > rcreate)
-               return (+1);
-       else
-               return (0);
-}
-
-int
-zfs_iter_snapshots_sorted(zfs_handle_t *zhp, zfs_iter_f callback, void *data)
-{
-       int ret = 0;
-       zfs_node_t *node;
-       avl_tree_t avl;
-       void *cookie = NULL;
-
-       avl_create(&avl, zfs_snapshot_compare,
-           sizeof (zfs_node_t), offsetof(zfs_node_t, zn_avlnode));
-
-       ret = zfs_iter_snapshots(zhp, B_FALSE, zfs_sort_snaps, &avl);
-
-       for (node = avl_first(&avl); node != NULL; node = AVL_NEXT(&avl, node))
-               ret |= callback(node->zn_handle, data);
-
-       while ((node = avl_destroy_nodes(&avl, &cookie)) != NULL)
-               free(node);
-
-       avl_destroy(&avl);
-
-       return (ret);
-}
-
-typedef struct {
-       char *ssa_first;
-       char *ssa_last;
-       boolean_t ssa_seenfirst;
-       boolean_t ssa_seenlast;
-       zfs_iter_f ssa_func;
-       void *ssa_arg;
-} snapspec_arg_t;
-
-static int
-snapspec_cb(zfs_handle_t *zhp, void *arg) {
-       snapspec_arg_t *ssa = arg;
-       char *shortsnapname;
-       int err = 0;
-
-       if (ssa->ssa_seenlast)
-               return (0);
-       shortsnapname = zfs_strdup(zhp->zfs_hdl,
-           strchr(zfs_get_name(zhp), '@') + 1);
-
-       if (!ssa->ssa_seenfirst && strcmp(shortsnapname, ssa->ssa_first) == 0)
-               ssa->ssa_seenfirst = B_TRUE;
-
-       if (ssa->ssa_seenfirst) {
-               err = ssa->ssa_func(zhp, ssa->ssa_arg);
-       } else {
-               zfs_close(zhp);
-       }
-
-       if (strcmp(shortsnapname, ssa->ssa_last) == 0)
-               ssa->ssa_seenlast = B_TRUE;
-       free(shortsnapname);
-
-       return (err);
-}
-
-/*
- * spec is a string like "A,B%C,D"
- *
- * <snaps>, where <snaps> can be:
- *      <snap>          (single snapshot)
- *      <snap>%<snap>   (range of snapshots, inclusive)
- *      %<snap>         (range of snapshots, starting with earliest)
- *      <snap>%         (range of snapshots, ending with last)
- *      %               (all snapshots)
- *      <snaps>[,...]   (comma separated list of the above)
- *
- * If a snapshot can not be opened, continue trying to open the others, but
- * return ENOENT at the end.
- */
-int
-zfs_iter_snapspec(zfs_handle_t *fs_zhp, const char *spec_orig,
-    zfs_iter_f func, void *arg)
-{
-       char *buf, *comma_separated, *cp;
-       int err = 0;
-       int ret = 0;
-
-       buf = zfs_strdup(fs_zhp->zfs_hdl, spec_orig);
-       cp = buf;
-
-       while ((comma_separated = strsep(&cp, ",")) != NULL) {
-               char *pct = strchr(comma_separated, '%');
-               if (pct != NULL) {
-                       snapspec_arg_t ssa = { 0 };
-                       ssa.ssa_func = func;
-                       ssa.ssa_arg = arg;
-
-                       if (pct == comma_separated)
-                               ssa.ssa_seenfirst = B_TRUE;
-                       else
-                               ssa.ssa_first = comma_separated;
-                       *pct = '\0';
-                       ssa.ssa_last = pct + 1;
-
-                       /*
-                        * If there is a lastname specified, make sure it
-                        * exists.
-                        */
-                       if (ssa.ssa_last[0] != '\0') {
-                               char snapname[ZFS_MAXNAMELEN];
-                               (void) snprintf(snapname, sizeof (snapname),
-                                   "%s@%s", zfs_get_name(fs_zhp),
-                                   ssa.ssa_last);
-                               if (!zfs_dataset_exists(fs_zhp->zfs_hdl,
-                                   snapname, ZFS_TYPE_SNAPSHOT)) {
-                                       ret = ENOENT;
-                                       continue;
-                               }
-                       }
-
-                       err = zfs_iter_snapshots_sorted(fs_zhp,
-                           snapspec_cb, &ssa);
-                       if (ret == 0)
-                               ret = err;
-                       if (ret == 0 && (!ssa.ssa_seenfirst ||
-                           (ssa.ssa_last[0] != '\0' && !ssa.ssa_seenlast))) {
-                               ret = ENOENT;
-                       }
-               } else {
-                       char snapname[ZFS_MAXNAMELEN];
-                       zfs_handle_t *snap_zhp;
-                       (void) snprintf(snapname, sizeof (snapname), "%s@%s",
-                           zfs_get_name(fs_zhp), comma_separated);
-                       snap_zhp = make_dataset_handle(fs_zhp->zfs_hdl,
-                           snapname);
-                       if (snap_zhp == NULL) {
-                               ret = ENOENT;
-                               continue;
-                       }
-                       err = func(snap_zhp, arg);
-                       if (ret == 0)
-                               ret = err;
-               }
-       }
-
-       free(buf);
-       return (ret);
-}
-
-/*
- * Iterate over all children, snapshots and filesystems
- */
-int
-zfs_iter_children(zfs_handle_t *zhp, zfs_iter_f func, void *data)
-{
-       int ret;
-
-       if ((ret = zfs_iter_filesystems(zhp, func, data)) != 0)
-               return (ret);
-
-       return (zfs_iter_snapshots(zhp, B_FALSE, func, data));
-}
-
-
-typedef struct iter_stack_frame {
-       struct iter_stack_frame *next;
-       zfs_handle_t *zhp;
-} iter_stack_frame_t;
-
-typedef struct iter_dependents_arg {
-       boolean_t first;
-       boolean_t allowrecursion;
-       iter_stack_frame_t *stack;
-       zfs_iter_f func;
-       void *data;
-} iter_dependents_arg_t;
-
-static int
-iter_dependents_cb(zfs_handle_t *zhp, void *arg)
-{
-       iter_dependents_arg_t *ida = arg;
-       int err = 0;
-       boolean_t first = ida->first;
-       ida->first = B_FALSE;
-
-       if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT) {
-               err = zfs_iter_clones(zhp, iter_dependents_cb, ida);
-       } else if (zhp->zfs_type != ZFS_TYPE_BOOKMARK) {
-               iter_stack_frame_t isf;
-               iter_stack_frame_t *f;
-
-               /*
-                * check if there is a cycle by seeing if this fs is already
-                * on the stack.
-                */
-               for (f = ida->stack; f != NULL; f = f->next) {
-                       if (f->zhp->zfs_dmustats.dds_guid ==
-                           zhp->zfs_dmustats.dds_guid) {
-                               if (ida->allowrecursion) {
-                                       zfs_close(zhp);
-                                       return (0);
-                               } else {
-                                       zfs_error_aux(zhp->zfs_hdl,
-                                           dgettext(TEXT_DOMAIN,
-                                           "recursive dependency at '%s'"),
-                                           zfs_get_name(zhp));
-                                       err = zfs_error(zhp->zfs_hdl,
-                                           EZFS_RECURSIVE,
-                                           dgettext(TEXT_DOMAIN,
-                                           "cannot determine dependent "
-                                           "datasets"));
-                                       zfs_close(zhp);
-                                       return (err);
-                               }
-                       }
-               }
-
-               isf.zhp = zhp;
-               isf.next = ida->stack;
-               ida->stack = &isf;
-               err = zfs_iter_filesystems(zhp, iter_dependents_cb, ida);
-               if (err == 0)
-                       err = zfs_iter_snapshots(zhp, B_FALSE,
-                           iter_dependents_cb, ida);
-               ida->stack = isf.next;
-       }
-
-       if (!first && err == 0)
-               err = ida->func(zhp, ida->data);
-       else
-               zfs_close(zhp);
-
-       return (err);
-}
-
-int
-zfs_iter_dependents(zfs_handle_t *zhp, boolean_t allowrecursion,
-    zfs_iter_f func, void *data)
-{
-       iter_dependents_arg_t ida;
-       ida.allowrecursion = allowrecursion;
-       ida.stack = NULL;
-       ida.func = func;
-       ida.data = data;
-       ida.first = B_TRUE;
-       return (iter_dependents_cb(zfs_handle_dup(zhp), &ida));
-}
diff --git a/zfs/lib/libzfs/libzfs_mount.c b/zfs/lib/libzfs/libzfs_mount.c
deleted file mode 100644 (file)
index c01ec10..0000000
+++ /dev/null
@@ -1,1296 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-/*
- * Routines to manage ZFS mounts.  We separate all the nasty routines that have
- * to deal with the OS.  The following functions are the main entry points --
- * they are used by mount and unmount and when changing a filesystem's
- * mountpoint.
- *
- *     zfs_is_mounted()
- *     zfs_mount()
- *     zfs_unmount()
- *     zfs_unmountall()
- *
- * This file also contains the functions used to manage sharing filesystems via
- * NFS and iSCSI:
- *
- *     zfs_is_shared()
- *     zfs_share()
- *     zfs_unshare()
- *
- *     zfs_is_shared_nfs()
- *     zfs_is_shared_smb()
- *     zfs_share_proto()
- *     zfs_shareall();
- *     zfs_unshare_nfs()
- *     zfs_unshare_smb()
- *     zfs_unshareall_nfs()
- *     zfs_unshareall_smb()
- *     zfs_unshareall()
- *     zfs_unshareall_bypath()
- *
- * The following functions are available for pool consumers, and will
- * mount/unmount and share/unshare all datasets within pool:
- *
- *     zpool_enable_datasets()
- *     zpool_disable_datasets()
- */
-
-#include <dirent.h>
-#include <dlfcn.h>
-#include <errno.h>
-#include <libgen.h>
-#include <libintl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <zone.h>
-#include <sys/mntent.h>
-#include <sys/mount.h>
-#include <sys/stat.h>
-
-#include <libzfs.h>
-
-#include "libzfs_impl.h"
-
-#include <libshare.h>
-#include <sys/systeminfo.h>
-#define        MAXISALEN       257     /* based on sysinfo(2) man page */
-
-static int zfs_share_proto(zfs_handle_t *, zfs_share_proto_t *);
-zfs_share_type_t zfs_is_shared_proto(zfs_handle_t *, char **,
-    zfs_share_proto_t);
-
-/*
- * The share protocols table must be in the same order as the zfs_share_prot_t
- * enum in libzfs_impl.h
- */
-typedef struct {
-       zfs_prop_t p_prop;
-       char *p_name;
-       int p_share_err;
-       int p_unshare_err;
-} proto_table_t;
-
-proto_table_t proto_table[PROTO_END] = {
-       {ZFS_PROP_SHARENFS, "nfs", EZFS_SHARENFSFAILED, EZFS_UNSHARENFSFAILED},
-       {ZFS_PROP_SHARESMB, "smb", EZFS_SHARESMBFAILED, EZFS_UNSHARESMBFAILED},
-};
-
-zfs_share_proto_t nfs_only[] = {
-       PROTO_NFS,
-       PROTO_END
-};
-
-zfs_share_proto_t smb_only[] = {
-       PROTO_SMB,
-       PROTO_END
-};
-zfs_share_proto_t share_all_proto[] = {
-       PROTO_NFS,
-       PROTO_SMB,
-       PROTO_END
-};
-
-/*
- * Search the sharetab for the given mountpoint and protocol, returning
- * a zfs_share_type_t value.
- */
-static zfs_share_type_t
-is_shared(libzfs_handle_t *hdl, const char *mountpoint, zfs_share_proto_t proto)
-{
-       char buf[MAXPATHLEN], *tab;
-       char *ptr;
-
-       if (hdl->libzfs_sharetab == NULL)
-               return (SHARED_NOT_SHARED);
-
-       (void) fseek(hdl->libzfs_sharetab, 0, SEEK_SET);
-
-       while (fgets(buf, sizeof (buf), hdl->libzfs_sharetab) != NULL) {
-
-               /* the mountpoint is the first entry on each line */
-               if ((tab = strchr(buf, '\t')) == NULL)
-                       continue;
-
-               *tab = '\0';
-               if (strcmp(buf, mountpoint) == 0) {
-                       /*
-                        * the protocol field is the third field
-                        * skip over second field
-                        */
-                       ptr = ++tab;
-                       if ((tab = strchr(ptr, '\t')) == NULL)
-                               continue;
-                       ptr = ++tab;
-                       if ((tab = strchr(ptr, '\t')) == NULL)
-                               continue;
-                       *tab = '\0';
-                       if (strcmp(ptr,
-                           proto_table[proto].p_name) == 0) {
-                               switch (proto) {
-                               case PROTO_NFS:
-                                       return (SHARED_NFS);
-                               case PROTO_SMB:
-                                       return (SHARED_SMB);
-                               default:
-                                       return (0);
-                               }
-                       }
-               }
-       }
-
-       return (SHARED_NOT_SHARED);
-}
-
-/*
- * Returns true if the specified directory is empty.  If we can't open the
- * directory at all, return true so that the mount can fail with a more
- * informative error message.
- */
-static boolean_t
-dir_is_empty(const char *dirname)
-{
-       DIR *dirp;
-       struct dirent64 *dp;
-
-       if ((dirp = opendir(dirname)) == NULL)
-               return (B_TRUE);
-
-       while ((dp = readdir64(dirp)) != NULL) {
-
-               if (strcmp(dp->d_name, ".") == 0 ||
-                   strcmp(dp->d_name, "..") == 0)
-                       continue;
-
-               (void) closedir(dirp);
-               return (B_FALSE);
-       }
-
-       (void) closedir(dirp);
-       return (B_TRUE);
-}
-
-/*
- * Checks to see if the mount is active.  If the filesystem is mounted, we fill
- * in 'where' with the current mountpoint, and return 1.  Otherwise, we return
- * 0.
- */
-boolean_t
-is_mounted(libzfs_handle_t *zfs_hdl, const char *special, char **where)
-{
-       struct mnttab entry;
-
-       if (libzfs_mnttab_find(zfs_hdl, special, &entry) != 0)
-               return (B_FALSE);
-
-       if (where != NULL)
-               *where = zfs_strdup(zfs_hdl, entry.mnt_mountp);
-
-       return (B_TRUE);
-}
-
-boolean_t
-zfs_is_mounted(zfs_handle_t *zhp, char **where)
-{
-       return (is_mounted(zhp->zfs_hdl, zfs_get_name(zhp), where));
-}
-
-/*
- * Returns true if the given dataset is mountable, false otherwise.  Returns the
- * mountpoint in 'buf'.
- */
-static boolean_t
-zfs_is_mountable(zfs_handle_t *zhp, char *buf, size_t buflen,
-    zprop_source_t *source)
-{
-       char sourceloc[ZFS_MAXNAMELEN];
-       zprop_source_t sourcetype;
-
-       if (!zfs_prop_valid_for_type(ZFS_PROP_MOUNTPOINT, zhp->zfs_type,
-           B_FALSE))
-               return (B_FALSE);
-
-       verify(zfs_prop_get(zhp, ZFS_PROP_MOUNTPOINT, buf, buflen,
-           &sourcetype, sourceloc, sizeof (sourceloc), B_FALSE) == 0);
-
-       if (strcmp(buf, ZFS_MOUNTPOINT_NONE) == 0 ||
-           strcmp(buf, ZFS_MOUNTPOINT_LEGACY) == 0)
-               return (B_FALSE);
-
-       if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_OFF)
-               return (B_FALSE);
-
-       if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED) &&
-           getzoneid() == GLOBAL_ZONEID)
-               return (B_FALSE);
-
-       if (source)
-               *source = sourcetype;
-
-       return (B_TRUE);
-}
-
-/*
- * The filesystem is mounted by invoking the system mount utility rather
- * than by the system call mount(2).  This ensures that the /etc/mtab
- * file is correctly locked for the update.  Performing our own locking
- * and /etc/mtab update requires making an unsafe assumption about how
- * the mount utility performs its locking.  Unfortunately, this also means
- * in the case of a mount failure we do not have the exact errno.  We must
- * make due with return value from the mount process.
- *
- * In the long term a shared library called libmount is under development
- * which provides a common API to address the locking and errno issues.
- * Once the standard mount utility has been updated to use this library
- * we can add an autoconf check to conditionally use it.
- *
- * http://www.kernel.org/pub/linux/utils/util-linux/libmount-docs/index.html
- */
-
-static int
-do_mount(const char *src, const char *mntpt, char *opts)
-{
-       char *argv[8] = {
-           "/bin/mount",
-           "-t", MNTTYPE_ZFS,
-           "-o", opts,
-           (char *)src,
-           (char *)mntpt,
-           (char *)NULL };
-       int rc;
-
-       /* Return only the most critical mount error */
-       rc = libzfs_run_process(argv[0], argv, STDOUT_VERBOSE|STDERR_VERBOSE);
-       if (rc) {
-               if (rc & MOUNT_FILEIO)
-                       return (EIO);
-               if (rc & MOUNT_USER)
-                       return (EINTR);
-               if (rc & MOUNT_SOFTWARE)
-                       return (EPIPE);
-               if (rc & MOUNT_BUSY)
-                       return (EBUSY);
-               if (rc & MOUNT_SYSERR)
-                       return (EAGAIN);
-               if (rc & MOUNT_USAGE)
-                       return (EINVAL);
-
-               return (ENXIO); /* Generic error */
-       }
-
-       return (0);
-}
-
-static int
-do_unmount(const char *mntpt, int flags)
-{
-       char force_opt[] = "-f";
-       char lazy_opt[] = "-l";
-       char *argv[7] = {
-           "/bin/umount",
-           "-t", MNTTYPE_ZFS,
-           NULL, NULL, NULL, NULL };
-       int rc, count = 3;
-
-       if (flags & MS_FORCE) {
-               argv[count] = force_opt;
-               count++;
-       }
-
-       if (flags & MS_DETACH) {
-               argv[count] = lazy_opt;
-               count++;
-       }
-
-       argv[count] = (char *)mntpt;
-       rc = libzfs_run_process(argv[0], argv, STDOUT_VERBOSE|STDERR_VERBOSE);
-
-       return (rc ? EINVAL : 0);
-}
-
-static int
-zfs_add_option(zfs_handle_t *zhp, char *options, int len,
-    zfs_prop_t prop, char *on, char *off)
-{
-       char *source;
-       uint64_t value;
-
-       /* Skip adding duplicate default options */
-       if ((strstr(options, on) != NULL) || (strstr(options, off) != NULL))
-               return (0);
-
-       /*
-        * zfs_prop_get_int() to not used to ensure our mount options
-        * are not influenced by the current /etc/mtab contents.
-        */
-       value = getprop_uint64(zhp, prop, &source);
-
-       (void) strlcat(options, ",", len);
-       (void) strlcat(options, value ? on : off, len);
-
-       return (0);
-}
-
-static int
-zfs_add_options(zfs_handle_t *zhp, char *options, int len)
-{
-       int error = 0;
-
-       error = zfs_add_option(zhp, options, len,
-           ZFS_PROP_ATIME, MNTOPT_ATIME, MNTOPT_NOATIME);
-       error = error ? error : zfs_add_option(zhp, options, len,
-           ZFS_PROP_DEVICES, MNTOPT_DEVICES, MNTOPT_NODEVICES);
-       error = error ? error : zfs_add_option(zhp, options, len,
-           ZFS_PROP_EXEC, MNTOPT_EXEC, MNTOPT_NOEXEC);
-       error = error ? error : zfs_add_option(zhp, options, len,
-           ZFS_PROP_READONLY, MNTOPT_RO, MNTOPT_RW);
-       error = error ? error : zfs_add_option(zhp, options, len,
-           ZFS_PROP_SETUID, MNTOPT_SETUID, MNTOPT_NOSETUID);
-       error = error ? error : zfs_add_option(zhp, options, len,
-           ZFS_PROP_NBMAND, MNTOPT_NBMAND, MNTOPT_NONBMAND);
-
-       return (error);
-}
-
-/*
- * Mount the given filesystem.
- */
-int
-zfs_mount(zfs_handle_t *zhp, const char *options, int flags)
-{
-       struct stat buf;
-       char mountpoint[ZFS_MAXPROPLEN];
-       char mntopts[MNT_LINE_MAX];
-       char overlay[ZFS_MAXPROPLEN];
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       int remount = 0, rc;
-
-       if (options == NULL) {
-               (void) strlcpy(mntopts, MNTOPT_DEFAULTS, sizeof (mntopts));
-       } else {
-               (void) strlcpy(mntopts, options, sizeof (mntopts));
-       }
-
-       if (strstr(mntopts, MNTOPT_REMOUNT) != NULL)
-               remount = 1;
-
-       /*
-        * If the pool is imported read-only then all mounts must be read-only
-        */
-       if (zpool_get_prop_int(zhp->zpool_hdl, ZPOOL_PROP_READONLY, NULL))
-               (void) strlcat(mntopts, "," MNTOPT_RO, sizeof (mntopts));
-
-       if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL))
-               return (0);
-
-       /*
-        * Append default mount options which apply to the mount point.
-        * This is done because under Linux (unlike Solaris) multiple mount
-        * points may reference a single super block.  This means that just
-        * given a super block there is no back reference to update the per
-        * mount point options.
-        */
-       rc = zfs_add_options(zhp, mntopts, sizeof (mntopts));
-       if (rc) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "default options unavailable"));
-               return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED,
-                   dgettext(TEXT_DOMAIN, "cannot mount '%s'"),
-                   mountpoint));
-       }
-
-       /*
-        * Append zfsutil option so the mount helper allow the mount
-        */
-       strlcat(mntopts, "," MNTOPT_ZFSUTIL, sizeof (mntopts));
-
-       /* Create the directory if it doesn't already exist */
-       if (lstat(mountpoint, &buf) != 0) {
-               if (mkdirp(mountpoint, 0755) != 0) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "failed to create mountpoint"));
-                       return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED,
-                           dgettext(TEXT_DOMAIN, "cannot mount '%s'"),
-                           mountpoint));
-               }
-       }
-
-       /*
-        * Overlay mounts are disabled by default but may be enabled
-        * via the 'overlay' property or the 'zfs mount -O' option.
-        */
-       if (!(flags & MS_OVERLAY)) {
-               if (zfs_prop_get(zhp, ZFS_PROP_OVERLAY, overlay,
-                           sizeof (overlay), NULL, NULL, 0, B_FALSE) == 0) {
-                       if (strcmp(overlay, "on") == 0) {
-                               flags |= MS_OVERLAY;
-                       }
-               }
-       }
-
-       /*
-        * Determine if the mountpoint is empty.  If so, refuse to perform the
-        * mount.  We don't perform this check if 'remount' is
-        * specified or if overlay option(-O) is given
-        */
-       if ((flags & MS_OVERLAY) == 0 && !remount &&
-           !dir_is_empty(mountpoint)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "directory is not empty"));
-               return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED,
-                   dgettext(TEXT_DOMAIN, "cannot mount '%s'"), mountpoint));
-       }
-
-       /* perform the mount */
-       rc = do_mount(zfs_get_name(zhp), mountpoint, mntopts);
-       if (rc) {
-               /*
-                * Generic errors are nasty, but there are just way too many
-                * from mount(), and they're well-understood.  We pick a few
-                * common ones to improve upon.
-                */
-               if (rc == EBUSY) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "mountpoint or dataset is busy"));
-               } else if (rc == EPERM) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "Insufficient privileges"));
-               } else if (rc == ENOTSUP) {
-                       char buf[256];
-                       int spa_version;
-
-                       VERIFY(zfs_spa_version(zhp, &spa_version) == 0);
-                       (void) snprintf(buf, sizeof (buf),
-                           dgettext(TEXT_DOMAIN, "Can't mount a version %lld "
-                           "file system on a version %d pool. Pool must be"
-                           " upgraded to mount this file system."),
-                           (u_longlong_t)zfs_prop_get_int(zhp,
-                           ZFS_PROP_VERSION), spa_version);
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, buf));
-               } else {
-                       zfs_error_aux(hdl, strerror(rc));
-               }
-               return (zfs_error_fmt(hdl, EZFS_MOUNTFAILED,
-                   dgettext(TEXT_DOMAIN, "cannot mount '%s'"),
-                   zhp->zfs_name));
-       }
-
-       /* remove the mounted entry before re-adding on remount */
-       if (remount)
-               libzfs_mnttab_remove(hdl, zhp->zfs_name);
-
-       /* add the mounted entry into our cache */
-       libzfs_mnttab_add(hdl, zfs_get_name(zhp), mountpoint, mntopts);
-       return (0);
-}
-
-/*
- * Unmount a single filesystem.
- */
-static int
-unmount_one(libzfs_handle_t *hdl, const char *mountpoint, int flags)
-{
-       int error;
-
-       error = do_unmount(mountpoint, flags);
-       if (error != 0) {
-               return (zfs_error_fmt(hdl, EZFS_UMOUNTFAILED,
-                   dgettext(TEXT_DOMAIN, "cannot unmount '%s'"),
-                   mountpoint));
-       }
-
-       return (0);
-}
-
-/*
- * Unmount the given filesystem.
- */
-int
-zfs_unmount(zfs_handle_t *zhp, const char *mountpoint, int flags)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       struct mnttab entry;
-       char *mntpt = NULL;
-
-       /* check to see if we need to unmount the filesystem */
-       if (mountpoint != NULL || ((zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) &&
-           libzfs_mnttab_find(hdl, zhp->zfs_name, &entry) == 0)) {
-               /*
-                * mountpoint may have come from a call to
-                * getmnt/getmntany if it isn't NULL. If it is NULL,
-                * we know it comes from libzfs_mnttab_find which can
-                * then get freed later. We strdup it to play it safe.
-                */
-               if (mountpoint == NULL)
-                       mntpt = zfs_strdup(hdl, entry.mnt_mountp);
-               else
-                       mntpt = zfs_strdup(hdl, mountpoint);
-
-               /*
-                * Unshare and unmount the filesystem
-                */
-               if (zfs_unshare_proto(zhp, mntpt, share_all_proto) != 0)
-                       return (-1);
-
-               if (unmount_one(hdl, mntpt, flags) != 0) {
-                       free(mntpt);
-                       (void) zfs_shareall(zhp);
-                       return (-1);
-               }
-               libzfs_mnttab_remove(hdl, zhp->zfs_name);
-               free(mntpt);
-       }
-
-       return (0);
-}
-
-/*
- * Unmount this filesystem and any children inheriting the mountpoint property.
- * To do this, just act like we're changing the mountpoint property, but don't
- * remount the filesystems afterwards.
- */
-int
-zfs_unmountall(zfs_handle_t *zhp, int flags)
-{
-       prop_changelist_t *clp;
-       int ret;
-
-       clp = changelist_gather(zhp, ZFS_PROP_MOUNTPOINT, 0, flags);
-       if (clp == NULL)
-               return (-1);
-
-       ret = changelist_prefix(clp);
-       changelist_free(clp);
-
-       return (ret);
-}
-
-boolean_t
-zfs_is_shared(zfs_handle_t *zhp)
-{
-       zfs_share_type_t rc = 0;
-       zfs_share_proto_t *curr_proto;
-
-       if (ZFS_IS_VOLUME(zhp))
-               return (B_FALSE);
-
-       for (curr_proto = share_all_proto; *curr_proto != PROTO_END;
-           curr_proto++)
-               rc |= zfs_is_shared_proto(zhp, NULL, *curr_proto);
-
-       return (rc ? B_TRUE : B_FALSE);
-}
-
-int
-zfs_share(zfs_handle_t *zhp)
-{
-       assert(!ZFS_IS_VOLUME(zhp));
-       return (zfs_share_proto(zhp, share_all_proto));
-}
-
-int
-zfs_unshare(zfs_handle_t *zhp)
-{
-       assert(!ZFS_IS_VOLUME(zhp));
-       return (zfs_unshareall(zhp));
-}
-
-/*
- * Check to see if the filesystem is currently shared.
- */
-zfs_share_type_t
-zfs_is_shared_proto(zfs_handle_t *zhp, char **where, zfs_share_proto_t proto)
-{
-       char *mountpoint;
-       zfs_share_type_t rc;
-
-       if (!zfs_is_mounted(zhp, &mountpoint))
-               return (SHARED_NOT_SHARED);
-
-       if ((rc = is_shared(zhp->zfs_hdl, mountpoint, proto))) {
-               if (where != NULL)
-                       *where = mountpoint;
-               else
-                       free(mountpoint);
-               return (rc);
-       } else {
-               free(mountpoint);
-               return (SHARED_NOT_SHARED);
-       }
-}
-
-boolean_t
-zfs_is_shared_nfs(zfs_handle_t *zhp, char **where)
-{
-       return (zfs_is_shared_proto(zhp, where,
-           PROTO_NFS) != SHARED_NOT_SHARED);
-}
-
-boolean_t
-zfs_is_shared_smb(zfs_handle_t *zhp, char **where)
-{
-       return (zfs_is_shared_proto(zhp, where,
-           PROTO_SMB) != SHARED_NOT_SHARED);
-}
-
-/*
- * zfs_init_libshare(zhandle, service)
- *
- * Initialize the libshare API if it hasn't already been initialized.
- * In all cases it returns 0 if it succeeded and an error if not. The
- * service value is which part(s) of the API to initialize and is a
- * direct map to the libshare sa_init(service) interface.
- */
-int
-zfs_init_libshare(libzfs_handle_t *zhandle, int service)
-{
-       int ret = SA_OK;
-
-       if (ret == SA_OK && zhandle->libzfs_shareflags & ZFSSHARE_MISS) {
-               /*
-                * We had a cache miss. Most likely it is a new ZFS
-                * dataset that was just created. We want to make sure
-                * so check timestamps to see if a different process
-                * has updated any of the configuration. If there was
-                * some non-ZFS change, we need to re-initialize the
-                * internal cache.
-                */
-               zhandle->libzfs_shareflags &= ~ZFSSHARE_MISS;
-               if (sa_needs_refresh(zhandle->libzfs_sharehdl)) {
-                       zfs_uninit_libshare(zhandle);
-                       zhandle->libzfs_sharehdl = sa_init(service);
-               }
-       }
-
-       if (ret == SA_OK && zhandle && zhandle->libzfs_sharehdl == NULL)
-               zhandle->libzfs_sharehdl = sa_init(service);
-
-       if (ret == SA_OK && zhandle->libzfs_sharehdl == NULL)
-               ret = SA_NO_MEMORY;
-
-       return (ret);
-}
-
-/*
- * zfs_uninit_libshare(zhandle)
- *
- * Uninitialize the libshare API if it hasn't already been
- * uninitialized. It is OK to call multiple times.
- */
-void
-zfs_uninit_libshare(libzfs_handle_t *zhandle)
-{
-       if (zhandle != NULL && zhandle->libzfs_sharehdl != NULL) {
-               sa_fini(zhandle->libzfs_sharehdl);
-               zhandle->libzfs_sharehdl = NULL;
-       }
-}
-
-/*
- * zfs_parse_options(options, proto)
- *
- * Call the legacy parse interface to get the protocol specific
- * options using the NULL arg to indicate that this is a "parse" only.
- */
-int
-zfs_parse_options(char *options, zfs_share_proto_t proto)
-{
-       return (sa_parse_legacy_options(NULL, options,
-           proto_table[proto].p_name));
-}
-
-/*
- * Share the given filesystem according to the options in the specified
- * protocol specific properties (sharenfs, sharesmb).  We rely
- * on "libshare" to do the dirty work for us.
- */
-static int
-zfs_share_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto)
-{
-       char mountpoint[ZFS_MAXPROPLEN];
-       char shareopts[ZFS_MAXPROPLEN];
-       char sourcestr[ZFS_MAXPROPLEN];
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       sa_share_t share;
-       zfs_share_proto_t *curr_proto;
-       zprop_source_t sourcetype;
-       int ret;
-
-       if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint), NULL))
-               return (0);
-
-       if ((ret = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
-               (void) zfs_error_fmt(hdl, EZFS_SHARENFSFAILED,
-                   dgettext(TEXT_DOMAIN, "cannot share '%s': %s"),
-                   zfs_get_name(zhp), sa_errorstr(ret));
-               return (-1);
-       }
-
-       for (curr_proto = proto; *curr_proto != PROTO_END; curr_proto++) {
-               /*
-                * Return success if there are no share options.
-                */
-               if (zfs_prop_get(zhp, proto_table[*curr_proto].p_prop,
-                   shareopts, sizeof (shareopts), &sourcetype, sourcestr,
-                   ZFS_MAXPROPLEN, B_FALSE) != 0 ||
-                   strcmp(shareopts, "off") == 0)
-                       continue;
-
-               /*
-                * If the 'zoned' property is set, then zfs_is_mountable()
-                * will have already bailed out if we are in the global zone.
-                * But local zones cannot be NFS servers, so we ignore it for
-                * local zones as well.
-                */
-               if (zfs_prop_get_int(zhp, ZFS_PROP_ZONED))
-                       continue;
-
-               share = sa_find_share(hdl->libzfs_sharehdl, mountpoint);
-               if (share == NULL) {
-                       /*
-                        * This may be a new file system that was just
-                        * created so isn't in the internal cache
-                        * (second time through). Rather than
-                        * reloading the entire configuration, we can
-                        * assume ZFS has done the checking and it is
-                        * safe to add this to the internal
-                        * configuration.
-                        */
-                       if (sa_zfs_process_share(hdl->libzfs_sharehdl,
-                           NULL, NULL, mountpoint,
-                           proto_table[*curr_proto].p_name, sourcetype,
-                           shareopts, sourcestr, zhp->zfs_name) != SA_OK) {
-                               (void) zfs_error_fmt(hdl,
-                                   proto_table[*curr_proto].p_share_err,
-                                   dgettext(TEXT_DOMAIN, "cannot share '%s'"),
-                                   zfs_get_name(zhp));
-                               return (-1);
-                       }
-                       hdl->libzfs_shareflags |= ZFSSHARE_MISS;
-                       share = sa_find_share(hdl->libzfs_sharehdl,
-                           mountpoint);
-               }
-               if (share != NULL) {
-                       int err;
-                       err = sa_enable_share(share,
-                           proto_table[*curr_proto].p_name);
-                       if (err != SA_OK) {
-                               (void) zfs_error_fmt(hdl,
-                                   proto_table[*curr_proto].p_share_err,
-                                   dgettext(TEXT_DOMAIN, "cannot share '%s'"),
-                                   zfs_get_name(zhp));
-                               return (-1);
-                       }
-               } else {
-                       (void) zfs_error_fmt(hdl,
-                           proto_table[*curr_proto].p_share_err,
-                           dgettext(TEXT_DOMAIN, "cannot share '%s'"),
-                           zfs_get_name(zhp));
-                       return (-1);
-               }
-
-       }
-       return (0);
-}
-
-
-int
-zfs_share_nfs(zfs_handle_t *zhp)
-{
-       return (zfs_share_proto(zhp, nfs_only));
-}
-
-int
-zfs_share_smb(zfs_handle_t *zhp)
-{
-       return (zfs_share_proto(zhp, smb_only));
-}
-
-int
-zfs_shareall(zfs_handle_t *zhp)
-{
-       return (zfs_share_proto(zhp, share_all_proto));
-}
-
-/*
- * Unshare a filesystem by mountpoint.
- */
-static int
-unshare_one(libzfs_handle_t *hdl, const char *name, const char *mountpoint,
-    zfs_share_proto_t proto)
-{
-       sa_share_t share;
-       int err;
-       char *mntpt;
-       /*
-        * Mountpoint could get trashed if libshare calls getmntany
-        * which it does during API initialization, so strdup the
-        * value.
-        */
-       mntpt = zfs_strdup(hdl, mountpoint);
-
-       /* make sure libshare initialized */
-       if ((err = zfs_init_libshare(hdl, SA_INIT_SHARE_API)) != SA_OK) {
-               free(mntpt);    /* don't need the copy anymore */
-               return (zfs_error_fmt(hdl, EZFS_SHARENFSFAILED,
-                   dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
-                   name, sa_errorstr(err)));
-       }
-
-       share = sa_find_share(hdl->libzfs_sharehdl, mntpt);
-       free(mntpt);    /* don't need the copy anymore */
-
-       if (share != NULL) {
-               err = sa_disable_share(share, proto_table[proto].p_name);
-               if (err != SA_OK) {
-                       return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
-                           dgettext(TEXT_DOMAIN, "cannot unshare '%s': %s"),
-                           name, sa_errorstr(err)));
-               }
-       } else {
-               return (zfs_error_fmt(hdl, EZFS_UNSHARENFSFAILED,
-                   dgettext(TEXT_DOMAIN, "cannot unshare '%s': not found"),
-                   name));
-       }
-       return (0);
-}
-
-/*
- * Unshare the given filesystem.
- */
-int
-zfs_unshare_proto(zfs_handle_t *zhp, const char *mountpoint,
-    zfs_share_proto_t *proto)
-{
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       struct mnttab entry;
-       char *mntpt = NULL;
-
-       /* check to see if need to unmount the filesystem */
-       if (mountpoint != NULL)
-               mountpoint = mntpt = zfs_strdup(hdl, mountpoint);
-
-       if (mountpoint != NULL || ((zfs_get_type(zhp) == ZFS_TYPE_FILESYSTEM) &&
-           libzfs_mnttab_find(hdl, zfs_get_name(zhp), &entry) == 0)) {
-               zfs_share_proto_t *curr_proto;
-
-               if (mountpoint == NULL)
-                       mntpt = zfs_strdup(zhp->zfs_hdl, entry.mnt_mountp);
-
-               for (curr_proto = proto; *curr_proto != PROTO_END;
-                   curr_proto++) {
-
-                       if (is_shared(hdl, mntpt, *curr_proto) &&
-                           unshare_one(hdl, zhp->zfs_name,
-                                       mntpt, *curr_proto) != 0) {
-                               if (mntpt != NULL)
-                                       free(mntpt);
-                               return (-1);
-                       }
-               }
-       }
-       if (mntpt != NULL)
-               free(mntpt);
-
-       return (0);
-}
-
-int
-zfs_unshare_nfs(zfs_handle_t *zhp, const char *mountpoint)
-{
-       return (zfs_unshare_proto(zhp, mountpoint, nfs_only));
-}
-
-int
-zfs_unshare_smb(zfs_handle_t *zhp, const char *mountpoint)
-{
-       return (zfs_unshare_proto(zhp, mountpoint, smb_only));
-}
-
-/*
- * Same as zfs_unmountall(), but for NFS and SMB unshares.
- */
-int
-zfs_unshareall_proto(zfs_handle_t *zhp, zfs_share_proto_t *proto)
-{
-       prop_changelist_t *clp;
-       int ret;
-
-       clp = changelist_gather(zhp, ZFS_PROP_SHARENFS, 0, 0);
-       if (clp == NULL)
-               return (-1);
-
-       ret = changelist_unshare(clp, proto);
-       changelist_free(clp);
-
-       return (ret);
-}
-
-int
-zfs_unshareall_nfs(zfs_handle_t *zhp)
-{
-       return (zfs_unshareall_proto(zhp, nfs_only));
-}
-
-int
-zfs_unshareall_smb(zfs_handle_t *zhp)
-{
-       return (zfs_unshareall_proto(zhp, smb_only));
-}
-
-int
-zfs_unshareall(zfs_handle_t *zhp)
-{
-       return (zfs_unshareall_proto(zhp, share_all_proto));
-}
-
-int
-zfs_unshareall_bypath(zfs_handle_t *zhp, const char *mountpoint)
-{
-       return (zfs_unshare_proto(zhp, mountpoint, share_all_proto));
-}
-
-/*
- * Remove the mountpoint associated with the current dataset, if necessary.
- * We only remove the underlying directory if:
- *
- *     - The mountpoint is not 'none' or 'legacy'
- *     - The mountpoint is non-empty
- *     - The mountpoint is the default or inherited
- *     - The 'zoned' property is set, or we're in a local zone
- *
- * Any other directories we leave alone.
- */
-void
-remove_mountpoint(zfs_handle_t *zhp)
-{
-       char mountpoint[ZFS_MAXPROPLEN];
-       zprop_source_t source;
-
-       if (!zfs_is_mountable(zhp, mountpoint, sizeof (mountpoint),
-           &source))
-               return;
-
-       if (source == ZPROP_SRC_DEFAULT ||
-           source == ZPROP_SRC_INHERITED) {
-               /*
-                * Try to remove the directory, silently ignoring any errors.
-                * The filesystem may have since been removed or moved around,
-                * and this error isn't really useful to the administrator in
-                * any way.
-                */
-               (void) rmdir(mountpoint);
-       }
-}
-
-void
-libzfs_add_handle(get_all_cb_t *cbp, zfs_handle_t *zhp)
-{
-       if (cbp->cb_alloc == cbp->cb_used) {
-               size_t newsz;
-               void *ptr;
-
-               newsz = cbp->cb_alloc ? cbp->cb_alloc * 2 : 64;
-               ptr = zfs_realloc(zhp->zfs_hdl,
-                   cbp->cb_handles, cbp->cb_alloc * sizeof (void *),
-                   newsz * sizeof (void *));
-               cbp->cb_handles = ptr;
-               cbp->cb_alloc = newsz;
-       }
-       cbp->cb_handles[cbp->cb_used++] = zhp;
-}
-
-static int
-mount_cb(zfs_handle_t *zhp, void *data)
-{
-       get_all_cb_t *cbp = data;
-
-       if (!(zfs_get_type(zhp) & ZFS_TYPE_FILESYSTEM)) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if (zfs_prop_get_int(zhp, ZFS_PROP_CANMOUNT) == ZFS_CANMOUNT_NOAUTO) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       libzfs_add_handle(cbp, zhp);
-       if (zfs_iter_filesystems(zhp, mount_cb, cbp) != 0) {
-               zfs_close(zhp);
-               return (-1);
-       }
-       return (0);
-}
-
-int
-libzfs_dataset_cmp(const void *a, const void *b)
-{
-       zfs_handle_t **za = (zfs_handle_t **)a;
-       zfs_handle_t **zb = (zfs_handle_t **)b;
-       char mounta[MAXPATHLEN];
-       char mountb[MAXPATHLEN];
-       boolean_t gota, gotb;
-
-       if ((gota = (zfs_get_type(*za) == ZFS_TYPE_FILESYSTEM)) != 0)
-               verify(zfs_prop_get(*za, ZFS_PROP_MOUNTPOINT, mounta,
-                   sizeof (mounta), NULL, NULL, 0, B_FALSE) == 0);
-       if ((gotb = (zfs_get_type(*zb) == ZFS_TYPE_FILESYSTEM)) != 0)
-               verify(zfs_prop_get(*zb, ZFS_PROP_MOUNTPOINT, mountb,
-                   sizeof (mountb), NULL, NULL, 0, B_FALSE) == 0);
-
-       if (gota && gotb)
-               return (strcmp(mounta, mountb));
-
-       if (gota)
-               return (-1);
-       if (gotb)
-               return (1);
-
-       return (strcmp(zfs_get_name(a), zfs_get_name(b)));
-}
-
-/*
- * Mount and share all datasets within the given pool.  This assumes that no
- * datasets within the pool are currently mounted.  Because users can create
- * complicated nested hierarchies of mountpoints, we first gather all the
- * datasets and mountpoints within the pool, and sort them by mountpoint.  Once
- * we have the list of all filesystems, we iterate over them in order and mount
- * and/or share each one.
- */
-#pragma weak zpool_mount_datasets = zpool_enable_datasets
-int
-zpool_enable_datasets(zpool_handle_t *zhp, const char *mntopts, int flags)
-{
-       get_all_cb_t cb = { 0 };
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       zfs_handle_t *zfsp;
-       int i, ret = -1;
-       int *good;
-
-       /*
-        * Gather all non-snap datasets within the pool.
-        */
-       if ((zfsp = zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_DATASET)) == NULL)
-               goto out;
-
-       libzfs_add_handle(&cb, zfsp);
-       if (zfs_iter_filesystems(zfsp, mount_cb, &cb) != 0)
-               goto out;
-       /*
-        * Sort the datasets by mountpoint.
-        */
-       qsort(cb.cb_handles, cb.cb_used, sizeof (void *),
-           libzfs_dataset_cmp);
-
-       /*
-        * And mount all the datasets, keeping track of which ones
-        * succeeded or failed.
-        */
-       if ((good = zfs_alloc(zhp->zpool_hdl,
-           cb.cb_used * sizeof (int))) == NULL)
-               goto out;
-
-       ret = 0;
-       for (i = 0; i < cb.cb_used; i++) {
-               if (zfs_mount(cb.cb_handles[i], mntopts, flags) != 0)
-                       ret = -1;
-               else
-                       good[i] = 1;
-       }
-
-       /*
-        * Then share all the ones that need to be shared. This needs
-        * to be a separate pass in order to avoid excessive reloading
-        * of the configuration. Good should never be NULL since
-        * zfs_alloc is supposed to exit if memory isn't available.
-        */
-       for (i = 0; i < cb.cb_used; i++) {
-               if (good[i] && zfs_share(cb.cb_handles[i]) != 0)
-                       ret = -1;
-       }
-
-       free(good);
-
-out:
-       for (i = 0; i < cb.cb_used; i++)
-               zfs_close(cb.cb_handles[i]);
-       free(cb.cb_handles);
-
-       return (ret);
-}
-
-static int
-mountpoint_compare(const void *a, const void *b)
-{
-       const char *mounta = *((char **)a);
-       const char *mountb = *((char **)b);
-
-       return (strcmp(mountb, mounta));
-}
-
-/* alias for 2002/240 */
-#pragma weak zpool_unmount_datasets = zpool_disable_datasets
-/*
- * Unshare and unmount all datasets within the given pool.  We don't want to
- * rely on traversing the DSL to discover the filesystems within the pool,
- * because this may be expensive (if not all of them are mounted), and can fail
- * arbitrarily (on I/O error, for example).  Instead, we walk /etc/mtab and
- * gather all the filesystems that are currently mounted.
- */
-int
-zpool_disable_datasets(zpool_handle_t *zhp, boolean_t force)
-{
-       int used, alloc;
-       struct mnttab entry;
-       size_t namelen;
-       char **mountpoints = NULL;
-       zfs_handle_t **datasets = NULL;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       int i;
-       int ret = -1;
-       int flags = (force ? MS_FORCE : 0);
-
-       namelen = strlen(zhp->zpool_name);
-
-       /* Reopen MNTTAB to prevent reading stale data from open file */
-       if (freopen(MNTTAB, "r", hdl->libzfs_mnttab) == NULL)
-               return (ENOENT);
-
-       used = alloc = 0;
-       while (getmntent(hdl->libzfs_mnttab, &entry) == 0) {
-               /*
-                * Ignore non-ZFS entries.
-                */
-               if (entry.mnt_fstype == NULL ||
-                   strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0)
-                       continue;
-
-               /*
-                * Ignore filesystems not within this pool.
-                */
-               if (entry.mnt_mountp == NULL ||
-                   strncmp(entry.mnt_special, zhp->zpool_name, namelen) != 0 ||
-                   (entry.mnt_special[namelen] != '/' &&
-                   entry.mnt_special[namelen] != '\0'))
-                       continue;
-
-               /*
-                * At this point we've found a filesystem within our pool.  Add
-                * it to our growing list.
-                */
-               if (used == alloc) {
-                       if (alloc == 0) {
-                               if ((mountpoints = zfs_alloc(hdl,
-                                   8 * sizeof (void *))) == NULL)
-                                       goto out;
-
-                               if ((datasets = zfs_alloc(hdl,
-                                   8 * sizeof (void *))) == NULL)
-                                       goto out;
-
-                               alloc = 8;
-                       } else {
-                               void *ptr;
-
-                               if ((ptr = zfs_realloc(hdl, mountpoints,
-                                   alloc * sizeof (void *),
-                                   alloc * 2 * sizeof (void *))) == NULL)
-                                       goto out;
-                               mountpoints = ptr;
-
-                               if ((ptr = zfs_realloc(hdl, datasets,
-                                   alloc * sizeof (void *),
-                                   alloc * 2 * sizeof (void *))) == NULL)
-                                       goto out;
-                               datasets = ptr;
-
-                               alloc *= 2;
-                       }
-               }
-
-               if ((mountpoints[used] = zfs_strdup(hdl,
-                   entry.mnt_mountp)) == NULL)
-                       goto out;
-
-               /*
-                * This is allowed to fail, in case there is some I/O error.  It
-                * is only used to determine if we need to remove the underlying
-                * mountpoint, so failure is not fatal.
-                */
-               datasets[used] = make_dataset_handle(hdl, entry.mnt_special);
-
-               used++;
-       }
-
-       /*
-        * At this point, we have the entire list of filesystems, so sort it by
-        * mountpoint.
-        */
-       qsort(mountpoints, used, sizeof (char *), mountpoint_compare);
-
-       /*
-        * Walk through and first unshare everything.
-        */
-       for (i = 0; i < used; i++) {
-               zfs_share_proto_t *curr_proto;
-               for (curr_proto = share_all_proto; *curr_proto != PROTO_END;
-                   curr_proto++) {
-                       if (is_shared(hdl, mountpoints[i], *curr_proto) &&
-                           unshare_one(hdl, mountpoints[i],
-                           mountpoints[i], *curr_proto) != 0)
-                               goto out;
-               }
-       }
-
-       /*
-        * Now unmount everything, removing the underlying directories as
-        * appropriate.
-        */
-       for (i = 0; i < used; i++) {
-               if (unmount_one(hdl, mountpoints[i], flags) != 0)
-                       goto out;
-       }
-
-       for (i = 0; i < used; i++) {
-               if (datasets[i])
-                       remove_mountpoint(datasets[i]);
-       }
-
-       ret = 0;
-out:
-       for (i = 0; i < used; i++) {
-               if (datasets[i])
-                       zfs_close(datasets[i]);
-               free(mountpoints[i]);
-       }
-       free(datasets);
-       free(mountpoints);
-
-       return (ret);
-}
diff --git a/zfs/lib/libzfs/libzfs_pool.c b/zfs/lib/libzfs/libzfs_pool.c
deleted file mode 100644 (file)
index a730a94..0000000
+++ /dev/null
@@ -1,4261 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
- */
-
-#include <ctype.h>
-#include <errno.h>
-#include <devid.h>
-#include <fcntl.h>
-#include <libintl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <libgen.h>
-#include <zone.h>
-#include <sys/stat.h>
-#include <sys/efi_partition.h>
-#include <sys/vtoc.h>
-#include <sys/zfs_ioctl.h>
-#include <dlfcn.h>
-
-#include "zfs_namecheck.h"
-#include "zfs_prop.h"
-#include "libzfs_impl.h"
-#include "zfs_comutil.h"
-#include "zfeature_common.h"
-
-static int read_efi_label(nvlist_t *config, diskaddr_t *sb);
-
-typedef struct prop_flags {
-       int create:1;   /* Validate property on creation */
-       int import:1;   /* Validate property on import */
-} prop_flags_t;
-
-/*
- * ====================================================================
- *   zpool property functions
- * ====================================================================
- */
-
-static int
-zpool_get_all_props(zpool_handle_t *zhp)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, 0) != 0)
-               return (-1);
-
-       while (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_GET_PROPS, &zc) != 0) {
-               if (errno == ENOMEM) {
-                       if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                               zcmd_free_nvlists(&zc);
-                               return (-1);
-                       }
-               } else {
-                       zcmd_free_nvlists(&zc);
-                       return (-1);
-               }
-       }
-
-       if (zcmd_read_dst_nvlist(hdl, &zc, &zhp->zpool_props) != 0) {
-               zcmd_free_nvlists(&zc);
-               return (-1);
-       }
-
-       zcmd_free_nvlists(&zc);
-
-       return (0);
-}
-
-static int
-zpool_props_refresh(zpool_handle_t *zhp)
-{
-       nvlist_t *old_props;
-
-       old_props = zhp->zpool_props;
-
-       if (zpool_get_all_props(zhp) != 0)
-               return (-1);
-
-       nvlist_free(old_props);
-       return (0);
-}
-
-static char *
-zpool_get_prop_string(zpool_handle_t *zhp, zpool_prop_t prop,
-    zprop_source_t *src)
-{
-       nvlist_t *nv, *nvl;
-       uint64_t ival;
-       char *value;
-       zprop_source_t source;
-
-       nvl = zhp->zpool_props;
-       if (nvlist_lookup_nvlist(nvl, zpool_prop_to_name(prop), &nv) == 0) {
-               verify(nvlist_lookup_uint64(nv, ZPROP_SOURCE, &ival) == 0);
-               source = ival;
-               verify(nvlist_lookup_string(nv, ZPROP_VALUE, &value) == 0);
-       } else {
-               source = ZPROP_SRC_DEFAULT;
-               if ((value = (char *)zpool_prop_default_string(prop)) == NULL)
-                       value = "-";
-       }
-
-       if (src)
-               *src = source;
-
-       return (value);
-}
-
-uint64_t
-zpool_get_prop_int(zpool_handle_t *zhp, zpool_prop_t prop, zprop_source_t *src)
-{
-       nvlist_t *nv, *nvl;
-       uint64_t value;
-       zprop_source_t source;
-
-       if (zhp->zpool_props == NULL && zpool_get_all_props(zhp)) {
-               /*
-                * zpool_get_all_props() has most likely failed because
-                * the pool is faulted, but if all we need is the top level
-                * vdev's guid then get it from the zhp config nvlist.
-                */
-               if ((prop == ZPOOL_PROP_GUID) &&
-                   (nvlist_lookup_nvlist(zhp->zpool_config,
-                   ZPOOL_CONFIG_VDEV_TREE, &nv) == 0) &&
-                   (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID, &value)
-                   == 0)) {
-                       return (value);
-               }
-               return (zpool_prop_default_numeric(prop));
-       }
-
-       nvl = zhp->zpool_props;
-       if (nvlist_lookup_nvlist(nvl, zpool_prop_to_name(prop), &nv) == 0) {
-               verify(nvlist_lookup_uint64(nv, ZPROP_SOURCE, &value) == 0);
-               source = value;
-               verify(nvlist_lookup_uint64(nv, ZPROP_VALUE, &value) == 0);
-       } else {
-               source = ZPROP_SRC_DEFAULT;
-               value = zpool_prop_default_numeric(prop);
-       }
-
-       if (src)
-               *src = source;
-
-       return (value);
-}
-
-/*
- * Map VDEV STATE to printed strings.
- */
-char *
-zpool_state_to_name(vdev_state_t state, vdev_aux_t aux)
-{
-       switch (state) {
-       default:
-               break;
-       case VDEV_STATE_CLOSED:
-       case VDEV_STATE_OFFLINE:
-               return (gettext("OFFLINE"));
-       case VDEV_STATE_REMOVED:
-               return (gettext("REMOVED"));
-       case VDEV_STATE_CANT_OPEN:
-               if (aux == VDEV_AUX_CORRUPT_DATA || aux == VDEV_AUX_BAD_LOG)
-                       return (gettext("FAULTED"));
-               else if (aux == VDEV_AUX_SPLIT_POOL)
-                       return (gettext("SPLIT"));
-               else
-                       return (gettext("UNAVAIL"));
-       case VDEV_STATE_FAULTED:
-               return (gettext("FAULTED"));
-       case VDEV_STATE_DEGRADED:
-               return (gettext("DEGRADED"));
-       case VDEV_STATE_HEALTHY:
-               return (gettext("ONLINE"));
-       }
-
-       return (gettext("UNKNOWN"));
-}
-
-/*
- * Map POOL STATE to printed strings.
- */
-const char *
-zpool_pool_state_to_name(pool_state_t state)
-{
-       switch (state) {
-       default:
-               break;
-       case POOL_STATE_ACTIVE:
-               return (gettext("ACTIVE"));
-       case POOL_STATE_EXPORTED:
-               return (gettext("EXPORTED"));
-       case POOL_STATE_DESTROYED:
-               return (gettext("DESTROYED"));
-       case POOL_STATE_SPARE:
-               return (gettext("SPARE"));
-       case POOL_STATE_L2CACHE:
-               return (gettext("L2CACHE"));
-       case POOL_STATE_UNINITIALIZED:
-               return (gettext("UNINITIALIZED"));
-       case POOL_STATE_UNAVAIL:
-               return (gettext("UNAVAIL"));
-       case POOL_STATE_POTENTIALLY_ACTIVE:
-               return (gettext("POTENTIALLY_ACTIVE"));
-       }
-
-       return (gettext("UNKNOWN"));
-}
-
-/*
- * API compatibility wrapper around zpool_get_prop_literal
- */
-int
-zpool_get_prop(zpool_handle_t *zhp, zpool_prop_t prop, char *buf, size_t len,
-    zprop_source_t *srctype)
-{
-       return (zpool_get_prop_literal(zhp, prop, buf, len, srctype, B_FALSE));
-}
-
-/*
- * Get a zpool property value for 'prop' and return the value in
- * a pre-allocated buffer.
- */
-int
-zpool_get_prop_literal(zpool_handle_t *zhp, zpool_prop_t prop, char *buf,
-    size_t len, zprop_source_t *srctype, boolean_t literal)
-{
-       uint64_t intval;
-       const char *strval;
-       zprop_source_t src = ZPROP_SRC_NONE;
-       nvlist_t *nvroot;
-       vdev_stat_t *vs;
-       uint_t vsc;
-
-       if (zpool_get_state(zhp) == POOL_STATE_UNAVAIL) {
-               switch (prop) {
-               case ZPOOL_PROP_NAME:
-                       (void) strlcpy(buf, zpool_get_name(zhp), len);
-                       break;
-
-               case ZPOOL_PROP_HEALTH:
-                       (void) strlcpy(buf, "FAULTED", len);
-                       break;
-
-               case ZPOOL_PROP_GUID:
-                       intval = zpool_get_prop_int(zhp, prop, &src);
-                       (void) snprintf(buf, len, "%llu", (u_longlong_t)intval);
-                       break;
-
-               case ZPOOL_PROP_ALTROOT:
-               case ZPOOL_PROP_CACHEFILE:
-               case ZPOOL_PROP_COMMENT:
-                       if (zhp->zpool_props != NULL ||
-                           zpool_get_all_props(zhp) == 0) {
-                               (void) strlcpy(buf,
-                                   zpool_get_prop_string(zhp, prop, &src),
-                                   len);
-                               if (srctype != NULL)
-                                       *srctype = src;
-                               return (0);
-                       }
-                       /* FALLTHROUGH */
-               default:
-                       (void) strlcpy(buf, "-", len);
-                       break;
-               }
-
-               if (srctype != NULL)
-                       *srctype = src;
-               return (0);
-       }
-
-       if (zhp->zpool_props == NULL && zpool_get_all_props(zhp) &&
-           prop != ZPOOL_PROP_NAME)
-               return (-1);
-
-       switch (zpool_prop_get_type(prop)) {
-       case PROP_TYPE_STRING:
-               (void) strlcpy(buf, zpool_get_prop_string(zhp, prop, &src),
-                   len);
-               break;
-
-       case PROP_TYPE_NUMBER:
-               intval = zpool_get_prop_int(zhp, prop, &src);
-
-               switch (prop) {
-               case ZPOOL_PROP_SIZE:
-               case ZPOOL_PROP_ALLOCATED:
-               case ZPOOL_PROP_FREE:
-               case ZPOOL_PROP_FREEING:
-               case ZPOOL_PROP_LEAKED:
-               case ZPOOL_PROP_ASHIFT:
-                       if (literal)
-                               (void) snprintf(buf, len, "%llu",
-                                       (u_longlong_t)intval);
-                       else
-                               (void) zfs_nicenum(intval, buf, len);
-                       break;
-
-               case ZPOOL_PROP_EXPANDSZ:
-                       if (intval == 0) {
-                               (void) strlcpy(buf, "-", len);
-                       } else if (literal) {
-                               (void) snprintf(buf, len, "%llu",
-                                   (u_longlong_t)intval);
-                       } else {
-                               (void) zfs_nicenum(intval, buf, len);
-                       }
-                       break;
-
-               case ZPOOL_PROP_CAPACITY:
-                       (void) snprintf(buf, len, "%llu%%",
-                           (u_longlong_t)intval);
-                       break;
-
-               case ZPOOL_PROP_FRAGMENTATION:
-                       if (intval == UINT64_MAX) {
-                               (void) strlcpy(buf, "-", len);
-                       } else {
-                               (void) snprintf(buf, len, "%llu%%",
-                                   (u_longlong_t)intval);
-                       }
-                       break;
-
-               case ZPOOL_PROP_DEDUPRATIO:
-                       (void) snprintf(buf, len, "%llu.%02llux",
-                           (u_longlong_t)(intval / 100),
-                           (u_longlong_t)(intval % 100));
-                       break;
-
-               case ZPOOL_PROP_HEALTH:
-                       verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
-                           ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
-                       verify(nvlist_lookup_uint64_array(nvroot,
-                           ZPOOL_CONFIG_VDEV_STATS, (uint64_t **)&vs, &vsc)
-                           == 0);
-
-                       (void) strlcpy(buf, zpool_state_to_name(intval,
-                           vs->vs_aux), len);
-                       break;
-               case ZPOOL_PROP_VERSION:
-                       if (intval >= SPA_VERSION_FEATURES) {
-                               (void) snprintf(buf, len, "-");
-                               break;
-                       }
-                       /* FALLTHROUGH */
-               default:
-                       (void) snprintf(buf, len, "%llu", (u_longlong_t)intval);
-               }
-               break;
-
-       case PROP_TYPE_INDEX:
-               intval = zpool_get_prop_int(zhp, prop, &src);
-               if (zpool_prop_index_to_string(prop, intval, &strval)
-                   != 0)
-                       return (-1);
-               (void) strlcpy(buf, strval, len);
-               break;
-
-       default:
-               abort();
-       }
-
-       if (srctype)
-               *srctype = src;
-
-       return (0);
-}
-
-/*
- * Check if the bootfs name has the same pool name as it is set to.
- * Assuming bootfs is a valid dataset name.
- */
-static boolean_t
-bootfs_name_valid(const char *pool, char *bootfs)
-{
-       int len = strlen(pool);
-
-       if (!zfs_name_valid(bootfs, ZFS_TYPE_FILESYSTEM|ZFS_TYPE_SNAPSHOT))
-               return (B_FALSE);
-
-       if (strncmp(pool, bootfs, len) == 0 &&
-           (bootfs[len] == '/' || bootfs[len] == '\0'))
-               return (B_TRUE);
-
-       return (B_FALSE);
-}
-
-#if defined(__sun__) || defined(__sun)
-/*
- * Inspect the configuration to determine if any of the devices contain
- * an EFI label.
- */
-static boolean_t
-pool_uses_efi(nvlist_t *config)
-{
-       nvlist_t **child;
-       uint_t c, children;
-
-       if (nvlist_lookup_nvlist_array(config, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               return (read_efi_label(config, NULL) >= 0);
-
-       for (c = 0; c < children; c++) {
-               if (pool_uses_efi(child[c]))
-                       return (B_TRUE);
-       }
-       return (B_FALSE);
-}
-#endif
-
-boolean_t
-zpool_is_bootable(zpool_handle_t *zhp)
-{
-       char bootfs[ZPOOL_MAXNAMELEN];
-
-       return (zpool_get_prop(zhp, ZPOOL_PROP_BOOTFS, bootfs,
-           sizeof (bootfs), NULL) == 0 && strncmp(bootfs, "-",
-           sizeof (bootfs)) != 0);
-}
-
-
-/*
- * Given an nvlist of zpool properties to be set, validate that they are
- * correct, and parse any numeric properties (index, boolean, etc) if they are
- * specified as strings.
- */
-static nvlist_t *
-zpool_valid_proplist(libzfs_handle_t *hdl, const char *poolname,
-    nvlist_t *props, uint64_t version, prop_flags_t flags, char *errbuf)
-{
-       nvpair_t *elem;
-       nvlist_t *retprops;
-       zpool_prop_t prop;
-       char *strval;
-       uint64_t intval;
-       char *slash, *check;
-       struct stat64 statbuf;
-       zpool_handle_t *zhp;
-       nvlist_t *nvroot;
-
-       if (nvlist_alloc(&retprops, NV_UNIQUE_NAME, 0) != 0) {
-               (void) no_memory(hdl);
-               return (NULL);
-       }
-
-       elem = NULL;
-       while ((elem = nvlist_next_nvpair(props, elem)) != NULL) {
-               const char *propname = nvpair_name(elem);
-
-               prop = zpool_name_to_prop(propname);
-               if (prop == ZPROP_INVAL && zpool_prop_feature(propname)) {
-                       int err;
-                       char *fname = strchr(propname, '@') + 1;
-
-                       err = zfeature_lookup_name(fname, NULL);
-                       if (err != 0) {
-                               ASSERT3U(err, ==, ENOENT);
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "invalid feature '%s'"), fname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       if (nvpair_type(elem) != DATA_TYPE_STRING) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "'%s' must be a string"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       (void) nvpair_value_string(elem, &strval);
-                       if (strcmp(strval, ZFS_FEATURE_ENABLED) != 0) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' can only be set to "
-                                   "'enabled'"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       if (nvlist_add_uint64(retprops, propname, 0) != 0) {
-                               (void) no_memory(hdl);
-                               goto error;
-                       }
-                       continue;
-               }
-
-               /*
-                * Make sure this property is valid and applies to this type.
-                */
-               if (prop == ZPROP_INVAL) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid property '%s'"), propname);
-                       (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                       goto error;
-               }
-
-               if (zpool_prop_readonly(prop)) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "'%s' "
-                           "is readonly"), propname);
-                       (void) zfs_error(hdl, EZFS_PROPREADONLY, errbuf);
-                       goto error;
-               }
-
-               if (zprop_parse_value(hdl, elem, prop, ZFS_TYPE_POOL, retprops,
-                   &strval, &intval, errbuf) != 0)
-                       goto error;
-
-               /*
-                * Perform additional checking for specific properties.
-                */
-               switch (prop) {
-               default:
-                       break;
-               case ZPOOL_PROP_VERSION:
-                       if (intval < version ||
-                           !SPA_VERSION_IS_SUPPORTED(intval)) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' number %d is invalid."),
-                                   propname, intval);
-                               (void) zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                               goto error;
-                       }
-                       break;
-
-               case ZPOOL_PROP_ASHIFT:
-                       if (!flags.create) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' can only be set at "
-                                   "creation time"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       if (intval != 0 && (intval < 9 || intval > 13)) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' number %d is invalid."),
-                                   propname, intval);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-                       break;
-
-               case ZPOOL_PROP_BOOTFS:
-                       if (flags.create || flags.import) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' cannot be set at creation "
-                                   "or import time"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       if (version < SPA_VERSION_BOOTFS) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "pool must be upgraded to support "
-                                   "'%s' property"), propname);
-                               (void) zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                               goto error;
-                       }
-
-                       /*
-                        * bootfs property value has to be a dataset name and
-                        * the dataset has to be in the same pool as it sets to.
-                        */
-                       if (strval[0] != '\0' && !bootfs_name_valid(poolname,
-                           strval)) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "'%s' "
-                                   "is an invalid name"), strval);
-                               (void) zfs_error(hdl, EZFS_INVALIDNAME, errbuf);
-                               goto error;
-                       }
-
-                       if ((zhp = zpool_open_canfail(hdl, poolname)) == NULL) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "could not open pool '%s'"), poolname);
-                               (void) zfs_error(hdl, EZFS_OPENFAILED, errbuf);
-                               goto error;
-                       }
-                       verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
-                           ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
-
-#if defined(__sun__) || defined(__sun)
-                       /*
-                        * bootfs property cannot be set on a disk which has
-                        * been EFI labeled.
-                        */
-                       if (pool_uses_efi(nvroot)) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' not supported on "
-                                   "EFI labeled devices"), propname);
-                               (void) zfs_error(hdl, EZFS_POOL_NOTSUP, errbuf);
-                               zpool_close(zhp);
-                               goto error;
-                       }
-#endif
-                       zpool_close(zhp);
-                       break;
-
-               case ZPOOL_PROP_ALTROOT:
-                       if (!flags.create && !flags.import) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' can only be set during pool "
-                                   "creation or import"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-
-                       if (strval[0] != '/') {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "bad alternate root '%s'"), strval);
-                               (void) zfs_error(hdl, EZFS_BADPATH, errbuf);
-                               goto error;
-                       }
-                       break;
-
-               case ZPOOL_PROP_CACHEFILE:
-                       if (strval[0] == '\0')
-                               break;
-
-                       if (strcmp(strval, "none") == 0)
-                               break;
-
-                       if (strval[0] != '/') {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' must be empty, an "
-                                   "absolute path, or 'none'"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPATH, errbuf);
-                               goto error;
-                       }
-
-                       slash = strrchr(strval, '/');
-
-                       if (slash[1] == '\0' || strcmp(slash, "/.") == 0 ||
-                           strcmp(slash, "/..") == 0) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "'%s' is not a valid file"), strval);
-                               (void) zfs_error(hdl, EZFS_BADPATH, errbuf);
-                               goto error;
-                       }
-
-                       *slash = '\0';
-
-                       if (strval[0] != '\0' &&
-                           (stat64(strval, &statbuf) != 0 ||
-                           !S_ISDIR(statbuf.st_mode))) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "'%s' is not a valid directory"),
-                                   strval);
-                               (void) zfs_error(hdl, EZFS_BADPATH, errbuf);
-                               goto error;
-                       }
-
-                       *slash = '/';
-                       break;
-
-               case ZPOOL_PROP_COMMENT:
-                       for (check = strval; *check != '\0'; check++) {
-                               if (!isprint(*check)) {
-                                       zfs_error_aux(hdl,
-                                           dgettext(TEXT_DOMAIN,
-                                           "comment may only have printable "
-                                           "characters"));
-                                       (void) zfs_error(hdl, EZFS_BADPROP,
-                                           errbuf);
-                                       goto error;
-                               }
-                       }
-                       if (strlen(strval) > ZPROP_MAX_COMMENT) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "comment must not exceed %d characters"),
-                                   ZPROP_MAX_COMMENT);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-                       break;
-               case ZPOOL_PROP_READONLY:
-                       if (!flags.import) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' can only be set at "
-                                   "import time"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-                       break;
-               case ZPOOL_PROP_TNAME:
-                       if (!flags.create) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "property '%s' can only be set at "
-                                   "creation time"), propname);
-                               (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-                               goto error;
-                       }
-                       break;
-               }
-       }
-
-       return (retprops);
-error:
-       nvlist_free(retprops);
-       return (NULL);
-}
-
-/*
- * Set zpool property : propname=propval.
- */
-int
-zpool_set_prop(zpool_handle_t *zhp, const char *propname, const char *propval)
-{
-       zfs_cmd_t zc = {"\0"};
-       int ret = -1;
-       char errbuf[1024];
-       nvlist_t *nvl = NULL;
-       nvlist_t *realprops;
-       uint64_t version;
-       prop_flags_t flags = { 0 };
-
-       (void) snprintf(errbuf, sizeof (errbuf),
-           dgettext(TEXT_DOMAIN, "cannot set property for '%s'"),
-           zhp->zpool_name);
-
-       if (nvlist_alloc(&nvl, NV_UNIQUE_NAME, 0) != 0)
-               return (no_memory(zhp->zpool_hdl));
-
-       if (nvlist_add_string(nvl, propname, propval) != 0) {
-               nvlist_free(nvl);
-               return (no_memory(zhp->zpool_hdl));
-       }
-
-       version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL);
-       if ((realprops = zpool_valid_proplist(zhp->zpool_hdl,
-           zhp->zpool_name, nvl, version, flags, errbuf)) == NULL) {
-               nvlist_free(nvl);
-               return (-1);
-       }
-
-       nvlist_free(nvl);
-       nvl = realprops;
-
-       /*
-        * Execute the corresponding ioctl() to set this property.
-        */
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-
-       if (zcmd_write_src_nvlist(zhp->zpool_hdl, &zc, nvl) != 0) {
-               nvlist_free(nvl);
-               return (-1);
-       }
-
-       ret = zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_SET_PROPS, &zc);
-
-       zcmd_free_nvlists(&zc);
-       nvlist_free(nvl);
-
-       if (ret)
-               (void) zpool_standard_error(zhp->zpool_hdl, errno, errbuf);
-       else
-               (void) zpool_props_refresh(zhp);
-
-       return (ret);
-}
-
-int
-zpool_expand_proplist(zpool_handle_t *zhp, zprop_list_t **plp)
-{
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       zprop_list_t *entry;
-       char buf[ZFS_MAXPROPLEN];
-       nvlist_t *features = NULL;
-       nvpair_t *nvp;
-       zprop_list_t **last;
-       boolean_t firstexpand = (NULL == *plp);
-       int i;
-
-       if (zprop_expand_list(hdl, plp, ZFS_TYPE_POOL) != 0)
-               return (-1);
-
-       last = plp;
-       while (*last != NULL)
-               last = &(*last)->pl_next;
-
-       if ((*plp)->pl_all)
-               features = zpool_get_features(zhp);
-
-       if ((*plp)->pl_all && firstexpand) {
-               for (i = 0; i < SPA_FEATURES; i++) {
-                       zprop_list_t *entry = zfs_alloc(hdl,
-                           sizeof (zprop_list_t));
-                       entry->pl_prop = ZPROP_INVAL;
-                       entry->pl_user_prop = zfs_asprintf(hdl, "feature@%s",
-                           spa_feature_table[i].fi_uname);
-                       entry->pl_width = strlen(entry->pl_user_prop);
-                       entry->pl_all = B_TRUE;
-
-                       *last = entry;
-                       last = &entry->pl_next;
-               }
-       }
-
-       /* add any unsupported features */
-       for (nvp = nvlist_next_nvpair(features, NULL);
-           nvp != NULL; nvp = nvlist_next_nvpair(features, nvp)) {
-               char *propname;
-               boolean_t found;
-               zprop_list_t *entry;
-
-               if (zfeature_is_supported(nvpair_name(nvp)))
-                       continue;
-
-               propname = zfs_asprintf(hdl, "unsupported@%s",
-                   nvpair_name(nvp));
-
-               /*
-                * Before adding the property to the list make sure that no
-                * other pool already added the same property.
-                */
-               found = B_FALSE;
-               entry = *plp;
-               while (entry != NULL) {
-                       if (entry->pl_user_prop != NULL &&
-                           strcmp(propname, entry->pl_user_prop) == 0) {
-                               found = B_TRUE;
-                               break;
-                       }
-                       entry = entry->pl_next;
-               }
-               if (found) {
-                       free(propname);
-                       continue;
-               }
-
-               entry = zfs_alloc(hdl, sizeof (zprop_list_t));
-               entry->pl_prop = ZPROP_INVAL;
-               entry->pl_user_prop = propname;
-               entry->pl_width = strlen(entry->pl_user_prop);
-               entry->pl_all = B_TRUE;
-
-               *last = entry;
-               last = &entry->pl_next;
-       }
-
-       for (entry = *plp; entry != NULL; entry = entry->pl_next) {
-
-               if (entry->pl_fixed)
-                       continue;
-
-               if (entry->pl_prop != ZPROP_INVAL &&
-                   zpool_get_prop(zhp, entry->pl_prop, buf, sizeof (buf),
-                   NULL) == 0) {
-                       if (strlen(buf) > entry->pl_width)
-                               entry->pl_width = strlen(buf);
-               }
-       }
-
-       return (0);
-}
-
-/*
- * Get the state for the given feature on the given ZFS pool.
- */
-int
-zpool_prop_get_feature(zpool_handle_t *zhp, const char *propname, char *buf,
-    size_t len)
-{
-       uint64_t refcount;
-       boolean_t found = B_FALSE;
-       nvlist_t *features = zpool_get_features(zhp);
-       boolean_t supported;
-       const char *feature = strchr(propname, '@') + 1;
-
-       supported = zpool_prop_feature(propname);
-       ASSERT(supported || zpool_prop_unsupported(propname));
-
-       /*
-        * Convert from feature name to feature guid. This conversion is
-        * unecessary for unsupported@... properties because they already
-        * use guids.
-        */
-       if (supported) {
-               int ret;
-               spa_feature_t fid;
-
-               ret = zfeature_lookup_name(feature, &fid);
-               if (ret != 0) {
-                       (void) strlcpy(buf, "-", len);
-                       return (ENOTSUP);
-               }
-               feature = spa_feature_table[fid].fi_guid;
-       }
-
-       if (nvlist_lookup_uint64(features, feature, &refcount) == 0)
-               found = B_TRUE;
-
-       if (supported) {
-               if (!found) {
-                       (void) strlcpy(buf, ZFS_FEATURE_DISABLED, len);
-               } else  {
-                       if (refcount == 0)
-                               (void) strlcpy(buf, ZFS_FEATURE_ENABLED, len);
-                       else
-                               (void) strlcpy(buf, ZFS_FEATURE_ACTIVE, len);
-               }
-       } else {
-               if (found) {
-                       if (refcount == 0) {
-                               (void) strcpy(buf, ZFS_UNSUPPORTED_INACTIVE);
-                       } else {
-                               (void) strcpy(buf, ZFS_UNSUPPORTED_READONLY);
-                       }
-               } else {
-                       (void) strlcpy(buf, "-", len);
-                       return (ENOTSUP);
-               }
-       }
-
-       return (0);
-}
-
-/*
- * Don't start the slice at the default block of 34; many storage
- * devices will use a stripe width of 128k, other vendors prefer a 1m
- * alignment.  It is best to play it safe and ensure a 1m alignment
- * given 512B blocks.  When the block size is larger by a power of 2
- * we will still be 1m aligned.  Some devices are sensitive to the
- * partition ending alignment as well.
- */
-#define        NEW_START_BLOCK         2048
-#define        PARTITION_END_ALIGNMENT 2048
-
-/*
- * Validate the given pool name, optionally putting an extended error message in
- * 'buf'.
- */
-boolean_t
-zpool_name_valid(libzfs_handle_t *hdl, boolean_t isopen, const char *pool)
-{
-       namecheck_err_t why;
-       char what;
-       int ret;
-
-       ret = pool_namecheck(pool, &why, &what);
-
-       /*
-        * The rules for reserved pool names were extended at a later point.
-        * But we need to support users with existing pools that may now be
-        * invalid.  So we only check for this expanded set of names during a
-        * create (or import), and only in userland.
-        */
-       if (ret == 0 && !isopen &&
-           (strncmp(pool, "mirror", 6) == 0 ||
-           strncmp(pool, "raidz", 5) == 0 ||
-           strncmp(pool, "spare", 5) == 0 ||
-           strcmp(pool, "log") == 0)) {
-               if (hdl != NULL)
-                       zfs_error_aux(hdl,
-                           dgettext(TEXT_DOMAIN, "name is reserved"));
-               return (B_FALSE);
-       }
-
-
-       if (ret != 0) {
-               if (hdl != NULL) {
-                       switch (why) {
-                       case NAME_ERR_TOOLONG:
-                               zfs_error_aux(hdl,
-                                   dgettext(TEXT_DOMAIN, "name is too long"));
-                               break;
-
-                       case NAME_ERR_INVALCHAR:
-                               zfs_error_aux(hdl,
-                                   dgettext(TEXT_DOMAIN, "invalid character "
-                                   "'%c' in pool name"), what);
-                               break;
-
-                       case NAME_ERR_NOLETTER:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "name must begin with a letter"));
-                               break;
-
-                       case NAME_ERR_RESERVED:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "name is reserved"));
-                               break;
-
-                       case NAME_ERR_DISKLIKE:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "pool name is reserved"));
-                               break;
-
-                       case NAME_ERR_LEADING_SLASH:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "leading slash in name"));
-                               break;
-
-                       case NAME_ERR_EMPTY_COMPONENT:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "empty component in name"));
-                               break;
-
-                       case NAME_ERR_TRAILING_SLASH:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "trailing slash in name"));
-                               break;
-
-                       case NAME_ERR_MULTIPLE_AT:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "multiple '@' delimiters in name"));
-                               break;
-                       case NAME_ERR_NO_AT:
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "permission set is missing '@'"));
-                               break;
-                       }
-               }
-               return (B_FALSE);
-       }
-
-       return (B_TRUE);
-}
-
-/*
- * Open a handle to the given pool, even if the pool is currently in the FAULTED
- * state.
- */
-zpool_handle_t *
-zpool_open_canfail(libzfs_handle_t *hdl, const char *pool)
-{
-       zpool_handle_t *zhp;
-       boolean_t missing;
-
-       /*
-        * Make sure the pool name is valid.
-        */
-       if (!zpool_name_valid(hdl, B_TRUE, pool)) {
-               (void) zfs_error_fmt(hdl, EZFS_INVALIDNAME,
-                   dgettext(TEXT_DOMAIN, "cannot open '%s'"),
-                   pool);
-               return (NULL);
-       }
-
-       if ((zhp = zfs_alloc(hdl, sizeof (zpool_handle_t))) == NULL)
-               return (NULL);
-
-       zhp->zpool_hdl = hdl;
-       (void) strlcpy(zhp->zpool_name, pool, sizeof (zhp->zpool_name));
-
-       if (zpool_refresh_stats(zhp, &missing) != 0) {
-               zpool_close(zhp);
-               return (NULL);
-       }
-
-       if (missing) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "no such pool"));
-               (void) zfs_error_fmt(hdl, EZFS_NOENT,
-                   dgettext(TEXT_DOMAIN, "cannot open '%s'"), pool);
-               zpool_close(zhp);
-               return (NULL);
-       }
-
-       return (zhp);
-}
-
-/*
- * Like the above, but silent on error.  Used when iterating over pools (because
- * the configuration cache may be out of date).
- */
-int
-zpool_open_silent(libzfs_handle_t *hdl, const char *pool, zpool_handle_t **ret)
-{
-       zpool_handle_t *zhp;
-       boolean_t missing;
-
-       if ((zhp = zfs_alloc(hdl, sizeof (zpool_handle_t))) == NULL)
-               return (-1);
-
-       zhp->zpool_hdl = hdl;
-       (void) strlcpy(zhp->zpool_name, pool, sizeof (zhp->zpool_name));
-
-       if (zpool_refresh_stats(zhp, &missing) != 0) {
-               zpool_close(zhp);
-               return (-1);
-       }
-
-       if (missing) {
-               zpool_close(zhp);
-               *ret = NULL;
-               return (0);
-       }
-
-       *ret = zhp;
-       return (0);
-}
-
-/*
- * Similar to zpool_open_canfail(), but refuses to open pools in the faulted
- * state.
- */
-zpool_handle_t *
-zpool_open(libzfs_handle_t *hdl, const char *pool)
-{
-       zpool_handle_t *zhp;
-
-       if ((zhp = zpool_open_canfail(hdl, pool)) == NULL)
-               return (NULL);
-
-       if (zhp->zpool_state == POOL_STATE_UNAVAIL) {
-               (void) zfs_error_fmt(hdl, EZFS_POOLUNAVAIL,
-                   dgettext(TEXT_DOMAIN, "cannot open '%s'"), zhp->zpool_name);
-               zpool_close(zhp);
-               return (NULL);
-       }
-
-       return (zhp);
-}
-
-/*
- * Close the handle.  Simply frees the memory associated with the handle.
- */
-void
-zpool_close(zpool_handle_t *zhp)
-{
-       if (zhp->zpool_config)
-               nvlist_free(zhp->zpool_config);
-       if (zhp->zpool_old_config)
-               nvlist_free(zhp->zpool_old_config);
-       if (zhp->zpool_props)
-               nvlist_free(zhp->zpool_props);
-       free(zhp);
-}
-
-/*
- * Return the name of the pool.
- */
-const char *
-zpool_get_name(zpool_handle_t *zhp)
-{
-       return (zhp->zpool_name);
-}
-
-
-/*
- * Return the state of the pool (ACTIVE or UNAVAILABLE)
- */
-int
-zpool_get_state(zpool_handle_t *zhp)
-{
-       return (zhp->zpool_state);
-}
-
-/*
- * Create the named pool, using the provided vdev list.  It is assumed
- * that the consumer has already validated the contents of the nvlist, so we
- * don't have to worry about error semantics.
- */
-int
-zpool_create(libzfs_handle_t *hdl, const char *pool, nvlist_t *nvroot,
-    nvlist_t *props, nvlist_t *fsprops)
-{
-       zfs_cmd_t zc = {"\0"};
-       nvlist_t *zc_fsprops = NULL;
-       nvlist_t *zc_props = NULL;
-       char msg[1024];
-       int ret = -1;
-
-       (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
-           "cannot create '%s'"), pool);
-
-       if (!zpool_name_valid(hdl, B_FALSE, pool))
-               return (zfs_error(hdl, EZFS_INVALIDNAME, msg));
-
-       if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0)
-               return (-1);
-
-       if (props) {
-               prop_flags_t flags = { .create = B_TRUE, .import = B_FALSE };
-
-               if ((zc_props = zpool_valid_proplist(hdl, pool, props,
-                   SPA_VERSION_1, flags, msg)) == NULL) {
-                       goto create_failed;
-               }
-       }
-
-       if (fsprops) {
-               uint64_t zoned;
-               char *zonestr;
-
-               zoned = ((nvlist_lookup_string(fsprops,
-                   zfs_prop_to_name(ZFS_PROP_ZONED), &zonestr) == 0) &&
-                   strcmp(zonestr, "on") == 0);
-
-               if ((zc_fsprops = zfs_valid_proplist(hdl,
-                   ZFS_TYPE_FILESYSTEM, fsprops, zoned, NULL, msg)) == NULL) {
-                       goto create_failed;
-               }
-               if (!zc_props &&
-                   (nvlist_alloc(&zc_props, NV_UNIQUE_NAME, 0) != 0)) {
-                       goto create_failed;
-               }
-               if (nvlist_add_nvlist(zc_props,
-                   ZPOOL_ROOTFS_PROPS, zc_fsprops) != 0) {
-                       goto create_failed;
-               }
-       }
-
-       if (zc_props && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0)
-               goto create_failed;
-
-       (void) strlcpy(zc.zc_name, pool, sizeof (zc.zc_name));
-
-       if ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_CREATE, &zc)) != 0) {
-
-               zcmd_free_nvlists(&zc);
-               nvlist_free(zc_props);
-               nvlist_free(zc_fsprops);
-
-               switch (errno) {
-               case EBUSY:
-                       /*
-                        * This can happen if the user has specified the same
-                        * device multiple times.  We can't reliably detect this
-                        * until we try to add it and see we already have a
-                        * label.  This can also happen under if the device is
-                        * part of an active md or lvm device.
-                        */
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "one or more vdevs refer to the same device, or "
-                           "one of\nthe devices is part of an active md or "
-                           "lvm device"));
-                       return (zfs_error(hdl, EZFS_BADDEV, msg));
-
-               case EOVERFLOW:
-                       /*
-                        * This occurs when one of the devices is below
-                        * SPA_MINDEVSIZE.  Unfortunately, we can't detect which
-                        * device was the problem device since there's no
-                        * reliable way to determine device size from userland.
-                        */
-                       {
-                               char buf[64];
-
-                               zfs_nicenum(SPA_MINDEVSIZE, buf, sizeof (buf));
-
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "one or more devices is less than the "
-                                   "minimum size (%s)"), buf);
-                       }
-                       return (zfs_error(hdl, EZFS_BADDEV, msg));
-
-               case ENOSPC:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "one or more devices is out of space"));
-                       return (zfs_error(hdl, EZFS_BADDEV, msg));
-
-               case ENOTBLK:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "cache device must be a disk or disk slice"));
-                       return (zfs_error(hdl, EZFS_BADDEV, msg));
-
-               default:
-                       return (zpool_standard_error(hdl, errno, msg));
-               }
-       }
-
-create_failed:
-       zcmd_free_nvlists(&zc);
-       nvlist_free(zc_props);
-       nvlist_free(zc_fsprops);
-       return (ret);
-}
-
-/*
- * Destroy the given pool.  It is up to the caller to ensure that there are no
- * datasets left in the pool.
- */
-int
-zpool_destroy(zpool_handle_t *zhp, const char *log_str)
-{
-       zfs_cmd_t zc = {"\0"};
-       zfs_handle_t *zfp = NULL;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       char msg[1024];
-
-       if (zhp->zpool_state == POOL_STATE_ACTIVE &&
-           (zfp = zfs_open(hdl, zhp->zpool_name, ZFS_TYPE_FILESYSTEM)) == NULL)
-               return (-1);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       zc.zc_history = (uint64_t)(uintptr_t)log_str;
-
-       if (zfs_ioctl(hdl, ZFS_IOC_POOL_DESTROY, &zc) != 0) {
-               (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
-                   "cannot destroy '%s'"), zhp->zpool_name);
-
-               if (errno == EROFS) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "one or more devices is read only"));
-                       (void) zfs_error(hdl, EZFS_BADDEV, msg);
-               } else {
-                       (void) zpool_standard_error(hdl, errno, msg);
-               }
-
-               if (zfp)
-                       zfs_close(zfp);
-               return (-1);
-       }
-
-       if (zfp) {
-               remove_mountpoint(zfp);
-               zfs_close(zfp);
-       }
-
-       return (0);
-}
-
-/*
- * Add the given vdevs to the pool.  The caller must have already performed the
- * necessary verification to ensure that the vdev specification is well-formed.
- */
-int
-zpool_add(zpool_handle_t *zhp, nvlist_t *nvroot)
-{
-       zfs_cmd_t zc = {"\0"};
-       int ret;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       char msg[1024];
-       nvlist_t **spares, **l2cache;
-       uint_t nspares, nl2cache;
-
-       (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
-           "cannot add to '%s'"), zhp->zpool_name);
-
-       if (zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL) <
-           SPA_VERSION_SPARES &&
-           nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_SPARES,
-           &spares, &nspares) == 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "pool must be "
-                   "upgraded to add hot spares"));
-               return (zfs_error(hdl, EZFS_BADVERSION, msg));
-       }
-
-#if defined(__sun__) || defined(__sun)
-       if (zpool_is_bootable(zhp) && nvlist_lookup_nvlist_array(nvroot,
-           ZPOOL_CONFIG_SPARES, &spares, &nspares) == 0) {
-               uint64_t s;
-
-               for (s = 0; s < nspares; s++) {
-                       char *path;
-
-                       if (nvlist_lookup_string(spares[s], ZPOOL_CONFIG_PATH,
-                           &path) == 0 && pool_uses_efi(spares[s])) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "device '%s' contains an EFI label and "
-                                   "cannot be used on root pools."),
-                                   zpool_vdev_name(hdl, NULL, spares[s],
-                                   B_FALSE));
-                               return (zfs_error(hdl, EZFS_POOL_NOTSUP, msg));
-                       }
-               }
-       }
-#endif
-
-       if (zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL) <
-           SPA_VERSION_L2CACHE &&
-           nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_L2CACHE,
-           &l2cache, &nl2cache) == 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "pool must be "
-                   "upgraded to add cache devices"));
-               return (zfs_error(hdl, EZFS_BADVERSION, msg));
-       }
-
-       if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0)
-               return (-1);
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-
-       if (zfs_ioctl(hdl, ZFS_IOC_VDEV_ADD, &zc) != 0) {
-               switch (errno) {
-               case EBUSY:
-                       /*
-                        * This can happen if the user has specified the same
-                        * device multiple times.  We can't reliably detect this
-                        * until we try to add it and see we already have a
-                        * label.
-                        */
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "one or more vdevs refer to the same device"));
-                       (void) zfs_error(hdl, EZFS_BADDEV, msg);
-                       break;
-
-               case EOVERFLOW:
-                       /*
-                        * This occurrs when one of the devices is below
-                        * SPA_MINDEVSIZE.  Unfortunately, we can't detect which
-                        * device was the problem device since there's no
-                        * reliable way to determine device size from userland.
-                        */
-                       {
-                               char buf[64];
-
-                               zfs_nicenum(SPA_MINDEVSIZE, buf, sizeof (buf));
-
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "device is less than the minimum "
-                                   "size (%s)"), buf);
-                       }
-                       (void) zfs_error(hdl, EZFS_BADDEV, msg);
-                       break;
-
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded to add these vdevs"));
-                       (void) zfs_error(hdl, EZFS_BADVERSION, msg);
-                       break;
-
-               case ENOTBLK:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "cache device must be a disk or disk slice"));
-                       (void) zfs_error(hdl, EZFS_BADDEV, msg);
-                       break;
-
-               default:
-                       (void) zpool_standard_error(hdl, errno, msg);
-               }
-
-               ret = -1;
-       } else {
-               ret = 0;
-       }
-
-       zcmd_free_nvlists(&zc);
-
-       return (ret);
-}
-
-/*
- * Exports the pool from the system.  The caller must ensure that there are no
- * mounted datasets in the pool.
- */
-static int
-zpool_export_common(zpool_handle_t *zhp, boolean_t force, boolean_t hardforce,
-    const char *log_str)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-
-       (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
-           "cannot export '%s'"), zhp->zpool_name);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       zc.zc_cookie = force;
-       zc.zc_guid = hardforce;
-       zc.zc_history = (uint64_t)(uintptr_t)log_str;
-
-       if (zfs_ioctl(zhp->zpool_hdl, ZFS_IOC_POOL_EXPORT, &zc) != 0) {
-               switch (errno) {
-               case EXDEV:
-                       zfs_error_aux(zhp->zpool_hdl, dgettext(TEXT_DOMAIN,
-                           "use '-f' to override the following errors:\n"
-                           "'%s' has an active shared spare which could be"
-                           " used by other pools once '%s' is exported."),
-                           zhp->zpool_name, zhp->zpool_name);
-                       return (zfs_error(zhp->zpool_hdl, EZFS_ACTIVE_SPARE,
-                           msg));
-               default:
-                       return (zpool_standard_error_fmt(zhp->zpool_hdl, errno,
-                           msg));
-               }
-       }
-
-       return (0);
-}
-
-int
-zpool_export(zpool_handle_t *zhp, boolean_t force, const char *log_str)
-{
-       return (zpool_export_common(zhp, force, B_FALSE, log_str));
-}
-
-int
-zpool_export_force(zpool_handle_t *zhp, const char *log_str)
-{
-       return (zpool_export_common(zhp, B_TRUE, B_TRUE, log_str));
-}
-
-static void
-zpool_rewind_exclaim(libzfs_handle_t *hdl, const char *name, boolean_t dryrun,
-    nvlist_t *config)
-{
-       nvlist_t *nv = NULL;
-       uint64_t rewindto;
-       int64_t loss = -1;
-       struct tm t;
-       char timestr[128];
-
-       if (!hdl->libzfs_printerr || config == NULL)
-               return;
-
-       if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0 ||
-           nvlist_lookup_nvlist(nv, ZPOOL_CONFIG_REWIND_INFO, &nv) != 0) {
-               return;
-       }
-
-       if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_LOAD_TIME, &rewindto) != 0)
-               return;
-       (void) nvlist_lookup_int64(nv, ZPOOL_CONFIG_REWIND_TIME, &loss);
-
-       if (localtime_r((time_t *)&rewindto, &t) != NULL &&
-           strftime(timestr, 128, "%c", &t) != 0) {
-               if (dryrun) {
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "Would be able to return %s "
-                           "to its state as of %s.\n"),
-                           name, timestr);
-               } else {
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "Pool %s returned to its state as of %s.\n"),
-                           name, timestr);
-               }
-               if (loss > 120) {
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "%s approximately %lld "),
-                           dryrun ? "Would discard" : "Discarded",
-                           ((longlong_t)loss + 30) / 60);
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "minutes of transactions.\n"));
-               } else if (loss > 0) {
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "%s approximately %lld "),
-                           dryrun ? "Would discard" : "Discarded",
-                           (longlong_t)loss);
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "seconds of transactions.\n"));
-               }
-       }
-}
-
-void
-zpool_explain_recover(libzfs_handle_t *hdl, const char *name, int reason,
-    nvlist_t *config)
-{
-       nvlist_t *nv = NULL;
-       int64_t loss = -1;
-       uint64_t edata = UINT64_MAX;
-       uint64_t rewindto;
-       struct tm t;
-       char timestr[128];
-
-       if (!hdl->libzfs_printerr)
-               return;
-
-       if (reason >= 0)
-               (void) printf(dgettext(TEXT_DOMAIN, "action: "));
-       else
-               (void) printf(dgettext(TEXT_DOMAIN, "\t"));
-
-       /* All attempted rewinds failed if ZPOOL_CONFIG_LOAD_TIME missing */
-       if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nv) != 0 ||
-           nvlist_lookup_nvlist(nv, ZPOOL_CONFIG_REWIND_INFO, &nv) != 0 ||
-           nvlist_lookup_uint64(nv, ZPOOL_CONFIG_LOAD_TIME, &rewindto) != 0)
-               goto no_info;
-
-       (void) nvlist_lookup_int64(nv, ZPOOL_CONFIG_REWIND_TIME, &loss);
-       (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_LOAD_DATA_ERRORS,
-           &edata);
-
-       (void) printf(dgettext(TEXT_DOMAIN,
-           "Recovery is possible, but will result in some data loss.\n"));
-
-       if (localtime_r((time_t *)&rewindto, &t) != NULL &&
-           strftime(timestr, 128, "%c", &t) != 0) {
-               (void) printf(dgettext(TEXT_DOMAIN,
-                   "\tReturning the pool to its state as of %s\n"
-                   "\tshould correct the problem.  "),
-                   timestr);
-       } else {
-               (void) printf(dgettext(TEXT_DOMAIN,
-                   "\tReverting the pool to an earlier state "
-                   "should correct the problem.\n\t"));
-       }
-
-       if (loss > 120) {
-               (void) printf(dgettext(TEXT_DOMAIN,
-                   "Approximately %lld minutes of data\n"
-                   "\tmust be discarded, irreversibly.  "),
-                   ((longlong_t)loss + 30) / 60);
-       } else if (loss > 0) {
-               (void) printf(dgettext(TEXT_DOMAIN,
-                   "Approximately %lld seconds of data\n"
-                   "\tmust be discarded, irreversibly.  "),
-                   (longlong_t)loss);
-       }
-       if (edata != 0 && edata != UINT64_MAX) {
-               if (edata == 1) {
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "After rewind, at least\n"
-                           "\tone persistent user-data error will remain.  "));
-               } else {
-                       (void) printf(dgettext(TEXT_DOMAIN,
-                           "After rewind, several\n"
-                           "\tpersistent user-data errors will remain.  "));
-               }
-       }
-       (void) printf(dgettext(TEXT_DOMAIN,
-           "Recovery can be attempted\n\tby executing 'zpool %s -F %s'.  "),
-           reason >= 0 ? "clear" : "import", name);
-
-       (void) printf(dgettext(TEXT_DOMAIN,
-           "A scrub of the pool\n"
-           "\tis strongly recommended after recovery.\n"));
-       return;
-
-no_info:
-       (void) printf(dgettext(TEXT_DOMAIN,
-           "Destroy and re-create the pool from\n\ta backup source.\n"));
-}
-
-/*
- * zpool_import() is a contracted interface. Should be kept the same
- * if possible.
- *
- * Applications should use zpool_import_props() to import a pool with
- * new properties value to be set.
- */
-int
-zpool_import(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
-    char *altroot)
-{
-       nvlist_t *props = NULL;
-       int ret;
-
-       if (altroot != NULL) {
-               if (nvlist_alloc(&props, NV_UNIQUE_NAME, 0) != 0) {
-                       return (zfs_error_fmt(hdl, EZFS_NOMEM,
-                           dgettext(TEXT_DOMAIN, "cannot import '%s'"),
-                           newname));
-               }
-
-               if (nvlist_add_string(props,
-                   zpool_prop_to_name(ZPOOL_PROP_ALTROOT), altroot) != 0 ||
-                   nvlist_add_string(props,
-                   zpool_prop_to_name(ZPOOL_PROP_CACHEFILE), "none") != 0) {
-                       nvlist_free(props);
-                       return (zfs_error_fmt(hdl, EZFS_NOMEM,
-                           dgettext(TEXT_DOMAIN, "cannot import '%s'"),
-                           newname));
-               }
-       }
-
-       ret = zpool_import_props(hdl, config, newname, props,
-           ZFS_IMPORT_NORMAL);
-       if (props)
-               nvlist_free(props);
-       return (ret);
-}
-
-static void
-print_vdev_tree(libzfs_handle_t *hdl, const char *name, nvlist_t *nv,
-    int indent)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       char *vname;
-       uint64_t is_log = 0;
-
-       (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_IS_LOG,
-           &is_log);
-
-       if (name != NULL)
-               (void) printf("\t%*s%s%s\n", indent, "", name,
-                   is_log ? " [log]" : "");
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               return;
-
-       for (c = 0; c < children; c++) {
-               vname = zpool_vdev_name(hdl, NULL, child[c], B_TRUE);
-               print_vdev_tree(hdl, vname, child[c], indent + 2);
-               free(vname);
-       }
-}
-
-void
-zpool_print_unsup_feat(nvlist_t *config)
-{
-       nvlist_t *nvinfo, *unsup_feat;
-       nvpair_t *nvp;
-
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO, &nvinfo) ==
-           0);
-       verify(nvlist_lookup_nvlist(nvinfo, ZPOOL_CONFIG_UNSUP_FEAT,
-           &unsup_feat) == 0);
-
-       for (nvp = nvlist_next_nvpair(unsup_feat, NULL); nvp != NULL;
-           nvp = nvlist_next_nvpair(unsup_feat, nvp)) {
-               char *desc;
-
-               verify(nvpair_type(nvp) == DATA_TYPE_STRING);
-               verify(nvpair_value_string(nvp, &desc) == 0);
-
-               if (strlen(desc) > 0)
-                       (void) printf("\t%s (%s)\n", nvpair_name(nvp), desc);
-               else
-                       (void) printf("\t%s\n", nvpair_name(nvp));
-       }
-}
-
-/*
- * Import the given pool using the known configuration and a list of
- * properties to be set. The configuration should have come from
- * zpool_find_import(). The 'newname' parameters control whether the pool
- * is imported with a different name.
- */
-int
-zpool_import_props(libzfs_handle_t *hdl, nvlist_t *config, const char *newname,
-    nvlist_t *props, int flags)
-{
-       zfs_cmd_t zc = {"\0"};
-       zpool_rewind_policy_t policy;
-       nvlist_t *nv = NULL;
-       nvlist_t *nvinfo = NULL;
-       nvlist_t *missing = NULL;
-       char *thename;
-       char *origname;
-       int ret;
-       int error = 0;
-       char errbuf[1024];
-
-       verify(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
-           &origname) == 0);
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot import pool '%s'"), origname);
-
-       if (newname != NULL) {
-               if (!zpool_name_valid(hdl, B_FALSE, newname))
-                       return (zfs_error_fmt(hdl, EZFS_INVALIDNAME,
-                           dgettext(TEXT_DOMAIN, "cannot import '%s'"),
-                           newname));
-               thename = (char *)newname;
-       } else {
-               thename = origname;
-       }
-
-       if (props) {
-               uint64_t version;
-               prop_flags_t flags = { .create = B_FALSE, .import = B_TRUE };
-
-               verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
-                   &version) == 0);
-
-               if ((props = zpool_valid_proplist(hdl, origname,
-                   props, version, flags, errbuf)) == NULL) {
-                       return (-1);
-               } else if (zcmd_write_src_nvlist(hdl, &zc, props) != 0) {
-                       nvlist_free(props);
-                       return (-1);
-               }
-       }
-
-       (void) strlcpy(zc.zc_name, thename, sizeof (zc.zc_name));
-
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_GUID,
-           &zc.zc_guid) == 0);
-
-       if (zcmd_write_conf_nvlist(hdl, &zc, config) != 0) {
-               nvlist_free(props);
-               return (-1);
-       }
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, zc.zc_nvlist_conf_size * 2) != 0) {
-               nvlist_free(props);
-               return (-1);
-       }
-
-       zc.zc_cookie = flags;
-       while ((ret = zfs_ioctl(hdl, ZFS_IOC_POOL_IMPORT, &zc)) != 0 &&
-           errno == ENOMEM) {
-               if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       return (-1);
-               }
-       }
-       if (ret != 0)
-               error = errno;
-
-       (void) zcmd_read_dst_nvlist(hdl, &zc, &nv);
-       zpool_get_rewind_policy(config, &policy);
-
-       if (error) {
-               char desc[1024];
-
-               /*
-                * Dry-run failed, but we print out what success
-                * looks like if we found a best txg
-                */
-               if (policy.zrp_request & ZPOOL_TRY_REWIND) {
-                       zpool_rewind_exclaim(hdl, newname ? origname : thename,
-                           B_TRUE, nv);
-                       nvlist_free(nv);
-                       return (-1);
-               }
-
-               if (newname == NULL)
-                       (void) snprintf(desc, sizeof (desc),
-                           dgettext(TEXT_DOMAIN, "cannot import '%s'"),
-                           thename);
-               else
-                       (void) snprintf(desc, sizeof (desc),
-                           dgettext(TEXT_DOMAIN, "cannot import '%s' as '%s'"),
-                           origname, thename);
-
-               switch (error) {
-               case ENOTSUP:
-                       if (nv != NULL && nvlist_lookup_nvlist(nv,
-                           ZPOOL_CONFIG_LOAD_INFO, &nvinfo) == 0 &&
-                           nvlist_exists(nvinfo, ZPOOL_CONFIG_UNSUP_FEAT)) {
-                               (void) printf(dgettext(TEXT_DOMAIN, "This "
-                                   "pool uses the following feature(s) not "
-                                   "supported by this system:\n"));
-                               zpool_print_unsup_feat(nv);
-                               if (nvlist_exists(nvinfo,
-                                   ZPOOL_CONFIG_CAN_RDONLY)) {
-                                       (void) printf(dgettext(TEXT_DOMAIN,
-                                           "All unsupported features are only "
-                                           "required for writing to the pool."
-                                           "\nThe pool can be imported using "
-                                           "'-o readonly=on'.\n"));
-                               }
-                       }
-                       /*
-                        * Unsupported version.
-                        */
-                       (void) zfs_error(hdl, EZFS_BADVERSION, desc);
-                       break;
-
-               case EINVAL:
-                       (void) zfs_error(hdl, EZFS_INVALCONFIG, desc);
-                       break;
-
-               case EROFS:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "one or more devices is read only"));
-                       (void) zfs_error(hdl, EZFS_BADDEV, desc);
-                       break;
-
-               case ENXIO:
-                       if (nv && nvlist_lookup_nvlist(nv,
-                           ZPOOL_CONFIG_LOAD_INFO, &nvinfo) == 0 &&
-                           nvlist_lookup_nvlist(nvinfo,
-                           ZPOOL_CONFIG_MISSING_DEVICES, &missing) == 0) {
-                               (void) printf(dgettext(TEXT_DOMAIN,
-                                   "The devices below are missing, use "
-                                   "'-m' to import the pool anyway:\n"));
-                               print_vdev_tree(hdl, NULL, missing, 2);
-                               (void) printf("\n");
-                       }
-                       (void) zpool_standard_error(hdl, error, desc);
-                       break;
-
-               case EEXIST:
-                       (void) zpool_standard_error(hdl, error, desc);
-                       break;
-
-               case EBUSY:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "one or more devices are already in use\n"));
-                       (void) zfs_error(hdl, EZFS_BADDEV, desc);
-                       break;
-
-               default:
-                       (void) zpool_standard_error(hdl, error, desc);
-                       zpool_explain_recover(hdl,
-                           newname ? origname : thename, -error, nv);
-                       break;
-               }
-
-               nvlist_free(nv);
-               ret = -1;
-       } else {
-               zpool_handle_t *zhp;
-
-               /*
-                * This should never fail, but play it safe anyway.
-                */
-               if (zpool_open_silent(hdl, thename, &zhp) != 0)
-                       ret = -1;
-               else if (zhp != NULL)
-                       zpool_close(zhp);
-               if (policy.zrp_request &
-                   (ZPOOL_DO_REWIND | ZPOOL_TRY_REWIND)) {
-                       zpool_rewind_exclaim(hdl, newname ? origname : thename,
-                           ((policy.zrp_request & ZPOOL_TRY_REWIND) != 0), nv);
-               }
-               nvlist_free(nv);
-               return (0);
-       }
-
-       zcmd_free_nvlists(&zc);
-       nvlist_free(props);
-
-       return (ret);
-}
-
-/*
- * Scan the pool.
- */
-int
-zpool_scan(zpool_handle_t *zhp, pool_scan_func_t func)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       zc.zc_cookie = func;
-
-       if (zfs_ioctl(hdl, ZFS_IOC_POOL_SCAN, &zc) == 0 ||
-           (errno == ENOENT && func != POOL_SCAN_NONE))
-               return (0);
-
-       if (func == POOL_SCAN_SCRUB) {
-               (void) snprintf(msg, sizeof (msg),
-                   dgettext(TEXT_DOMAIN, "cannot scrub %s"), zc.zc_name);
-       } else if (func == POOL_SCAN_NONE) {
-               (void) snprintf(msg, sizeof (msg),
-                   dgettext(TEXT_DOMAIN, "cannot cancel scrubbing %s"),
-                   zc.zc_name);
-       } else {
-               assert(!"unexpected result");
-       }
-
-       if (errno == EBUSY) {
-               nvlist_t *nvroot;
-               pool_scan_stat_t *ps = NULL;
-               uint_t psc;
-
-               verify(nvlist_lookup_nvlist(zhp->zpool_config,
-                   ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
-               (void) nvlist_lookup_uint64_array(nvroot,
-                   ZPOOL_CONFIG_SCAN_STATS, (uint64_t **)&ps, &psc);
-               if (ps && ps->pss_func == POOL_SCAN_SCRUB)
-                       return (zfs_error(hdl, EZFS_SCRUBBING, msg));
-               else
-                       return (zfs_error(hdl, EZFS_RESILVERING, msg));
-       } else if (errno == ENOENT) {
-               return (zfs_error(hdl, EZFS_NO_SCRUB, msg));
-       } else {
-               return (zpool_standard_error(hdl, errno, msg));
-       }
-}
-
-/*
- * Find a vdev that matches the search criteria specified. We use the
- * the nvpair name to determine how we should look for the device.
- * 'avail_spare' is set to TRUE if the provided guid refers to an AVAIL
- * spare; but FALSE if its an INUSE spare.
- */
-static nvlist_t *
-vdev_to_nvlist_iter(nvlist_t *nv, nvlist_t *search, boolean_t *avail_spare,
-    boolean_t *l2cache, boolean_t *log)
-{
-       uint_t c, children;
-       nvlist_t **child;
-       nvlist_t *ret;
-       uint64_t is_log;
-       char *srchkey;
-       nvpair_t *pair = nvlist_next_nvpair(search, NULL);
-
-       /* Nothing to look for */
-       if (search == NULL || pair == NULL)
-               return (NULL);
-
-       /* Obtain the key we will use to search */
-       srchkey = nvpair_name(pair);
-
-       switch (nvpair_type(pair)) {
-       case DATA_TYPE_UINT64:
-               if (strcmp(srchkey, ZPOOL_CONFIG_GUID) == 0) {
-                       uint64_t srchval, theguid;
-
-                       verify(nvpair_value_uint64(pair, &srchval) == 0);
-                       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
-                           &theguid) == 0);
-                       if (theguid == srchval)
-                               return (nv);
-               }
-               break;
-
-       case DATA_TYPE_STRING: {
-               char *srchval, *val;
-
-               verify(nvpair_value_string(pair, &srchval) == 0);
-               if (nvlist_lookup_string(nv, srchkey, &val) != 0)
-                       break;
-
-               /*
-                * Search for the requested value. Special cases:
-                *
-                * - ZPOOL_CONFIG_PATH for whole disk entries.  These end in
-                *   "-part1", or "p1".  The suffix is hidden from the user,
-                *   but included in the string, so this matches around it.
-                * - ZPOOL_CONFIG_PATH for short names zfs_strcmp_shortname()
-                *   is used to check all possible expanded paths.
-                * - looking for a top-level vdev name (i.e. ZPOOL_CONFIG_TYPE).
-                *
-                * Otherwise, all other searches are simple string compares.
-                */
-               if (strcmp(srchkey, ZPOOL_CONFIG_PATH) == 0) {
-                       uint64_t wholedisk = 0;
-
-                       (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
-                           &wholedisk);
-                       if (zfs_strcmp_pathname(srchval, val, wholedisk) == 0)
-                               return (nv);
-
-               } else if (strcmp(srchkey, ZPOOL_CONFIG_TYPE) == 0 && val) {
-                       char *type, *idx, *end, *p;
-                       uint64_t id, vdev_id;
-
-                       /*
-                        * Determine our vdev type, keeping in mind
-                        * that the srchval is composed of a type and
-                        * vdev id pair (i.e. mirror-4).
-                        */
-                       if ((type = strdup(srchval)) == NULL)
-                               return (NULL);
-
-                       if ((p = strrchr(type, '-')) == NULL) {
-                               free(type);
-                               break;
-                       }
-                       idx = p + 1;
-                       *p = '\0';
-
-                       /*
-                        * If the types don't match then keep looking.
-                        */
-                       if (strncmp(val, type, strlen(val)) != 0) {
-                               free(type);
-                               break;
-                       }
-
-                       verify(strncmp(type, VDEV_TYPE_RAIDZ,
-                           strlen(VDEV_TYPE_RAIDZ)) == 0 ||
-                           strncmp(type, VDEV_TYPE_MIRROR,
-                           strlen(VDEV_TYPE_MIRROR)) == 0);
-                       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_ID,
-                           &id) == 0);
-
-                       errno = 0;
-                       vdev_id = strtoull(idx, &end, 10);
-
-                       free(type);
-                       if (errno != 0)
-                               return (NULL);
-
-                       /*
-                        * Now verify that we have the correct vdev id.
-                        */
-                       if (vdev_id == id)
-                               return (nv);
-               }
-
-               /*
-                * Common case
-                */
-               if (strcmp(srchval, val) == 0)
-                       return (nv);
-               break;
-       }
-
-       default:
-               break;
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0)
-               return (NULL);
-
-       for (c = 0; c < children; c++) {
-               if ((ret = vdev_to_nvlist_iter(child[c], search,
-                   avail_spare, l2cache, NULL)) != NULL) {
-                       /*
-                        * The 'is_log' value is only set for the toplevel
-                        * vdev, not the leaf vdevs.  So we always lookup the
-                        * log device from the root of the vdev tree (where
-                        * 'log' is non-NULL).
-                        */
-                       if (log != NULL &&
-                           nvlist_lookup_uint64(child[c],
-                           ZPOOL_CONFIG_IS_LOG, &is_log) == 0 &&
-                           is_log) {
-                               *log = B_TRUE;
-                       }
-                       return (ret);
-               }
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_SPARES,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++) {
-                       if ((ret = vdev_to_nvlist_iter(child[c], search,
-                           avail_spare, l2cache, NULL)) != NULL) {
-                               *avail_spare = B_TRUE;
-                               return (ret);
-                       }
-               }
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ZPOOL_CONFIG_L2CACHE,
-           &child, &children) == 0) {
-               for (c = 0; c < children; c++) {
-                       if ((ret = vdev_to_nvlist_iter(child[c], search,
-                           avail_spare, l2cache, NULL)) != NULL) {
-                               *l2cache = B_TRUE;
-                               return (ret);
-                       }
-               }
-       }
-
-       return (NULL);
-}
-
-/*
- * Given a physical path (minus the "/devices" prefix), find the
- * associated vdev.
- */
-nvlist_t *
-zpool_find_vdev_by_physpath(zpool_handle_t *zhp, const char *ppath,
-    boolean_t *avail_spare, boolean_t *l2cache, boolean_t *log)
-{
-       nvlist_t *search, *nvroot, *ret;
-
-       verify(nvlist_alloc(&search, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-       verify(nvlist_add_string(search, ZPOOL_CONFIG_PHYS_PATH, ppath) == 0);
-
-       verify(nvlist_lookup_nvlist(zhp->zpool_config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-
-       *avail_spare = B_FALSE;
-       *l2cache = B_FALSE;
-       if (log != NULL)
-               *log = B_FALSE;
-       ret = vdev_to_nvlist_iter(nvroot, search, avail_spare, l2cache, log);
-       nvlist_free(search);
-
-       return (ret);
-}
-
-/*
- * Determine if we have an "interior" top-level vdev (i.e mirror/raidz).
- */
-boolean_t
-zpool_vdev_is_interior(const char *name)
-{
-       if (strncmp(name, VDEV_TYPE_RAIDZ, strlen(VDEV_TYPE_RAIDZ)) == 0 ||
-           strncmp(name, VDEV_TYPE_MIRROR, strlen(VDEV_TYPE_MIRROR)) == 0)
-               return (B_TRUE);
-       return (B_FALSE);
-}
-
-nvlist_t *
-zpool_find_vdev(zpool_handle_t *zhp, const char *path, boolean_t *avail_spare,
-    boolean_t *l2cache, boolean_t *log)
-{
-       char *end;
-       nvlist_t *nvroot, *search, *ret;
-       uint64_t guid;
-
-       verify(nvlist_alloc(&search, NV_UNIQUE_NAME, KM_SLEEP) == 0);
-
-       guid = strtoull(path, &end, 0);
-       if (guid != 0 && *end == '\0') {
-               verify(nvlist_add_uint64(search, ZPOOL_CONFIG_GUID, guid) == 0);
-       } else if (zpool_vdev_is_interior(path)) {
-               verify(nvlist_add_string(search, ZPOOL_CONFIG_TYPE, path) == 0);
-       } else {
-               verify(nvlist_add_string(search, ZPOOL_CONFIG_PATH, path) == 0);
-       }
-
-       verify(nvlist_lookup_nvlist(zhp->zpool_config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-
-       *avail_spare = B_FALSE;
-       *l2cache = B_FALSE;
-       if (log != NULL)
-               *log = B_FALSE;
-       ret = vdev_to_nvlist_iter(nvroot, search, avail_spare, l2cache, log);
-       nvlist_free(search);
-
-       return (ret);
-}
-
-static int
-vdev_online(nvlist_t *nv)
-{
-       uint64_t ival;
-
-       if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_OFFLINE, &ival) == 0 ||
-           nvlist_lookup_uint64(nv, ZPOOL_CONFIG_FAULTED, &ival) == 0 ||
-           nvlist_lookup_uint64(nv, ZPOOL_CONFIG_REMOVED, &ival) == 0)
-               return (0);
-
-       return (1);
-}
-
-/*
- * Helper function for zpool_get_physpaths().
- */
-static int
-vdev_get_one_physpath(nvlist_t *config, char *physpath, size_t physpath_size,
-    size_t *bytes_written)
-{
-       size_t bytes_left, pos, rsz;
-       char *tmppath;
-       const char *format;
-
-       if (nvlist_lookup_string(config, ZPOOL_CONFIG_PHYS_PATH,
-           &tmppath) != 0)
-               return (EZFS_NODEVICE);
-
-       pos = *bytes_written;
-       bytes_left = physpath_size - pos;
-       format = (pos == 0) ? "%s" : " %s";
-
-       rsz = snprintf(physpath + pos, bytes_left, format, tmppath);
-       *bytes_written += rsz;
-
-       if (rsz >= bytes_left) {
-               /* if physpath was not copied properly, clear it */
-               if (bytes_left != 0) {
-                       physpath[pos] = 0;
-               }
-               return (EZFS_NOSPC);
-       }
-       return (0);
-}
-
-static int
-vdev_get_physpaths(nvlist_t *nv, char *physpath, size_t phypath_size,
-    size_t *rsz, boolean_t is_spare)
-{
-       char *type;
-       int ret;
-
-       if (nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) != 0)
-               return (EZFS_INVALCONFIG);
-
-       if (strcmp(type, VDEV_TYPE_DISK) == 0) {
-               /*
-                * An active spare device has ZPOOL_CONFIG_IS_SPARE set.
-                * For a spare vdev, we only want to boot from the active
-                * spare device.
-                */
-               if (is_spare) {
-                       uint64_t spare = 0;
-                       (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_IS_SPARE,
-                           &spare);
-                       if (!spare)
-                               return (EZFS_INVALCONFIG);
-               }
-
-               if (vdev_online(nv)) {
-                       if ((ret = vdev_get_one_physpath(nv, physpath,
-                           phypath_size, rsz)) != 0)
-                               return (ret);
-               }
-       } else if (strcmp(type, VDEV_TYPE_MIRROR) == 0 ||
-           strcmp(type, VDEV_TYPE_REPLACING) == 0 ||
-           (is_spare = (strcmp(type, VDEV_TYPE_SPARE) == 0))) {
-               nvlist_t **child;
-               uint_t count;
-               int i, ret;
-
-               if (nvlist_lookup_nvlist_array(nv,
-                   ZPOOL_CONFIG_CHILDREN, &child, &count) != 0)
-                       return (EZFS_INVALCONFIG);
-
-               for (i = 0; i < count; i++) {
-                       ret = vdev_get_physpaths(child[i], physpath,
-                           phypath_size, rsz, is_spare);
-                       if (ret == EZFS_NOSPC)
-                               return (ret);
-               }
-       }
-
-       return (EZFS_POOL_INVALARG);
-}
-
-/*
- * Get phys_path for a root pool config.
- * Return 0 on success; non-zero on failure.
- */
-static int
-zpool_get_config_physpath(nvlist_t *config, char *physpath, size_t phypath_size)
-{
-       size_t rsz;
-       nvlist_t *vdev_root;
-       nvlist_t **child;
-       uint_t count;
-       char *type;
-
-       rsz = 0;
-
-       if (nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &vdev_root) != 0)
-               return (EZFS_INVALCONFIG);
-
-       if (nvlist_lookup_string(vdev_root, ZPOOL_CONFIG_TYPE, &type) != 0 ||
-           nvlist_lookup_nvlist_array(vdev_root, ZPOOL_CONFIG_CHILDREN,
-           &child, &count) != 0)
-               return (EZFS_INVALCONFIG);
-
-#if defined(__sun__) || defined(__sun)
-       /*
-        * root pool can not have EFI labeled disks and can only have
-        * a single top-level vdev.
-        */
-       if (strcmp(type, VDEV_TYPE_ROOT) != 0 || count != 1 ||
-           pool_uses_efi(vdev_root))
-               return (EZFS_POOL_INVALARG);
-#endif
-
-       (void) vdev_get_physpaths(child[0], physpath, phypath_size, &rsz,
-           B_FALSE);
-
-       /* No online devices */
-       if (rsz == 0)
-               return (EZFS_NODEVICE);
-
-       return (0);
-}
-
-/*
- * Get phys_path for a root pool
- * Return 0 on success; non-zero on failure.
- */
-int
-zpool_get_physpath(zpool_handle_t *zhp, char *physpath, size_t phypath_size)
-{
-       return (zpool_get_config_physpath(zhp->zpool_config, physpath,
-           phypath_size));
-}
-
-/*
- * If the device has being dynamically expanded then we need to relabel
- * the disk to use the new unallocated space.
- */
-static int
-zpool_relabel_disk(libzfs_handle_t *hdl, const char *path, const char *msg)
-{
-       int fd, error;
-
-       if ((fd = open(path, O_RDWR|O_DIRECT)) < 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
-                   "relabel '%s': unable to open device: %d"), path, errno);
-               return (zfs_error(hdl, EZFS_OPENFAILED, msg));
-       }
-
-       /*
-        * It's possible that we might encounter an error if the device
-        * does not have any unallocated space left. If so, we simply
-        * ignore that error and continue on.
-        *
-        * Also, we don't call efi_rescan() - that would just return EBUSY.
-        * The module will do it for us in vdev_disk_open().
-        */
-       error = efi_use_whole_disk(fd);
-       (void) close(fd);
-       if (error && error != VT_ENOSPC) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
-                   "relabel '%s': unable to read disk capacity"), path);
-               return (zfs_error(hdl, EZFS_NOCAP, msg));
-       }
-       return (0);
-}
-
-/*
- * Bring the specified vdev online.   The 'flags' parameter is a set of the
- * ZFS_ONLINE_* flags.
- */
-int
-zpool_vdev_online(zpool_handle_t *zhp, const char *path, int flags,
-    vdev_state_t *newstate)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       nvlist_t *tgt;
-       boolean_t avail_spare, l2cache, islog;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       int error;
-
-       if (flags & ZFS_ONLINE_EXPAND) {
-               (void) snprintf(msg, sizeof (msg),
-                   dgettext(TEXT_DOMAIN, "cannot expand %s"), path);
-       } else {
-               (void) snprintf(msg, sizeof (msg),
-                   dgettext(TEXT_DOMAIN, "cannot online %s"), path);
-       }
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
-           &islog)) == NULL)
-               return (zfs_error(hdl, EZFS_NODEVICE, msg));
-
-       verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0);
-
-       if (avail_spare)
-               return (zfs_error(hdl, EZFS_ISSPARE, msg));
-
-       if (flags & ZFS_ONLINE_EXPAND ||
-           zpool_get_prop_int(zhp, ZPOOL_PROP_AUTOEXPAND, NULL)) {
-               uint64_t wholedisk = 0;
-
-               (void) nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_WHOLE_DISK,
-                   &wholedisk);
-
-               /*
-                * XXX - L2ARC 1.0 devices can't support expansion.
-                */
-               if (l2cache) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "cannot expand cache devices"));
-                       return (zfs_error(hdl, EZFS_VDEVNOTSUP, msg));
-               }
-
-               if (wholedisk) {
-                       const char *fullpath = path;
-                       char buf[MAXPATHLEN];
-
-                       if (path[0] != '/') {
-                               error = zfs_resolve_shortname(path, buf,
-                                   sizeof (buf));
-                               if (error != 0)
-                                       return (zfs_error(hdl, EZFS_NODEVICE,
-                                           msg));
-
-                               fullpath = buf;
-                       }
-
-                       error = zpool_relabel_disk(hdl, fullpath, msg);
-                       if (error != 0)
-                               return (error);
-               }
-       }
-
-       zc.zc_cookie = VDEV_STATE_ONLINE;
-       zc.zc_obj = flags;
-
-       if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) != 0) {
-               if (errno == EINVAL) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "was split "
-                           "from this pool into a new one.  Use '%s' "
-                           "instead"), "zpool detach");
-                       return (zfs_error(hdl, EZFS_POSTSPLIT_ONLINE, msg));
-               }
-               return (zpool_standard_error(hdl, errno, msg));
-       }
-
-       *newstate = zc.zc_cookie;
-       return (0);
-}
-
-/*
- * Take the specified vdev offline
- */
-int
-zpool_vdev_offline(zpool_handle_t *zhp, const char *path, boolean_t istmp)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       nvlist_t *tgt;
-       boolean_t avail_spare, l2cache;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot offline %s"), path);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
-           NULL)) == NULL)
-               return (zfs_error(hdl, EZFS_NODEVICE, msg));
-
-       verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0);
-
-       if (avail_spare)
-               return (zfs_error(hdl, EZFS_ISSPARE, msg));
-
-       zc.zc_cookie = VDEV_STATE_OFFLINE;
-       zc.zc_obj = istmp ? ZFS_OFFLINE_TEMPORARY : 0;
-
-       if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SET_STATE, &zc) == 0)
-               return (0);
-
-       switch (errno) {
-       case EBUSY:
-
-               /*
-                * There are no other replicas of this device.
-                */
-               return (zfs_error(hdl, EZFS_NOREPLICAS, msg));
-
-       case EEXIST:
-               /*
-                * The log device has unplayed logs
-                */
-               return (zfs_error(hdl, EZFS_UNPLAYED_LOGS, msg));
-
-       default:
-               return (zpool_standard_error(hdl, errno, msg));
-       }
-}
-
-/*
- * Mark the given vdev faulted.
- */
-int
-zpool_vdev_fault(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot fault %llu"), (u_longlong_t)guid);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       zc.zc_guid = guid;
-       zc.zc_cookie = VDEV_STATE_FAULTED;
-       zc.zc_obj = aux;
-
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0)
-               return (0);
-
-       switch (errno) {
-       case EBUSY:
-
-               /*
-                * There are no other replicas of this device.
-                */
-               return (zfs_error(hdl, EZFS_NOREPLICAS, msg));
-
-       default:
-               return (zpool_standard_error(hdl, errno, msg));
-       }
-
-}
-
-/*
- * Mark the given vdev degraded.
- */
-int
-zpool_vdev_degrade(zpool_handle_t *zhp, uint64_t guid, vdev_aux_t aux)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot degrade %llu"), (u_longlong_t)guid);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       zc.zc_guid = guid;
-       zc.zc_cookie = VDEV_STATE_DEGRADED;
-       zc.zc_obj = aux;
-
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_VDEV_SET_STATE, &zc) == 0)
-               return (0);
-
-       return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
- * Returns TRUE if the given nvlist is a vdev that was originally swapped in as
- * a hot spare.
- */
-static boolean_t
-is_replacing_spare(nvlist_t *search, nvlist_t *tgt, int which)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       char *type;
-
-       if (nvlist_lookup_nvlist_array(search, ZPOOL_CONFIG_CHILDREN, &child,
-           &children) == 0) {
-               verify(nvlist_lookup_string(search, ZPOOL_CONFIG_TYPE,
-                   &type) == 0);
-
-               if (strcmp(type, VDEV_TYPE_SPARE) == 0 &&
-                   children == 2 && child[which] == tgt)
-                       return (B_TRUE);
-
-               for (c = 0; c < children; c++)
-                       if (is_replacing_spare(child[c], tgt, which))
-                               return (B_TRUE);
-       }
-
-       return (B_FALSE);
-}
-
-/*
- * Attach new_disk (fully described by nvroot) to old_disk.
- * If 'replacing' is specified, the new disk will replace the old one.
- */
-int
-zpool_vdev_attach(zpool_handle_t *zhp,
-    const char *old_disk, const char *new_disk, nvlist_t *nvroot, int replacing)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       int ret;
-       nvlist_t *tgt;
-       boolean_t avail_spare, l2cache, islog;
-       uint64_t val;
-       char *newname;
-       nvlist_t **child;
-       uint_t children;
-       nvlist_t *config_root;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       boolean_t rootpool = zpool_is_bootable(zhp);
-
-       if (replacing)
-               (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
-                   "cannot replace %s with %s"), old_disk, new_disk);
-       else
-               (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
-                   "cannot attach %s to %s"), new_disk, old_disk);
-
-#if defined(__sun__) || defined(__sun)
-       /*
-        * If this is a root pool, make sure that we're not attaching an
-        * EFI labeled device.
-        */
-       if (rootpool && pool_uses_efi(nvroot)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "EFI labeled devices are not supported on root pools."));
-               return (zfs_error(hdl, EZFS_POOL_NOTSUP, msg));
-       }
-#endif
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if ((tgt = zpool_find_vdev(zhp, old_disk, &avail_spare, &l2cache,
-           &islog)) == 0)
-               return (zfs_error(hdl, EZFS_NODEVICE, msg));
-
-       if (avail_spare)
-               return (zfs_error(hdl, EZFS_ISSPARE, msg));
-
-       if (l2cache)
-               return (zfs_error(hdl, EZFS_ISL2CACHE, msg));
-
-       verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0);
-       zc.zc_cookie = replacing;
-
-       if (nvlist_lookup_nvlist_array(nvroot, ZPOOL_CONFIG_CHILDREN,
-           &child, &children) != 0 || children != 1) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "new device must be a single disk"));
-               return (zfs_error(hdl, EZFS_INVALCONFIG, msg));
-       }
-
-       verify(nvlist_lookup_nvlist(zpool_get_config(zhp, NULL),
-           ZPOOL_CONFIG_VDEV_TREE, &config_root) == 0);
-
-       if ((newname = zpool_vdev_name(NULL, NULL, child[0], B_FALSE)) == NULL)
-               return (-1);
-
-       /*
-        * If the target is a hot spare that has been swapped in, we can only
-        * replace it with another hot spare.
-        */
-       if (replacing &&
-           nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_IS_SPARE, &val) == 0 &&
-           (zpool_find_vdev(zhp, newname, &avail_spare, &l2cache,
-           NULL) == NULL || !avail_spare) &&
-           is_replacing_spare(config_root, tgt, 1)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "can only be replaced by another hot spare"));
-               free(newname);
-               return (zfs_error(hdl, EZFS_BADTARGET, msg));
-       }
-
-       free(newname);
-
-       if (zcmd_write_conf_nvlist(hdl, &zc, nvroot) != 0)
-               return (-1);
-
-       ret = zfs_ioctl(hdl, ZFS_IOC_VDEV_ATTACH, &zc);
-
-       zcmd_free_nvlists(&zc);
-
-       if (ret == 0) {
-               if (rootpool) {
-                       /*
-                        * XXX need a better way to prevent user from
-                        * booting up a half-baked vdev.
-                        */
-                       (void) fprintf(stderr, dgettext(TEXT_DOMAIN, "Make "
-                           "sure to wait until resilver is done "
-                           "before rebooting.\n"));
-               }
-               return (0);
-       }
-
-       switch (errno) {
-       case ENOTSUP:
-               /*
-                * Can't attach to or replace this type of vdev.
-                */
-               if (replacing) {
-                       uint64_t version = zpool_get_prop_int(zhp,
-                           ZPOOL_PROP_VERSION, NULL);
-
-                       if (islog)
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "cannot replace a log with a spare"));
-                       else if (version >= SPA_VERSION_MULTI_REPLACE)
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "already in replacing/spare config; wait "
-                                   "for completion or use 'zpool detach'"));
-                       else
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "cannot replace a replacing device"));
-               } else {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "can only attach to mirrors and top-level "
-                           "disks"));
-               }
-               (void) zfs_error(hdl, EZFS_BADTARGET, msg);
-               break;
-
-       case EINVAL:
-               /*
-                * The new device must be a single disk.
-                */
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "new device must be a single disk"));
-               (void) zfs_error(hdl, EZFS_INVALCONFIG, msg);
-               break;
-
-       case EBUSY:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "%s is busy"),
-                   new_disk);
-               (void) zfs_error(hdl, EZFS_BADDEV, msg);
-               break;
-
-       case EOVERFLOW:
-               /*
-                * The new device is too small.
-                */
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "device is too small"));
-               (void) zfs_error(hdl, EZFS_BADDEV, msg);
-               break;
-
-       case EDOM:
-               /*
-                * The new device has a different optimal sector size.
-                */
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "new device has a different optimal sector size; use the "
-                   "option '-o ashift=N' to override the optimal size"));
-               (void) zfs_error(hdl, EZFS_BADDEV, msg);
-               break;
-
-       case ENAMETOOLONG:
-               /*
-                * The resulting top-level vdev spec won't fit in the label.
-                */
-               (void) zfs_error(hdl, EZFS_DEVOVERFLOW, msg);
-               break;
-
-       default:
-               (void) zpool_standard_error(hdl, errno, msg);
-       }
-
-       return (-1);
-}
-
-/*
- * Detach the specified device.
- */
-int
-zpool_vdev_detach(zpool_handle_t *zhp, const char *path)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       nvlist_t *tgt;
-       boolean_t avail_spare, l2cache;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot detach %s"), path);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
-           NULL)) == 0)
-               return (zfs_error(hdl, EZFS_NODEVICE, msg));
-
-       if (avail_spare)
-               return (zfs_error(hdl, EZFS_ISSPARE, msg));
-
-       if (l2cache)
-               return (zfs_error(hdl, EZFS_ISL2CACHE, msg));
-
-       verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0);
-
-       if (zfs_ioctl(hdl, ZFS_IOC_VDEV_DETACH, &zc) == 0)
-               return (0);
-
-       switch (errno) {
-
-       case ENOTSUP:
-               /*
-                * Can't detach from this type of vdev.
-                */
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "only "
-                   "applicable to mirror and replacing vdevs"));
-               (void) zfs_error(hdl, EZFS_BADTARGET, msg);
-               break;
-
-       case EBUSY:
-               /*
-                * There are no other replicas of this device.
-                */
-               (void) zfs_error(hdl, EZFS_NOREPLICAS, msg);
-               break;
-
-       default:
-               (void) zpool_standard_error(hdl, errno, msg);
-       }
-
-       return (-1);
-}
-
-/*
- * Find a mirror vdev in the source nvlist.
- *
- * The mchild array contains a list of disks in one of the top-level mirrors
- * of the source pool.  The schild array contains a list of disks that the
- * user specified on the command line.  We loop over the mchild array to
- * see if any entry in the schild array matches.
- *
- * If a disk in the mchild array is found in the schild array, we return
- * the index of that entry.  Otherwise we return -1.
- */
-static int
-find_vdev_entry(zpool_handle_t *zhp, nvlist_t **mchild, uint_t mchildren,
-    nvlist_t **schild, uint_t schildren)
-{
-       uint_t mc;
-
-       for (mc = 0; mc < mchildren; mc++) {
-               uint_t sc;
-               char *mpath = zpool_vdev_name(zhp->zpool_hdl, zhp,
-                   mchild[mc], B_FALSE);
-
-               for (sc = 0; sc < schildren; sc++) {
-                       char *spath = zpool_vdev_name(zhp->zpool_hdl, zhp,
-                           schild[sc], B_FALSE);
-                       boolean_t result = (strcmp(mpath, spath) == 0);
-
-                       free(spath);
-                       if (result) {
-                               free(mpath);
-                               return (mc);
-                       }
-               }
-
-               free(mpath);
-       }
-
-       return (-1);
-}
-
-/*
- * Split a mirror pool.  If newroot points to null, then a new nvlist
- * is generated and it is the responsibility of the caller to free it.
- */
-int
-zpool_vdev_split(zpool_handle_t *zhp, char *newname, nvlist_t **newroot,
-    nvlist_t *props, splitflags_t flags)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       nvlist_t *tree, *config, **child, **newchild, *newconfig = NULL;
-       nvlist_t **varray = NULL, *zc_props = NULL;
-       uint_t c, children, newchildren, lastlog = 0, vcount, found = 0;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       uint64_t vers;
-       boolean_t freelist = B_FALSE, memory_err = B_TRUE;
-       int retval = 0;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "Unable to split %s"), zhp->zpool_name);
-
-       if (!zpool_name_valid(hdl, B_FALSE, newname))
-               return (zfs_error(hdl, EZFS_INVALIDNAME, msg));
-
-       if ((config = zpool_get_config(zhp, NULL)) == NULL) {
-               (void) fprintf(stderr, gettext("Internal error: unable to "
-                   "retrieve pool configuration\n"));
-               return (-1);
-       }
-
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE, &tree)
-           == 0);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION, &vers) == 0);
-
-       if (props) {
-               prop_flags_t flags = { .create = B_FALSE, .import = B_TRUE };
-               if ((zc_props = zpool_valid_proplist(hdl, zhp->zpool_name,
-                   props, vers, flags, msg)) == NULL)
-                       return (-1);
-       }
-
-       if (nvlist_lookup_nvlist_array(tree, ZPOOL_CONFIG_CHILDREN, &child,
-           &children) != 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "Source pool is missing vdev tree"));
-               if (zc_props)
-                       nvlist_free(zc_props);
-               return (-1);
-       }
-
-       varray = zfs_alloc(hdl, children * sizeof (nvlist_t *));
-       vcount = 0;
-
-       if (*newroot == NULL ||
-           nvlist_lookup_nvlist_array(*newroot, ZPOOL_CONFIG_CHILDREN,
-           &newchild, &newchildren) != 0)
-               newchildren = 0;
-
-       for (c = 0; c < children; c++) {
-               uint64_t is_log = B_FALSE, is_hole = B_FALSE;
-               char *type;
-               nvlist_t **mchild, *vdev;
-               uint_t mchildren;
-               int entry;
-
-               /*
-                * Unlike cache & spares, slogs are stored in the
-                * ZPOOL_CONFIG_CHILDREN array.  We filter them out here.
-                */
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_LOG,
-                   &is_log);
-               (void) nvlist_lookup_uint64(child[c], ZPOOL_CONFIG_IS_HOLE,
-                   &is_hole);
-               if (is_log || is_hole) {
-                       /*
-                        * Create a hole vdev and put it in the config.
-                        */
-                       if (nvlist_alloc(&vdev, NV_UNIQUE_NAME, 0) != 0)
-                               goto out;
-                       if (nvlist_add_string(vdev, ZPOOL_CONFIG_TYPE,
-                           VDEV_TYPE_HOLE) != 0)
-                               goto out;
-                       if (nvlist_add_uint64(vdev, ZPOOL_CONFIG_IS_HOLE,
-                           1) != 0)
-                               goto out;
-                       if (lastlog == 0)
-                               lastlog = vcount;
-                       varray[vcount++] = vdev;
-                       continue;
-               }
-               lastlog = 0;
-               verify(nvlist_lookup_string(child[c], ZPOOL_CONFIG_TYPE, &type)
-                   == 0);
-               if (strcmp(type, VDEV_TYPE_MIRROR) != 0) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "Source pool must be composed only of mirrors\n"));
-                       retval = zfs_error(hdl, EZFS_INVALCONFIG, msg);
-                       goto out;
-               }
-
-               verify(nvlist_lookup_nvlist_array(child[c],
-                   ZPOOL_CONFIG_CHILDREN, &mchild, &mchildren) == 0);
-
-               /* find or add an entry for this top-level vdev */
-               if (newchildren > 0 &&
-                   (entry = find_vdev_entry(zhp, mchild, mchildren,
-                   newchild, newchildren)) >= 0) {
-                       /* We found a disk that the user specified. */
-                       vdev = mchild[entry];
-                       ++found;
-               } else {
-                       /* User didn't specify a disk for this vdev. */
-                       vdev = mchild[mchildren - 1];
-               }
-
-               if (nvlist_dup(vdev, &varray[vcount++], 0) != 0)
-                       goto out;
-       }
-
-       /* did we find every disk the user specified? */
-       if (found != newchildren) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "Device list must "
-                   "include at most one disk from each mirror"));
-               retval = zfs_error(hdl, EZFS_INVALCONFIG, msg);
-               goto out;
-       }
-
-       /* Prepare the nvlist for populating. */
-       if (*newroot == NULL) {
-               if (nvlist_alloc(newroot, NV_UNIQUE_NAME, 0) != 0)
-                       goto out;
-               freelist = B_TRUE;
-               if (nvlist_add_string(*newroot, ZPOOL_CONFIG_TYPE,
-                   VDEV_TYPE_ROOT) != 0)
-                       goto out;
-       } else {
-               verify(nvlist_remove_all(*newroot, ZPOOL_CONFIG_CHILDREN) == 0);
-       }
-
-       /* Add all the children we found */
-       if (nvlist_add_nvlist_array(*newroot, ZPOOL_CONFIG_CHILDREN, varray,
-           lastlog == 0 ? vcount : lastlog) != 0)
-               goto out;
-
-       /*
-        * If we're just doing a dry run, exit now with success.
-        */
-       if (flags.dryrun) {
-               memory_err = B_FALSE;
-               freelist = B_FALSE;
-               goto out;
-       }
-
-       /* now build up the config list & call the ioctl */
-       if (nvlist_alloc(&newconfig, NV_UNIQUE_NAME, 0) != 0)
-               goto out;
-
-       if (nvlist_add_nvlist(newconfig,
-           ZPOOL_CONFIG_VDEV_TREE, *newroot) != 0 ||
-           nvlist_add_string(newconfig,
-           ZPOOL_CONFIG_POOL_NAME, newname) != 0 ||
-           nvlist_add_uint64(newconfig, ZPOOL_CONFIG_VERSION, vers) != 0)
-               goto out;
-
-       /*
-        * The new pool is automatically part of the namespace unless we
-        * explicitly export it.
-        */
-       if (!flags.import)
-               zc.zc_cookie = ZPOOL_EXPORT_AFTER_SPLIT;
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       (void) strlcpy(zc.zc_string, newname, sizeof (zc.zc_string));
-       if (zcmd_write_conf_nvlist(hdl, &zc, newconfig) != 0)
-               goto out;
-       if (zc_props != NULL && zcmd_write_src_nvlist(hdl, &zc, zc_props) != 0)
-               goto out;
-
-       if (zfs_ioctl(hdl, ZFS_IOC_VDEV_SPLIT, &zc) != 0) {
-               retval = zpool_standard_error(hdl, errno, msg);
-               goto out;
-       }
-
-       freelist = B_FALSE;
-       memory_err = B_FALSE;
-
-out:
-       if (varray != NULL) {
-               int v;
-
-               for (v = 0; v < vcount; v++)
-                       nvlist_free(varray[v]);
-               free(varray);
-       }
-       zcmd_free_nvlists(&zc);
-       if (zc_props)
-               nvlist_free(zc_props);
-       if (newconfig)
-               nvlist_free(newconfig);
-       if (freelist) {
-               nvlist_free(*newroot);
-               *newroot = NULL;
-       }
-
-       if (retval != 0)
-               return (retval);
-
-       if (memory_err)
-               return (no_memory(hdl));
-
-       return (0);
-}
-
-/*
- * Remove the given device.  Currently, this is supported only for hot spares
- * and level 2 cache devices.
- */
-int
-zpool_vdev_remove(zpool_handle_t *zhp, const char *path)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       nvlist_t *tgt;
-       boolean_t avail_spare, l2cache, islog;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       uint64_t version;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot remove %s"), path);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if ((tgt = zpool_find_vdev(zhp, path, &avail_spare, &l2cache,
-           &islog)) == 0)
-               return (zfs_error(hdl, EZFS_NODEVICE, msg));
-       /*
-        * XXX - this should just go away.
-        */
-       if (!avail_spare && !l2cache && !islog) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "only inactive hot spares, cache, top-level, "
-                   "or log devices can be removed"));
-               return (zfs_error(hdl, EZFS_NODEVICE, msg));
-       }
-
-       version = zpool_get_prop_int(zhp, ZPOOL_PROP_VERSION, NULL);
-       if (islog && version < SPA_VERSION_HOLES) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "pool must be upgrade to support log removal"));
-               return (zfs_error(hdl, EZFS_BADVERSION, msg));
-       }
-
-       verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID, &zc.zc_guid) == 0);
-
-       if (zfs_ioctl(hdl, ZFS_IOC_VDEV_REMOVE, &zc) == 0)
-               return (0);
-
-       return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
- * Clear the errors for the pool, or the particular device if specified.
- */
-int
-zpool_clear(zpool_handle_t *zhp, const char *path, nvlist_t *rewindnvl)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       nvlist_t *tgt;
-       zpool_rewind_policy_t policy;
-       boolean_t avail_spare, l2cache;
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       nvlist_t *nvi = NULL;
-       int error;
-
-       if (path)
-               (void) snprintf(msg, sizeof (msg),
-                   dgettext(TEXT_DOMAIN, "cannot clear errors for %s"),
-                   path);
-       else
-               (void) snprintf(msg, sizeof (msg),
-                   dgettext(TEXT_DOMAIN, "cannot clear errors for %s"),
-                   zhp->zpool_name);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if (path) {
-               if ((tgt = zpool_find_vdev(zhp, path, &avail_spare,
-                   &l2cache, NULL)) == 0)
-                       return (zfs_error(hdl, EZFS_NODEVICE, msg));
-
-               /*
-                * Don't allow error clearing for hot spares.  Do allow
-                * error clearing for l2cache devices.
-                */
-               if (avail_spare)
-                       return (zfs_error(hdl, EZFS_ISSPARE, msg));
-
-               verify(nvlist_lookup_uint64(tgt, ZPOOL_CONFIG_GUID,
-                   &zc.zc_guid) == 0);
-       }
-
-       zpool_get_rewind_policy(rewindnvl, &policy);
-       zc.zc_cookie = policy.zrp_request;
-
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, zhp->zpool_config_size * 2) != 0)
-               return (-1);
-
-       if (zcmd_write_src_nvlist(hdl, &zc, rewindnvl) != 0)
-               return (-1);
-
-       while ((error = zfs_ioctl(hdl, ZFS_IOC_CLEAR, &zc)) != 0 &&
-           errno == ENOMEM) {
-               if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       return (-1);
-               }
-       }
-
-       if (!error || ((policy.zrp_request & ZPOOL_TRY_REWIND) &&
-           errno != EPERM && errno != EACCES)) {
-               if (policy.zrp_request &
-                   (ZPOOL_DO_REWIND | ZPOOL_TRY_REWIND)) {
-                       (void) zcmd_read_dst_nvlist(hdl, &zc, &nvi);
-                       zpool_rewind_exclaim(hdl, zc.zc_name,
-                           ((policy.zrp_request & ZPOOL_TRY_REWIND) != 0),
-                           nvi);
-                       nvlist_free(nvi);
-               }
-               zcmd_free_nvlists(&zc);
-               return (0);
-       }
-
-       zcmd_free_nvlists(&zc);
-       return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
- * Similar to zpool_clear(), but takes a GUID (used by fmd).
- */
-int
-zpool_vdev_clear(zpool_handle_t *zhp, uint64_t guid)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot clear errors for %llx"),
-           (u_longlong_t)guid);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       zc.zc_guid = guid;
-       zc.zc_cookie = ZPOOL_NO_REWIND;
-
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_CLEAR, &zc) == 0)
-               return (0);
-
-       return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
- * Change the GUID for a pool.
- */
-int
-zpool_reguid(zpool_handle_t *zhp)
-{
-       char msg[1024];
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-       zfs_cmd_t zc = {"\0"};
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot reguid '%s'"), zhp->zpool_name);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if (zfs_ioctl(hdl, ZFS_IOC_POOL_REGUID, &zc) == 0)
-               return (0);
-
-       return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
- * Reopen the pool.
- */
-int
-zpool_reopen(zpool_handle_t *zhp)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) snprintf(msg, sizeof (msg),
-           dgettext(TEXT_DOMAIN, "cannot reopen '%s'"),
-           zhp->zpool_name);
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       if (zfs_ioctl(hdl, ZFS_IOC_POOL_REOPEN, &zc) == 0)
-               return (0);
-       return (zpool_standard_error(hdl, errno, msg));
-}
-
-/*
- * Convert from a devid string to a path.
- */
-static char *
-devid_to_path(char *devid_str)
-{
-       ddi_devid_t devid;
-       char *minor;
-       char *path;
-       devid_nmlist_t *list = NULL;
-       int ret;
-
-       if (devid_str_decode(devid_str, &devid, &minor) != 0)
-               return (NULL);
-
-       ret = devid_deviceid_to_nmlist("/dev", devid, minor, &list);
-
-       devid_str_free(minor);
-       devid_free(devid);
-
-       if (ret != 0)
-               return (NULL);
-
-       if ((path = strdup(list[0].devname)) == NULL)
-               return (NULL);
-
-       devid_free_nmlist(list);
-
-       return (path);
-}
-
-/*
- * Convert from a path to a devid string.
- */
-static char *
-path_to_devid(const char *path)
-{
-       int fd;
-       ddi_devid_t devid;
-       char *minor, *ret;
-
-       if ((fd = open(path, O_RDONLY)) < 0)
-               return (NULL);
-
-       minor = NULL;
-       ret = NULL;
-       if (devid_get(fd, &devid) == 0) {
-               if (devid_get_minor_name(fd, &minor) == 0)
-                       ret = devid_str_encode(devid, minor);
-               if (minor != NULL)
-                       devid_str_free(minor);
-               devid_free(devid);
-       }
-       (void) close(fd);
-
-       return (ret);
-}
-
-/*
- * Issue the necessary ioctl() to update the stored path value for the vdev.  We
- * ignore any failure here, since a common case is for an unprivileged user to
- * type 'zpool status', and we'll display the correct information anyway.
- */
-static void
-set_path(zpool_handle_t *zhp, nvlist_t *nv, const char *path)
-{
-       zfs_cmd_t zc = {"\0"};
-
-       (void) strncpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       (void) strncpy(zc.zc_value, path, sizeof (zc.zc_value));
-       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
-           &zc.zc_guid) == 0);
-
-       (void) ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_VDEV_SETPATH, &zc);
-}
-
-/*
- * Remove partition suffix from a vdev path.  Partition suffixes may take three
- * forms: "-partX", "pX", or "X", where X is a string of digits.  The second
- * case only occurs when the suffix is preceded by a digit, i.e. "md0p0" The
- * third case only occurs when preceded by a string matching the regular
- * expression "^([hsv]|xv)d[a-z]+", i.e. a scsi, ide, virtio or xen disk.
- */
-static char *
-strip_partition(libzfs_handle_t *hdl, char *path)
-{
-       char *tmp = zfs_strdup(hdl, path);
-       char *part = NULL, *d = NULL;
-
-       if ((part = strstr(tmp, "-part")) && part != tmp) {
-               d = part + 5;
-       } else if ((part = strrchr(tmp, 'p')) &&
-           part > tmp + 1 && isdigit(*(part-1))) {
-               d = part + 1;
-       } else if ((tmp[0] == 'h' || tmp[0] == 's' || tmp[0] == 'v') &&
-           tmp[1] == 'd') {
-               for (d = &tmp[2]; isalpha(*d); part = ++d);
-       } else if (strncmp("xvd", tmp, 3) == 0) {
-               for (d = &tmp[3]; isalpha(*d); part = ++d);
-       }
-       if (part && d && *d != '\0') {
-               for (; isdigit(*d); d++);
-               if (*d == '\0')
-                       *part = '\0';
-       }
-       return (tmp);
-}
-
-#define        PATH_BUF_LEN    64
-
-/*
- * Given a vdev, return the name to display in iostat.  If the vdev has a path,
- * we use that, stripping off any leading "/dev/dsk/"; if not, we use the type.
- * We also check if this is a whole disk, in which case we strip off the
- * trailing 's0' slice name.
- *
- * This routine is also responsible for identifying when disks have been
- * reconfigured in a new location.  The kernel will have opened the device by
- * devid, but the path will still refer to the old location.  To catch this, we
- * first do a path -> devid translation (which is fast for the common case).  If
- * the devid matches, we're done.  If not, we do a reverse devid -> path
- * translation and issue the appropriate ioctl() to update the path of the vdev.
- * If 'zhp' is NULL, then this is an exported pool, and we don't need to do any
- * of these checks.
- */
-char *
-zpool_vdev_name(libzfs_handle_t *hdl, zpool_handle_t *zhp, nvlist_t *nv,
-    boolean_t verbose)
-{
-       char *path, *devid, *type;
-       uint64_t value;
-       char buf[PATH_BUF_LEN];
-       char tmpbuf[PATH_BUF_LEN];
-       vdev_stat_t *vs;
-       uint_t vsc;
-
-       if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NOT_PRESENT,
-           &value) == 0) {
-               verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_GUID,
-                   &value) == 0);
-               (void) snprintf(buf, sizeof (buf), "%llu",
-                   (u_longlong_t)value);
-               path = buf;
-       } else if (nvlist_lookup_string(nv, ZPOOL_CONFIG_PATH, &path) == 0) {
-               /*
-                * If the device is dead (faulted, offline, etc) then don't
-                * bother opening it.  Otherwise we may be forcing the user to
-                * open a misbehaving device, which can have undesirable
-                * effects.
-                */
-               if ((nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
-                   (uint64_t **)&vs, &vsc) != 0 ||
-                   vs->vs_state >= VDEV_STATE_DEGRADED) &&
-                   zhp != NULL &&
-                   nvlist_lookup_string(nv, ZPOOL_CONFIG_DEVID, &devid) == 0) {
-                       /*
-                        * Determine if the current path is correct.
-                        */
-                       char *newdevid = path_to_devid(path);
-
-                       if (newdevid == NULL ||
-                           strcmp(devid, newdevid) != 0) {
-                               char *newpath;
-
-                               if ((newpath = devid_to_path(devid)) != NULL) {
-                                       /*
-                                        * Update the path appropriately.
-                                        */
-                                       set_path(zhp, nv, newpath);
-                                       if (nvlist_add_string(nv,
-                                           ZPOOL_CONFIG_PATH, newpath) == 0)
-                                               verify(nvlist_lookup_string(nv,
-                                                   ZPOOL_CONFIG_PATH,
-                                                   &path) == 0);
-                                       free(newpath);
-                               }
-                       }
-
-                       if (newdevid)
-                               devid_str_free(newdevid);
-               }
-
-               /*
-                * For a block device only use the name.
-                */
-               verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &type) == 0);
-               if (strcmp(type, VDEV_TYPE_DISK) == 0) {
-                       path = strrchr(path, '/');
-                       path++;
-               }
-
-               /*
-                * Remove the partition from the path it this is a whole disk.
-                */
-               if (nvlist_lookup_uint64(nv, ZPOOL_CONFIG_WHOLE_DISK,
-                   &value) == 0 && value) {
-                       return (strip_partition(hdl, path));
-               }
-       } else {
-               verify(nvlist_lookup_string(nv, ZPOOL_CONFIG_TYPE, &path) == 0);
-
-               /*
-                * If it's a raidz device, we need to stick in the parity level.
-                */
-               if (strcmp(path, VDEV_TYPE_RAIDZ) == 0) {
-
-                       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_NPARITY,
-                           &value) == 0);
-                       (void) snprintf(buf, sizeof (buf), "%s%llu", path,
-                           (u_longlong_t)value);
-                       path = buf;
-               }
-
-               /*
-                * We identify each top-level vdev by using a <type-id>
-                * naming convention.
-                */
-               if (verbose) {
-                       uint64_t id;
-
-                       verify(nvlist_lookup_uint64(nv, ZPOOL_CONFIG_ID,
-                           &id) == 0);
-                       (void) snprintf(tmpbuf, sizeof (tmpbuf), "%s-%llu",
-                           path, (u_longlong_t)id);
-                       path = tmpbuf;
-               }
-       }
-
-       return (zfs_strdup(hdl, path));
-}
-
-static int
-zbookmark_compare(const void *a, const void *b)
-{
-       return (memcmp(a, b, sizeof (zbookmark_phys_t)));
-}
-
-/*
- * Retrieve the persistent error log, uniquify the members, and return to the
- * caller.
- */
-int
-zpool_get_errlog(zpool_handle_t *zhp, nvlist_t **nverrlistp)
-{
-       zfs_cmd_t zc = {"\0"};
-       uint64_t count;
-       zbookmark_phys_t *zb = NULL;
-       int i;
-
-       /*
-        * Retrieve the raw error list from the kernel.  If the number of errors
-        * has increased, allocate more space and continue until we get the
-        * entire list.
-        */
-       verify(nvlist_lookup_uint64(zhp->zpool_config, ZPOOL_CONFIG_ERRCOUNT,
-           &count) == 0);
-       if (count == 0)
-               return (0);
-       if ((zc.zc_nvlist_dst = (uintptr_t)zfs_alloc(zhp->zpool_hdl,
-           count * sizeof (zbookmark_phys_t))) == (uintptr_t)NULL)
-               return (-1);
-       zc.zc_nvlist_dst_size = count;
-       (void) strcpy(zc.zc_name, zhp->zpool_name);
-       for (;;) {
-               if (ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_ERROR_LOG,
-                   &zc) != 0) {
-                       free((void *)(uintptr_t)zc.zc_nvlist_dst);
-                       if (errno == ENOMEM) {
-                               void *dst;
-
-                               count = zc.zc_nvlist_dst_size;
-                               dst = zfs_alloc(zhp->zpool_hdl, count *
-                                   sizeof (zbookmark_phys_t));
-                               if (dst == NULL)
-                                       return (-1);
-                               zc.zc_nvlist_dst = (uintptr_t)dst;
-                       } else {
-                               return (-1);
-                       }
-               } else {
-                       break;
-               }
-       }
-
-       /*
-        * Sort the resulting bookmarks.  This is a little confusing due to the
-        * implementation of ZFS_IOC_ERROR_LOG.  The bookmarks are copied last
-        * to first, and 'zc_nvlist_dst_size' indicates the number of boomarks
-        * _not_ copied as part of the process.  So we point the start of our
-        * array appropriate and decrement the total number of elements.
-        */
-       zb = ((zbookmark_phys_t *)(uintptr_t)zc.zc_nvlist_dst) +
-           zc.zc_nvlist_dst_size;
-       count -= zc.zc_nvlist_dst_size;
-
-       qsort(zb, count, sizeof (zbookmark_phys_t), zbookmark_compare);
-
-       verify(nvlist_alloc(nverrlistp, 0, KM_SLEEP) == 0);
-
-       /*
-        * Fill in the nverrlistp with nvlist's of dataset and object numbers.
-        */
-       for (i = 0; i < count; i++) {
-               nvlist_t *nv;
-
-               /* ignoring zb_blkid and zb_level for now */
-               if (i > 0 && zb[i-1].zb_objset == zb[i].zb_objset &&
-                   zb[i-1].zb_object == zb[i].zb_object)
-                       continue;
-
-               if (nvlist_alloc(&nv, NV_UNIQUE_NAME, KM_SLEEP) != 0)
-                       goto nomem;
-               if (nvlist_add_uint64(nv, ZPOOL_ERR_DATASET,
-                   zb[i].zb_objset) != 0) {
-                       nvlist_free(nv);
-                       goto nomem;
-               }
-               if (nvlist_add_uint64(nv, ZPOOL_ERR_OBJECT,
-                   zb[i].zb_object) != 0) {
-                       nvlist_free(nv);
-                       goto nomem;
-               }
-               if (nvlist_add_nvlist(*nverrlistp, "ejk", nv) != 0) {
-                       nvlist_free(nv);
-                       goto nomem;
-               }
-               nvlist_free(nv);
-       }
-
-       free((void *)(uintptr_t)zc.zc_nvlist_dst);
-       return (0);
-
-nomem:
-       free((void *)(uintptr_t)zc.zc_nvlist_dst);
-       return (no_memory(zhp->zpool_hdl));
-}
-
-/*
- * Upgrade a ZFS pool to the latest on-disk version.
- */
-int
-zpool_upgrade(zpool_handle_t *zhp, uint64_t new_version)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) strcpy(zc.zc_name, zhp->zpool_name);
-       zc.zc_cookie = new_version;
-
-       if (zfs_ioctl(hdl, ZFS_IOC_POOL_UPGRADE, &zc) != 0)
-               return (zpool_standard_error_fmt(hdl, errno,
-                   dgettext(TEXT_DOMAIN, "cannot upgrade '%s'"),
-                   zhp->zpool_name));
-       return (0);
-}
-
-void
-zfs_save_arguments(int argc, char **argv, char *string, int len)
-{
-       int i;
-
-       (void) strlcpy(string, basename(argv[0]), len);
-       for (i = 1; i < argc; i++) {
-               (void) strlcat(string, " ", len);
-               (void) strlcat(string, argv[i], len);
-       }
-}
-
-int
-zpool_log_history(libzfs_handle_t *hdl, const char *message)
-{
-       zfs_cmd_t zc = {"\0"};
-       nvlist_t *args;
-       int err;
-
-       args = fnvlist_alloc();
-       fnvlist_add_string(args, "message", message);
-       err = zcmd_write_src_nvlist(hdl, &zc, args);
-       if (err == 0)
-               err = ioctl(hdl->libzfs_fd, ZFS_IOC_LOG_HISTORY, &zc);
-       nvlist_free(args);
-       zcmd_free_nvlists(&zc);
-       return (err);
-}
-
-/*
- * Perform ioctl to get some command history of a pool.
- *
- * 'buf' is the buffer to fill up to 'len' bytes.  'off' is the
- * logical offset of the history buffer to start reading from.
- *
- * Upon return, 'off' is the next logical offset to read from and
- * 'len' is the actual amount of bytes read into 'buf'.
- */
-static int
-get_history(zpool_handle_t *zhp, char *buf, uint64_t *off, uint64_t *len)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *hdl = zhp->zpool_hdl;
-
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-
-       zc.zc_history = (uint64_t)(uintptr_t)buf;
-       zc.zc_history_len = *len;
-       zc.zc_history_offset = *off;
-
-       if (ioctl(hdl->libzfs_fd, ZFS_IOC_POOL_GET_HISTORY, &zc) != 0) {
-               switch (errno) {
-               case EPERM:
-                       return (zfs_error_fmt(hdl, EZFS_PERM,
-                           dgettext(TEXT_DOMAIN,
-                           "cannot show history for pool '%s'"),
-                           zhp->zpool_name));
-               case ENOENT:
-                       return (zfs_error_fmt(hdl, EZFS_NOHISTORY,
-                           dgettext(TEXT_DOMAIN, "cannot get history for pool "
-                           "'%s'"), zhp->zpool_name));
-               case ENOTSUP:
-                       return (zfs_error_fmt(hdl, EZFS_BADVERSION,
-                           dgettext(TEXT_DOMAIN, "cannot get history for pool "
-                           "'%s', pool must be upgraded"), zhp->zpool_name));
-               default:
-                       return (zpool_standard_error_fmt(hdl, errno,
-                           dgettext(TEXT_DOMAIN,
-                           "cannot get history for '%s'"), zhp->zpool_name));
-               }
-       }
-
-       *len = zc.zc_history_len;
-       *off = zc.zc_history_offset;
-
-       return (0);
-}
-
-/*
- * Process the buffer of nvlists, unpacking and storing each nvlist record
- * into 'records'.  'leftover' is set to the number of bytes that weren't
- * processed as there wasn't a complete record.
- */
-int
-zpool_history_unpack(char *buf, uint64_t bytes_read, uint64_t *leftover,
-    nvlist_t ***records, uint_t *numrecords)
-{
-       uint64_t reclen;
-       nvlist_t *nv;
-       int i;
-
-       while (bytes_read > sizeof (reclen)) {
-
-               /* get length of packed record (stored as little endian) */
-               for (i = 0, reclen = 0; i < sizeof (reclen); i++)
-                       reclen += (uint64_t)(((uchar_t *)buf)[i]) << (8*i);
-
-               if (bytes_read < sizeof (reclen) + reclen)
-                       break;
-
-               /* unpack record */
-               if (nvlist_unpack(buf + sizeof (reclen), reclen, &nv, 0) != 0)
-                       return (ENOMEM);
-               bytes_read -= sizeof (reclen) + reclen;
-               buf += sizeof (reclen) + reclen;
-
-               /* add record to nvlist array */
-               (*numrecords)++;
-               if (ISP2(*numrecords + 1)) {
-                       *records = realloc(*records,
-                           *numrecords * 2 * sizeof (nvlist_t *));
-               }
-               (*records)[*numrecords - 1] = nv;
-       }
-
-       *leftover = bytes_read;
-       return (0);
-}
-
-/*
- * Retrieve the command history of a pool.
- */
-int
-zpool_get_history(zpool_handle_t *zhp, nvlist_t **nvhisp)
-{
-       char *buf;
-       int buflen = 128 * 1024;
-       uint64_t off = 0;
-       nvlist_t **records = NULL;
-       uint_t numrecords = 0;
-       int err, i;
-
-       buf = malloc(buflen);
-       if (buf == NULL)
-               return (ENOMEM);
-       do {
-               uint64_t bytes_read = buflen;
-               uint64_t leftover;
-
-               if ((err = get_history(zhp, buf, &off, &bytes_read)) != 0)
-                       break;
-
-               /* if nothing else was read in, we're at EOF, just return */
-               if (!bytes_read)
-                       break;
-
-               if ((err = zpool_history_unpack(buf, bytes_read,
-                   &leftover, &records, &numrecords)) != 0)
-                       break;
-               off -= leftover;
-               if (leftover == bytes_read) {
-                       /*
-                        * no progress made, because buffer is not big enough
-                        * to hold this record; resize and retry.
-                        */
-                       buflen *= 2;
-                       free(buf);
-                       buf = malloc(buflen);
-                       if (buf == NULL)
-                               return (ENOMEM);
-               }
-
-               /* CONSTCOND */
-       } while (1);
-
-       free(buf);
-
-       if (!err) {
-               verify(nvlist_alloc(nvhisp, NV_UNIQUE_NAME, 0) == 0);
-               verify(nvlist_add_nvlist_array(*nvhisp, ZPOOL_HIST_RECORD,
-                   records, numrecords) == 0);
-       }
-       for (i = 0; i < numrecords; i++)
-               nvlist_free(records[i]);
-       free(records);
-
-       return (err);
-}
-
-/*
- * Retrieve the next event given the passed 'zevent_fd' file descriptor.
- * If there is a new event available 'nvp' will contain a newly allocated
- * nvlist and 'dropped' will be set to the number of missed events since
- * the last call to this function.  When 'nvp' is set to NULL it indicates
- * no new events are available.  In either case the function returns 0 and
- * it is up to the caller to free 'nvp'.  In the case of a fatal error the
- * function will return a non-zero value.  When the function is called in
- * blocking mode (the default, unless the ZEVENT_NONBLOCK flag is passed),
- * it will not return until a new event is available.
- */
-int
-zpool_events_next(libzfs_handle_t *hdl, nvlist_t **nvp,
-    int *dropped, unsigned flags, int zevent_fd)
-{
-       zfs_cmd_t zc = {"\0"};
-       int error = 0;
-
-       *nvp = NULL;
-       *dropped = 0;
-       zc.zc_cleanup_fd = zevent_fd;
-
-       if (flags & ZEVENT_NONBLOCK)
-               zc.zc_guid = ZEVENT_NONBLOCK;
-
-       if (zcmd_alloc_dst_nvlist(hdl, &zc, ZEVENT_SIZE) != 0)
-               return (-1);
-
-retry:
-       if (zfs_ioctl(hdl, ZFS_IOC_EVENTS_NEXT, &zc) != 0) {
-               switch (errno) {
-               case ESHUTDOWN:
-                       error = zfs_error_fmt(hdl, EZFS_POOLUNAVAIL,
-                           dgettext(TEXT_DOMAIN, "zfs shutdown"));
-                       goto out;
-               case ENOENT:
-                       /* Blocking error case should not occur */
-                       if (!(flags & ZEVENT_NONBLOCK))
-                               error = zpool_standard_error_fmt(hdl, errno,
-                                   dgettext(TEXT_DOMAIN, "cannot get event"));
-
-                       goto out;
-               case ENOMEM:
-                       if (zcmd_expand_dst_nvlist(hdl, &zc) != 0) {
-                               error = zfs_error_fmt(hdl, EZFS_NOMEM,
-                                   dgettext(TEXT_DOMAIN, "cannot get event"));
-                               goto out;
-                       } else {
-                               goto retry;
-                       }
-               default:
-                       error = zpool_standard_error_fmt(hdl, errno,
-                           dgettext(TEXT_DOMAIN, "cannot get event"));
-                       goto out;
-               }
-       }
-
-       error = zcmd_read_dst_nvlist(hdl, &zc, nvp);
-       if (error != 0)
-               goto out;
-
-       *dropped = (int)zc.zc_cookie;
-out:
-       zcmd_free_nvlists(&zc);
-
-       return (error);
-}
-
-/*
- * Clear all events.
- */
-int
-zpool_events_clear(libzfs_handle_t *hdl, int *count)
-{
-       zfs_cmd_t zc = {"\0"};
-       char msg[1024];
-
-       (void) snprintf(msg, sizeof (msg), dgettext(TEXT_DOMAIN,
-           "cannot clear events"));
-
-       if (zfs_ioctl(hdl, ZFS_IOC_EVENTS_CLEAR, &zc) != 0)
-               return (zpool_standard_error_fmt(hdl, errno, msg));
-
-       if (count != NULL)
-               *count = (int)zc.zc_cookie; /* # of events cleared */
-
-       return (0);
-}
-
-/*
- * Seek to a specific EID, ZEVENT_SEEK_START, or ZEVENT_SEEK_END for
- * the passed zevent_fd file handle.  On success zero is returned,
- * otherwise -1 is returned and hdl->libzfs_error is set to the errno.
- */
-int
-zpool_events_seek(libzfs_handle_t *hdl, uint64_t eid, int zevent_fd)
-{
-       zfs_cmd_t zc = {"\0"};
-       int error = 0;
-
-       zc.zc_guid = eid;
-       zc.zc_cleanup_fd = zevent_fd;
-
-       if (zfs_ioctl(hdl, ZFS_IOC_EVENTS_SEEK, &zc) != 0) {
-               switch (errno) {
-               case ENOENT:
-                       error = zfs_error_fmt(hdl, EZFS_NOENT,
-                           dgettext(TEXT_DOMAIN, "cannot get event"));
-                       break;
-
-               case ENOMEM:
-                       error = zfs_error_fmt(hdl, EZFS_NOMEM,
-                           dgettext(TEXT_DOMAIN, "cannot get event"));
-                       break;
-
-               default:
-                       error = zpool_standard_error_fmt(hdl, errno,
-                           dgettext(TEXT_DOMAIN, "cannot get event"));
-                       break;
-               }
-       }
-
-       return (error);
-}
-
-void
-zpool_obj_to_path(zpool_handle_t *zhp, uint64_t dsobj, uint64_t obj,
-    char *pathname, size_t len)
-{
-       zfs_cmd_t zc = {"\0"};
-       boolean_t mounted = B_FALSE;
-       char *mntpnt = NULL;
-       char dsname[MAXNAMELEN];
-
-       if (dsobj == 0) {
-               /* special case for the MOS */
-               (void) snprintf(pathname, len, "<metadata>:<0x%llx>",
-                   (longlong_t)obj);
-               return;
-       }
-
-       /* get the dataset's name */
-       (void) strlcpy(zc.zc_name, zhp->zpool_name, sizeof (zc.zc_name));
-       zc.zc_obj = dsobj;
-       if (ioctl(zhp->zpool_hdl->libzfs_fd,
-           ZFS_IOC_DSOBJ_TO_DSNAME, &zc) != 0) {
-               /* just write out a path of two object numbers */
-               (void) snprintf(pathname, len, "<0x%llx>:<0x%llx>",
-                   (longlong_t)dsobj, (longlong_t)obj);
-               return;
-       }
-       (void) strlcpy(dsname, zc.zc_value, sizeof (dsname));
-
-       /* find out if the dataset is mounted */
-       mounted = is_mounted(zhp->zpool_hdl, dsname, &mntpnt);
-
-       /* get the corrupted object's path */
-       (void) strlcpy(zc.zc_name, dsname, sizeof (zc.zc_name));
-       zc.zc_obj = obj;
-       if (ioctl(zhp->zpool_hdl->libzfs_fd, ZFS_IOC_OBJ_TO_PATH,
-           &zc) == 0) {
-               if (mounted) {
-                       (void) snprintf(pathname, len, "%s%s", mntpnt,
-                           zc.zc_value);
-               } else {
-                       (void) snprintf(pathname, len, "%s:%s",
-                           dsname, zc.zc_value);
-               }
-       } else {
-               (void) snprintf(pathname, len, "%s:<0x%llx>", dsname,
-                   (longlong_t)obj);
-       }
-       free(mntpnt);
-}
-
-/*
- * Read the EFI label from the config, if a label does not exist then
- * pass back the error to the caller. If the caller has passed a non-NULL
- * diskaddr argument then we set it to the starting address of the EFI
- * partition.
- */
-static int
-read_efi_label(nvlist_t *config, diskaddr_t *sb)
-{
-       char *path;
-       int fd;
-       char diskname[MAXPATHLEN];
-       int err = -1;
-
-       if (nvlist_lookup_string(config, ZPOOL_CONFIG_PATH, &path) != 0)
-               return (err);
-
-       (void) snprintf(diskname, sizeof (diskname), "%s%s", DISK_ROOT,
-           strrchr(path, '/'));
-       if ((fd = open(diskname, O_RDWR|O_DIRECT)) >= 0) {
-               struct dk_gpt *vtoc;
-
-               if ((err = efi_alloc_and_read(fd, &vtoc)) >= 0) {
-                       if (sb != NULL)
-                               *sb = vtoc->efi_parts[0].p_start;
-                       efi_free(vtoc);
-               }
-               (void) close(fd);
-       }
-       return (err);
-}
-
-/*
- * determine where a partition starts on a disk in the current
- * configuration
- */
-static diskaddr_t
-find_start_block(nvlist_t *config)
-{
-       nvlist_t **child;
-       uint_t c, children;
-       diskaddr_t sb = MAXOFFSET_T;
-       uint64_t wholedisk;
-
-       if (nvlist_lookup_nvlist_array(config,
-           ZPOOL_CONFIG_CHILDREN, &child, &children) != 0) {
-               if (nvlist_lookup_uint64(config,
-                   ZPOOL_CONFIG_WHOLE_DISK,
-                   &wholedisk) != 0 || !wholedisk) {
-                       return (MAXOFFSET_T);
-               }
-               if (read_efi_label(config, &sb) < 0)
-                       sb = MAXOFFSET_T;
-               return (sb);
-       }
-
-       for (c = 0; c < children; c++) {
-               sb = find_start_block(child[c]);
-               if (sb != MAXOFFSET_T) {
-                       return (sb);
-               }
-       }
-       return (MAXOFFSET_T);
-}
-
-int
-zpool_label_disk_wait(char *path, int timeout)
-{
-       struct stat64 statbuf;
-       int i;
-
-       /*
-        * Wait timeout miliseconds for a newly created device to be available
-        * from the given path.  There is a small window when a /dev/ device
-        * will exist and the udev link will not, so we must wait for the
-        * symlink.  Depending on the udev rules this may take a few seconds.
-        */
-       for (i = 0; i < timeout; i++) {
-               usleep(1000);
-
-               errno = 0;
-               if ((stat64(path, &statbuf) == 0) && (errno == 0))
-                       return (0);
-       }
-
-       return (ENOENT);
-}
-
-int
-zpool_label_disk_check(char *path)
-{
-       struct dk_gpt *vtoc;
-       int fd, err;
-
-       if ((fd = open(path, O_RDWR|O_DIRECT)) < 0)
-               return (errno);
-
-       if ((err = efi_alloc_and_read(fd, &vtoc)) != 0) {
-               (void) close(fd);
-               return (err);
-       }
-
-       if (vtoc->efi_flags & EFI_GPT_PRIMARY_CORRUPT) {
-               efi_free(vtoc);
-               (void) close(fd);
-               return (EIDRM);
-       }
-
-       efi_free(vtoc);
-       (void) close(fd);
-       return (0);
-}
-
-/*
- * Label an individual disk.  The name provided is the short name,
- * stripped of any leading /dev path.
- */
-int
-zpool_label_disk(libzfs_handle_t *hdl, zpool_handle_t *zhp, char *name)
-{
-       char path[MAXPATHLEN];
-       struct dk_gpt *vtoc;
-       int rval, fd;
-       size_t resv = EFI_MIN_RESV_SIZE;
-       uint64_t slice_size;
-       diskaddr_t start_block;
-       char errbuf[1024];
-
-       /* prepare an error message just in case */
-       (void) snprintf(errbuf, sizeof (errbuf),
-           dgettext(TEXT_DOMAIN, "cannot label '%s'"), name);
-
-       if (zhp) {
-               nvlist_t *nvroot;
-
-#if defined(__sun__) || defined(__sun)
-               if (zpool_is_bootable(zhp)) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "EFI labeled devices are not supported on root "
-                           "pools."));
-                       return (zfs_error(hdl, EZFS_POOL_NOTSUP, errbuf));
-               }
-#endif
-
-               verify(nvlist_lookup_nvlist(zhp->zpool_config,
-                   ZPOOL_CONFIG_VDEV_TREE, &nvroot) == 0);
-
-               if (zhp->zpool_start_block == 0)
-                       start_block = find_start_block(nvroot);
-               else
-                       start_block = zhp->zpool_start_block;
-               zhp->zpool_start_block = start_block;
-       } else {
-               /* new pool */
-               start_block = NEW_START_BLOCK;
-       }
-
-       (void) snprintf(path, sizeof (path), "%s/%s", DISK_ROOT, name);
-
-       if ((fd = open(path, O_RDWR|O_DIRECT)) < 0) {
-               /*
-                * This shouldn't happen.  We've long since verified that this
-                * is a valid device.
-                */
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
-                   "label '%s': unable to open device: %d"), path, errno);
-               return (zfs_error(hdl, EZFS_OPENFAILED, errbuf));
-       }
-
-       if (efi_alloc_and_init(fd, EFI_NUMPAR, &vtoc) != 0) {
-               /*
-                * The only way this can fail is if we run out of memory, or we
-                * were unable to read the disk's capacity
-                */
-               if (errno == ENOMEM)
-                       (void) no_memory(hdl);
-
-               (void) close(fd);
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "cannot "
-                   "label '%s': unable to read disk capacity"), path);
-
-               return (zfs_error(hdl, EZFS_NOCAP, errbuf));
-       }
-
-       slice_size = vtoc->efi_last_u_lba + 1;
-       slice_size -= EFI_MIN_RESV_SIZE;
-       if (start_block == MAXOFFSET_T)
-               start_block = NEW_START_BLOCK;
-       slice_size -= start_block;
-       slice_size = P2ALIGN(slice_size, PARTITION_END_ALIGNMENT);
-
-       vtoc->efi_parts[0].p_start = start_block;
-       vtoc->efi_parts[0].p_size = slice_size;
-
-       /*
-        * Why we use V_USR: V_BACKUP confuses users, and is considered
-        * disposable by some EFI utilities (since EFI doesn't have a backup
-        * slice).  V_UNASSIGNED is supposed to be used only for zero size
-        * partitions, and efi_write() will fail if we use it.  V_ROOT, V_BOOT,
-        * etc. were all pretty specific.  V_USR is as close to reality as we
-        * can get, in the absence of V_OTHER.
-        */
-       vtoc->efi_parts[0].p_tag = V_USR;
-       (void) strcpy(vtoc->efi_parts[0].p_name, "zfs");
-
-       vtoc->efi_parts[8].p_start = slice_size + start_block;
-       vtoc->efi_parts[8].p_size = resv;
-       vtoc->efi_parts[8].p_tag = V_RESERVED;
-
-       if ((rval = efi_write(fd, vtoc)) != 0 || (rval = efi_rescan(fd)) != 0) {
-               /*
-                * Some block drivers (like pcata) may not support EFI
-                * GPT labels.  Print out a helpful error message dir-
-                * ecting the user to manually label the disk and give
-                * a specific slice.
-                */
-               (void) close(fd);
-               efi_free(vtoc);
-
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "try using "
-                   "parted(8) and then provide a specific slice: %d"), rval);
-               return (zfs_error(hdl, EZFS_LABELFAILED, errbuf));
-       }
-
-       (void) close(fd);
-       efi_free(vtoc);
-
-       /* Wait for the first expected partition to appear. */
-
-       (void) snprintf(path, sizeof (path), "%s/%s", DISK_ROOT, name);
-       (void) zfs_append_partition(path, MAXPATHLEN);
-
-       rval = zpool_label_disk_wait(path, 3000);
-       if (rval) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "failed to "
-                   "detect device partitions on '%s': %d"), path, rval);
-               return (zfs_error(hdl, EZFS_LABELFAILED, errbuf));
-       }
-
-       /* We can't be to paranoid.  Read the label back and verify it. */
-       (void) snprintf(path, sizeof (path), "%s/%s", DISK_ROOT, name);
-       rval = zpool_label_disk_check(path);
-       if (rval) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "freshly written "
-                   "EFI label on '%s' is damaged.  Ensure\nthis device "
-                   "is not in in use, and is functioning properly: %d"),
-                   path, rval);
-               return (zfs_error(hdl, EZFS_LABELFAILED, errbuf));
-       }
-
-       return (0);
-}
diff --git a/zfs/lib/libzfs/libzfs_sendrecv.c b/zfs/lib/libzfs/libzfs_sendrecv.c
deleted file mode 100644 (file)
index bd2fd29..0000000
+++ /dev/null
@@ -1,3386 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2011, 2014 by Delphix. All rights reserved.
- * Copyright (c) 2012, Joyent, Inc. All rights reserved.
- * Copyright (c) 2012 Pawel Jakub Dawidek <pawel@dawidek.net>.
- * All rights reserved
- * Copyright (c) 2013 Steven Hartland. All rights reserved.
- */
-
-#include <assert.h>
-#include <ctype.h>
-#include <errno.h>
-#include <libintl.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <stddef.h>
-#include <fcntl.h>
-#include <sys/mount.h>
-#include <sys/mntent.h>
-#include <sys/mnttab.h>
-#include <sys/avl.h>
-#include <sys/debug.h>
-#include <sys/stat.h>
-#include <stddef.h>
-#include <pthread.h>
-#include <umem.h>
-#include <time.h>
-
-#include <libzfs.h>
-#include <libzfs_core.h>
-
-#include "zfs_namecheck.h"
-#include "zfs_prop.h"
-#include "zfs_fletcher.h"
-#include "libzfs_impl.h"
-#include <sys/zio_checksum.h>
-#include <sys/ddt.h>
-#include <sys/socket.h>
-
-/* in libzfs_dataset.c */
-extern void zfs_setprop_error(libzfs_handle_t *, zfs_prop_t, int, char *);
-
-static int zfs_receive_impl(libzfs_handle_t *, const char *, recvflags_t *,
-    int, const char *, nvlist_t *, avl_tree_t *, char **, int, uint64_t *);
-
-static const zio_cksum_t zero_cksum = { { 0 } };
-
-typedef struct dedup_arg {
-       int     inputfd;
-       int     outputfd;
-       libzfs_handle_t  *dedup_hdl;
-} dedup_arg_t;
-
-typedef struct progress_arg {
-       zfs_handle_t *pa_zhp;
-       int pa_fd;
-       boolean_t pa_parsable;
-} progress_arg_t;
-
-typedef struct dataref {
-       uint64_t ref_guid;
-       uint64_t ref_object;
-       uint64_t ref_offset;
-} dataref_t;
-
-typedef struct dedup_entry {
-       struct dedup_entry      *dde_next;
-       zio_cksum_t dde_chksum;
-       uint64_t dde_prop;
-       dataref_t dde_ref;
-} dedup_entry_t;
-
-#define        MAX_DDT_PHYSMEM_PERCENT         20
-#define        SMALLEST_POSSIBLE_MAX_DDT_MB            128
-
-typedef struct dedup_table {
-       dedup_entry_t   **dedup_hash_array;
-       umem_cache_t    *ddecache;
-       uint64_t        max_ddt_size;  /* max dedup table size in bytes */
-       uint64_t        cur_ddt_size;  /* current dedup table size in bytes */
-       uint64_t        ddt_count;
-       int             numhashbits;
-       boolean_t       ddt_full;
-} dedup_table_t;
-
-static int
-high_order_bit(uint64_t n)
-{
-       int count;
-
-       for (count = 0; n != 0; count++)
-               n >>= 1;
-       return (count);
-}
-
-static size_t
-ssread(void *buf, size_t len, FILE *stream)
-{
-       size_t outlen;
-
-       if ((outlen = fread(buf, len, 1, stream)) == 0)
-               return (0);
-
-       return (outlen);
-}
-
-static void
-ddt_hash_append(libzfs_handle_t *hdl, dedup_table_t *ddt, dedup_entry_t **ddepp,
-    zio_cksum_t *cs, uint64_t prop, dataref_t *dr)
-{
-       dedup_entry_t   *dde;
-
-       if (ddt->cur_ddt_size >= ddt->max_ddt_size) {
-               if (ddt->ddt_full == B_FALSE) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "Dedup table full.  Deduplication will continue "
-                           "with existing table entries"));
-                       ddt->ddt_full = B_TRUE;
-               }
-               return;
-       }
-
-       if ((dde = umem_cache_alloc(ddt->ddecache, UMEM_DEFAULT))
-           != NULL) {
-               assert(*ddepp == NULL);
-               dde->dde_next = NULL;
-               dde->dde_chksum = *cs;
-               dde->dde_prop = prop;
-               dde->dde_ref = *dr;
-               *ddepp = dde;
-               ddt->cur_ddt_size += sizeof (dedup_entry_t);
-               ddt->ddt_count++;
-       }
-}
-
-/*
- * Using the specified dedup table, do a lookup for an entry with
- * the checksum cs.  If found, return the block's reference info
- * in *dr. Otherwise, insert a new entry in the dedup table, using
- * the reference information specified by *dr.
- *
- * return value:  true - entry was found
- *               false - entry was not found
- */
-static boolean_t
-ddt_update(libzfs_handle_t *hdl, dedup_table_t *ddt, zio_cksum_t *cs,
-    uint64_t prop, dataref_t *dr)
-{
-       uint32_t hashcode;
-       dedup_entry_t **ddepp;
-
-       hashcode = BF64_GET(cs->zc_word[0], 0, ddt->numhashbits);
-
-       for (ddepp = &(ddt->dedup_hash_array[hashcode]); *ddepp != NULL;
-           ddepp = &((*ddepp)->dde_next)) {
-               if (ZIO_CHECKSUM_EQUAL(((*ddepp)->dde_chksum), *cs) &&
-                   (*ddepp)->dde_prop == prop) {
-                       *dr = (*ddepp)->dde_ref;
-                       return (B_TRUE);
-               }
-       }
-       ddt_hash_append(hdl, ddt, ddepp, cs, prop, dr);
-       return (B_FALSE);
-}
-
-static int
-cksum_and_write(const void *buf, uint64_t len, zio_cksum_t *zc, int outfd)
-{
-       fletcher_4_incremental_native(buf, len, zc);
-       return (write(outfd, buf, len));
-}
-
-/*
- * This function is started in a separate thread when the dedup option
- * has been requested.  The main send thread determines the list of
- * snapshots to be included in the send stream and makes the ioctl calls
- * for each one.  But instead of having the ioctl send the output to the
- * the output fd specified by the caller of zfs_send()), the
- * ioctl is told to direct the output to a pipe, which is read by the
- * alternate thread running THIS function.  This function does the
- * dedup'ing by:
- *  1. building a dedup table (the DDT)
- *  2. doing checksums on each data block and inserting a record in the DDT
- *  3. looking for matching checksums, and
- *  4.  sending a DRR_WRITE_BYREF record instead of a write record whenever
- *      a duplicate block is found.
- * The output of this function then goes to the output fd requested
- * by the caller of zfs_send().
- */
-static void *
-cksummer(void *arg)
-{
-       dedup_arg_t *dda = arg;
-       char *buf = zfs_alloc(dda->dedup_hdl, SPA_MAXBLOCKSIZE);
-       dmu_replay_record_t thedrr;
-       dmu_replay_record_t *drr = &thedrr;
-       struct drr_begin *drrb = &thedrr.drr_u.drr_begin;
-       struct drr_end *drre = &thedrr.drr_u.drr_end;
-       struct drr_object *drro = &thedrr.drr_u.drr_object;
-       struct drr_write *drrw = &thedrr.drr_u.drr_write;
-       struct drr_spill *drrs = &thedrr.drr_u.drr_spill;
-       struct drr_write_embedded *drrwe = &thedrr.drr_u.drr_write_embedded;
-       FILE *ofp;
-       int outfd;
-       dmu_replay_record_t wbr_drr = {0};
-       struct drr_write_byref *wbr_drrr = &wbr_drr.drr_u.drr_write_byref;
-       dedup_table_t ddt;
-       zio_cksum_t stream_cksum;
-       uint64_t physmem = sysconf(_SC_PHYS_PAGES) * sysconf(_SC_PAGESIZE);
-       uint64_t numbuckets;
-
-       ddt.max_ddt_size =
-           MAX((physmem * MAX_DDT_PHYSMEM_PERCENT)/100,
-           SMALLEST_POSSIBLE_MAX_DDT_MB<<20);
-
-       numbuckets = ddt.max_ddt_size/(sizeof (dedup_entry_t));
-
-       /*
-        * numbuckets must be a power of 2.  Increase number to
-        * a power of 2 if necessary.
-        */
-       if (!ISP2(numbuckets))
-               numbuckets = 1 << high_order_bit(numbuckets);
-
-       ddt.dedup_hash_array = calloc(numbuckets, sizeof (dedup_entry_t *));
-       ddt.ddecache = umem_cache_create("dde", sizeof (dedup_entry_t), 0,
-           NULL, NULL, NULL, NULL, NULL, 0);
-       ddt.cur_ddt_size = numbuckets * sizeof (dedup_entry_t *);
-       ddt.numhashbits = high_order_bit(numbuckets) - 1;
-       ddt.ddt_full = B_FALSE;
-
-       /* Initialize the write-by-reference block. */
-       wbr_drr.drr_type = DRR_WRITE_BYREF;
-       wbr_drr.drr_payloadlen = 0;
-
-       outfd = dda->outputfd;
-       ofp = fdopen(dda->inputfd, "r");
-       while (ssread(drr, sizeof (dmu_replay_record_t), ofp) != 0) {
-
-               switch (drr->drr_type) {
-               case DRR_BEGIN:
-               {
-                       int     fflags;
-                       ZIO_SET_CHECKSUM(&stream_cksum, 0, 0, 0, 0);
-
-                       /* set the DEDUP feature flag for this stream */
-                       fflags = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
-                       fflags |= (DMU_BACKUP_FEATURE_DEDUP |
-                           DMU_BACKUP_FEATURE_DEDUPPROPS);
-                       DMU_SET_FEATUREFLAGS(drrb->drr_versioninfo, fflags);
-
-                       if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       if (DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) ==
-                           DMU_COMPOUNDSTREAM && drr->drr_payloadlen != 0) {
-                               int sz = drr->drr_payloadlen;
-
-                               if (sz > SPA_MAXBLOCKSIZE) {
-                                       buf = zfs_realloc(dda->dedup_hdl, buf,
-                                           SPA_MAXBLOCKSIZE, sz);
-                               }
-                               (void) ssread(buf, sz, ofp);
-                               if (ferror(stdin))
-                                       perror("fread");
-                               if (cksum_and_write(buf, sz, &stream_cksum,
-                                   outfd) == -1)
-                                       goto out;
-                       }
-                       break;
-               }
-
-               case DRR_END:
-               {
-                       /* use the recalculated checksum */
-                       ZIO_SET_CHECKSUM(&drre->drr_checksum,
-                           stream_cksum.zc_word[0], stream_cksum.zc_word[1],
-                           stream_cksum.zc_word[2], stream_cksum.zc_word[3]);
-                       if ((write(outfd, drr,
-                           sizeof (dmu_replay_record_t))) == -1)
-                               goto out;
-                       break;
-               }
-
-               case DRR_OBJECT:
-               {
-                       if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       if (drro->drr_bonuslen > 0) {
-                               (void) ssread(buf,
-                                   P2ROUNDUP((uint64_t)drro->drr_bonuslen, 8),
-                                   ofp);
-                               if (cksum_and_write(buf,
-                                   P2ROUNDUP((uint64_t)drro->drr_bonuslen, 8),
-                                   &stream_cksum, outfd) == -1)
-                                       goto out;
-                       }
-                       break;
-               }
-
-               case DRR_SPILL:
-               {
-                       if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       (void) ssread(buf, drrs->drr_length, ofp);
-                       if (cksum_and_write(buf, drrs->drr_length,
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       break;
-               }
-
-               case DRR_FREEOBJECTS:
-               {
-                       if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       break;
-               }
-
-               case DRR_WRITE:
-               {
-                       dataref_t       dataref;
-
-                       (void) ssread(buf, drrw->drr_length, ofp);
-
-                       /*
-                        * Use the existing checksum if it's dedup-capable,
-                        * else calculate a SHA256 checksum for it.
-                        */
-
-                       if (ZIO_CHECKSUM_EQUAL(drrw->drr_key.ddk_cksum,
-                           zero_cksum) ||
-                           !DRR_IS_DEDUP_CAPABLE(drrw->drr_checksumflags)) {
-                               zio_cksum_t tmpsha256;
-
-                               zio_checksum_SHA256(buf,
-                                   drrw->drr_length, &tmpsha256);
-
-                               drrw->drr_key.ddk_cksum.zc_word[0] =
-                                   BE_64(tmpsha256.zc_word[0]);
-                               drrw->drr_key.ddk_cksum.zc_word[1] =
-                                   BE_64(tmpsha256.zc_word[1]);
-                               drrw->drr_key.ddk_cksum.zc_word[2] =
-                                   BE_64(tmpsha256.zc_word[2]);
-                               drrw->drr_key.ddk_cksum.zc_word[3] =
-                                   BE_64(tmpsha256.zc_word[3]);
-                               drrw->drr_checksumtype = ZIO_CHECKSUM_SHA256;
-                               drrw->drr_checksumflags = DRR_CHECKSUM_DEDUP;
-                       }
-
-                       dataref.ref_guid = drrw->drr_toguid;
-                       dataref.ref_object = drrw->drr_object;
-                       dataref.ref_offset = drrw->drr_offset;
-
-                       if (ddt_update(dda->dedup_hdl, &ddt,
-                           &drrw->drr_key.ddk_cksum, drrw->drr_key.ddk_prop,
-                           &dataref)) {
-                               /* block already present in stream */
-                               wbr_drrr->drr_object = drrw->drr_object;
-                               wbr_drrr->drr_offset = drrw->drr_offset;
-                               wbr_drrr->drr_length = drrw->drr_length;
-                               wbr_drrr->drr_toguid = drrw->drr_toguid;
-                               wbr_drrr->drr_refguid = dataref.ref_guid;
-                               wbr_drrr->drr_refobject =
-                                   dataref.ref_object;
-                               wbr_drrr->drr_refoffset =
-                                   dataref.ref_offset;
-
-                               wbr_drrr->drr_checksumtype =
-                                   drrw->drr_checksumtype;
-                               wbr_drrr->drr_checksumflags =
-                                   drrw->drr_checksumtype;
-                               wbr_drrr->drr_key.ddk_cksum =
-                                   drrw->drr_key.ddk_cksum;
-                               wbr_drrr->drr_key.ddk_prop =
-                                   drrw->drr_key.ddk_prop;
-
-                               if (cksum_and_write(&wbr_drr,
-                                   sizeof (dmu_replay_record_t), &stream_cksum,
-                                   outfd) == -1)
-                                       goto out;
-                       } else {
-                               /* block not previously seen */
-                               if (cksum_and_write(drr,
-                                   sizeof (dmu_replay_record_t), &stream_cksum,
-                                   outfd) == -1)
-                                       goto out;
-                               if (cksum_and_write(buf,
-                                   drrw->drr_length,
-                                   &stream_cksum, outfd) == -1)
-                                       goto out;
-                       }
-                       break;
-               }
-
-               case DRR_WRITE_EMBEDDED:
-               {
-                       if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       (void) ssread(buf,
-                           P2ROUNDUP((uint64_t)drrwe->drr_psize, 8), ofp);
-                       if (cksum_and_write(buf,
-                           P2ROUNDUP((uint64_t)drrwe->drr_psize, 8),
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       break;
-               }
-
-               case DRR_FREE:
-               {
-                       if (cksum_and_write(drr, sizeof (dmu_replay_record_t),
-                           &stream_cksum, outfd) == -1)
-                               goto out;
-                       break;
-               }
-
-               default:
-                       (void) printf("INVALID record type 0x%x\n",
-                           drr->drr_type);
-                       /* should never happen, so assert */
-                       assert(B_FALSE);
-               }
-       }
-out:
-       umem_cache_destroy(ddt.ddecache);
-       free(ddt.dedup_hash_array);
-       free(buf);
-       (void) fclose(ofp);
-
-       return (NULL);
-}
-
-/*
- * Routines for dealing with the AVL tree of fs-nvlists
- */
-typedef struct fsavl_node {
-       avl_node_t fn_node;
-       nvlist_t *fn_nvfs;
-       char *fn_snapname;
-       uint64_t fn_guid;
-} fsavl_node_t;
-
-static int
-fsavl_compare(const void *arg1, const void *arg2)
-{
-       const fsavl_node_t *fn1 = arg1;
-       const fsavl_node_t *fn2 = arg2;
-
-       if (fn1->fn_guid > fn2->fn_guid)
-               return (+1);
-       else if (fn1->fn_guid < fn2->fn_guid)
-               return (-1);
-       else
-               return (0);
-}
-
-/*
- * Given the GUID of a snapshot, find its containing filesystem and
- * (optionally) name.
- */
-static nvlist_t *
-fsavl_find(avl_tree_t *avl, uint64_t snapguid, char **snapname)
-{
-       fsavl_node_t fn_find;
-       fsavl_node_t *fn;
-
-       fn_find.fn_guid = snapguid;
-
-       fn = avl_find(avl, &fn_find, NULL);
-       if (fn) {
-               if (snapname)
-                       *snapname = fn->fn_snapname;
-               return (fn->fn_nvfs);
-       }
-       return (NULL);
-}
-
-static void
-fsavl_destroy(avl_tree_t *avl)
-{
-       fsavl_node_t *fn;
-       void *cookie;
-
-       if (avl == NULL)
-               return;
-
-       cookie = NULL;
-       while ((fn = avl_destroy_nodes(avl, &cookie)) != NULL)
-               free(fn);
-       avl_destroy(avl);
-       free(avl);
-}
-
-/*
- * Given an nvlist, produce an avl tree of snapshots, ordered by guid
- */
-static avl_tree_t *
-fsavl_create(nvlist_t *fss)
-{
-       avl_tree_t *fsavl;
-       nvpair_t *fselem = NULL;
-
-       if ((fsavl = malloc(sizeof (avl_tree_t))) == NULL)
-               return (NULL);
-
-       avl_create(fsavl, fsavl_compare, sizeof (fsavl_node_t),
-           offsetof(fsavl_node_t, fn_node));
-
-       while ((fselem = nvlist_next_nvpair(fss, fselem)) != NULL) {
-               nvlist_t *nvfs, *snaps;
-               nvpair_t *snapelem = NULL;
-
-               VERIFY(0 == nvpair_value_nvlist(fselem, &nvfs));
-               VERIFY(0 == nvlist_lookup_nvlist(nvfs, "snaps", &snaps));
-
-               while ((snapelem =
-                   nvlist_next_nvpair(snaps, snapelem)) != NULL) {
-                       fsavl_node_t *fn;
-                       uint64_t guid;
-
-                       VERIFY(0 == nvpair_value_uint64(snapelem, &guid));
-                       if ((fn = malloc(sizeof (fsavl_node_t))) == NULL) {
-                               fsavl_destroy(fsavl);
-                               return (NULL);
-                       }
-                       fn->fn_nvfs = nvfs;
-                       fn->fn_snapname = nvpair_name(snapelem);
-                       fn->fn_guid = guid;
-
-                       /*
-                        * Note: if there are multiple snaps with the
-                        * same GUID, we ignore all but one.
-                        */
-                       if (avl_find(fsavl, fn, NULL) == NULL)
-                               avl_add(fsavl, fn);
-                       else
-                               free(fn);
-               }
-       }
-
-       return (fsavl);
-}
-
-/*
- * Routines for dealing with the giant nvlist of fs-nvlists, etc.
- */
-typedef struct send_data {
-       uint64_t parent_fromsnap_guid;
-       nvlist_t *parent_snaps;
-       nvlist_t *fss;
-       nvlist_t *snapprops;
-       const char *fromsnap;
-       const char *tosnap;
-       boolean_t recursive;
-       boolean_t seenfrom;
-       boolean_t seento;
-
-       /*
-        * The header nvlist is of the following format:
-        * {
-        *   "tosnap" -> string
-        *   "fromsnap" -> string (if incremental)
-        *   "fss" -> {
-        *      id -> {
-        *
-        *       "name" -> string (full name; for debugging)
-        *       "parentfromsnap" -> number (guid of fromsnap in parent)
-        *
-        *       "props" -> { name -> value (only if set here) }
-        *       "snaps" -> { name (lastname) -> number (guid) }
-        *       "snapprops" -> { name (lastname) -> { name -> value } }
-        *
-        *       "origin" -> number (guid) (if clone)
-        *       "sent" -> boolean (not on-disk)
-        *      }
-        *   }
-        * }
-        *
-        */
-} send_data_t;
-
-static void send_iterate_prop(zfs_handle_t *zhp, nvlist_t *nv);
-
-static int
-send_iterate_snap(zfs_handle_t *zhp, void *arg)
-{
-       send_data_t *sd = arg;
-       uint64_t guid = zhp->zfs_dmustats.dds_guid;
-       char *snapname;
-       nvlist_t *nv;
-       boolean_t isfromsnap, istosnap, istosnapwithnofrom;
-
-       snapname = strrchr(zhp->zfs_name, '@')+1;
-       isfromsnap = (sd->fromsnap != NULL &&
-           strcmp(sd->fromsnap, snapname) == 0);
-       istosnap = (sd->tosnap != NULL && (strcmp(sd->tosnap, snapname) == 0));
-       istosnapwithnofrom = (istosnap && sd->fromsnap == NULL);
-
-       VERIFY(0 == nvlist_add_uint64(sd->parent_snaps, snapname, guid));
-       /*
-        * NB: if there is no fromsnap here (it's a newly created fs in
-        * an incremental replication), we will substitute the tosnap.
-        */
-       if (isfromsnap || (sd->parent_fromsnap_guid == 0 && istosnap)) {
-               sd->parent_fromsnap_guid = guid;
-       }
-
-       if (!sd->recursive) {
-               if (!sd->seenfrom && isfromsnap) {
-                       sd->seenfrom = B_TRUE;
-                       zfs_close(zhp);
-                       return (0);
-               }
-
-               if ((sd->seento || !sd->seenfrom) && !istosnapwithnofrom) {
-                       zfs_close(zhp);
-                       return (0);
-               }
-
-               if (istosnap)
-                       sd->seento = B_TRUE;
-       }
-
-       VERIFY(0 == nvlist_alloc(&nv, NV_UNIQUE_NAME, 0));
-       send_iterate_prop(zhp, nv);
-       VERIFY(0 == nvlist_add_nvlist(sd->snapprops, snapname, nv));
-       nvlist_free(nv);
-
-       zfs_close(zhp);
-       return (0);
-}
-
-static void
-send_iterate_prop(zfs_handle_t *zhp, nvlist_t *nv)
-{
-       nvpair_t *elem = NULL;
-
-       while ((elem = nvlist_next_nvpair(zhp->zfs_props, elem)) != NULL) {
-               char *propname = nvpair_name(elem);
-               zfs_prop_t prop = zfs_name_to_prop(propname);
-               nvlist_t *propnv;
-
-               if (!zfs_prop_user(propname)) {
-                       /*
-                        * Realistically, this should never happen.  However,
-                        * we want the ability to add DSL properties without
-                        * needing to make incompatible version changes.  We
-                        * need to ignore unknown properties to allow older
-                        * software to still send datasets containing these
-                        * properties, with the unknown properties elided.
-                        */
-                       if (prop == ZPROP_INVAL)
-                               continue;
-
-                       if (zfs_prop_readonly(prop))
-                               continue;
-               }
-
-               verify(nvpair_value_nvlist(elem, &propnv) == 0);
-               if (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_RESERVATION ||
-                   prop == ZFS_PROP_REFQUOTA ||
-                   prop == ZFS_PROP_REFRESERVATION) {
-                       char *source;
-                       uint64_t value;
-                       verify(nvlist_lookup_uint64(propnv,
-                           ZPROP_VALUE, &value) == 0);
-                       if (zhp->zfs_type == ZFS_TYPE_SNAPSHOT)
-                               continue;
-                       /*
-                        * May have no source before SPA_VERSION_RECVD_PROPS,
-                        * but is still modifiable.
-                        */
-                       if (nvlist_lookup_string(propnv,
-                           ZPROP_SOURCE, &source) == 0) {
-                               if ((strcmp(source, zhp->zfs_name) != 0) &&
-                                   (strcmp(source,
-                                   ZPROP_SOURCE_VAL_RECVD) != 0))
-                                       continue;
-                       }
-               } else {
-                       char *source;
-                       if (nvlist_lookup_string(propnv,
-                           ZPROP_SOURCE, &source) != 0)
-                               continue;
-                       if ((strcmp(source, zhp->zfs_name) != 0) &&
-                           (strcmp(source, ZPROP_SOURCE_VAL_RECVD) != 0))
-                               continue;
-               }
-
-               if (zfs_prop_user(propname) ||
-                   zfs_prop_get_type(prop) == PROP_TYPE_STRING) {
-                       char *value;
-                       verify(nvlist_lookup_string(propnv,
-                           ZPROP_VALUE, &value) == 0);
-                       VERIFY(0 == nvlist_add_string(nv, propname, value));
-               } else {
-                       uint64_t value;
-                       verify(nvlist_lookup_uint64(propnv,
-                           ZPROP_VALUE, &value) == 0);
-                       VERIFY(0 == nvlist_add_uint64(nv, propname, value));
-               }
-       }
-}
-
-/*
- * recursively generate nvlists describing datasets.  See comment
- * for the data structure send_data_t above for description of contents
- * of the nvlist.
- */
-static int
-send_iterate_fs(zfs_handle_t *zhp, void *arg)
-{
-       send_data_t *sd = arg;
-       nvlist_t *nvfs, *nv;
-       int rv = 0;
-       uint64_t parent_fromsnap_guid_save = sd->parent_fromsnap_guid;
-       uint64_t guid = zhp->zfs_dmustats.dds_guid;
-       char guidstring[64];
-
-       VERIFY(0 == nvlist_alloc(&nvfs, NV_UNIQUE_NAME, 0));
-       VERIFY(0 == nvlist_add_string(nvfs, "name", zhp->zfs_name));
-       VERIFY(0 == nvlist_add_uint64(nvfs, "parentfromsnap",
-           sd->parent_fromsnap_guid));
-
-       if (zhp->zfs_dmustats.dds_origin[0]) {
-               zfs_handle_t *origin = zfs_open(zhp->zfs_hdl,
-                   zhp->zfs_dmustats.dds_origin, ZFS_TYPE_SNAPSHOT);
-               if (origin == NULL)
-                       return (-1);
-               VERIFY(0 == nvlist_add_uint64(nvfs, "origin",
-                   origin->zfs_dmustats.dds_guid));
-       }
-
-       /* iterate over props */
-       VERIFY(0 == nvlist_alloc(&nv, NV_UNIQUE_NAME, 0));
-       send_iterate_prop(zhp, nv);
-       VERIFY(0 == nvlist_add_nvlist(nvfs, "props", nv));
-       nvlist_free(nv);
-
-       /* iterate over snaps, and set sd->parent_fromsnap_guid */
-       sd->parent_fromsnap_guid = 0;
-       VERIFY(0 == nvlist_alloc(&sd->parent_snaps, NV_UNIQUE_NAME, 0));
-       VERIFY(0 == nvlist_alloc(&sd->snapprops, NV_UNIQUE_NAME, 0));
-       (void) zfs_iter_snapshots_sorted(zhp, send_iterate_snap, sd);
-       VERIFY(0 == nvlist_add_nvlist(nvfs, "snaps", sd->parent_snaps));
-       VERIFY(0 == nvlist_add_nvlist(nvfs, "snapprops", sd->snapprops));
-       nvlist_free(sd->parent_snaps);
-       nvlist_free(sd->snapprops);
-
-       /* add this fs to nvlist */
-       (void) snprintf(guidstring, sizeof (guidstring),
-           "0x%llx", (longlong_t)guid);
-       VERIFY(0 == nvlist_add_nvlist(sd->fss, guidstring, nvfs));
-       nvlist_free(nvfs);
-
-       /* iterate over children */
-       if (sd->recursive)
-               rv = zfs_iter_filesystems(zhp, send_iterate_fs, sd);
-
-       sd->parent_fromsnap_guid = parent_fromsnap_guid_save;
-
-       zfs_close(zhp);
-       return (rv);
-}
-
-static int
-gather_nvlist(libzfs_handle_t *hdl, const char *fsname, const char *fromsnap,
-    const char *tosnap, boolean_t recursive, nvlist_t **nvlp, avl_tree_t **avlp)
-{
-       zfs_handle_t *zhp;
-       send_data_t sd = { 0 };
-       int error;
-
-       zhp = zfs_open(hdl, fsname, ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-       if (zhp == NULL)
-               return (EZFS_BADTYPE);
-
-       VERIFY(0 == nvlist_alloc(&sd.fss, NV_UNIQUE_NAME, 0));
-       sd.fromsnap = fromsnap;
-       sd.tosnap = tosnap;
-       sd.recursive = recursive;
-
-       if ((error = send_iterate_fs(zhp, &sd)) != 0) {
-               nvlist_free(sd.fss);
-               if (avlp != NULL)
-                       *avlp = NULL;
-               *nvlp = NULL;
-               return (error);
-       }
-
-       if (avlp != NULL && (*avlp = fsavl_create(sd.fss)) == NULL) {
-               nvlist_free(sd.fss);
-               *nvlp = NULL;
-               return (EZFS_NOMEM);
-       }
-
-       *nvlp = sd.fss;
-       return (0);
-}
-
-/*
- * Routines specific to "zfs send"
- */
-typedef struct send_dump_data {
-       /* these are all just the short snapname (the part after the @) */
-       const char *fromsnap;
-       const char *tosnap;
-       char prevsnap[ZFS_MAXNAMELEN];
-       uint64_t prevsnap_obj;
-       boolean_t seenfrom, seento, replicate, doall, fromorigin;
-       boolean_t verbose, dryrun, parsable, progress, embed_data, std_out;
-       boolean_t large_block;
-       int outfd;
-       boolean_t err;
-       nvlist_t *fss;
-       nvlist_t *snapholds;
-       avl_tree_t *fsavl;
-       snapfilter_cb_t *filter_cb;
-       void *filter_cb_arg;
-       nvlist_t *debugnv;
-       char holdtag[ZFS_MAXNAMELEN];
-       int cleanup_fd;
-       uint64_t size;
-} send_dump_data_t;
-
-static int
-estimate_ioctl(zfs_handle_t *zhp, uint64_t fromsnap_obj,
-    boolean_t fromorigin, uint64_t *sizep)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-
-       assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
-       assert(fromsnap_obj == 0 || !fromorigin);
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-       zc.zc_obj = fromorigin;
-       zc.zc_sendobj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
-       zc.zc_fromobj = fromsnap_obj;
-       zc.zc_guid = 1;  /* estimate flag */
-
-       if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND, &zc) != 0) {
-               char errbuf[1024];
-               (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-                   "warning: cannot estimate space for '%s'"), zhp->zfs_name);
-
-               switch (errno) {
-               case EXDEV:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "not an earlier snapshot from the same fs"));
-                       return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf));
-
-               case ENOENT:
-                       if (zfs_dataset_exists(hdl, zc.zc_name,
-                           ZFS_TYPE_SNAPSHOT)) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "incremental source (@%s) does not exist"),
-                                   zc.zc_value);
-                       }
-                       return (zfs_error(hdl, EZFS_NOENT, errbuf));
-
-               case EDQUOT:
-               case EFBIG:
-               case EIO:
-               case ENOLINK:
-               case ENOSPC:
-               case ENOSTR:
-               case ENXIO:
-               case EPIPE:
-               case ERANGE:
-               case EFAULT:
-               case EROFS:
-                       zfs_error_aux(hdl, strerror(errno));
-                       return (zfs_error(hdl, EZFS_BADBACKUP, errbuf));
-
-               default:
-                       return (zfs_standard_error(hdl, errno, errbuf));
-               }
-       }
-
-       *sizep = zc.zc_objset_type;
-
-       return (0);
-}
-
-/*
- * Dumps a backup of the given snapshot (incremental from fromsnap if it's not
- * NULL) to the file descriptor specified by outfd.
- */
-static int
-dump_ioctl(zfs_handle_t *zhp, const char *fromsnap, uint64_t fromsnap_obj,
-    boolean_t fromorigin, int outfd, enum lzc_send_flags flags,
-    nvlist_t *debugnv)
-{
-       zfs_cmd_t zc = {"\0"};
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       nvlist_t *thisdbg;
-
-       assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
-       assert(fromsnap_obj == 0 || !fromorigin);
-
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-       zc.zc_cookie = outfd;
-       zc.zc_obj = fromorigin;
-       zc.zc_sendobj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
-       zc.zc_fromobj = fromsnap_obj;
-       zc.zc_flags = flags;
-
-       VERIFY(0 == nvlist_alloc(&thisdbg, NV_UNIQUE_NAME, 0));
-       if (fromsnap && fromsnap[0] != '\0') {
-               VERIFY(0 == nvlist_add_string(thisdbg,
-                   "fromsnap", fromsnap));
-       }
-
-       if (zfs_ioctl(zhp->zfs_hdl, ZFS_IOC_SEND, &zc) != 0) {
-               char errbuf[1024];
-               (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-                   "warning: cannot send '%s'"), zhp->zfs_name);
-
-               VERIFY(0 == nvlist_add_uint64(thisdbg, "error", errno));
-               if (debugnv) {
-                       VERIFY(0 == nvlist_add_nvlist(debugnv,
-                           zhp->zfs_name, thisdbg));
-               }
-               nvlist_free(thisdbg);
-
-               switch (errno) {
-               case EXDEV:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "not an earlier snapshot from the same fs"));
-                       return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf));
-
-               case ENOENT:
-                       if (zfs_dataset_exists(hdl, zc.zc_name,
-                           ZFS_TYPE_SNAPSHOT)) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "incremental source (@%s) does not exist"),
-                                   zc.zc_value);
-                       }
-                       return (zfs_error(hdl, EZFS_NOENT, errbuf));
-
-               case EDQUOT:
-               case EFBIG:
-               case EIO:
-               case ENOLINK:
-               case ENOSPC:
-               case ENOSTR:
-               case ENXIO:
-               case EPIPE:
-               case ERANGE:
-               case EFAULT:
-               case EROFS:
-                       zfs_error_aux(hdl, strerror(errno));
-                       return (zfs_error(hdl, EZFS_BADBACKUP, errbuf));
-
-               default:
-                       return (zfs_standard_error(hdl, errno, errbuf));
-               }
-       }
-
-       if (debugnv)
-               VERIFY(0 == nvlist_add_nvlist(debugnv, zhp->zfs_name, thisdbg));
-       nvlist_free(thisdbg);
-
-       return (0);
-}
-
-static void
-gather_holds(zfs_handle_t *zhp, send_dump_data_t *sdd)
-{
-       assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
-
-       /*
-        * zfs_send() only sets snapholds for sends that need them,
-        * e.g. replication and doall.
-        */
-       if (sdd->snapholds == NULL)
-               return;
-
-       fnvlist_add_string(sdd->snapholds, zhp->zfs_name, sdd->holdtag);
-}
-
-static void *
-send_progress_thread(void *arg)
-{
-       progress_arg_t *pa = arg;
-
-       zfs_cmd_t zc = {"\0"};
-       zfs_handle_t *zhp = pa->pa_zhp;
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-       unsigned long long bytes;
-       char buf[16];
-
-       time_t t;
-       struct tm *tm;
-
-       assert(zhp->zfs_type == ZFS_TYPE_SNAPSHOT);
-       (void) strlcpy(zc.zc_name, zhp->zfs_name, sizeof (zc.zc_name));
-
-       if (!pa->pa_parsable)
-               (void) fprintf(stderr, "TIME        SENT   SNAPSHOT\n");
-
-       /*
-        * Print the progress from ZFS_IOC_SEND_PROGRESS every second.
-        */
-       for (;;) {
-               (void) sleep(1);
-
-               zc.zc_cookie = pa->pa_fd;
-               if (zfs_ioctl(hdl, ZFS_IOC_SEND_PROGRESS, &zc) != 0)
-                       return ((void *)-1);
-
-               (void) time(&t);
-               tm = localtime(&t);
-               bytes = zc.zc_cookie;
-
-               if (pa->pa_parsable) {
-                       (void) fprintf(stderr, "%02d:%02d:%02d\t%llu\t%s\n",
-                           tm->tm_hour, tm->tm_min, tm->tm_sec,
-                           bytes, zhp->zfs_name);
-               } else {
-                       zfs_nicenum(bytes, buf, sizeof (buf));
-                       (void) fprintf(stderr, "%02d:%02d:%02d   %5s   %s\n",
-                           tm->tm_hour, tm->tm_min, tm->tm_sec,
-                           buf, zhp->zfs_name);
-               }
-       }
-}
-
-static int
-dump_snapshot(zfs_handle_t *zhp, void *arg)
-{
-       send_dump_data_t *sdd = arg;
-       progress_arg_t pa = { 0 };
-       pthread_t tid;
-       char *thissnap;
-       int err;
-       boolean_t isfromsnap, istosnap, fromorigin;
-       boolean_t exclude = B_FALSE;
-       FILE *fout = sdd->std_out ? stdout : stderr;
-
-       err = 0;
-       thissnap = strchr(zhp->zfs_name, '@') + 1;
-       isfromsnap = (sdd->fromsnap != NULL &&
-           strcmp(sdd->fromsnap, thissnap) == 0);
-
-       if (!sdd->seenfrom && isfromsnap) {
-               gather_holds(zhp, sdd);
-               sdd->seenfrom = B_TRUE;
-               (void) strcpy(sdd->prevsnap, thissnap);
-               sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
-               zfs_close(zhp);
-               return (0);
-       }
-
-       if (sdd->seento || !sdd->seenfrom) {
-               zfs_close(zhp);
-               return (0);
-       }
-
-       istosnap = (strcmp(sdd->tosnap, thissnap) == 0);
-       if (istosnap)
-               sdd->seento = B_TRUE;
-
-       if (!sdd->doall && !isfromsnap && !istosnap) {
-               if (sdd->replicate) {
-                       char *snapname;
-                       nvlist_t *snapprops;
-                       /*
-                        * Filter out all intermediate snapshots except origin
-                        * snapshots needed to replicate clones.
-                        */
-                       nvlist_t *nvfs = fsavl_find(sdd->fsavl,
-                           zhp->zfs_dmustats.dds_guid, &snapname);
-
-                       VERIFY(0 == nvlist_lookup_nvlist(nvfs,
-                           "snapprops", &snapprops));
-                       VERIFY(0 == nvlist_lookup_nvlist(snapprops,
-                           thissnap, &snapprops));
-                       exclude = !nvlist_exists(snapprops, "is_clone_origin");
-               } else {
-                       exclude = B_TRUE;
-               }
-       }
-
-       /*
-        * If a filter function exists, call it to determine whether
-        * this snapshot will be sent.
-        */
-       if (exclude || (sdd->filter_cb != NULL &&
-           sdd->filter_cb(zhp, sdd->filter_cb_arg) == B_FALSE)) {
-               /*
-                * This snapshot is filtered out.  Don't send it, and don't
-                * set prevsnap_obj, so it will be as if this snapshot didn't
-                * exist, and the next accepted snapshot will be sent as
-                * an incremental from the last accepted one, or as the
-                * first (and full) snapshot in the case of a replication,
-                * non-incremental send.
-                */
-               zfs_close(zhp);
-               return (0);
-       }
-
-       gather_holds(zhp, sdd);
-       fromorigin = sdd->prevsnap[0] == '\0' &&
-           (sdd->fromorigin || sdd->replicate);
-
-       if (sdd->verbose) {
-               uint64_t size;
-               err = estimate_ioctl(zhp, sdd->prevsnap_obj,
-                   fromorigin, &size);
-
-               if (sdd->parsable) {
-                       if (sdd->prevsnap[0] != '\0') {
-                               (void) fprintf(fout, "incremental\t%s\t%s",
-                                   sdd->prevsnap, zhp->zfs_name);
-                       } else {
-                               (void) fprintf(fout, "full\t%s",
-                                   zhp->zfs_name);
-                       }
-               } else {
-                       (void) fprintf(fout, dgettext(TEXT_DOMAIN,
-                           "send from @%s to %s"),
-                           sdd->prevsnap, zhp->zfs_name);
-               }
-               if (err == 0) {
-                       if (sdd->parsable) {
-                               (void) fprintf(fout, "\t%llu\n",
-                                   (longlong_t)size);
-                       } else {
-                               char buf[16];
-                               zfs_nicenum(size, buf, sizeof (buf));
-                               (void) fprintf(fout, dgettext(TEXT_DOMAIN,
-                                   " estimated size is %s\n"), buf);
-                       }
-                       sdd->size += size;
-               } else {
-                       (void) fprintf(fout, "\n");
-               }
-       }
-
-       if (!sdd->dryrun) {
-               /*
-                * If progress reporting is requested, spawn a new thread to
-                * poll ZFS_IOC_SEND_PROGRESS at a regular interval.
-                */
-               if (sdd->progress) {
-                       pa.pa_zhp = zhp;
-                       pa.pa_fd = sdd->outfd;
-                       pa.pa_parsable = sdd->parsable;
-
-                       if ((err = pthread_create(&tid, NULL,
-                           send_progress_thread, &pa))) {
-                               zfs_close(zhp);
-                               return (err);
-                       }
-               }
-
-               enum lzc_send_flags flags = 0;
-               if (sdd->large_block)
-                       flags |= LZC_SEND_FLAG_LARGE_BLOCK;
-               if (sdd->embed_data)
-                       flags |= LZC_SEND_FLAG_EMBED_DATA;
-
-               err = dump_ioctl(zhp, sdd->prevsnap, sdd->prevsnap_obj,
-                   fromorigin, sdd->outfd, flags, sdd->debugnv);
-
-               if (sdd->progress) {
-                       (void) pthread_cancel(tid);
-                       (void) pthread_join(tid, NULL);
-               }
-       }
-
-       (void) strcpy(sdd->prevsnap, thissnap);
-       sdd->prevsnap_obj = zfs_prop_get_int(zhp, ZFS_PROP_OBJSETID);
-       zfs_close(zhp);
-       return (err);
-}
-
-static int
-dump_filesystem(zfs_handle_t *zhp, void *arg)
-{
-       int rv = 0;
-       send_dump_data_t *sdd = arg;
-       boolean_t missingfrom = B_FALSE;
-       zfs_cmd_t zc = {"\0"};
-
-       (void) snprintf(zc.zc_name, sizeof (zc.zc_name), "%s@%s",
-           zhp->zfs_name, sdd->tosnap);
-       if (ioctl(zhp->zfs_hdl->libzfs_fd, ZFS_IOC_OBJSET_STATS, &zc) != 0) {
-               (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
-                   "WARNING: could not send %s@%s: does not exist\n"),
-                   zhp->zfs_name, sdd->tosnap);
-               sdd->err = B_TRUE;
-               return (0);
-       }
-
-       if (sdd->replicate && sdd->fromsnap) {
-               /*
-                * If this fs does not have fromsnap, and we're doing
-                * recursive, we need to send a full stream from the
-                * beginning (or an incremental from the origin if this
-                * is a clone).  If we're doing non-recursive, then let
-                * them get the error.
-                */
-               (void) snprintf(zc.zc_name, sizeof (zc.zc_name), "%s@%s",
-                   zhp->zfs_name, sdd->fromsnap);
-               if (ioctl(zhp->zfs_hdl->libzfs_fd,
-                   ZFS_IOC_OBJSET_STATS, &zc) != 0) {
-                       missingfrom = B_TRUE;
-               }
-       }
-
-       sdd->seenfrom = sdd->seento = sdd->prevsnap[0] = 0;
-       sdd->prevsnap_obj = 0;
-       if (sdd->fromsnap == NULL || missingfrom)
-               sdd->seenfrom = B_TRUE;
-
-       rv = zfs_iter_snapshots_sorted(zhp, dump_snapshot, arg);
-       if (!sdd->seenfrom) {
-               (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
-                   "WARNING: could not send %s@%s:\n"
-                   "incremental source (%s@%s) does not exist\n"),
-                   zhp->zfs_name, sdd->tosnap,
-                   zhp->zfs_name, sdd->fromsnap);
-               sdd->err = B_TRUE;
-       } else if (!sdd->seento) {
-               if (sdd->fromsnap) {
-                       (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
-                           "WARNING: could not send %s@%s:\n"
-                           "incremental source (%s@%s) "
-                           "is not earlier than it\n"),
-                           zhp->zfs_name, sdd->tosnap,
-                           zhp->zfs_name, sdd->fromsnap);
-               } else {
-                       (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
-                           "WARNING: "
-                           "could not send %s@%s: does not exist\n"),
-                           zhp->zfs_name, sdd->tosnap);
-               }
-               sdd->err = B_TRUE;
-       }
-
-       return (rv);
-}
-
-static int
-dump_filesystems(zfs_handle_t *rzhp, void *arg)
-{
-       send_dump_data_t *sdd = arg;
-       nvpair_t *fspair;
-       boolean_t needagain, progress;
-
-       if (!sdd->replicate)
-               return (dump_filesystem(rzhp, sdd));
-
-       /* Mark the clone origin snapshots. */
-       for (fspair = nvlist_next_nvpair(sdd->fss, NULL); fspair;
-           fspair = nvlist_next_nvpair(sdd->fss, fspair)) {
-               nvlist_t *nvfs;
-               uint64_t origin_guid = 0;
-
-               VERIFY(0 == nvpair_value_nvlist(fspair, &nvfs));
-               (void) nvlist_lookup_uint64(nvfs, "origin", &origin_guid);
-               if (origin_guid != 0) {
-                       char *snapname;
-                       nvlist_t *origin_nv = fsavl_find(sdd->fsavl,
-                           origin_guid, &snapname);
-                       if (origin_nv != NULL) {
-                               nvlist_t *snapprops;
-                               VERIFY(0 == nvlist_lookup_nvlist(origin_nv,
-                                   "snapprops", &snapprops));
-                               VERIFY(0 == nvlist_lookup_nvlist(snapprops,
-                                   snapname, &snapprops));
-                               VERIFY(0 == nvlist_add_boolean(
-                                   snapprops, "is_clone_origin"));
-                       }
-               }
-       }
-again:
-       needagain = progress = B_FALSE;
-       for (fspair = nvlist_next_nvpair(sdd->fss, NULL); fspair;
-           fspair = nvlist_next_nvpair(sdd->fss, fspair)) {
-               nvlist_t *fslist, *parent_nv;
-               char *fsname;
-               zfs_handle_t *zhp;
-               int err;
-               uint64_t origin_guid = 0;
-               uint64_t parent_guid = 0;
-
-               VERIFY(nvpair_value_nvlist(fspair, &fslist) == 0);
-               if (nvlist_lookup_boolean(fslist, "sent") == 0)
-                       continue;
-
-               VERIFY(nvlist_lookup_string(fslist, "name", &fsname) == 0);
-               (void) nvlist_lookup_uint64(fslist, "origin", &origin_guid);
-               (void) nvlist_lookup_uint64(fslist, "parentfromsnap",
-                   &parent_guid);
-
-               if (parent_guid != 0) {
-                       parent_nv = fsavl_find(sdd->fsavl, parent_guid, NULL);
-                       if (!nvlist_exists(parent_nv, "sent")) {
-                               /* parent has not been sent; skip this one */
-                               needagain = B_TRUE;
-                               continue;
-                       }
-               }
-
-               if (origin_guid != 0) {
-                       nvlist_t *origin_nv = fsavl_find(sdd->fsavl,
-                           origin_guid, NULL);
-                       if (origin_nv != NULL &&
-                           !nvlist_exists(origin_nv, "sent")) {
-                               /*
-                                * origin has not been sent yet;
-                                * skip this clone.
-                                */
-                               needagain = B_TRUE;
-                               continue;
-                       }
-               }
-
-               zhp = zfs_open(rzhp->zfs_hdl, fsname, ZFS_TYPE_DATASET);
-               if (zhp == NULL)
-                       return (-1);
-               err = dump_filesystem(zhp, sdd);
-               VERIFY(nvlist_add_boolean(fslist, "sent") == 0);
-               progress = B_TRUE;
-               zfs_close(zhp);
-               if (err)
-                       return (err);
-       }
-       if (needagain) {
-               assert(progress);
-               goto again;
-       }
-
-       /* clean out the sent flags in case we reuse this fss */
-       for (fspair = nvlist_next_nvpair(sdd->fss, NULL); fspair;
-           fspair = nvlist_next_nvpair(sdd->fss, fspair)) {
-               nvlist_t *fslist;
-
-               VERIFY(nvpair_value_nvlist(fspair, &fslist) == 0);
-               (void) nvlist_remove_all(fslist, "sent");
-       }
-
-       return (0);
-}
-
-/*
- * Generate a send stream for the dataset identified by the argument zhp.
- *
- * The content of the send stream is the snapshot identified by
- * 'tosnap'.  Incremental streams are requested in two ways:
- *     - from the snapshot identified by "fromsnap" (if non-null) or
- *     - from the origin of the dataset identified by zhp, which must
- *      be a clone.  In this case, "fromsnap" is null and "fromorigin"
- *      is TRUE.
- *
- * The send stream is recursive (i.e. dumps a hierarchy of snapshots) and
- * uses a special header (with a hdrtype field of DMU_COMPOUNDSTREAM)
- * if "replicate" is set.  If "doall" is set, dump all the intermediate
- * snapshots. The DMU_COMPOUNDSTREAM header is used in the "doall"
- * case too. If "props" is set, send properties.
- */
-int
-zfs_send(zfs_handle_t *zhp, const char *fromsnap, const char *tosnap,
-    sendflags_t *flags, int outfd, snapfilter_cb_t filter_func,
-    void *cb_arg, nvlist_t **debugnvp)
-{
-       char errbuf[1024];
-       send_dump_data_t sdd = { 0 };
-       int err = 0;
-       nvlist_t *fss = NULL;
-       avl_tree_t *fsavl = NULL;
-       static uint64_t holdseq;
-       int spa_version;
-       pthread_t tid = 0;
-       int pipefd[2];
-       dedup_arg_t dda = { 0 };
-       int featureflags = 0;
-       FILE *fout;
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot send '%s'"), zhp->zfs_name);
-
-       if (fromsnap && fromsnap[0] == '\0') {
-               zfs_error_aux(zhp->zfs_hdl, dgettext(TEXT_DOMAIN,
-                   "zero-length incremental source"));
-               return (zfs_error(zhp->zfs_hdl, EZFS_NOENT, errbuf));
-       }
-
-       if (zhp->zfs_type == ZFS_TYPE_FILESYSTEM) {
-               uint64_t version;
-               version = zfs_prop_get_int(zhp, ZFS_PROP_VERSION);
-               if (version >= ZPL_VERSION_SA) {
-                       featureflags |= DMU_BACKUP_FEATURE_SA_SPILL;
-               }
-       }
-
-       if (flags->dedup && !flags->dryrun) {
-               featureflags |= (DMU_BACKUP_FEATURE_DEDUP |
-                   DMU_BACKUP_FEATURE_DEDUPPROPS);
-               if ((err = socketpair(AF_UNIX, SOCK_STREAM, 0, pipefd))) {
-                       zfs_error_aux(zhp->zfs_hdl, strerror(errno));
-                       return (zfs_error(zhp->zfs_hdl, EZFS_PIPEFAILED,
-                           errbuf));
-               }
-               dda.outputfd = outfd;
-               dda.inputfd = pipefd[1];
-               dda.dedup_hdl = zhp->zfs_hdl;
-               if ((err = pthread_create(&tid, NULL, cksummer, &dda))) {
-                       (void) close(pipefd[0]);
-                       (void) close(pipefd[1]);
-                       zfs_error_aux(zhp->zfs_hdl, strerror(errno));
-                       return (zfs_error(zhp->zfs_hdl,
-                           EZFS_THREADCREATEFAILED, errbuf));
-               }
-       }
-
-       if (flags->replicate || flags->doall || flags->props) {
-               dmu_replay_record_t drr = { 0 };
-               char *packbuf = NULL;
-               size_t buflen = 0;
-               zio_cksum_t zc = { { 0 } };
-
-               if (flags->replicate || flags->props) {
-                       nvlist_t *hdrnv;
-
-                       VERIFY(0 == nvlist_alloc(&hdrnv, NV_UNIQUE_NAME, 0));
-                       if (fromsnap) {
-                               VERIFY(0 == nvlist_add_string(hdrnv,
-                                   "fromsnap", fromsnap));
-                       }
-                       VERIFY(0 == nvlist_add_string(hdrnv, "tosnap", tosnap));
-                       if (!flags->replicate) {
-                               VERIFY(0 == nvlist_add_boolean(hdrnv,
-                                   "not_recursive"));
-                       }
-
-                       err = gather_nvlist(zhp->zfs_hdl, zhp->zfs_name,
-                           fromsnap, tosnap, flags->replicate, &fss, &fsavl);
-                       if (err)
-                               goto err_out;
-                       VERIFY(0 == nvlist_add_nvlist(hdrnv, "fss", fss));
-                       err = nvlist_pack(hdrnv, &packbuf, &buflen,
-                           NV_ENCODE_XDR, 0);
-                       if (debugnvp)
-                               *debugnvp = hdrnv;
-                       else
-                               nvlist_free(hdrnv);
-                       if (err)
-                               goto stderr_out;
-               }
-
-               if (!flags->dryrun) {
-                       /* write first begin record */
-                       drr.drr_type = DRR_BEGIN;
-                       drr.drr_u.drr_begin.drr_magic = DMU_BACKUP_MAGIC;
-                       DMU_SET_STREAM_HDRTYPE(drr.drr_u.drr_begin.
-                           drr_versioninfo, DMU_COMPOUNDSTREAM);
-                       DMU_SET_FEATUREFLAGS(drr.drr_u.drr_begin.
-                           drr_versioninfo, featureflags);
-                       (void) snprintf(drr.drr_u.drr_begin.drr_toname,
-                           sizeof (drr.drr_u.drr_begin.drr_toname),
-                           "%s@%s", zhp->zfs_name, tosnap);
-                       drr.drr_payloadlen = buflen;
-                       err = cksum_and_write(&drr, sizeof (drr), &zc, outfd);
-
-                       /* write header nvlist */
-                       if (err != -1 && packbuf != NULL) {
-                               err = cksum_and_write(packbuf, buflen, &zc,
-                                   outfd);
-                       }
-                       free(packbuf);
-                       if (err == -1) {
-                               err = errno;
-                               goto stderr_out;
-                       }
-
-                       /* write end record */
-                       bzero(&drr, sizeof (drr));
-                       drr.drr_type = DRR_END;
-                       drr.drr_u.drr_end.drr_checksum = zc;
-                       err = write(outfd, &drr, sizeof (drr));
-                       if (err == -1) {
-                               err = errno;
-                               goto stderr_out;
-                       }
-
-                       err = 0;
-               }
-       }
-
-       /* dump each stream */
-       sdd.fromsnap = fromsnap;
-       sdd.tosnap = tosnap;
-       if (tid != 0)
-               sdd.outfd = pipefd[0];
-       else
-               sdd.outfd = outfd;
-       sdd.replicate = flags->replicate;
-       sdd.doall = flags->doall;
-       sdd.fromorigin = flags->fromorigin;
-       sdd.fss = fss;
-       sdd.fsavl = fsavl;
-       sdd.verbose = flags->verbose;
-       sdd.parsable = flags->parsable;
-       sdd.progress = flags->progress;
-       sdd.dryrun = flags->dryrun;
-       sdd.large_block = flags->largeblock;
-       sdd.embed_data = flags->embed_data;
-       sdd.filter_cb = filter_func;
-       sdd.filter_cb_arg = cb_arg;
-       if (debugnvp)
-               sdd.debugnv = *debugnvp;
-       if (sdd.verbose && sdd.dryrun)
-               sdd.std_out = B_TRUE;
-       fout = sdd.std_out ? stdout : stderr;
-
-       /*
-        * Some flags require that we place user holds on the datasets that are
-        * being sent so they don't get destroyed during the send. We can skip
-        * this step if the pool is imported read-only since the datasets cannot
-        * be destroyed.
-        */
-       if (!flags->dryrun && !zpool_get_prop_int(zfs_get_pool_handle(zhp),
-           ZPOOL_PROP_READONLY, NULL) &&
-           zfs_spa_version(zhp, &spa_version) == 0 &&
-           spa_version >= SPA_VERSION_USERREFS &&
-           (flags->doall || flags->replicate)) {
-               ++holdseq;
-               (void) snprintf(sdd.holdtag, sizeof (sdd.holdtag),
-                   ".send-%d-%llu", getpid(), (u_longlong_t)holdseq);
-               sdd.cleanup_fd = open(ZFS_DEV, O_RDWR);
-               if (sdd.cleanup_fd < 0) {
-                       err = errno;
-                       goto stderr_out;
-               }
-               sdd.snapholds = fnvlist_alloc();
-       } else {
-               sdd.cleanup_fd = -1;
-               sdd.snapholds = NULL;
-       }
-       if (flags->verbose || sdd.snapholds != NULL) {
-               /*
-                * Do a verbose no-op dry run to get all the verbose output
-                * or to gather snapshot hold's before generating any data,
-                * then do a non-verbose real run to generate the streams.
-                */
-               sdd.dryrun = B_TRUE;
-               err = dump_filesystems(zhp, &sdd);
-
-               if (err != 0)
-                       goto stderr_out;
-
-               if (flags->verbose) {
-                       if (flags->parsable) {
-                               (void) fprintf(fout, "size\t%llu\n",
-                                   (longlong_t)sdd.size);
-                       } else {
-                               char buf[16];
-                               zfs_nicenum(sdd.size, buf, sizeof (buf));
-                               (void) fprintf(fout, dgettext(TEXT_DOMAIN,
-                                   "total estimated size is %s\n"), buf);
-                       }
-               }
-
-               /* Ensure no snaps found is treated as an error. */
-               if (!sdd.seento) {
-                       err = ENOENT;
-                       goto err_out;
-               }
-
-               /* Skip the second run if dryrun was requested. */
-               if (flags->dryrun)
-                       goto err_out;
-
-               if (sdd.snapholds != NULL) {
-                       err = zfs_hold_nvl(zhp, sdd.cleanup_fd, sdd.snapholds);
-                       if (err != 0)
-                               goto stderr_out;
-
-                       fnvlist_free(sdd.snapholds);
-                       sdd.snapholds = NULL;
-               }
-
-               sdd.dryrun = B_FALSE;
-               sdd.verbose = B_FALSE;
-       }
-
-       err = dump_filesystems(zhp, &sdd);
-       fsavl_destroy(fsavl);
-       nvlist_free(fss);
-
-       /* Ensure no snaps found is treated as an error. */
-       if (err == 0 && !sdd.seento)
-               err = ENOENT;
-
-       if (tid != 0) {
-               if (err != 0)
-                       (void) pthread_cancel(tid);
-               (void) close(pipefd[0]);
-               (void) pthread_join(tid, NULL);
-       }
-
-       if (sdd.cleanup_fd != -1) {
-               VERIFY(0 == close(sdd.cleanup_fd));
-               sdd.cleanup_fd = -1;
-       }
-
-       if (!flags->dryrun && (flags->replicate || flags->doall ||
-           flags->props)) {
-               /*
-                * write final end record.  NB: want to do this even if
-                * there was some error, because it might not be totally
-                * failed.
-                */
-               dmu_replay_record_t drr = { 0 };
-               drr.drr_type = DRR_END;
-               if (write(outfd, &drr, sizeof (drr)) == -1) {
-                       return (zfs_standard_error(zhp->zfs_hdl,
-                           errno, errbuf));
-               }
-       }
-
-       return (err || sdd.err);
-
-stderr_out:
-       err = zfs_standard_error(zhp->zfs_hdl, err, errbuf);
-err_out:
-       fsavl_destroy(fsavl);
-       nvlist_free(fss);
-       fnvlist_free(sdd.snapholds);
-
-       if (sdd.cleanup_fd != -1)
-               VERIFY(0 == close(sdd.cleanup_fd));
-       if (tid != 0) {
-               (void) pthread_cancel(tid);
-               (void) close(pipefd[0]);
-               (void) pthread_join(tid, NULL);
-       }
-       return (err);
-}
-
-int
-zfs_send_one(zfs_handle_t *zhp, const char *from, int fd,
-    enum lzc_send_flags flags)
-{
-       int err;
-       libzfs_handle_t *hdl = zhp->zfs_hdl;
-
-       char errbuf[1024];
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "warning: cannot send '%s'"), zhp->zfs_name);
-
-       err = lzc_send(zhp->zfs_name, from, fd, flags);
-       if (err != 0) {
-               switch (errno) {
-               case EXDEV:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "not an earlier snapshot from the same fs"));
-                       return (zfs_error(hdl, EZFS_CROSSTARGET, errbuf));
-
-               case ENOENT:
-               case ESRCH:
-                       if (lzc_exists(zhp->zfs_name)) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "incremental source (%s) does not exist"),
-                                   from);
-                       }
-                       return (zfs_error(hdl, EZFS_NOENT, errbuf));
-
-               case EBUSY:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "target is busy; if a filesystem, "
-                           "it must not be mounted"));
-                       return (zfs_error(hdl, EZFS_BUSY, errbuf));
-
-               case EDQUOT:
-               case EFBIG:
-               case EIO:
-               case ENOLINK:
-               case ENOSPC:
-               case ENOSTR:
-               case ENXIO:
-               case EPIPE:
-               case ERANGE:
-               case EFAULT:
-               case EROFS:
-                       zfs_error_aux(hdl, strerror(errno));
-                       return (zfs_error(hdl, EZFS_BADBACKUP, errbuf));
-
-               default:
-                       return (zfs_standard_error(hdl, errno, errbuf));
-               }
-       }
-       return (err != 0);
-}
-
-/*
- * Routines specific to "zfs recv"
- */
-
-static int
-recv_read(libzfs_handle_t *hdl, int fd, void *buf, int ilen,
-    boolean_t byteswap, zio_cksum_t *zc)
-{
-       char *cp = buf;
-       int rv;
-       int len = ilen;
-
-       do {
-               rv = read(fd, cp, len);
-               cp += rv;
-               len -= rv;
-       } while (rv > 0);
-
-       if (rv < 0 || len != 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "failed to read from stream"));
-               return (zfs_error(hdl, EZFS_BADSTREAM, dgettext(TEXT_DOMAIN,
-                   "cannot receive")));
-       }
-
-       if (zc) {
-               if (byteswap)
-                       fletcher_4_incremental_byteswap(buf, ilen, zc);
-               else
-                       fletcher_4_incremental_native(buf, ilen, zc);
-       }
-       return (0);
-}
-
-static int
-recv_read_nvlist(libzfs_handle_t *hdl, int fd, int len, nvlist_t **nvp,
-    boolean_t byteswap, zio_cksum_t *zc)
-{
-       char *buf;
-       int err;
-
-       buf = zfs_alloc(hdl, len);
-       if (buf == NULL)
-               return (ENOMEM);
-
-       err = recv_read(hdl, fd, buf, len, byteswap, zc);
-       if (err != 0) {
-               free(buf);
-               return (err);
-       }
-
-       err = nvlist_unpack(buf, len, nvp, 0);
-       free(buf);
-       if (err != 0) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid "
-                   "stream (malformed nvlist)"));
-               return (EINVAL);
-       }
-       return (0);
-}
-
-static int
-recv_rename(libzfs_handle_t *hdl, const char *name, const char *tryname,
-    int baselen, char *newname, recvflags_t *flags)
-{
-       static int seq;
-       zfs_cmd_t zc = {"\0"};
-       int err;
-       prop_changelist_t *clp;
-       zfs_handle_t *zhp;
-
-       zhp = zfs_open(hdl, name, ZFS_TYPE_DATASET);
-       if (zhp == NULL)
-               return (-1);
-       clp = changelist_gather(zhp, ZFS_PROP_NAME, 0,
-           flags->force ? MS_FORCE : 0);
-       zfs_close(zhp);
-       if (clp == NULL)
-               return (-1);
-       err = changelist_prefix(clp);
-       if (err)
-               return (err);
-
-       zc.zc_objset_type = DMU_OST_ZFS;
-       (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name));
-
-       if (tryname) {
-               (void) strcpy(newname, tryname);
-
-               (void) strlcpy(zc.zc_value, tryname, sizeof (zc.zc_value));
-
-               if (flags->verbose) {
-                       (void) printf("attempting rename %s to %s\n",
-                           zc.zc_name, zc.zc_value);
-               }
-               err = ioctl(hdl->libzfs_fd, ZFS_IOC_RENAME, &zc);
-               if (err == 0)
-                       changelist_rename(clp, name, tryname);
-       } else {
-               err = ENOENT;
-       }
-
-       if (err != 0 && strncmp(name + baselen, "recv-", 5) != 0) {
-               seq++;
-
-               (void) snprintf(newname, ZFS_MAXNAMELEN, "%.*srecv-%u-%u",
-                   baselen, name, getpid(), seq);
-               (void) strlcpy(zc.zc_value, newname, sizeof (zc.zc_value));
-
-               if (flags->verbose) {
-                       (void) printf("failed - trying rename %s to %s\n",
-                           zc.zc_name, zc.zc_value);
-               }
-               err = ioctl(hdl->libzfs_fd, ZFS_IOC_RENAME, &zc);
-               if (err == 0)
-                       changelist_rename(clp, name, newname);
-               if (err && flags->verbose) {
-                       (void) printf("failed (%u) - "
-                           "will try again on next pass\n", errno);
-               }
-               err = EAGAIN;
-       } else if (flags->verbose) {
-               if (err == 0)
-                       (void) printf("success\n");
-               else
-                       (void) printf("failed (%u)\n", errno);
-       }
-
-       (void) changelist_postfix(clp);
-       changelist_free(clp);
-
-       return (err);
-}
-
-static int
-recv_destroy(libzfs_handle_t *hdl, const char *name, int baselen,
-    char *newname, recvflags_t *flags)
-{
-       zfs_cmd_t zc = {"\0"};
-       int err = 0;
-       prop_changelist_t *clp;
-       zfs_handle_t *zhp;
-       boolean_t defer = B_FALSE;
-       int spa_version;
-
-       zhp = zfs_open(hdl, name, ZFS_TYPE_DATASET);
-       if (zhp == NULL)
-               return (-1);
-       clp = changelist_gather(zhp, ZFS_PROP_NAME, 0,
-           flags->force ? MS_FORCE : 0);
-       if (zfs_get_type(zhp) == ZFS_TYPE_SNAPSHOT &&
-           zfs_spa_version(zhp, &spa_version) == 0 &&
-           spa_version >= SPA_VERSION_USERREFS)
-               defer = B_TRUE;
-       zfs_close(zhp);
-       if (clp == NULL)
-               return (-1);
-       err = changelist_prefix(clp);
-       if (err)
-               return (err);
-
-       zc.zc_objset_type = DMU_OST_ZFS;
-       zc.zc_defer_destroy = defer;
-       (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name));
-
-       if (flags->verbose)
-               (void) printf("attempting destroy %s\n", zc.zc_name);
-       err = ioctl(hdl->libzfs_fd, ZFS_IOC_DESTROY, &zc);
-       if (err == 0) {
-               if (flags->verbose)
-                       (void) printf("success\n");
-               changelist_remove(clp, zc.zc_name);
-       }
-
-       (void) changelist_postfix(clp);
-       changelist_free(clp);
-
-       /*
-        * Deferred destroy might destroy the snapshot or only mark it to be
-        * destroyed later, and it returns success in either case.
-        */
-       if (err != 0 || (defer && zfs_dataset_exists(hdl, name,
-           ZFS_TYPE_SNAPSHOT))) {
-               err = recv_rename(hdl, name, NULL, baselen, newname, flags);
-       }
-
-       return (err);
-}
-
-typedef struct guid_to_name_data {
-       uint64_t guid;
-       char *name;
-       char *skip;
-} guid_to_name_data_t;
-
-static int
-guid_to_name_cb(zfs_handle_t *zhp, void *arg)
-{
-       guid_to_name_data_t *gtnd = arg;
-       int err;
-
-       if (gtnd->skip != NULL &&
-           strcmp(zhp->zfs_name, gtnd->skip) == 0) {
-               return (0);
-       }
-
-       if (zhp->zfs_dmustats.dds_guid == gtnd->guid) {
-               (void) strcpy(gtnd->name, zhp->zfs_name);
-               zfs_close(zhp);
-               return (EEXIST);
-       }
-
-       err = zfs_iter_children(zhp, guid_to_name_cb, gtnd);
-       zfs_close(zhp);
-       return (err);
-}
-
-/*
- * Attempt to find the local dataset associated with this guid.  In the case of
- * multiple matches, we attempt to find the "best" match by searching
- * progressively larger portions of the hierarchy.  This allows one to send a
- * tree of datasets individually and guarantee that we will find the source
- * guid within that hierarchy, even if there are multiple matches elsewhere.
- */
-static int
-guid_to_name(libzfs_handle_t *hdl, const char *parent, uint64_t guid,
-    char *name)
-{
-       /* exhaustive search all local snapshots */
-       char pname[ZFS_MAXNAMELEN];
-       guid_to_name_data_t gtnd;
-       int err = 0;
-       zfs_handle_t *zhp;
-       char *cp;
-
-       gtnd.guid = guid;
-       gtnd.name = name;
-       gtnd.skip = NULL;
-
-       (void) strlcpy(pname, parent, sizeof (pname));
-
-       /*
-        * Search progressively larger portions of the hierarchy.  This will
-        * select the "most local" version of the origin snapshot in the case
-        * that there are multiple matching snapshots in the system.
-        */
-       while ((cp = strrchr(pname, '/')) != NULL) {
-
-               /* Chop off the last component and open the parent */
-               *cp = '\0';
-               zhp = make_dataset_handle(hdl, pname);
-
-               if (zhp == NULL)
-                       continue;
-
-               err = zfs_iter_children(zhp, guid_to_name_cb, &gtnd);
-               zfs_close(zhp);
-               if (err == EEXIST)
-                       return (0);
-
-               /*
-                * Remember the dataset that we already searched, so we
-                * skip it next time through.
-                */
-               gtnd.skip = pname;
-       }
-
-       return (ENOENT);
-}
-
-/*
- * Return +1 if guid1 is before guid2, 0 if they are the same, and -1 if
- * guid1 is after guid2.
- */
-static int
-created_before(libzfs_handle_t *hdl, avl_tree_t *avl,
-    uint64_t guid1, uint64_t guid2)
-{
-       nvlist_t *nvfs;
-       char *fsname = NULL, *snapname = NULL;
-       char buf[ZFS_MAXNAMELEN];
-       int rv;
-       zfs_handle_t *guid1hdl, *guid2hdl;
-       uint64_t create1, create2;
-
-       if (guid2 == 0)
-               return (0);
-       if (guid1 == 0)
-               return (1);
-
-       nvfs = fsavl_find(avl, guid1, &snapname);
-       VERIFY(0 == nvlist_lookup_string(nvfs, "name", &fsname));
-       (void) snprintf(buf, sizeof (buf), "%s@%s", fsname, snapname);
-       guid1hdl = zfs_open(hdl, buf, ZFS_TYPE_SNAPSHOT);
-       if (guid1hdl == NULL)
-               return (-1);
-
-       nvfs = fsavl_find(avl, guid2, &snapname);
-       VERIFY(0 == nvlist_lookup_string(nvfs, "name", &fsname));
-       (void) snprintf(buf, sizeof (buf), "%s@%s", fsname, snapname);
-       guid2hdl = zfs_open(hdl, buf, ZFS_TYPE_SNAPSHOT);
-       if (guid2hdl == NULL) {
-               zfs_close(guid1hdl);
-               return (-1);
-       }
-
-       create1 = zfs_prop_get_int(guid1hdl, ZFS_PROP_CREATETXG);
-       create2 = zfs_prop_get_int(guid2hdl, ZFS_PROP_CREATETXG);
-
-       if (create1 < create2)
-               rv = -1;
-       else if (create1 > create2)
-               rv = +1;
-       else
-               rv = 0;
-
-       zfs_close(guid1hdl);
-       zfs_close(guid2hdl);
-
-       return (rv);
-}
-
-static int
-recv_incremental_replication(libzfs_handle_t *hdl, const char *tofs,
-    recvflags_t *flags, nvlist_t *stream_nv, avl_tree_t *stream_avl,
-    nvlist_t *renamed)
-{
-       nvlist_t *local_nv, *deleted = NULL;
-       avl_tree_t *local_avl;
-       nvpair_t *fselem, *nextfselem;
-       char *fromsnap;
-       char newname[ZFS_MAXNAMELEN];
-       char guidname[32];
-       int error;
-       boolean_t needagain, progress, recursive;
-       char *s1, *s2;
-
-       VERIFY(0 == nvlist_lookup_string(stream_nv, "fromsnap", &fromsnap));
-
-       recursive = (nvlist_lookup_boolean(stream_nv, "not_recursive") ==
-           ENOENT);
-
-       if (flags->dryrun)
-               return (0);
-
-again:
-       needagain = progress = B_FALSE;
-
-       VERIFY(0 == nvlist_alloc(&deleted, NV_UNIQUE_NAME, 0));
-
-       if ((error = gather_nvlist(hdl, tofs, fromsnap, NULL,
-           recursive, &local_nv, &local_avl)) != 0)
-               return (error);
-
-       /*
-        * Process deletes and renames
-        */
-       for (fselem = nvlist_next_nvpair(local_nv, NULL);
-           fselem; fselem = nextfselem) {
-               nvlist_t *nvfs, *snaps;
-               nvlist_t *stream_nvfs = NULL;
-               nvpair_t *snapelem, *nextsnapelem;
-               uint64_t fromguid = 0;
-               uint64_t originguid = 0;
-               uint64_t stream_originguid = 0;
-               uint64_t parent_fromsnap_guid, stream_parent_fromsnap_guid;
-               char *fsname, *stream_fsname;
-
-               nextfselem = nvlist_next_nvpair(local_nv, fselem);
-
-               VERIFY(0 == nvpair_value_nvlist(fselem, &nvfs));
-               VERIFY(0 == nvlist_lookup_nvlist(nvfs, "snaps", &snaps));
-               VERIFY(0 == nvlist_lookup_string(nvfs, "name", &fsname));
-               VERIFY(0 == nvlist_lookup_uint64(nvfs, "parentfromsnap",
-                   &parent_fromsnap_guid));
-               (void) nvlist_lookup_uint64(nvfs, "origin", &originguid);
-
-               /*
-                * First find the stream's fs, so we can check for
-                * a different origin (due to "zfs promote")
-                */
-               for (snapelem = nvlist_next_nvpair(snaps, NULL);
-                   snapelem; snapelem = nvlist_next_nvpair(snaps, snapelem)) {
-                       uint64_t thisguid;
-
-                       VERIFY(0 == nvpair_value_uint64(snapelem, &thisguid));
-                       stream_nvfs = fsavl_find(stream_avl, thisguid, NULL);
-
-                       if (stream_nvfs != NULL)
-                               break;
-               }
-
-               /* check for promote */
-               (void) nvlist_lookup_uint64(stream_nvfs, "origin",
-                   &stream_originguid);
-               if (stream_nvfs && originguid != stream_originguid) {
-                       switch (created_before(hdl, local_avl,
-                           stream_originguid, originguid)) {
-                       case 1: {
-                               /* promote it! */
-                               zfs_cmd_t zc = {"\0"};
-                               nvlist_t *origin_nvfs;
-                               char *origin_fsname;
-
-                               if (flags->verbose)
-                                       (void) printf("promoting %s\n", fsname);
-
-                               origin_nvfs = fsavl_find(local_avl, originguid,
-                                   NULL);
-                               VERIFY(0 == nvlist_lookup_string(origin_nvfs,
-                                   "name", &origin_fsname));
-                               (void) strlcpy(zc.zc_value, origin_fsname,
-                                   sizeof (zc.zc_value));
-                               (void) strlcpy(zc.zc_name, fsname,
-                                   sizeof (zc.zc_name));
-                               error = zfs_ioctl(hdl, ZFS_IOC_PROMOTE, &zc);
-                               if (error == 0)
-                                       progress = B_TRUE;
-                               break;
-                       }
-                       default:
-                               break;
-                       case -1:
-                               fsavl_destroy(local_avl);
-                               nvlist_free(local_nv);
-                               return (-1);
-                       }
-                       /*
-                        * We had/have the wrong origin, therefore our
-                        * list of snapshots is wrong.  Need to handle
-                        * them on the next pass.
-                        */
-                       needagain = B_TRUE;
-                       continue;
-               }
-
-               for (snapelem = nvlist_next_nvpair(snaps, NULL);
-                   snapelem; snapelem = nextsnapelem) {
-                       uint64_t thisguid;
-                       char *stream_snapname;
-                       nvlist_t *found, *props;
-
-                       nextsnapelem = nvlist_next_nvpair(snaps, snapelem);
-
-                       VERIFY(0 == nvpair_value_uint64(snapelem, &thisguid));
-                       found = fsavl_find(stream_avl, thisguid,
-                           &stream_snapname);
-
-                       /* check for delete */
-                       if (found == NULL) {
-                               char name[ZFS_MAXNAMELEN];
-
-                               if (!flags->force)
-                                       continue;
-
-                               (void) snprintf(name, sizeof (name), "%s@%s",
-                                   fsname, nvpair_name(snapelem));
-
-                               error = recv_destroy(hdl, name,
-                                   strlen(fsname)+1, newname, flags);
-                               if (error)
-                                       needagain = B_TRUE;
-                               else
-                                       progress = B_TRUE;
-                               sprintf(guidname, "%llu",
-                                   (u_longlong_t)thisguid);
-                               nvlist_add_boolean(deleted, guidname);
-                               continue;
-                       }
-
-                       stream_nvfs = found;
-
-                       if (0 == nvlist_lookup_nvlist(stream_nvfs, "snapprops",
-                           &props) && 0 == nvlist_lookup_nvlist(props,
-                           stream_snapname, &props)) {
-                               zfs_cmd_t zc = {"\0"};
-
-                               zc.zc_cookie = B_TRUE; /* received */
-                               (void) snprintf(zc.zc_name, sizeof (zc.zc_name),
-                                   "%s@%s", fsname, nvpair_name(snapelem));
-                               if (zcmd_write_src_nvlist(hdl, &zc,
-                                   props) == 0) {
-                                       (void) zfs_ioctl(hdl,
-                                           ZFS_IOC_SET_PROP, &zc);
-                                       zcmd_free_nvlists(&zc);
-                               }
-                       }
-
-                       /* check for different snapname */
-                       if (strcmp(nvpair_name(snapelem),
-                           stream_snapname) != 0) {
-                               char name[ZFS_MAXNAMELEN];
-                               char tryname[ZFS_MAXNAMELEN];
-
-                               (void) snprintf(name, sizeof (name), "%s@%s",
-                                   fsname, nvpair_name(snapelem));
-                               (void) snprintf(tryname, sizeof (name), "%s@%s",
-                                   fsname, stream_snapname);
-
-                               error = recv_rename(hdl, name, tryname,
-                                   strlen(fsname)+1, newname, flags);
-                               if (error)
-                                       needagain = B_TRUE;
-                               else
-                                       progress = B_TRUE;
-                       }
-
-                       if (strcmp(stream_snapname, fromsnap) == 0)
-                               fromguid = thisguid;
-               }
-
-               /* check for delete */
-               if (stream_nvfs == NULL) {
-                       if (!flags->force)
-                               continue;
-
-                       error = recv_destroy(hdl, fsname, strlen(tofs)+1,
-                           newname, flags);
-                       if (error)
-                               needagain = B_TRUE;
-                       else
-                               progress = B_TRUE;
-                       sprintf(guidname, "%llu",
-                           (u_longlong_t) parent_fromsnap_guid);
-                       nvlist_add_boolean(deleted, guidname);
-                       continue;
-               }
-
-               if (fromguid == 0) {
-                       if (flags->verbose) {
-                               (void) printf("local fs %s does not have "
-                                   "fromsnap (%s in stream); must have "
-                                   "been deleted locally; ignoring\n",
-                                   fsname, fromsnap);
-                       }
-                       continue;
-               }
-
-               VERIFY(0 == nvlist_lookup_string(stream_nvfs,
-                   "name", &stream_fsname));
-               VERIFY(0 == nvlist_lookup_uint64(stream_nvfs,
-                   "parentfromsnap", &stream_parent_fromsnap_guid));
-
-               s1 = strrchr(fsname, '/');
-               s2 = strrchr(stream_fsname, '/');
-
-               /*
-                * Check if we're going to rename based on parent guid change
-                * and the current parent guid was also deleted. If it was then
-                * rename will fail and is likely unneeded, so avoid this and
-                * force an early retry to determine the new
-                * parent_fromsnap_guid.
-                */
-               if (stream_parent_fromsnap_guid != 0 &&
-                   parent_fromsnap_guid != 0 &&
-                   stream_parent_fromsnap_guid != parent_fromsnap_guid) {
-                       sprintf(guidname, "%llu",
-                           (u_longlong_t) parent_fromsnap_guid);
-                       if (nvlist_exists(deleted, guidname)) {
-                               progress = B_TRUE;
-                               needagain = B_TRUE;
-                               goto doagain;
-                       }
-               }
-
-               /*
-                * Check for rename. If the exact receive path is specified, it
-                * does not count as a rename, but we still need to check the
-                * datasets beneath it.
-                */
-               if ((stream_parent_fromsnap_guid != 0 &&
-                   parent_fromsnap_guid != 0 &&
-                   stream_parent_fromsnap_guid != parent_fromsnap_guid) ||
-                   ((flags->isprefix || strcmp(tofs, fsname) != 0) &&
-                   (s1 != NULL) && (s2 != NULL) && strcmp(s1, s2) != 0)) {
-                       nvlist_t *parent;
-                       char tryname[ZFS_MAXNAMELEN];
-
-                       parent = fsavl_find(local_avl,
-                           stream_parent_fromsnap_guid, NULL);
-                       /*
-                        * NB: parent might not be found if we used the
-                        * tosnap for stream_parent_fromsnap_guid,
-                        * because the parent is a newly-created fs;
-                        * we'll be able to rename it after we recv the
-                        * new fs.
-                        */
-                       if (parent != NULL) {
-                               char *pname;
-
-                               VERIFY(0 == nvlist_lookup_string(parent, "name",
-                                   &pname));
-                               (void) snprintf(tryname, sizeof (tryname),
-                                   "%s%s", pname, strrchr(stream_fsname, '/'));
-                       } else {
-                               tryname[0] = '\0';
-                               if (flags->verbose) {
-                                       (void) printf("local fs %s new parent "
-                                           "not found\n", fsname);
-                               }
-                       }
-
-                       newname[0] = '\0';
-
-                       error = recv_rename(hdl, fsname, tryname,
-                           strlen(tofs)+1, newname, flags);
-
-                       if (renamed != NULL && newname[0] != '\0') {
-                               VERIFY(0 == nvlist_add_boolean(renamed,
-                                   newname));
-                       }
-
-                       if (error)
-                               needagain = B_TRUE;
-                       else
-                               progress = B_TRUE;
-               }
-       }
-
-doagain:
-       fsavl_destroy(local_avl);
-       nvlist_free(local_nv);
-       nvlist_free(deleted);
-
-       if (needagain && progress) {
-               /* do another pass to fix up temporary names */
-               if (flags->verbose)
-                       (void) printf("another pass:\n");
-               goto again;
-       }
-
-       return (needagain);
-}
-
-static int
-zfs_receive_package(libzfs_handle_t *hdl, int fd, const char *destname,
-    recvflags_t *flags, dmu_replay_record_t *drr, zio_cksum_t *zc,
-    char **top_zfs, int cleanup_fd, uint64_t *action_handlep)
-{
-       nvlist_t *stream_nv = NULL;
-       avl_tree_t *stream_avl = NULL;
-       char *fromsnap = NULL;
-       char *cp;
-       char tofs[ZFS_MAXNAMELEN];
-       char sendfs[ZFS_MAXNAMELEN];
-       char errbuf[1024];
-       dmu_replay_record_t drre;
-       int error;
-       boolean_t anyerr = B_FALSE;
-       boolean_t softerr = B_FALSE;
-       boolean_t recursive;
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot receive"));
-
-       assert(drr->drr_type == DRR_BEGIN);
-       assert(drr->drr_u.drr_begin.drr_magic == DMU_BACKUP_MAGIC);
-       assert(DMU_GET_STREAM_HDRTYPE(drr->drr_u.drr_begin.drr_versioninfo) ==
-           DMU_COMPOUNDSTREAM);
-
-       /*
-        * Read in the nvlist from the stream.
-        */
-       if (drr->drr_payloadlen != 0) {
-               error = recv_read_nvlist(hdl, fd, drr->drr_payloadlen,
-                   &stream_nv, flags->byteswap, zc);
-               if (error) {
-                       error = zfs_error(hdl, EZFS_BADSTREAM, errbuf);
-                       goto out;
-               }
-       }
-
-       recursive = (nvlist_lookup_boolean(stream_nv, "not_recursive") ==
-           ENOENT);
-
-       if (recursive && strchr(destname, '@')) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "cannot specify snapshot name for multi-snapshot stream"));
-               error = zfs_error(hdl, EZFS_BADSTREAM, errbuf);
-               goto out;
-       }
-
-       /*
-        * Read in the end record and verify checksum.
-        */
-       if (0 != (error = recv_read(hdl, fd, &drre, sizeof (drre),
-           flags->byteswap, NULL)))
-               goto out;
-       if (flags->byteswap) {
-               drre.drr_type = BSWAP_32(drre.drr_type);
-               drre.drr_u.drr_end.drr_checksum.zc_word[0] =
-                   BSWAP_64(drre.drr_u.drr_end.drr_checksum.zc_word[0]);
-               drre.drr_u.drr_end.drr_checksum.zc_word[1] =
-                   BSWAP_64(drre.drr_u.drr_end.drr_checksum.zc_word[1]);
-               drre.drr_u.drr_end.drr_checksum.zc_word[2] =
-                   BSWAP_64(drre.drr_u.drr_end.drr_checksum.zc_word[2]);
-               drre.drr_u.drr_end.drr_checksum.zc_word[3] =
-                   BSWAP_64(drre.drr_u.drr_end.drr_checksum.zc_word[3]);
-       }
-       if (drre.drr_type != DRR_END) {
-               error = zfs_error(hdl, EZFS_BADSTREAM, errbuf);
-               goto out;
-       }
-       if (!ZIO_CHECKSUM_EQUAL(drre.drr_u.drr_end.drr_checksum, *zc)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "incorrect header checksum"));
-               error = zfs_error(hdl, EZFS_BADSTREAM, errbuf);
-               goto out;
-       }
-
-       (void) nvlist_lookup_string(stream_nv, "fromsnap", &fromsnap);
-
-       if (drr->drr_payloadlen != 0) {
-               nvlist_t *stream_fss;
-
-               VERIFY(0 == nvlist_lookup_nvlist(stream_nv, "fss",
-                   &stream_fss));
-               if ((stream_avl = fsavl_create(stream_fss)) == NULL) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "couldn't allocate avl tree"));
-                       error = zfs_error(hdl, EZFS_NOMEM, errbuf);
-                       goto out;
-               }
-
-               if (fromsnap != NULL) {
-                       nvlist_t *renamed = NULL;
-                       nvpair_t *pair = NULL;
-
-                       (void) strlcpy(tofs, destname, ZFS_MAXNAMELEN);
-                       if (flags->isprefix) {
-                               struct drr_begin *drrb = &drr->drr_u.drr_begin;
-                               int i;
-
-                               if (flags->istail) {
-                                       cp = strrchr(drrb->drr_toname, '/');
-                                       if (cp == NULL) {
-                                               (void) strlcat(tofs, "/",
-                                                   ZFS_MAXNAMELEN);
-                                               i = 0;
-                                       } else {
-                                               i = (cp - drrb->drr_toname);
-                                       }
-                               } else {
-                                       i = strcspn(drrb->drr_toname, "/@");
-                               }
-                               /* zfs_receive_one() will create_parents() */
-                               (void) strlcat(tofs, &drrb->drr_toname[i],
-                                   ZFS_MAXNAMELEN);
-                               *strchr(tofs, '@') = '\0';
-                       }
-
-                       if (recursive && !flags->dryrun && !flags->nomount) {
-                               VERIFY(0 == nvlist_alloc(&renamed,
-                                   NV_UNIQUE_NAME, 0));
-                       }
-
-                       softerr = recv_incremental_replication(hdl, tofs, flags,
-                           stream_nv, stream_avl, renamed);
-
-                       /* Unmount renamed filesystems before receiving. */
-                       while ((pair = nvlist_next_nvpair(renamed,
-                           pair)) != NULL) {
-                               zfs_handle_t *zhp;
-                               prop_changelist_t *clp = NULL;
-
-                               zhp = zfs_open(hdl, nvpair_name(pair),
-                                   ZFS_TYPE_FILESYSTEM);
-                               if (zhp != NULL) {
-                                       clp = changelist_gather(zhp,
-                                           ZFS_PROP_MOUNTPOINT, 0, 0);
-                                       zfs_close(zhp);
-                                       if (clp != NULL) {
-                                               softerr |=
-                                                   changelist_prefix(clp);
-                                               changelist_free(clp);
-                                       }
-                               }
-                       }
-
-                       nvlist_free(renamed);
-               }
-       }
-
-       /*
-        * Get the fs specified by the first path in the stream (the top level
-        * specified by 'zfs send') and pass it to each invocation of
-        * zfs_receive_one().
-        */
-       (void) strlcpy(sendfs, drr->drr_u.drr_begin.drr_toname,
-           ZFS_MAXNAMELEN);
-       if ((cp = strchr(sendfs, '@')) != NULL)
-               *cp = '\0';
-
-       /* Finally, receive each contained stream */
-       do {
-               /*
-                * we should figure out if it has a recoverable
-                * error, in which case do a recv_skip() and drive on.
-                * Note, if we fail due to already having this guid,
-                * zfs_receive_one() will take care of it (ie,
-                * recv_skip() and return 0).
-                */
-               error = zfs_receive_impl(hdl, destname, flags, fd,
-                   sendfs, stream_nv, stream_avl, top_zfs, cleanup_fd,
-                   action_handlep);
-               if (error == ENODATA) {
-                       error = 0;
-                       break;
-               }
-               anyerr |= error;
-       } while (error == 0);
-
-       if (drr->drr_payloadlen != 0 && fromsnap != NULL) {
-               /*
-                * Now that we have the fs's they sent us, try the
-                * renames again.
-                */
-               softerr = recv_incremental_replication(hdl, tofs, flags,
-                   stream_nv, stream_avl, NULL);
-       }
-
-out:
-       fsavl_destroy(stream_avl);
-       if (stream_nv)
-               nvlist_free(stream_nv);
-       if (softerr)
-               error = -2;
-       if (anyerr)
-               error = -1;
-       return (error);
-}
-
-static void
-trunc_prop_errs(int truncated)
-{
-       ASSERT(truncated != 0);
-
-       if (truncated == 1)
-               (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
-                   "1 more property could not be set\n"));
-       else
-               (void) fprintf(stderr, dgettext(TEXT_DOMAIN,
-                   "%d more properties could not be set\n"), truncated);
-}
-
-static int
-recv_skip(libzfs_handle_t *hdl, int fd, boolean_t byteswap)
-{
-       dmu_replay_record_t *drr;
-       void *buf = zfs_alloc(hdl, SPA_MAXBLOCKSIZE);
-       char errbuf[1024];
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot receive:"));
-
-       /* XXX would be great to use lseek if possible... */
-       drr = buf;
-
-       while (recv_read(hdl, fd, drr, sizeof (dmu_replay_record_t),
-           byteswap, NULL) == 0) {
-               if (byteswap)
-                       drr->drr_type = BSWAP_32(drr->drr_type);
-
-               switch (drr->drr_type) {
-               case DRR_BEGIN:
-                       /* NB: not to be used on v2 stream packages */
-                       if (drr->drr_payloadlen != 0) {
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "invalid substream header"));
-                               return (zfs_error(hdl, EZFS_BADSTREAM, errbuf));
-                       }
-                       break;
-
-               case DRR_END:
-                       free(buf);
-                       return (0);
-
-               case DRR_OBJECT:
-                       if (byteswap) {
-                               drr->drr_u.drr_object.drr_bonuslen =
-                                   BSWAP_32(drr->drr_u.drr_object.
-                                   drr_bonuslen);
-                       }
-                       (void) recv_read(hdl, fd, buf,
-                           P2ROUNDUP(drr->drr_u.drr_object.drr_bonuslen, 8),
-                           B_FALSE, NULL);
-                       break;
-
-               case DRR_WRITE:
-                       if (byteswap) {
-                               drr->drr_u.drr_write.drr_length =
-                                   BSWAP_64(drr->drr_u.drr_write.drr_length);
-                       }
-                       (void) recv_read(hdl, fd, buf,
-                           drr->drr_u.drr_write.drr_length, B_FALSE, NULL);
-                       break;
-               case DRR_SPILL:
-                       if (byteswap) {
-                               drr->drr_u.drr_write.drr_length =
-                                   BSWAP_64(drr->drr_u.drr_spill.drr_length);
-                       }
-                       (void) recv_read(hdl, fd, buf,
-                           drr->drr_u.drr_spill.drr_length, B_FALSE, NULL);
-                       break;
-               case DRR_WRITE_EMBEDDED:
-                       if (byteswap) {
-                               drr->drr_u.drr_write_embedded.drr_psize =
-                                   BSWAP_32(drr->drr_u.drr_write_embedded.
-                                   drr_psize);
-                       }
-                       (void) recv_read(hdl, fd, buf,
-                           P2ROUNDUP(drr->drr_u.drr_write_embedded.drr_psize,
-                           8), B_FALSE, NULL);
-                       break;
-               case DRR_WRITE_BYREF:
-               case DRR_FREEOBJECTS:
-               case DRR_FREE:
-                       break;
-
-               default:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid record type"));
-                       return (zfs_error(hdl, EZFS_BADSTREAM, errbuf));
-               }
-       }
-
-       free(buf);
-       return (-1);
-}
-
-/*
- * Restores a backup of tosnap from the file descriptor specified by infd.
- */
-static int
-zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap,
-    recvflags_t *flags, dmu_replay_record_t *drr,
-    dmu_replay_record_t *drr_noswap, const char *sendfs,
-    nvlist_t *stream_nv, avl_tree_t *stream_avl, char **top_zfs, int cleanup_fd,
-    uint64_t *action_handlep)
-{
-       zfs_cmd_t zc = {"\0"};
-       time_t begin_time;
-       int ioctl_err, ioctl_errno, err;
-       char *cp;
-       struct drr_begin *drrb = &drr->drr_u.drr_begin;
-       char errbuf[1024];
-       char prop_errbuf[1024];
-       const char *chopprefix;
-       boolean_t newfs = B_FALSE;
-       boolean_t stream_wantsnewfs;
-       uint64_t parent_snapguid = 0;
-       prop_changelist_t *clp = NULL;
-       nvlist_t *snapprops_nvlist = NULL;
-       zprop_errflags_t prop_errflags;
-       boolean_t recursive;
-
-       begin_time = time(NULL);
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot receive"));
-
-       recursive = (nvlist_lookup_boolean(stream_nv, "not_recursive") ==
-           ENOENT);
-
-       if (stream_avl != NULL) {
-               char *snapname;
-               nvlist_t *fs = fsavl_find(stream_avl, drrb->drr_toguid,
-                   &snapname);
-               nvlist_t *props;
-               int ret;
-
-               (void) nvlist_lookup_uint64(fs, "parentfromsnap",
-                   &parent_snapguid);
-               err = nvlist_lookup_nvlist(fs, "props", &props);
-               if (err)
-                       VERIFY(0 == nvlist_alloc(&props, NV_UNIQUE_NAME, 0));
-
-               if (flags->canmountoff) {
-                       VERIFY(0 == nvlist_add_uint64(props,
-                           zfs_prop_to_name(ZFS_PROP_CANMOUNT), 0));
-               }
-               ret = zcmd_write_src_nvlist(hdl, &zc, props);
-               if (err)
-                       nvlist_free(props);
-               if (ret != 0)
-                       return (-1);
-       }
-
-       cp = NULL;
-
-       /*
-        * Determine how much of the snapshot name stored in the stream
-        * we are going to tack on to the name they specified on the
-        * command line, and how much we are going to chop off.
-        *
-        * If they specified a snapshot, chop the entire name stored in
-        * the stream.
-        */
-       if (flags->istail) {
-               /*
-                * A filesystem was specified with -e. We want to tack on only
-                * the tail of the sent snapshot path.
-                */
-               if (strchr(tosnap, '@')) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid "
-                           "argument - snapshot not allowed with -e"));
-                       return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-               }
-
-               chopprefix = strrchr(sendfs, '/');
-
-               if (chopprefix == NULL) {
-                       /*
-                        * The tail is the poolname, so we need to
-                        * prepend a path separator.
-                        */
-                       int len = strlen(drrb->drr_toname);
-                       cp = malloc(len + 2);
-                       cp[0] = '/';
-                       (void) strcpy(&cp[1], drrb->drr_toname);
-                       chopprefix = cp;
-               } else {
-                       chopprefix = drrb->drr_toname + (chopprefix - sendfs);
-               }
-       } else if (flags->isprefix) {
-               /*
-                * A filesystem was specified with -d. We want to tack on
-                * everything but the first element of the sent snapshot path
-                * (all but the pool name).
-                */
-               if (strchr(tosnap, '@')) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid "
-                           "argument - snapshot not allowed with -d"));
-                       return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-               }
-
-               chopprefix = strchr(drrb->drr_toname, '/');
-               if (chopprefix == NULL)
-                       chopprefix = strchr(drrb->drr_toname, '@');
-       } else if (strchr(tosnap, '@') == NULL) {
-               /*
-                * If a filesystem was specified without -d or -e, we want to
-                * tack on everything after the fs specified by 'zfs send'.
-                */
-               chopprefix = drrb->drr_toname + strlen(sendfs);
-       } else {
-               /* A snapshot was specified as an exact path (no -d or -e). */
-               if (recursive) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "cannot specify snapshot name for multi-snapshot "
-                           "stream"));
-                       return (zfs_error(hdl, EZFS_BADSTREAM, errbuf));
-               }
-               chopprefix = drrb->drr_toname + strlen(drrb->drr_toname);
-       }
-
-       ASSERT(strstr(drrb->drr_toname, sendfs) == drrb->drr_toname);
-       ASSERT(chopprefix > drrb->drr_toname);
-       ASSERT(chopprefix <= drrb->drr_toname + strlen(drrb->drr_toname));
-       ASSERT(chopprefix[0] == '/' || chopprefix[0] == '@' ||
-           chopprefix[0] == '\0');
-
-       /*
-        * Determine name of destination snapshot, store in zc_value.
-        */
-       (void) strcpy(zc.zc_value, tosnap);
-       (void) strlcat(zc.zc_value, chopprefix, sizeof (zc.zc_value));
-       free(cp);
-       if (!zfs_name_valid(zc.zc_value, ZFS_TYPE_SNAPSHOT)) {
-               zcmd_free_nvlists(&zc);
-               return (zfs_error(hdl, EZFS_INVALIDNAME, errbuf));
-       }
-
-       /*
-        * Determine the name of the origin snapshot, store in zc_string.
-        */
-       if (drrb->drr_flags & DRR_FLAG_CLONE) {
-               if (guid_to_name(hdl, zc.zc_value,
-                   drrb->drr_fromguid, zc.zc_string) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "local origin for clone %s does not exist"),
-                           zc.zc_value);
-                       return (zfs_error(hdl, EZFS_NOENT, errbuf));
-               }
-               if (flags->verbose)
-                       (void) printf("found clone origin %s\n", zc.zc_string);
-       }
-
-       stream_wantsnewfs = (drrb->drr_fromguid == 0 ||
-           (drrb->drr_flags & DRR_FLAG_CLONE));
-
-       if (stream_wantsnewfs) {
-               /*
-                * if the parent fs does not exist, look for it based on
-                * the parent snap GUID
-                */
-               (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-                   "cannot receive new filesystem stream"));
-
-               (void) strcpy(zc.zc_name, zc.zc_value);
-               cp = strrchr(zc.zc_name, '/');
-               if (cp)
-                       *cp = '\0';
-               if (cp &&
-                   !zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) {
-                       char suffix[ZFS_MAXNAMELEN];
-                       (void) strcpy(suffix, strrchr(zc.zc_value, '/'));
-                       if (guid_to_name(hdl, zc.zc_name, parent_snapguid,
-                           zc.zc_value) == 0) {
-                               *strchr(zc.zc_value, '@') = '\0';
-                               (void) strcat(zc.zc_value, suffix);
-                       }
-               }
-       } else {
-               /*
-                * if the fs does not exist, look for it based on the
-                * fromsnap GUID
-                */
-               (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-                   "cannot receive incremental stream"));
-
-               (void) strcpy(zc.zc_name, zc.zc_value);
-               *strchr(zc.zc_name, '@') = '\0';
-
-               /*
-                * If the exact receive path was specified and this is the
-                * topmost path in the stream, then if the fs does not exist we
-                * should look no further.
-                */
-               if ((flags->isprefix || (*(chopprefix = drrb->drr_toname +
-                   strlen(sendfs)) != '\0' && *chopprefix != '@')) &&
-                   !zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) {
-                       char snap[ZFS_MAXNAMELEN];
-                       (void) strcpy(snap, strchr(zc.zc_value, '@'));
-                       if (guid_to_name(hdl, zc.zc_name, drrb->drr_fromguid,
-                           zc.zc_value) == 0) {
-                               *strchr(zc.zc_value, '@') = '\0';
-                               (void) strcat(zc.zc_value, snap);
-                       }
-               }
-       }
-
-       (void) strcpy(zc.zc_name, zc.zc_value);
-       *strchr(zc.zc_name, '@') = '\0';
-
-       if (zfs_dataset_exists(hdl, zc.zc_name, ZFS_TYPE_DATASET)) {
-               zfs_handle_t *zhp;
-
-               /*
-                * Destination fs exists.  Therefore this should either
-                * be an incremental, or the stream specifies a new fs
-                * (full stream or clone) and they want us to blow it
-                * away (and have therefore specified -F and removed any
-                * snapshots).
-                */
-               if (stream_wantsnewfs) {
-                       if (!flags->force) {
-                               zcmd_free_nvlists(&zc);
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "destination '%s' exists\n"
-                                   "must specify -F to overwrite it"),
-                                   zc.zc_name);
-                               return (zfs_error(hdl, EZFS_EXISTS, errbuf));
-                       }
-                       if (ioctl(hdl->libzfs_fd, ZFS_IOC_SNAPSHOT_LIST_NEXT,
-                           &zc) == 0) {
-                               zcmd_free_nvlists(&zc);
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "destination has snapshots (eg. %s)\n"
-                                   "must destroy them to overwrite it"),
-                                   zc.zc_name);
-                               return (zfs_error(hdl, EZFS_EXISTS, errbuf));
-                       }
-               }
-
-               if ((zhp = zfs_open(hdl, zc.zc_name,
-                   ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME)) == NULL) {
-                       zcmd_free_nvlists(&zc);
-                       return (-1);
-               }
-
-               if (stream_wantsnewfs &&
-                   zhp->zfs_dmustats.dds_origin[0]) {
-                       zcmd_free_nvlists(&zc);
-                       zfs_close(zhp);
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "destination '%s' is a clone\n"
-                           "must destroy it to overwrite it"),
-                           zc.zc_name);
-                       return (zfs_error(hdl, EZFS_EXISTS, errbuf));
-               }
-
-               if (!flags->dryrun && zhp->zfs_type == ZFS_TYPE_FILESYSTEM &&
-                   stream_wantsnewfs) {
-                       /* We can't do online recv in this case */
-                       clp = changelist_gather(zhp, ZFS_PROP_NAME, 0, 0);
-                       if (clp == NULL) {
-                               zfs_close(zhp);
-                               zcmd_free_nvlists(&zc);
-                               return (-1);
-                       }
-                       if (changelist_prefix(clp) != 0) {
-                               changelist_free(clp);
-                               zfs_close(zhp);
-                               zcmd_free_nvlists(&zc);
-                               return (-1);
-                       }
-               }
-               zfs_close(zhp);
-       } else {
-               /*
-                * Destination filesystem does not exist.  Therefore we better
-                * be creating a new filesystem (either from a full backup, or
-                * a clone).  It would therefore be invalid if the user
-                * specified only the pool name (i.e. if the destination name
-                * contained no slash character).
-                */
-               if (!stream_wantsnewfs ||
-                   (cp = strrchr(zc.zc_name, '/')) == NULL) {
-                       zcmd_free_nvlists(&zc);
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "destination '%s' does not exist"), zc.zc_name);
-                       return (zfs_error(hdl, EZFS_NOENT, errbuf));
-               }
-
-               /*
-                * Trim off the final dataset component so we perform the
-                * recvbackup ioctl to the filesystems's parent.
-                */
-               *cp = '\0';
-
-               if (flags->isprefix && !flags->istail && !flags->dryrun &&
-                   create_parents(hdl, zc.zc_value, strlen(tosnap)) != 0) {
-                       zcmd_free_nvlists(&zc);
-                       return (zfs_error(hdl, EZFS_BADRESTORE, errbuf));
-               }
-
-               newfs = B_TRUE;
-       }
-
-       zc.zc_begin_record = drr_noswap->drr_u.drr_begin;
-       zc.zc_cookie = infd;
-       zc.zc_guid = flags->force;
-       if (flags->verbose) {
-               (void) printf("%s %s stream of %s into %s\n",
-                   flags->dryrun ? "would receive" : "receiving",
-                   drrb->drr_fromguid ? "incremental" : "full",
-                   drrb->drr_toname, zc.zc_value);
-               (void) fflush(stdout);
-       }
-
-       if (flags->dryrun) {
-               zcmd_free_nvlists(&zc);
-               return (recv_skip(hdl, infd, flags->byteswap));
-       }
-
-       zc.zc_nvlist_dst = (uint64_t)(uintptr_t)prop_errbuf;
-       zc.zc_nvlist_dst_size = sizeof (prop_errbuf);
-       zc.zc_cleanup_fd = cleanup_fd;
-       zc.zc_action_handle = *action_handlep;
-
-       err = ioctl_err = zfs_ioctl(hdl, ZFS_IOC_RECV, &zc);
-       ioctl_errno = errno;
-       prop_errflags = (zprop_errflags_t)zc.zc_obj;
-
-       if (err == 0) {
-               nvlist_t *prop_errors;
-               VERIFY(0 == nvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
-                   zc.zc_nvlist_dst_size, &prop_errors, 0));
-
-               nvpair_t *prop_err = NULL;
-
-               while ((prop_err = nvlist_next_nvpair(prop_errors,
-                   prop_err)) != NULL) {
-                       char tbuf[1024];
-                       zfs_prop_t prop;
-                       int intval;
-
-                       prop = zfs_name_to_prop(nvpair_name(prop_err));
-                       (void) nvpair_value_int32(prop_err, &intval);
-                       if (strcmp(nvpair_name(prop_err),
-                           ZPROP_N_MORE_ERRORS) == 0) {
-                               trunc_prop_errs(intval);
-                               break;
-                       } else {
-                               (void) snprintf(tbuf, sizeof (tbuf),
-                                   dgettext(TEXT_DOMAIN,
-                                   "cannot receive %s property on %s"),
-                                   nvpair_name(prop_err), zc.zc_name);
-                               zfs_setprop_error(hdl, prop, intval, tbuf);
-                       }
-               }
-               nvlist_free(prop_errors);
-       }
-
-       zc.zc_nvlist_dst = 0;
-       zc.zc_nvlist_dst_size = 0;
-       zcmd_free_nvlists(&zc);
-
-       if (err == 0 && snapprops_nvlist) {
-               zfs_cmd_t zc2 = {"\0"};
-
-               (void) strcpy(zc2.zc_name, zc.zc_value);
-               zc2.zc_cookie = B_TRUE; /* received */
-               if (zcmd_write_src_nvlist(hdl, &zc2, snapprops_nvlist) == 0) {
-                       (void) zfs_ioctl(hdl, ZFS_IOC_SET_PROP, &zc2);
-                       zcmd_free_nvlists(&zc2);
-               }
-       }
-
-       if (err && (ioctl_errno == ENOENT || ioctl_errno == EEXIST)) {
-               /*
-                * It may be that this snapshot already exists,
-                * in which case we want to consume & ignore it
-                * rather than failing.
-                */
-               avl_tree_t *local_avl;
-               nvlist_t *local_nv, *fs;
-               cp = strchr(zc.zc_value, '@');
-
-               /*
-                * XXX Do this faster by just iterating over snaps in
-                * this fs.  Also if zc_value does not exist, we will
-                * get a strange "does not exist" error message.
-                */
-               *cp = '\0';
-               if (gather_nvlist(hdl, zc.zc_value, NULL, NULL, B_FALSE,
-                   &local_nv, &local_avl) == 0) {
-                       *cp = '@';
-                       fs = fsavl_find(local_avl, drrb->drr_toguid, NULL);
-                       fsavl_destroy(local_avl);
-                       nvlist_free(local_nv);
-
-                       if (fs != NULL) {
-                               if (flags->verbose) {
-                                       (void) printf("snap %s already exists; "
-                                           "ignoring\n", zc.zc_value);
-                               }
-                               err = ioctl_err = recv_skip(hdl, infd,
-                                   flags->byteswap);
-                       }
-               }
-               *cp = '@';
-       }
-
-       if (ioctl_err != 0) {
-               switch (ioctl_errno) {
-               case ENODEV:
-                       cp = strchr(zc.zc_value, '@');
-                       *cp = '\0';
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "most recent snapshot of %s does not\n"
-                           "match incremental source"), zc.zc_value);
-                       (void) zfs_error(hdl, EZFS_BADRESTORE, errbuf);
-                       *cp = '@';
-                       break;
-               case ETXTBSY:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "destination %s has been modified\n"
-                           "since most recent snapshot"), zc.zc_name);
-                       (void) zfs_error(hdl, EZFS_BADRESTORE, errbuf);
-                       break;
-               case EEXIST:
-                       cp = strchr(zc.zc_value, '@');
-                       if (newfs) {
-                               /* it's the containing fs that exists */
-                               *cp = '\0';
-                       }
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "destination already exists"));
-                       (void) zfs_error_fmt(hdl, EZFS_EXISTS,
-                           dgettext(TEXT_DOMAIN, "cannot restore to %s"),
-                           zc.zc_value);
-                       *cp = '@';
-                       break;
-               case EINVAL:
-                       (void) zfs_error(hdl, EZFS_BADSTREAM, errbuf);
-                       break;
-               case ECKSUM:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid stream (checksum mismatch)"));
-                       (void) zfs_error(hdl, EZFS_BADSTREAM, errbuf);
-                       break;
-               case ENOTSUP:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "pool must be upgraded to receive this stream."));
-                       (void) zfs_error(hdl, EZFS_BADVERSION, errbuf);
-                       break;
-               case EDQUOT:
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "destination %s space quota exceeded"), zc.zc_name);
-                       (void) zfs_error(hdl, EZFS_NOSPC, errbuf);
-                       break;
-               default:
-                       (void) zfs_standard_error(hdl, ioctl_errno, errbuf);
-               }
-       }
-
-       /*
-        * Mount the target filesystem (if created).  Also mount any
-        * children of the target filesystem if we did a replication
-        * receive (indicated by stream_avl being non-NULL).
-        */
-       cp = strchr(zc.zc_value, '@');
-       if (cp && (ioctl_err == 0 || !newfs)) {
-               zfs_handle_t *h;
-
-               *cp = '\0';
-               h = zfs_open(hdl, zc.zc_value,
-                   ZFS_TYPE_FILESYSTEM | ZFS_TYPE_VOLUME);
-               if (h != NULL) {
-                       if (h->zfs_type == ZFS_TYPE_VOLUME) {
-                               *cp = '@';
-                       } else if (newfs || stream_avl) {
-                               /*
-                                * Track the first/top of hierarchy fs,
-                                * for mounting and sharing later.
-                                */
-                               if (top_zfs && *top_zfs == NULL)
-                                       *top_zfs = zfs_strdup(hdl, zc.zc_value);
-                       }
-                       zfs_close(h);
-               }
-               *cp = '@';
-       }
-
-       if (clp) {
-               err |= changelist_postfix(clp);
-               changelist_free(clp);
-       }
-
-       if (prop_errflags & ZPROP_ERR_NOCLEAR) {
-               (void) fprintf(stderr, dgettext(TEXT_DOMAIN, "Warning: "
-                   "failed to clear unreceived properties on %s"),
-                   zc.zc_name);
-               (void) fprintf(stderr, "\n");
-       }
-       if (prop_errflags & ZPROP_ERR_NORESTORE) {
-               (void) fprintf(stderr, dgettext(TEXT_DOMAIN, "Warning: "
-                   "failed to restore original properties on %s"),
-                   zc.zc_name);
-               (void) fprintf(stderr, "\n");
-       }
-
-       if (err || ioctl_err)
-               return (-1);
-
-       *action_handlep = zc.zc_action_handle;
-
-       if (flags->verbose) {
-               char buf1[64];
-               char buf2[64];
-               uint64_t bytes = zc.zc_cookie;
-               time_t delta = time(NULL) - begin_time;
-               if (delta == 0)
-                       delta = 1;
-               zfs_nicenum(bytes, buf1, sizeof (buf1));
-               zfs_nicenum(bytes/delta, buf2, sizeof (buf1));
-
-               (void) printf("received %sB stream in %lu seconds (%sB/sec)\n",
-                   buf1, delta, buf2);
-       }
-
-       return (0);
-}
-
-static int
-zfs_receive_impl(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
-    int infd, const char *sendfs, nvlist_t *stream_nv, avl_tree_t *stream_avl,
-    char **top_zfs, int cleanup_fd, uint64_t *action_handlep)
-{
-       int err;
-       dmu_replay_record_t drr, drr_noswap;
-       struct drr_begin *drrb = &drr.drr_u.drr_begin;
-       char errbuf[1024];
-       zio_cksum_t zcksum = { { 0 } };
-       uint64_t featureflags;
-       int hdrtype;
-
-       (void) snprintf(errbuf, sizeof (errbuf), dgettext(TEXT_DOMAIN,
-           "cannot receive"));
-
-       if (flags->isprefix &&
-           !zfs_dataset_exists(hdl, tosnap, ZFS_TYPE_DATASET)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "specified fs "
-                   "(%s) does not exist"), tosnap);
-               return (zfs_error(hdl, EZFS_NOENT, errbuf));
-       }
-
-       /* read in the BEGIN record */
-       if (0 != (err = recv_read(hdl, infd, &drr, sizeof (drr), B_FALSE,
-           &zcksum)))
-               return (err);
-
-       if (drr.drr_type == DRR_END || drr.drr_type == BSWAP_32(DRR_END)) {
-               /* It's the double end record at the end of a package */
-               return (ENODATA);
-       }
-
-       /* the kernel needs the non-byteswapped begin record */
-       drr_noswap = drr;
-
-       flags->byteswap = B_FALSE;
-       if (drrb->drr_magic == BSWAP_64(DMU_BACKUP_MAGIC)) {
-               /*
-                * We computed the checksum in the wrong byteorder in
-                * recv_read() above; do it again correctly.
-                */
-               bzero(&zcksum, sizeof (zio_cksum_t));
-               fletcher_4_incremental_byteswap(&drr, sizeof (drr), &zcksum);
-               flags->byteswap = B_TRUE;
-
-               drr.drr_type = BSWAP_32(drr.drr_type);
-               drr.drr_payloadlen = BSWAP_32(drr.drr_payloadlen);
-               drrb->drr_magic = BSWAP_64(drrb->drr_magic);
-               drrb->drr_versioninfo = BSWAP_64(drrb->drr_versioninfo);
-               drrb->drr_creation_time = BSWAP_64(drrb->drr_creation_time);
-               drrb->drr_type = BSWAP_32(drrb->drr_type);
-               drrb->drr_flags = BSWAP_32(drrb->drr_flags);
-               drrb->drr_toguid = BSWAP_64(drrb->drr_toguid);
-               drrb->drr_fromguid = BSWAP_64(drrb->drr_fromguid);
-       }
-
-       if (drrb->drr_magic != DMU_BACKUP_MAGIC || drr.drr_type != DRR_BEGIN) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid "
-                   "stream (bad magic number)"));
-               return (zfs_error(hdl, EZFS_BADSTREAM, errbuf));
-       }
-
-       featureflags = DMU_GET_FEATUREFLAGS(drrb->drr_versioninfo);
-       hdrtype = DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo);
-
-       if (!DMU_STREAM_SUPPORTED(featureflags) ||
-           (hdrtype != DMU_SUBSTREAM && hdrtype != DMU_COMPOUNDSTREAM)) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "stream has unsupported feature, feature flags = %lx"),
-                   featureflags);
-               return (zfs_error(hdl, EZFS_BADSTREAM, errbuf));
-       }
-
-       if (strchr(drrb->drr_toname, '@') == NULL) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "invalid "
-                   "stream (bad snapshot name)"));
-               return (zfs_error(hdl, EZFS_BADSTREAM, errbuf));
-       }
-
-       if (DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) == DMU_SUBSTREAM) {
-               char nonpackage_sendfs[ZFS_MAXNAMELEN];
-               if (sendfs == NULL) {
-                       /*
-                        * We were not called from zfs_receive_package(). Get
-                        * the fs specified by 'zfs send'.
-                        */
-                       char *cp;
-                       (void) strlcpy(nonpackage_sendfs,
-                           drr.drr_u.drr_begin.drr_toname, ZFS_MAXNAMELEN);
-                       if ((cp = strchr(nonpackage_sendfs, '@')) != NULL)
-                               *cp = '\0';
-                       sendfs = nonpackage_sendfs;
-               }
-               return (zfs_receive_one(hdl, infd, tosnap, flags,
-                   &drr, &drr_noswap, sendfs, stream_nv, stream_avl,
-                   top_zfs, cleanup_fd, action_handlep));
-       } else {
-               assert(DMU_GET_STREAM_HDRTYPE(drrb->drr_versioninfo) ==
-                   DMU_COMPOUNDSTREAM);
-               return (zfs_receive_package(hdl, infd, tosnap, flags,
-                   &drr, &zcksum, top_zfs, cleanup_fd, action_handlep));
-       }
-}
-
-/*
- * Restores a backup of tosnap from the file descriptor specified by infd.
- * Return 0 on total success, -2 if some things couldn't be
- * destroyed/renamed/promoted, -1 if some things couldn't be received.
- * (-1 will override -2).
- */
-int
-zfs_receive(libzfs_handle_t *hdl, const char *tosnap, recvflags_t *flags,
-    int infd, avl_tree_t *stream_avl)
-{
-       char *top_zfs = NULL;
-       int err;
-       int cleanup_fd;
-       uint64_t action_handle = 0;
-       struct stat sb;
-
-       /*
-        * The only way fstat can fail is if we do not have a valid file
-        * descriptor.
-        */
-       if (fstat(infd, &sb) == -1) {
-               perror("fstat");
-               return (-2);
-       }
-
-#ifdef __linux__
-#ifndef F_SETPIPE_SZ
-#define        F_SETPIPE_SZ (F_SETLEASE + 7)
-#endif /* F_SETPIPE_SZ */
-
-#ifndef F_GETPIPE_SZ
-#define        F_GETPIPE_SZ (F_GETLEASE + 7)
-#endif /* F_GETPIPE_SZ */
-
-       /*
-        * It is not uncommon for gigabytes to be processed in zfs receive.
-        * Speculatively increase the buffer size via Linux-specific fcntl()
-        * call.
-        */
-       if (S_ISFIFO(sb.st_mode)) {
-               FILE *procf = fopen("/proc/sys/fs/pipe-max-size", "r");
-
-               if (procf != NULL) {
-                       unsigned long max_psize;
-                       long cur_psize;
-                       if (fscanf(procf, "%lu", &max_psize) > 0) {
-                               cur_psize = fcntl(infd, F_GETPIPE_SZ);
-                               if (cur_psize > 0 &&
-                                   max_psize > (unsigned long) cur_psize)
-                                       (void) fcntl(infd, F_SETPIPE_SZ,
-                                           max_psize);
-                       }
-                       fclose(procf);
-               }
-       }
-#endif /* __linux__ */
-
-       cleanup_fd = open(ZFS_DEV, O_RDWR);
-       VERIFY(cleanup_fd >= 0);
-
-       err = zfs_receive_impl(hdl, tosnap, flags, infd, NULL, NULL,
-           stream_avl, &top_zfs, cleanup_fd, &action_handle);
-
-       VERIFY(0 == close(cleanup_fd));
-
-       if (err == 0 && !flags->nomount && top_zfs) {
-               zfs_handle_t *zhp;
-               prop_changelist_t *clp;
-
-               zhp = zfs_open(hdl, top_zfs, ZFS_TYPE_FILESYSTEM);
-               if (zhp != NULL) {
-                       clp = changelist_gather(zhp, ZFS_PROP_MOUNTPOINT,
-                           CL_GATHER_MOUNT_ALWAYS, 0);
-                       zfs_close(zhp);
-                       if (clp != NULL) {
-                               /* mount and share received datasets */
-                               err = changelist_postfix(clp);
-                               changelist_free(clp);
-                       }
-               }
-               if (zhp == NULL || clp == NULL || err)
-                       err = -1;
-       }
-       if (top_zfs)
-               free(top_zfs);
-
-       return (err);
-}
diff --git a/zfs/lib/libzfs/libzfs_status.c b/zfs/lib/libzfs/libzfs_status.c
deleted file mode 100644 (file)
index f69bd45..0000000
+++ /dev/null
@@ -1,462 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- * Copyright (c) 2013 Steven Hartland. All rights reserved.
- */
-
-/*
- * This file contains the functions which analyze the status of a pool.  This
- * include both the status of an active pool, as well as the status exported
- * pools.  Returns one of the ZPOOL_STATUS_* defines describing the status of
- * the pool.  This status is independent (to a certain degree) from the state of
- * the pool.  A pool's state describes only whether or not it is capable of
- * providing the necessary fault tolerance for data.  The status describes the
- * overall status of devices.  A pool that is online can still have a device
- * that is experiencing errors.
- *
- * Only a subset of the possible faults can be detected using 'zpool status',
- * and not all possible errors correspond to a FMA message ID.  The explanation
- * is left up to the caller, depending on whether it is a live pool or an
- * import.
- */
-
-#include <libzfs.h>
-#include <string.h>
-#include <unistd.h>
-#include "libzfs_impl.h"
-#include "zfeature_common.h"
-
-/*
- * Message ID table.  This must be kept in sync with the ZPOOL_STATUS_* defines
- * in libzfs.h.  Note that there are some status results which go past the end
- * of this table, and hence have no associated message ID.
- */
-static char *zfs_msgid_table[] = {
-       "ZFS-8000-14",
-       "ZFS-8000-2Q",
-       "ZFS-8000-3C",
-       "ZFS-8000-4J",
-       "ZFS-8000-5E",
-       "ZFS-8000-6X",
-       "ZFS-8000-72",
-       "ZFS-8000-8A",
-       "ZFS-8000-9P",
-       "ZFS-8000-A5",
-       "ZFS-8000-EY",
-       "ZFS-8000-HC",
-       "ZFS-8000-JQ",
-       "ZFS-8000-K4",
-       "ZFS-8000-ER",
-};
-
-#define        NMSGID  (sizeof (zfs_msgid_table) / sizeof (zfs_msgid_table[0]))
-
-/* ARGSUSED */
-static int
-vdev_missing(uint64_t state, uint64_t aux, uint64_t errs)
-{
-       return (state == VDEV_STATE_CANT_OPEN &&
-           aux == VDEV_AUX_OPEN_FAILED);
-}
-
-/* ARGSUSED */
-static int
-vdev_faulted(uint64_t state, uint64_t aux, uint64_t errs)
-{
-       return (state == VDEV_STATE_FAULTED);
-}
-
-/* ARGSUSED */
-static int
-vdev_errors(uint64_t state, uint64_t aux, uint64_t errs)
-{
-       return (state == VDEV_STATE_DEGRADED || errs != 0);
-}
-
-/* ARGSUSED */
-static int
-vdev_broken(uint64_t state, uint64_t aux, uint64_t errs)
-{
-       return (state == VDEV_STATE_CANT_OPEN);
-}
-
-/* ARGSUSED */
-static int
-vdev_offlined(uint64_t state, uint64_t aux, uint64_t errs)
-{
-       return (state == VDEV_STATE_OFFLINE);
-}
-
-/* ARGSUSED */
-static int
-vdev_removed(uint64_t state, uint64_t aux, uint64_t errs)
-{
-       return (state == VDEV_STATE_REMOVED);
-}
-
-/*
- * Detect if any leaf devices that have seen errors or could not be opened.
- */
-static boolean_t
-find_vdev_problem(nvlist_t *vdev, int (*func)(uint64_t, uint64_t, uint64_t))
-{
-       nvlist_t **child;
-       vdev_stat_t *vs;
-       uint_t c, children;
-       char *type;
-
-       /*
-        * Ignore problems within a 'replacing' vdev, since we're presumably in
-        * the process of repairing any such errors, and don't want to call them
-        * out again.  We'll pick up the fact that a resilver is happening
-        * later.
-        */
-       verify(nvlist_lookup_string(vdev, ZPOOL_CONFIG_TYPE, &type) == 0);
-       if (strcmp(type, VDEV_TYPE_REPLACING) == 0)
-               return (B_FALSE);
-
-       if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_CHILDREN, &child,
-           &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if (find_vdev_problem(child[c], func))
-                               return (B_TRUE);
-       } else {
-               verify(nvlist_lookup_uint64_array(vdev, ZPOOL_CONFIG_VDEV_STATS,
-                   (uint64_t **)&vs, &c) == 0);
-
-               if (func(vs->vs_state, vs->vs_aux,
-                   vs->vs_read_errors +
-                   vs->vs_write_errors +
-                   vs->vs_checksum_errors))
-                       return (B_TRUE);
-       }
-
-       /*
-        * Check any L2 cache devs
-        */
-       if (nvlist_lookup_nvlist_array(vdev, ZPOOL_CONFIG_L2CACHE, &child,
-           &children) == 0) {
-               for (c = 0; c < children; c++)
-                       if (find_vdev_problem(child[c], func))
-                               return (B_TRUE);
-       }
-
-       return (B_FALSE);
-}
-
-/*
- * Active pool health status.
- *
- * To determine the status for a pool, we make several passes over the config,
- * picking the most egregious error we find.  In order of importance, we do the
- * following:
- *
- *     - Check for a complete and valid configuration
- *     - Look for any faulted or missing devices in a non-replicated config
- *     - Check for any data errors
- *     - Check for any faulted or missing devices in a replicated config
- *     - Look for any devices showing errors
- *     - Check for any resilvering devices
- *
- * There can obviously be multiple errors within a single pool, so this routine
- * only picks the most damaging of all the current errors to report.
- */
-static zpool_status_t
-check_status(nvlist_t *config, boolean_t isimport, zpool_errata_t *erratap)
-{
-       nvlist_t *nvroot;
-       vdev_stat_t *vs;
-       pool_scan_stat_t *ps = NULL;
-       uint_t vsc, psc;
-       uint64_t nerr;
-       uint64_t version;
-       uint64_t stateval;
-       uint64_t suspended;
-       uint64_t hostid = 0;
-       uint64_t errata = 0;
-       unsigned long system_hostid = get_system_hostid();
-
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_VERSION,
-           &version) == 0);
-       verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-       verify(nvlist_lookup_uint64_array(nvroot, ZPOOL_CONFIG_VDEV_STATS,
-           (uint64_t **)&vs, &vsc) == 0);
-       verify(nvlist_lookup_uint64(config, ZPOOL_CONFIG_POOL_STATE,
-           &stateval) == 0);
-
-       /*
-        * Currently resilvering a vdev
-        */
-       (void) nvlist_lookup_uint64_array(nvroot, ZPOOL_CONFIG_SCAN_STATS,
-           (uint64_t **)&ps, &psc);
-       if (ps && ps->pss_func == POOL_SCAN_RESILVER &&
-           ps->pss_state == DSS_SCANNING)
-               return (ZPOOL_STATUS_RESILVERING);
-
-       /*
-        * Pool last accessed by another system.
-        */
-       (void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_HOSTID, &hostid);
-       if (hostid != 0 && (unsigned long)hostid != system_hostid &&
-           stateval == POOL_STATE_ACTIVE)
-               return (ZPOOL_STATUS_HOSTID_MISMATCH);
-
-       /*
-        * Newer on-disk version.
-        */
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           vs->vs_aux == VDEV_AUX_VERSION_NEWER)
-               return (ZPOOL_STATUS_VERSION_NEWER);
-
-       /*
-        * Unsupported feature(s).
-        */
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           vs->vs_aux == VDEV_AUX_UNSUP_FEAT) {
-               nvlist_t *nvinfo;
-
-               verify(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_LOAD_INFO,
-                   &nvinfo) == 0);
-               if (nvlist_exists(nvinfo, ZPOOL_CONFIG_CAN_RDONLY))
-                       return (ZPOOL_STATUS_UNSUP_FEAT_WRITE);
-               return (ZPOOL_STATUS_UNSUP_FEAT_READ);
-       }
-
-       /*
-        * Check that the config is complete.
-        */
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           vs->vs_aux == VDEV_AUX_BAD_GUID_SUM)
-               return (ZPOOL_STATUS_BAD_GUID_SUM);
-
-       /*
-        * Check whether the pool has suspended due to failed I/O.
-        */
-       if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_SUSPENDED,
-           &suspended) == 0) {
-               if (suspended == ZIO_FAILURE_MODE_CONTINUE)
-                       return (ZPOOL_STATUS_IO_FAILURE_CONTINUE);
-               return (ZPOOL_STATUS_IO_FAILURE_WAIT);
-       }
-
-       /*
-        * Could not read a log.
-        */
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           vs->vs_aux == VDEV_AUX_BAD_LOG) {
-               return (ZPOOL_STATUS_BAD_LOG);
-       }
-
-       /*
-        * Bad devices in non-replicated config.
-        */
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           find_vdev_problem(nvroot, vdev_faulted))
-               return (ZPOOL_STATUS_FAULTED_DEV_NR);
-
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           find_vdev_problem(nvroot, vdev_missing))
-               return (ZPOOL_STATUS_MISSING_DEV_NR);
-
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           find_vdev_problem(nvroot, vdev_broken))
-               return (ZPOOL_STATUS_CORRUPT_LABEL_NR);
-
-       /*
-        * Corrupted pool metadata
-        */
-       if (vs->vs_state == VDEV_STATE_CANT_OPEN &&
-           vs->vs_aux == VDEV_AUX_CORRUPT_DATA)
-               return (ZPOOL_STATUS_CORRUPT_POOL);
-
-       /*
-        * Persistent data errors.
-        */
-       if (!isimport) {
-               if (nvlist_lookup_uint64(config, ZPOOL_CONFIG_ERRCOUNT,
-                   &nerr) == 0 && nerr != 0)
-                       return (ZPOOL_STATUS_CORRUPT_DATA);
-       }
-
-       /*
-        * Missing devices in a replicated config.
-        */
-       if (find_vdev_problem(nvroot, vdev_faulted))
-               return (ZPOOL_STATUS_FAULTED_DEV_R);
-       if (find_vdev_problem(nvroot, vdev_missing))
-               return (ZPOOL_STATUS_MISSING_DEV_R);
-       if (find_vdev_problem(nvroot, vdev_broken))
-               return (ZPOOL_STATUS_CORRUPT_LABEL_R);
-
-       /*
-        * Devices with errors
-        */
-       if (!isimport && find_vdev_problem(nvroot, vdev_errors))
-               return (ZPOOL_STATUS_FAILING_DEV);
-
-       /*
-        * Offlined devices
-        */
-       if (find_vdev_problem(nvroot, vdev_offlined))
-               return (ZPOOL_STATUS_OFFLINE_DEV);
-
-       /*
-        * Removed device
-        */
-       if (find_vdev_problem(nvroot, vdev_removed))
-               return (ZPOOL_STATUS_REMOVED_DEV);
-
-       /*
-        * Outdated, but usable, version
-        */
-       if (SPA_VERSION_IS_SUPPORTED(version) && version != SPA_VERSION)
-               return (ZPOOL_STATUS_VERSION_OLDER);
-
-       /*
-        * Usable pool with disabled features
-        */
-       if (version >= SPA_VERSION_FEATURES) {
-               int i;
-               nvlist_t *feat;
-
-               if (isimport) {
-                       feat = fnvlist_lookup_nvlist(config,
-                           ZPOOL_CONFIG_LOAD_INFO);
-                       feat = fnvlist_lookup_nvlist(feat,
-                           ZPOOL_CONFIG_ENABLED_FEAT);
-               } else {
-                       feat = fnvlist_lookup_nvlist(config,
-                           ZPOOL_CONFIG_FEATURE_STATS);
-               }
-
-               for (i = 0; i < SPA_FEATURES; i++) {
-                       zfeature_info_t *fi = &spa_feature_table[i];
-                       if (!nvlist_exists(feat, fi->fi_guid))
-                               return (ZPOOL_STATUS_FEAT_DISABLED);
-               }
-       }
-
-       /*
-        * Informational errata available.
-        */
-       (void) nvlist_lookup_uint64(config, ZPOOL_CONFIG_ERRATA, &errata);
-       if (errata) {
-               *erratap = errata;
-               return (ZPOOL_STATUS_ERRATA);
-       }
-
-       return (ZPOOL_STATUS_OK);
-}
-
-zpool_status_t
-zpool_get_status(zpool_handle_t *zhp, char **msgid, zpool_errata_t *errata)
-{
-       zpool_status_t ret = check_status(zhp->zpool_config, B_FALSE, errata);
-
-       if (ret >= NMSGID)
-               *msgid = NULL;
-       else
-               *msgid = zfs_msgid_table[ret];
-
-       return (ret);
-}
-
-zpool_status_t
-zpool_import_status(nvlist_t *config, char **msgid, zpool_errata_t *errata)
-{
-       zpool_status_t ret = check_status(config, B_TRUE, errata);
-
-       if (ret >= NMSGID)
-               *msgid = NULL;
-       else
-               *msgid = zfs_msgid_table[ret];
-
-       return (ret);
-}
-
-static void
-dump_ddt_stat(const ddt_stat_t *dds, int h)
-{
-       char refcnt[6];
-       char blocks[6], lsize[6], psize[6], dsize[6];
-       char ref_blocks[6], ref_lsize[6], ref_psize[6], ref_dsize[6];
-
-       if (dds == NULL || dds->dds_blocks == 0)
-               return;
-
-       if (h == -1)
-               (void) strcpy(refcnt, "Total");
-       else
-               zfs_nicenum(1ULL << h, refcnt, sizeof (refcnt));
-
-       zfs_nicenum(dds->dds_blocks, blocks, sizeof (blocks));
-       zfs_nicenum(dds->dds_lsize, lsize, sizeof (lsize));
-       zfs_nicenum(dds->dds_psize, psize, sizeof (psize));
-       zfs_nicenum(dds->dds_dsize, dsize, sizeof (dsize));
-       zfs_nicenum(dds->dds_ref_blocks, ref_blocks, sizeof (ref_blocks));
-       zfs_nicenum(dds->dds_ref_lsize, ref_lsize, sizeof (ref_lsize));
-       zfs_nicenum(dds->dds_ref_psize, ref_psize, sizeof (ref_psize));
-       zfs_nicenum(dds->dds_ref_dsize, ref_dsize, sizeof (ref_dsize));
-
-       (void) printf("%6s   %6s   %5s   %5s   %5s   %6s   %5s   %5s   %5s\n",
-           refcnt,
-           blocks, lsize, psize, dsize,
-           ref_blocks, ref_lsize, ref_psize, ref_dsize);
-}
-
-/*
- * Print the DDT histogram and the column totals.
- */
-void
-zpool_dump_ddt(const ddt_stat_t *dds_total, const ddt_histogram_t *ddh)
-{
-       int h;
-
-       (void) printf("\n");
-
-       (void) printf("bucket   "
-           "           allocated             "
-           "          referenced          \n");
-       (void) printf("______   "
-           "______________________________   "
-           "______________________________\n");
-
-       (void) printf("%6s   %6s   %5s   %5s   %5s   %6s   %5s   %5s   %5s\n",
-           "refcnt",
-           "blocks", "LSIZE", "PSIZE", "DSIZE",
-           "blocks", "LSIZE", "PSIZE", "DSIZE");
-
-       (void) printf("%6s   %6s   %5s   %5s   %5s   %6s   %5s   %5s   %5s\n",
-           "------",
-           "------", "-----", "-----", "-----",
-           "------", "-----", "-----", "-----");
-
-       for (h = 0; h < 64; h++)
-               dump_ddt_stat(&ddh->ddh_stat[h], h);
-
-       dump_ddt_stat(dds_total, -1);
-
-       (void) printf("\n");
-}
diff --git a/zfs/lib/libzfs/libzfs_util.c b/zfs/lib/libzfs/libzfs_util.c
deleted file mode 100644 (file)
index 1e7bfb2..0000000
+++ /dev/null
@@ -1,1836 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- * Copyright (c) 2013, Joyent, Inc. All rights reserved.
- * Copyright (c) 2012 by Delphix. All rights reserved.
- */
-
-/*
- * Internal utility routines for the ZFS library.
- */
-
-#include <errno.h>
-#include <fcntl.h>
-#include <libintl.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <unistd.h>
-#include <ctype.h>
-#include <math.h>
-#include <sys/stat.h>
-#include <sys/mnttab.h>
-#include <sys/mntent.h>
-#include <sys/types.h>
-#include <wait.h>
-
-#include <libzfs.h>
-#include <libzfs_core.h>
-
-#include "libzfs_impl.h"
-#include "zfs_prop.h"
-#include "zfeature_common.h"
-
-int
-libzfs_errno(libzfs_handle_t *hdl)
-{
-       return (hdl->libzfs_error);
-}
-
-const char *
-libzfs_error_init(int error)
-{
-       switch (error) {
-       case ENXIO:
-               return (dgettext(TEXT_DOMAIN, "The ZFS modules are not "
-                   "loaded.\nTry running '/sbin/modprobe zfs' as root "
-                   "to load them.\n"));
-       case ENOENT:
-               return (dgettext(TEXT_DOMAIN, "The /dev/zfs device is "
-                   "missing and must be created.\nTry running 'udevadm "
-                   "trigger' as root to create it.\n"));
-       case ENOEXEC:
-               return (dgettext(TEXT_DOMAIN, "The ZFS modules cannot be "
-                   "auto-loaded.\nTry running '/sbin/modprobe zfs' as "
-                   "root to manually load them.\n"));
-       case EACCES:
-               return (dgettext(TEXT_DOMAIN, "Permission denied the "
-                   "ZFS utilities must be run as root.\n"));
-       default:
-               return (dgettext(TEXT_DOMAIN, "Failed to initialize the "
-                   "libzfs library.\n"));
-       }
-}
-
-const char *
-libzfs_error_action(libzfs_handle_t *hdl)
-{
-       return (hdl->libzfs_action);
-}
-
-const char *
-libzfs_error_description(libzfs_handle_t *hdl)
-{
-       if (hdl->libzfs_desc[0] != '\0')
-               return (hdl->libzfs_desc);
-
-       switch (hdl->libzfs_error) {
-       case EZFS_NOMEM:
-               return (dgettext(TEXT_DOMAIN, "out of memory"));
-       case EZFS_BADPROP:
-               return (dgettext(TEXT_DOMAIN, "invalid property value"));
-       case EZFS_PROPREADONLY:
-               return (dgettext(TEXT_DOMAIN, "read-only property"));
-       case EZFS_PROPTYPE:
-               return (dgettext(TEXT_DOMAIN, "property doesn't apply to "
-                   "datasets of this type"));
-       case EZFS_PROPNONINHERIT:
-               return (dgettext(TEXT_DOMAIN, "property cannot be inherited"));
-       case EZFS_PROPSPACE:
-               return (dgettext(TEXT_DOMAIN, "invalid quota or reservation"));
-       case EZFS_BADTYPE:
-               return (dgettext(TEXT_DOMAIN, "operation not applicable to "
-                   "datasets of this type"));
-       case EZFS_BUSY:
-               return (dgettext(TEXT_DOMAIN, "pool or dataset is busy"));
-       case EZFS_EXISTS:
-               return (dgettext(TEXT_DOMAIN, "pool or dataset exists"));
-       case EZFS_NOENT:
-               return (dgettext(TEXT_DOMAIN, "no such pool or dataset"));
-       case EZFS_BADSTREAM:
-               return (dgettext(TEXT_DOMAIN, "invalid backup stream"));
-       case EZFS_DSREADONLY:
-               return (dgettext(TEXT_DOMAIN, "dataset is read-only"));
-       case EZFS_VOLTOOBIG:
-               return (dgettext(TEXT_DOMAIN, "volume size exceeds limit for "
-                   "this system"));
-       case EZFS_INVALIDNAME:
-               return (dgettext(TEXT_DOMAIN, "invalid name"));
-       case EZFS_BADRESTORE:
-               return (dgettext(TEXT_DOMAIN, "unable to restore to "
-                   "destination"));
-       case EZFS_BADBACKUP:
-               return (dgettext(TEXT_DOMAIN, "backup failed"));
-       case EZFS_BADTARGET:
-               return (dgettext(TEXT_DOMAIN, "invalid target vdev"));
-       case EZFS_NODEVICE:
-               return (dgettext(TEXT_DOMAIN, "no such device in pool"));
-       case EZFS_BADDEV:
-               return (dgettext(TEXT_DOMAIN, "invalid device"));
-       case EZFS_NOREPLICAS:
-               return (dgettext(TEXT_DOMAIN, "no valid replicas"));
-       case EZFS_RESILVERING:
-               return (dgettext(TEXT_DOMAIN, "currently resilvering"));
-       case EZFS_BADVERSION:
-               return (dgettext(TEXT_DOMAIN, "unsupported version or "
-                   "feature"));
-       case EZFS_POOLUNAVAIL:
-               return (dgettext(TEXT_DOMAIN, "pool is unavailable"));
-       case EZFS_DEVOVERFLOW:
-               return (dgettext(TEXT_DOMAIN, "too many devices in one vdev"));
-       case EZFS_BADPATH:
-               return (dgettext(TEXT_DOMAIN, "must be an absolute path"));
-       case EZFS_CROSSTARGET:
-               return (dgettext(TEXT_DOMAIN, "operation crosses datasets or "
-                   "pools"));
-       case EZFS_ZONED:
-               return (dgettext(TEXT_DOMAIN, "dataset in use by local zone"));
-       case EZFS_MOUNTFAILED:
-               return (dgettext(TEXT_DOMAIN, "mount failed"));
-       case EZFS_UMOUNTFAILED:
-               return (dgettext(TEXT_DOMAIN, "umount failed"));
-       case EZFS_UNSHARENFSFAILED:
-               return (dgettext(TEXT_DOMAIN, "unshare(1M) failed"));
-       case EZFS_SHARENFSFAILED:
-               return (dgettext(TEXT_DOMAIN, "share(1M) failed"));
-       case EZFS_UNSHARESMBFAILED:
-               return (dgettext(TEXT_DOMAIN, "smb remove share failed"));
-       case EZFS_SHARESMBFAILED:
-               return (dgettext(TEXT_DOMAIN, "smb add share failed"));
-       case EZFS_PERM:
-               return (dgettext(TEXT_DOMAIN, "permission denied"));
-       case EZFS_NOSPC:
-               return (dgettext(TEXT_DOMAIN, "out of space"));
-       case EZFS_FAULT:
-               return (dgettext(TEXT_DOMAIN, "bad address"));
-       case EZFS_IO:
-               return (dgettext(TEXT_DOMAIN, "I/O error"));
-       case EZFS_INTR:
-               return (dgettext(TEXT_DOMAIN, "signal received"));
-       case EZFS_ISSPARE:
-               return (dgettext(TEXT_DOMAIN, "device is reserved as a hot "
-                   "spare"));
-       case EZFS_INVALCONFIG:
-               return (dgettext(TEXT_DOMAIN, "invalid vdev configuration"));
-       case EZFS_RECURSIVE:
-               return (dgettext(TEXT_DOMAIN, "recursive dataset dependency"));
-       case EZFS_NOHISTORY:
-               return (dgettext(TEXT_DOMAIN, "no history available"));
-       case EZFS_POOLPROPS:
-               return (dgettext(TEXT_DOMAIN, "failed to retrieve "
-                   "pool properties"));
-       case EZFS_POOL_NOTSUP:
-               return (dgettext(TEXT_DOMAIN, "operation not supported "
-                   "on this type of pool"));
-       case EZFS_POOL_INVALARG:
-               return (dgettext(TEXT_DOMAIN, "invalid argument for "
-                   "this pool operation"));
-       case EZFS_NAMETOOLONG:
-               return (dgettext(TEXT_DOMAIN, "dataset name is too long"));
-       case EZFS_OPENFAILED:
-               return (dgettext(TEXT_DOMAIN, "open failed"));
-       case EZFS_NOCAP:
-               return (dgettext(TEXT_DOMAIN,
-                   "disk capacity information could not be retrieved"));
-       case EZFS_LABELFAILED:
-               return (dgettext(TEXT_DOMAIN, "write of label failed"));
-       case EZFS_BADWHO:
-               return (dgettext(TEXT_DOMAIN, "invalid user/group"));
-       case EZFS_BADPERM:
-               return (dgettext(TEXT_DOMAIN, "invalid permission"));
-       case EZFS_BADPERMSET:
-               return (dgettext(TEXT_DOMAIN, "invalid permission set name"));
-       case EZFS_NODELEGATION:
-               return (dgettext(TEXT_DOMAIN, "delegated administration is "
-                   "disabled on pool"));
-       case EZFS_BADCACHE:
-               return (dgettext(TEXT_DOMAIN, "invalid or missing cache file"));
-       case EZFS_ISL2CACHE:
-               return (dgettext(TEXT_DOMAIN, "device is in use as a cache"));
-       case EZFS_VDEVNOTSUP:
-               return (dgettext(TEXT_DOMAIN, "vdev specification is not "
-                   "supported"));
-       case EZFS_NOTSUP:
-               return (dgettext(TEXT_DOMAIN, "operation not supported "
-                   "on this dataset"));
-       case EZFS_ACTIVE_SPARE:
-               return (dgettext(TEXT_DOMAIN, "pool has active shared spare "
-                   "device"));
-       case EZFS_UNPLAYED_LOGS:
-               return (dgettext(TEXT_DOMAIN, "log device has unplayed intent "
-                   "logs"));
-       case EZFS_REFTAG_RELE:
-               return (dgettext(TEXT_DOMAIN, "no such tag on this dataset"));
-       case EZFS_REFTAG_HOLD:
-               return (dgettext(TEXT_DOMAIN, "tag already exists on this "
-                   "dataset"));
-       case EZFS_TAGTOOLONG:
-               return (dgettext(TEXT_DOMAIN, "tag too long"));
-       case EZFS_PIPEFAILED:
-               return (dgettext(TEXT_DOMAIN, "pipe create failed"));
-       case EZFS_THREADCREATEFAILED:
-               return (dgettext(TEXT_DOMAIN, "thread create failed"));
-       case EZFS_POSTSPLIT_ONLINE:
-               return (dgettext(TEXT_DOMAIN, "disk was split from this pool "
-                   "into a new one"));
-       case EZFS_SCRUBBING:
-               return (dgettext(TEXT_DOMAIN, "currently scrubbing; "
-                   "use 'zpool scrub -s' to cancel current scrub"));
-       case EZFS_NO_SCRUB:
-               return (dgettext(TEXT_DOMAIN, "there is no active scrub"));
-       case EZFS_DIFF:
-               return (dgettext(TEXT_DOMAIN, "unable to generate diffs"));
-       case EZFS_DIFFDATA:
-               return (dgettext(TEXT_DOMAIN, "invalid diff data"));
-       case EZFS_POOLREADONLY:
-               return (dgettext(TEXT_DOMAIN, "pool is read-only"));
-       case EZFS_UNKNOWN:
-               return (dgettext(TEXT_DOMAIN, "unknown error"));
-       default:
-               assert(hdl->libzfs_error == 0);
-               return (dgettext(TEXT_DOMAIN, "no error"));
-       }
-}
-
-/*PRINTFLIKE2*/
-void
-zfs_error_aux(libzfs_handle_t *hdl, const char *fmt, ...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-
-       (void) vsnprintf(hdl->libzfs_desc, sizeof (hdl->libzfs_desc),
-           fmt, ap);
-       hdl->libzfs_desc_active = 1;
-
-       va_end(ap);
-}
-
-static void
-zfs_verror(libzfs_handle_t *hdl, int error, const char *fmt, va_list ap)
-{
-       (void) vsnprintf(hdl->libzfs_action, sizeof (hdl->libzfs_action),
-           fmt, ap);
-       hdl->libzfs_error = error;
-
-       if (hdl->libzfs_desc_active)
-               hdl->libzfs_desc_active = 0;
-       else
-               hdl->libzfs_desc[0] = '\0';
-
-       if (hdl->libzfs_printerr) {
-               if (error == EZFS_UNKNOWN) {
-                       (void) fprintf(stderr, dgettext(TEXT_DOMAIN, "internal "
-                           "error: %s\n"), libzfs_error_description(hdl));
-                       abort();
-               }
-
-               (void) fprintf(stderr, "%s: %s\n", hdl->libzfs_action,
-                   libzfs_error_description(hdl));
-               if (error == EZFS_NOMEM)
-                       exit(1);
-       }
-}
-
-int
-zfs_error(libzfs_handle_t *hdl, int error, const char *msg)
-{
-       return (zfs_error_fmt(hdl, error, "%s", msg));
-}
-
-/*PRINTFLIKE3*/
-int
-zfs_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-
-       zfs_verror(hdl, error, fmt, ap);
-
-       va_end(ap);
-
-       return (-1);
-}
-
-static int
-zfs_common_error(libzfs_handle_t *hdl, int error, const char *fmt,
-    va_list ap)
-{
-       switch (error) {
-       case EPERM:
-       case EACCES:
-               zfs_verror(hdl, EZFS_PERM, fmt, ap);
-               return (-1);
-
-       case ECANCELED:
-               zfs_verror(hdl, EZFS_NODELEGATION, fmt, ap);
-               return (-1);
-
-       case EIO:
-               zfs_verror(hdl, EZFS_IO, fmt, ap);
-               return (-1);
-
-       case EFAULT:
-               zfs_verror(hdl, EZFS_FAULT, fmt, ap);
-               return (-1);
-
-       case EINTR:
-               zfs_verror(hdl, EZFS_INTR, fmt, ap);
-               return (-1);
-       }
-
-       return (0);
-}
-
-int
-zfs_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
-{
-       return (zfs_standard_error_fmt(hdl, error, "%s", msg));
-}
-
-/*PRINTFLIKE3*/
-int
-zfs_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-
-       if (zfs_common_error(hdl, error, fmt, ap) != 0) {
-               va_end(ap);
-               return (-1);
-       }
-
-       switch (error) {
-       case ENXIO:
-       case ENODEV:
-       case EPIPE:
-               zfs_verror(hdl, EZFS_IO, fmt, ap);
-               break;
-
-       case ENOENT:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "dataset does not exist"));
-               zfs_verror(hdl, EZFS_NOENT, fmt, ap);
-               break;
-
-       case ENOSPC:
-       case EDQUOT:
-               zfs_verror(hdl, EZFS_NOSPC, fmt, ap);
-               return (-1);
-
-       case EEXIST:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "dataset already exists"));
-               zfs_verror(hdl, EZFS_EXISTS, fmt, ap);
-               break;
-
-       case EBUSY:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "dataset is busy"));
-               zfs_verror(hdl, EZFS_BUSY, fmt, ap);
-               break;
-       case EROFS:
-               zfs_verror(hdl, EZFS_POOLREADONLY, fmt, ap);
-               break;
-       case ENAMETOOLONG:
-               zfs_verror(hdl, EZFS_NAMETOOLONG, fmt, ap);
-               break;
-       case ENOTSUP:
-               zfs_verror(hdl, EZFS_BADVERSION, fmt, ap);
-               break;
-       case EAGAIN:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "pool I/O is currently suspended"));
-               zfs_verror(hdl, EZFS_POOLUNAVAIL, fmt, ap);
-               break;
-       default:
-               zfs_error_aux(hdl, strerror(error));
-               zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
-               break;
-       }
-
-       va_end(ap);
-       return (-1);
-}
-
-int
-zpool_standard_error(libzfs_handle_t *hdl, int error, const char *msg)
-{
-       return (zpool_standard_error_fmt(hdl, error, "%s", msg));
-}
-
-/*PRINTFLIKE3*/
-int
-zpool_standard_error_fmt(libzfs_handle_t *hdl, int error, const char *fmt, ...)
-{
-       va_list ap;
-
-       va_start(ap, fmt);
-
-       if (zfs_common_error(hdl, error, fmt, ap) != 0) {
-               va_end(ap);
-               return (-1);
-       }
-
-       switch (error) {
-       case ENODEV:
-               zfs_verror(hdl, EZFS_NODEVICE, fmt, ap);
-               break;
-
-       case ENOENT:
-               zfs_error_aux(hdl,
-                   dgettext(TEXT_DOMAIN, "no such pool or dataset"));
-               zfs_verror(hdl, EZFS_NOENT, fmt, ap);
-               break;
-
-       case EEXIST:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "pool already exists"));
-               zfs_verror(hdl, EZFS_EXISTS, fmt, ap);
-               break;
-
-       case EBUSY:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN, "pool is busy"));
-               zfs_verror(hdl, EZFS_BUSY, fmt, ap);
-               break;
-
-       case ENXIO:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "one or more devices is currently unavailable"));
-               zfs_verror(hdl, EZFS_BADDEV, fmt, ap);
-               break;
-
-       case ENAMETOOLONG:
-               zfs_verror(hdl, EZFS_DEVOVERFLOW, fmt, ap);
-               break;
-
-       case ENOTSUP:
-               zfs_verror(hdl, EZFS_POOL_NOTSUP, fmt, ap);
-               break;
-
-       case EINVAL:
-               zfs_verror(hdl, EZFS_POOL_INVALARG, fmt, ap);
-               break;
-
-       case ENOSPC:
-       case EDQUOT:
-               zfs_verror(hdl, EZFS_NOSPC, fmt, ap);
-               return (-1);
-
-       case EAGAIN:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "pool I/O is currently suspended"));
-               zfs_verror(hdl, EZFS_POOLUNAVAIL, fmt, ap);
-               break;
-
-       case EROFS:
-               zfs_verror(hdl, EZFS_POOLREADONLY, fmt, ap);
-               break;
-       case EDOM:
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "block size out of range or does not match"));
-               zfs_verror(hdl, EZFS_BADPROP, fmt, ap);
-               break;
-
-       default:
-               zfs_error_aux(hdl, strerror(error));
-               zfs_verror(hdl, EZFS_UNKNOWN, fmt, ap);
-       }
-
-       va_end(ap);
-       return (-1);
-}
-
-/*
- * Display an out of memory error message and abort the current program.
- */
-int
-no_memory(libzfs_handle_t *hdl)
-{
-       return (zfs_error(hdl, EZFS_NOMEM, "internal error"));
-}
-
-/*
- * A safe form of malloc() which will die if the allocation fails.
- */
-void *
-zfs_alloc(libzfs_handle_t *hdl, size_t size)
-{
-       void *data;
-
-       if ((data = calloc(1, size)) == NULL)
-               (void) no_memory(hdl);
-
-       return (data);
-}
-
-/*
- * A safe form of asprintf() which will die if the allocation fails.
- */
-/*PRINTFLIKE2*/
-char *
-zfs_asprintf(libzfs_handle_t *hdl, const char *fmt, ...)
-{
-       va_list ap;
-       char *ret;
-       int err;
-
-       va_start(ap, fmt);
-
-       err = vasprintf(&ret, fmt, ap);
-
-       va_end(ap);
-
-       if (err < 0)
-               (void) no_memory(hdl);
-
-       return (ret);
-}
-
-/*
- * A safe form of realloc(), which also zeroes newly allocated space.
- */
-void *
-zfs_realloc(libzfs_handle_t *hdl, void *ptr, size_t oldsize, size_t newsize)
-{
-       void *ret;
-
-       if ((ret = realloc(ptr, newsize)) == NULL) {
-               (void) no_memory(hdl);
-               return (NULL);
-       }
-
-       bzero((char *)ret + oldsize, (newsize - oldsize));
-       return (ret);
-}
-
-/*
- * A safe form of strdup() which will die if the allocation fails.
- */
-char *
-zfs_strdup(libzfs_handle_t *hdl, const char *str)
-{
-       char *ret;
-
-       if ((ret = strdup(str)) == NULL)
-               (void) no_memory(hdl);
-
-       return (ret);
-}
-
-/*
- * Convert a number to an appropriately human-readable output.
- */
-void
-zfs_nicenum(uint64_t num, char *buf, size_t buflen)
-{
-       uint64_t n = num;
-       int index = 0;
-       char u;
-
-       while (n >= 1024 && index < 6) {
-               n /= 1024;
-               index++;
-       }
-
-       u = " KMGTPE"[index];
-
-       if (index == 0) {
-               (void) snprintf(buf, buflen, "%llu", (u_longlong_t) n);
-       } else if ((num & ((1ULL << 10 * index) - 1)) == 0) {
-               /*
-                * If this is an even multiple of the base, always display
-                * without any decimal precision.
-                */
-               (void) snprintf(buf, buflen, "%llu%c", (u_longlong_t) n, u);
-       } else {
-               /*
-                * We want to choose a precision that reflects the best choice
-                * for fitting in 5 characters.  This can get rather tricky when
-                * we have numbers that are very close to an order of magnitude.
-                * For example, when displaying 10239 (which is really 9.999K),
-                * we want only a single place of precision for 10.0K.  We could
-                * develop some complex heuristics for this, but it's much
-                * easier just to try each combination in turn.
-                */
-               int i;
-               for (i = 2; i >= 0; i--) {
-                       if (snprintf(buf, buflen, "%.*f%c", i,
-                           (double)num / (1ULL << 10 * index), u) <= 5)
-                               break;
-               }
-       }
-}
-
-void
-libzfs_print_on_error(libzfs_handle_t *hdl, boolean_t printerr)
-{
-       hdl->libzfs_printerr = printerr;
-}
-
-static int
-libzfs_module_loaded(const char *module)
-{
-       const char path_prefix[] = "/sys/module/";
-       char path[256];
-
-       memcpy(path, path_prefix, sizeof (path_prefix) - 1);
-       strcpy(path + sizeof (path_prefix) - 1, module);
-
-       return (access(path, F_OK) == 0);
-}
-
-int
-libzfs_run_process(const char *path, char *argv[], int flags)
-{
-       pid_t pid;
-       int error, devnull_fd;
-
-       pid = vfork();
-       if (pid == 0) {
-               devnull_fd = open("/dev/null", O_WRONLY);
-
-               if (devnull_fd < 0)
-                       _exit(-1);
-
-               if (!(flags & STDOUT_VERBOSE))
-                       (void) dup2(devnull_fd, STDOUT_FILENO);
-
-               if (!(flags & STDERR_VERBOSE))
-                       (void) dup2(devnull_fd, STDERR_FILENO);
-
-               close(devnull_fd);
-
-               (void) execvp(path, argv);
-               _exit(-1);
-       } else if (pid > 0) {
-               int status;
-
-               while ((error = waitpid(pid, &status, 0)) == -1 &&
-                       errno == EINTR);
-               if (error < 0 || !WIFEXITED(status))
-                       return (-1);
-
-               return (WEXITSTATUS(status));
-       }
-
-       return (-1);
-}
-
-/*
- * Verify the required ZFS_DEV device is available and optionally attempt
- * to load the ZFS modules.  Under normal circumstances the modules
- * should already have been loaded by some external mechanism.
- *
- * Environment variables:
- * - ZFS_MODULE_LOADING="YES|yes|ON|on" - Attempt to load modules.
- * - ZFS_MODULE_TIMEOUT="<seconds>"     - Seconds to wait for ZFS_DEV
- */
-static int
-libzfs_load_module(const char *module)
-{
-       char *argv[4] = {"/sbin/modprobe", "-q", (char *)module, (char *)0};
-       char *load_str, *timeout_str;
-       long timeout = 10; /* seconds */
-       long busy_timeout = 10; /* milliseconds */
-       int load = 0, fd;
-       hrtime_t start;
-
-       /* Optionally request module loading */
-       if (!libzfs_module_loaded(module)) {
-               load_str = getenv("ZFS_MODULE_LOADING");
-               if (load_str) {
-                       if (!strncasecmp(load_str, "YES", strlen("YES")) ||
-                           !strncasecmp(load_str, "ON", strlen("ON")))
-                               load = 1;
-                       else
-                               load = 0;
-               }
-
-               if (load && libzfs_run_process("/sbin/modprobe", argv, 0))
-                       return (ENOEXEC);
-       }
-
-       /* Module loading is synchronous it must be available */
-       if (!libzfs_module_loaded(module))
-               return (ENXIO);
-
-       /*
-        * Device creation by udev is asynchronous and waiting may be
-        * required.  Busy wait for 10ms and then fall back to polling every
-        * 10ms for the allowed timeout (default 10s, max 10m).  This is
-        * done to optimize for the common case where the device is
-        * immediately available and to avoid penalizing the possible
-        * case where udev is slow or unable to create the device.
-        */
-       timeout_str = getenv("ZFS_MODULE_TIMEOUT");
-       if (timeout_str) {
-               timeout = strtol(timeout_str, NULL, 0);
-               timeout = MAX(MIN(timeout, (10 * 60)), 0); /* 0 <= N <= 600 */
-       }
-
-       start = gethrtime();
-       do {
-               fd = open(ZFS_DEV, O_RDWR);
-               if (fd >= 0) {
-                       (void) close(fd);
-                       return (0);
-               } else if (errno != ENOENT) {
-                       return (errno);
-               } else if (NSEC2MSEC(gethrtime() - start) < busy_timeout) {
-                       sched_yield();
-               } else {
-                       usleep(10 * MILLISEC);
-               }
-       } while (NSEC2MSEC(gethrtime() - start) < (timeout * MILLISEC));
-
-       return (ENOENT);
-}
-
-libzfs_handle_t *
-libzfs_init(void)
-{
-       libzfs_handle_t *hdl;
-       int error;
-
-       error = libzfs_load_module(ZFS_DRIVER);
-       if (error) {
-               errno = error;
-               return (NULL);
-       }
-
-       if ((hdl = calloc(1, sizeof (libzfs_handle_t))) == NULL) {
-               return (NULL);
-       }
-
-       if ((hdl->libzfs_fd = open(ZFS_DEV, O_RDWR)) < 0) {
-               free(hdl);
-               return (NULL);
-       }
-
-#ifdef HAVE_SETMNTENT
-       if ((hdl->libzfs_mnttab = setmntent(MNTTAB, "r")) == NULL) {
-#else
-       if ((hdl->libzfs_mnttab = fopen(MNTTAB, "r")) == NULL) {
-#endif
-               (void) close(hdl->libzfs_fd);
-               free(hdl);
-               return (NULL);
-       }
-
-       hdl->libzfs_sharetab = fopen("/etc/dfs/sharetab", "r");
-
-       if (libzfs_core_init() != 0) {
-               (void) close(hdl->libzfs_fd);
-               (void) fclose(hdl->libzfs_mnttab);
-               (void) fclose(hdl->libzfs_sharetab);
-               free(hdl);
-               return (NULL);
-       }
-
-       zfs_prop_init();
-       zpool_prop_init();
-       zpool_feature_init();
-       libzfs_mnttab_init(hdl);
-
-       return (hdl);
-}
-
-void
-libzfs_fini(libzfs_handle_t *hdl)
-{
-       (void) close(hdl->libzfs_fd);
-       if (hdl->libzfs_mnttab)
-#ifdef HAVE_SETMNTENT
-               (void) endmntent(hdl->libzfs_mnttab);
-#else
-               (void) fclose(hdl->libzfs_mnttab);
-#endif
-       if (hdl->libzfs_sharetab)
-               (void) fclose(hdl->libzfs_sharetab);
-       zfs_uninit_libshare(hdl);
-       zpool_free_handles(hdl);
-       libzfs_fru_clear(hdl, B_TRUE);
-       namespace_clear(hdl);
-       libzfs_mnttab_fini(hdl);
-       libzfs_core_fini();
-       free(hdl);
-}
-
-libzfs_handle_t *
-zpool_get_handle(zpool_handle_t *zhp)
-{
-       return (zhp->zpool_hdl);
-}
-
-libzfs_handle_t *
-zfs_get_handle(zfs_handle_t *zhp)
-{
-       return (zhp->zfs_hdl);
-}
-
-zpool_handle_t *
-zfs_get_pool_handle(const zfs_handle_t *zhp)
-{
-       return (zhp->zpool_hdl);
-}
-
-/*
- * Given a name, determine whether or not it's a valid path
- * (starts with '/' or "./").  If so, walk the mnttab trying
- * to match the device number.  If not, treat the path as an
- * fs/vol/snap name.
- */
-zfs_handle_t *
-zfs_path_to_zhandle(libzfs_handle_t *hdl, char *path, zfs_type_t argtype)
-{
-       struct stat64 statbuf;
-       struct extmnttab entry;
-       int ret;
-
-       if (path[0] != '/' && strncmp(path, "./", strlen("./")) != 0) {
-               /*
-                * It's not a valid path, assume it's a name of type 'argtype'.
-                */
-               return (zfs_open(hdl, path, argtype));
-       }
-
-       if (stat64(path, &statbuf) != 0) {
-               (void) fprintf(stderr, "%s: %s\n", path, strerror(errno));
-               return (NULL);
-       }
-
-       /* Reopen MNTTAB to prevent reading stale data from open file */
-       if (freopen(MNTTAB, "r", hdl->libzfs_mnttab) == NULL)
-               return (NULL);
-
-       while ((ret = getextmntent(hdl->libzfs_mnttab, &entry, 0)) == 0) {
-               if (makedevice(entry.mnt_major, entry.mnt_minor) ==
-                   statbuf.st_dev) {
-                       break;
-               }
-       }
-       if (ret != 0) {
-               return (NULL);
-       }
-
-       if (strcmp(entry.mnt_fstype, MNTTYPE_ZFS) != 0) {
-               (void) fprintf(stderr, gettext("'%s': not a ZFS filesystem\n"),
-                   path);
-               return (NULL);
-       }
-
-       return (zfs_open(hdl, entry.mnt_special, ZFS_TYPE_FILESYSTEM));
-}
-
-/*
- * Append partition suffix to an otherwise fully qualified device path.
- * This is used to generate the name the full path as its stored in
- * ZPOOL_CONFIG_PATH for whole disk devices.  On success the new length
- * of 'path' will be returned on error a negative value is returned.
- */
-int
-zfs_append_partition(char *path, size_t max_len)
-{
-       int len = strlen(path);
-
-       if (strncmp(path, UDISK_ROOT, strlen(UDISK_ROOT)) == 0) {
-               if (len + 6 >= max_len)
-                       return (-1);
-
-               (void) strcat(path, "-part1");
-               len += 6;
-       } else {
-               if (len + 2 >= max_len)
-                       return (-1);
-
-               if (isdigit(path[len-1])) {
-                       (void) strcat(path, "p1");
-                       len += 2;
-               } else {
-                       (void) strcat(path, "1");
-                       len += 1;
-               }
-       }
-
-       return (len);
-}
-
-/*
- * Given a shorthand device name check if a file by that name exists in any
- * of the 'zpool_default_import_path' or ZPOOL_IMPORT_PATH directories.  If
- * one is found, store its fully qualified path in the 'path' buffer passed
- * by the caller and return 0, otherwise return an error.
- */
-int
-zfs_resolve_shortname(const char *name, char *path, size_t len)
-{
-       int i, error = -1;
-       char *dir, *env, *envdup;
-
-       env = getenv("ZPOOL_IMPORT_PATH");
-       errno = ENOENT;
-
-       if (env) {
-               envdup = strdup(env);
-               dir = strtok(envdup, ":");
-               while (dir && error) {
-                       (void) snprintf(path, len, "%s/%s", dir, name);
-                       error = access(path, F_OK);
-                       dir = strtok(NULL, ":");
-               }
-               free(envdup);
-       } else {
-               for (i = 0; i < DEFAULT_IMPORT_PATH_SIZE && error < 0; i++) {
-                       (void) snprintf(path, len, "%s/%s",
-                           zpool_default_import_path[i], name);
-                       error = access(path, F_OK);
-               }
-       }
-
-       return (error ? ENOENT : 0);
-}
-
-/*
- * Given a shorthand device name look for a match against 'cmp_name'.  This
- * is done by checking all prefix expansions using either the default
- * 'zpool_default_import_paths' or the ZPOOL_IMPORT_PATH environment
- * variable.  Proper partition suffixes will be appended if this is a
- * whole disk.  When a match is found 0 is returned otherwise ENOENT.
- */
-static int
-zfs_strcmp_shortname(char *name, char *cmp_name, int wholedisk)
-{
-       int path_len, cmp_len, i = 0, error = ENOENT;
-       char *dir, *env, *envdup = NULL;
-       char path_name[MAXPATHLEN];
-
-       cmp_len = strlen(cmp_name);
-       env = getenv("ZPOOL_IMPORT_PATH");
-
-       if (env) {
-               envdup = strdup(env);
-               dir = strtok(envdup, ":");
-       } else {
-               dir =  zpool_default_import_path[i];
-       }
-
-       while (dir) {
-               /* Trim trailing directory slashes from ZPOOL_IMPORT_PATH */
-               while (dir[strlen(dir)-1] == '/')
-                       dir[strlen(dir)-1] = '\0';
-
-               path_len = snprintf(path_name, MAXPATHLEN, "%s/%s", dir, name);
-               if (wholedisk)
-                       path_len = zfs_append_partition(path_name, MAXPATHLEN);
-
-               if ((path_len == cmp_len) && strcmp(path_name, cmp_name) == 0) {
-                       error = 0;
-                       break;
-               }
-
-               if (env) {
-                       dir = strtok(NULL, ":");
-               } else if (++i < DEFAULT_IMPORT_PATH_SIZE) {
-                       dir = zpool_default_import_path[i];
-               } else {
-                       dir = NULL;
-               }
-       }
-
-       if (env)
-               free(envdup);
-
-       return (error);
-}
-
-/*
- * Given either a shorthand or fully qualified path name look for a match
- * against 'cmp'.  The passed name will be expanded as needed for comparison
- * purposes and redundant slashes stripped to ensure an accurate match.
- */
-int
-zfs_strcmp_pathname(char *name, char *cmp, int wholedisk)
-{
-       int path_len, cmp_len;
-       char path_name[MAXPATHLEN];
-       char cmp_name[MAXPATHLEN];
-       char *dir;
-
-       /* Strip redundant slashes if one exists due to ZPOOL_IMPORT_PATH */
-       memset(cmp_name, 0, MAXPATHLEN);
-       dir = strtok(cmp, "/");
-       while (dir) {
-               strcat(cmp_name, "/");
-               strcat(cmp_name, dir);
-               dir = strtok(NULL, "/");
-       }
-
-       if (name[0] != '/')
-               return (zfs_strcmp_shortname(name, cmp_name, wholedisk));
-
-       (void) strlcpy(path_name, name, MAXPATHLEN);
-       path_len = strlen(path_name);
-       cmp_len = strlen(cmp_name);
-
-       if (wholedisk) {
-               path_len = zfs_append_partition(path_name, MAXPATHLEN);
-               if (path_len == -1)
-                       return (ENOMEM);
-       }
-
-       if ((path_len != cmp_len) || strcmp(path_name, cmp_name))
-               return (ENOENT);
-
-       return (0);
-}
-
-/*
- * Initialize the zc_nvlist_dst member to prepare for receiving an nvlist from
- * an ioctl().
- */
-int
-zcmd_alloc_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc, size_t len)
-{
-       if (len == 0)
-               len = 16 * 1024;
-       zc->zc_nvlist_dst_size = len;
-       if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t)
-           zfs_alloc(hdl, zc->zc_nvlist_dst_size)) == 0)
-               return (-1);
-
-       return (0);
-}
-
-/*
- * Called when an ioctl() which returns an nvlist fails with ENOMEM.  This will
- * expand the nvlist to the size specified in 'zc_nvlist_dst_size', which was
- * filled in by the kernel to indicate the actual required size.
- */
-int
-zcmd_expand_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc)
-{
-       free((void *)(uintptr_t)zc->zc_nvlist_dst);
-       if ((zc->zc_nvlist_dst = (uint64_t)(uintptr_t)
-           zfs_alloc(hdl, zc->zc_nvlist_dst_size)) == 0)
-               return (-1);
-
-       return (0);
-}
-
-/*
- * Called to free the src and dst nvlists stored in the command structure.
- */
-void
-zcmd_free_nvlists(zfs_cmd_t *zc)
-{
-       free((void *)(uintptr_t)zc->zc_nvlist_conf);
-       free((void *)(uintptr_t)zc->zc_nvlist_src);
-       free((void *)(uintptr_t)zc->zc_nvlist_dst);
-}
-
-static int
-zcmd_write_nvlist_com(libzfs_handle_t *hdl, uint64_t *outnv, uint64_t *outlen,
-    nvlist_t *nvl)
-{
-       char *packed;
-       size_t len;
-
-       verify(nvlist_size(nvl, &len, NV_ENCODE_NATIVE) == 0);
-
-       if ((packed = zfs_alloc(hdl, len)) == NULL)
-               return (-1);
-
-       verify(nvlist_pack(nvl, &packed, &len, NV_ENCODE_NATIVE, 0) == 0);
-
-       *outnv = (uint64_t)(uintptr_t)packed;
-       *outlen = len;
-
-       return (0);
-}
-
-int
-zcmd_write_conf_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc, nvlist_t *nvl)
-{
-       return (zcmd_write_nvlist_com(hdl, &zc->zc_nvlist_conf,
-           &zc->zc_nvlist_conf_size, nvl));
-}
-
-int
-zcmd_write_src_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc, nvlist_t *nvl)
-{
-       return (zcmd_write_nvlist_com(hdl, &zc->zc_nvlist_src,
-           &zc->zc_nvlist_src_size, nvl));
-}
-
-/*
- * Unpacks an nvlist from the ZFS ioctl command structure.
- */
-int
-zcmd_read_dst_nvlist(libzfs_handle_t *hdl, zfs_cmd_t *zc, nvlist_t **nvlp)
-{
-       if (nvlist_unpack((void *)(uintptr_t)zc->zc_nvlist_dst,
-           zc->zc_nvlist_dst_size, nvlp, 0) != 0)
-               return (no_memory(hdl));
-
-       return (0);
-}
-
-int
-zfs_ioctl(libzfs_handle_t *hdl, int request, zfs_cmd_t *zc)
-{
-       return (ioctl(hdl->libzfs_fd, request, zc));
-}
-
-/*
- * ================================================================
- * API shared by zfs and zpool property management
- * ================================================================
- */
-
-static void
-zprop_print_headers(zprop_get_cbdata_t *cbp, zfs_type_t type)
-{
-       zprop_list_t *pl = cbp->cb_proplist;
-       int i;
-       char *title;
-       size_t len;
-
-       cbp->cb_first = B_FALSE;
-       if (cbp->cb_scripted)
-               return;
-
-       /*
-        * Start with the length of the column headers.
-        */
-       cbp->cb_colwidths[GET_COL_NAME] = strlen(dgettext(TEXT_DOMAIN, "NAME"));
-       cbp->cb_colwidths[GET_COL_PROPERTY] = strlen(dgettext(TEXT_DOMAIN,
-           "PROPERTY"));
-       cbp->cb_colwidths[GET_COL_VALUE] = strlen(dgettext(TEXT_DOMAIN,
-           "VALUE"));
-       cbp->cb_colwidths[GET_COL_RECVD] = strlen(dgettext(TEXT_DOMAIN,
-           "RECEIVED"));
-       cbp->cb_colwidths[GET_COL_SOURCE] = strlen(dgettext(TEXT_DOMAIN,
-           "SOURCE"));
-
-       /* first property is always NAME */
-       assert(cbp->cb_proplist->pl_prop ==
-           ((type == ZFS_TYPE_POOL) ?  ZPOOL_PROP_NAME : ZFS_PROP_NAME));
-
-       /*
-        * Go through and calculate the widths for each column.  For the
-        * 'source' column, we kludge it up by taking the worst-case scenario of
-        * inheriting from the longest name.  This is acceptable because in the
-        * majority of cases 'SOURCE' is the last column displayed, and we don't
-        * use the width anyway.  Note that the 'VALUE' column can be oversized,
-        * if the name of the property is much longer than any values we find.
-        */
-       for (pl = cbp->cb_proplist; pl != NULL; pl = pl->pl_next) {
-               /*
-                * 'PROPERTY' column
-                */
-               if (pl->pl_prop != ZPROP_INVAL) {
-                       const char *propname = (type == ZFS_TYPE_POOL) ?
-                           zpool_prop_to_name(pl->pl_prop) :
-                           zfs_prop_to_name(pl->pl_prop);
-
-                       len = strlen(propname);
-                       if (len > cbp->cb_colwidths[GET_COL_PROPERTY])
-                               cbp->cb_colwidths[GET_COL_PROPERTY] = len;
-               } else {
-                       len = strlen(pl->pl_user_prop);
-                       if (len > cbp->cb_colwidths[GET_COL_PROPERTY])
-                               cbp->cb_colwidths[GET_COL_PROPERTY] = len;
-               }
-
-               /*
-                * 'VALUE' column.  The first property is always the 'name'
-                * property that was tacked on either by /sbin/zfs's
-                * zfs_do_get() or when calling zprop_expand_list(), so we
-                * ignore its width.  If the user specified the name property
-                * to display, then it will be later in the list in any case.
-                */
-               if (pl != cbp->cb_proplist &&
-                   pl->pl_width > cbp->cb_colwidths[GET_COL_VALUE])
-                       cbp->cb_colwidths[GET_COL_VALUE] = pl->pl_width;
-
-               /* 'RECEIVED' column. */
-               if (pl != cbp->cb_proplist &&
-                   pl->pl_recvd_width > cbp->cb_colwidths[GET_COL_RECVD])
-                       cbp->cb_colwidths[GET_COL_RECVD] = pl->pl_recvd_width;
-
-               /*
-                * 'NAME' and 'SOURCE' columns
-                */
-               if (pl->pl_prop == (type == ZFS_TYPE_POOL ? ZPOOL_PROP_NAME :
-                   ZFS_PROP_NAME) &&
-                   pl->pl_width > cbp->cb_colwidths[GET_COL_NAME]) {
-                       cbp->cb_colwidths[GET_COL_NAME] = pl->pl_width;
-                       cbp->cb_colwidths[GET_COL_SOURCE] = pl->pl_width +
-                           strlen(dgettext(TEXT_DOMAIN, "inherited from"));
-               }
-       }
-
-       /*
-        * Now go through and print the headers.
-        */
-       for (i = 0; i < ZFS_GET_NCOLS; i++) {
-               switch (cbp->cb_columns[i]) {
-               case GET_COL_NAME:
-                       title = dgettext(TEXT_DOMAIN, "NAME");
-                       break;
-               case GET_COL_PROPERTY:
-                       title = dgettext(TEXT_DOMAIN, "PROPERTY");
-                       break;
-               case GET_COL_VALUE:
-                       title = dgettext(TEXT_DOMAIN, "VALUE");
-                       break;
-               case GET_COL_RECVD:
-                       title = dgettext(TEXT_DOMAIN, "RECEIVED");
-                       break;
-               case GET_COL_SOURCE:
-                       title = dgettext(TEXT_DOMAIN, "SOURCE");
-                       break;
-               default:
-                       title = NULL;
-               }
-
-               if (title != NULL) {
-                       if (i == (ZFS_GET_NCOLS - 1) ||
-                           cbp->cb_columns[i + 1] == GET_COL_NONE)
-                               (void) printf("%s", title);
-                       else
-                               (void) printf("%-*s  ",
-                                   cbp->cb_colwidths[cbp->cb_columns[i]],
-                                   title);
-               }
-       }
-       (void) printf("\n");
-}
-
-/*
- * Display a single line of output, according to the settings in the callback
- * structure.
- */
-void
-zprop_print_one_property(const char *name, zprop_get_cbdata_t *cbp,
-    const char *propname, const char *value, zprop_source_t sourcetype,
-    const char *source, const char *recvd_value)
-{
-       int i;
-       const char *str = NULL;
-       char buf[128];
-
-       /*
-        * Ignore those source types that the user has chosen to ignore.
-        */
-       if ((sourcetype & cbp->cb_sources) == 0)
-               return;
-
-       if (cbp->cb_first)
-               zprop_print_headers(cbp, cbp->cb_type);
-
-       for (i = 0; i < ZFS_GET_NCOLS; i++) {
-               switch (cbp->cb_columns[i]) {
-               case GET_COL_NAME:
-                       str = name;
-                       break;
-
-               case GET_COL_PROPERTY:
-                       str = propname;
-                       break;
-
-               case GET_COL_VALUE:
-                       str = value;
-                       break;
-
-               case GET_COL_SOURCE:
-                       switch (sourcetype) {
-                       case ZPROP_SRC_NONE:
-                               str = "-";
-                               break;
-
-                       case ZPROP_SRC_DEFAULT:
-                               str = "default";
-                               break;
-
-                       case ZPROP_SRC_LOCAL:
-                               str = "local";
-                               break;
-
-                       case ZPROP_SRC_TEMPORARY:
-                               str = "temporary";
-                               break;
-
-                       case ZPROP_SRC_INHERITED:
-                               (void) snprintf(buf, sizeof (buf),
-                                   "inherited from %s", source);
-                               str = buf;
-                               break;
-                       case ZPROP_SRC_RECEIVED:
-                               str = "received";
-                               break;
-                       }
-                       break;
-
-               case GET_COL_RECVD:
-                       str = (recvd_value == NULL ? "-" : recvd_value);
-                       break;
-
-               default:
-                       continue;
-               }
-
-               if (cbp->cb_columns[i + 1] == GET_COL_NONE)
-                       (void) printf("%s", str);
-               else if (cbp->cb_scripted)
-                       (void) printf("%s\t", str);
-               else
-                       (void) printf("%-*s  ",
-                           cbp->cb_colwidths[cbp->cb_columns[i]],
-                           str);
-       }
-
-       (void) printf("\n");
-}
-
-/*
- * Given a numeric suffix, convert the value into a number of bits that the
- * resulting value must be shifted.
- */
-static int
-str2shift(libzfs_handle_t *hdl, const char *buf)
-{
-       const char *ends = "BKMGTPEZ";
-       int i;
-
-       if (buf[0] == '\0')
-               return (0);
-       for (i = 0; i < strlen(ends); i++) {
-               if (toupper(buf[0]) == ends[i])
-                       break;
-       }
-       if (i == strlen(ends)) {
-               if (hdl)
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "invalid numeric suffix '%s'"), buf);
-               return (-1);
-       }
-
-       /*
-        * Allow 'G' = 'GB' = 'GiB', case-insensitively.
-        * However, 'BB' and 'BiB' are disallowed.
-        */
-       if (buf[1] == '\0' ||
-           (toupper(buf[0]) != 'B' &&
-           ((toupper(buf[1]) == 'B' && buf[2] == '\0') ||
-           (toupper(buf[1]) == 'I' && toupper(buf[2]) == 'B' &&
-           buf[3] == '\0'))))
-               return (10 * i);
-
-       if (hdl)
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "invalid numeric suffix '%s'"), buf);
-       return (-1);
-}
-
-/*
- * Convert a string of the form '100G' into a real number.  Used when setting
- * properties or creating a volume.  'buf' is used to place an extended error
- * message for the caller to use.
- */
-int
-zfs_nicestrtonum(libzfs_handle_t *hdl, const char *value, uint64_t *num)
-{
-       char *end;
-       int shift;
-
-       *num = 0;
-
-       /* Check to see if this looks like a number.  */
-       if ((value[0] < '0' || value[0] > '9') && value[0] != '.') {
-               if (hdl)
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "bad numeric value '%s'"), value);
-               return (-1);
-       }
-
-       /* Rely on strtoull() to process the numeric portion.  */
-       errno = 0;
-       *num = strtoull(value, &end, 10);
-
-       /*
-        * Check for ERANGE, which indicates that the value is too large to fit
-        * in a 64-bit value.
-        */
-       if (errno == ERANGE) {
-               if (hdl)
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "numeric value is too large"));
-               return (-1);
-       }
-
-       /*
-        * If we have a decimal value, then do the computation with floating
-        * point arithmetic.  Otherwise, use standard arithmetic.
-        */
-       if (*end == '.') {
-               double fval = strtod(value, &end);
-
-               if ((shift = str2shift(hdl, end)) == -1)
-                       return (-1);
-
-               fval *= pow(2, shift);
-
-               if (fval > UINT64_MAX) {
-                       if (hdl)
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "numeric value is too large"));
-                       return (-1);
-               }
-
-               *num = (uint64_t)fval;
-       } else {
-               if ((shift = str2shift(hdl, end)) == -1)
-                       return (-1);
-
-               /* Check for overflow */
-               if (shift >= 64 || (*num << shift) >> shift != *num) {
-                       if (hdl)
-                               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                                   "numeric value is too large"));
-                       return (-1);
-               }
-
-               *num <<= shift;
-       }
-
-       return (0);
-}
-
-/*
- * Given a propname=value nvpair to set, parse any numeric properties
- * (index, boolean, etc) if they are specified as strings and add the
- * resulting nvpair to the returned nvlist.
- *
- * At the DSL layer, all properties are either 64-bit numbers or strings.
- * We want the user to be able to ignore this fact and specify properties
- * as native values (numbers, for example) or as strings (to simplify
- * command line utilities).  This also handles converting index types
- * (compression, checksum, etc) from strings to their on-disk index.
- */
-int
-zprop_parse_value(libzfs_handle_t *hdl, nvpair_t *elem, int prop,
-    zfs_type_t type, nvlist_t *ret, char **svalp, uint64_t *ivalp,
-    const char *errbuf)
-{
-       data_type_t datatype = nvpair_type(elem);
-       zprop_type_t proptype;
-       const char *propname;
-       char *value;
-       boolean_t isnone = B_FALSE;
-
-       if (type == ZFS_TYPE_POOL) {
-               proptype = zpool_prop_get_type(prop);
-               propname = zpool_prop_to_name(prop);
-       } else {
-               proptype = zfs_prop_get_type(prop);
-               propname = zfs_prop_to_name(prop);
-       }
-
-       /*
-        * Convert any properties to the internal DSL value types.
-        */
-       *svalp = NULL;
-       *ivalp = 0;
-
-       switch (proptype) {
-       case PROP_TYPE_STRING:
-               if (datatype != DATA_TYPE_STRING) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "'%s' must be a string"), nvpair_name(elem));
-                       goto error;
-               }
-               (void) nvpair_value_string(elem, svalp);
-               if (strlen(*svalp) >= ZFS_MAXPROPLEN) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "'%s' is too long"), nvpair_name(elem));
-                       goto error;
-               }
-               break;
-
-       case PROP_TYPE_NUMBER:
-               if (datatype == DATA_TYPE_STRING) {
-                       (void) nvpair_value_string(elem, &value);
-                       if (strcmp(value, "none") == 0) {
-                               isnone = B_TRUE;
-                       } else if (zfs_nicestrtonum(hdl, value, ivalp)
-                           != 0) {
-                               goto error;
-                       }
-               } else if (datatype == DATA_TYPE_UINT64) {
-                       (void) nvpair_value_uint64(elem, ivalp);
-               } else {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "'%s' must be a number"), nvpair_name(elem));
-                       goto error;
-               }
-
-               /*
-                * Quota special: force 'none' and don't allow 0.
-                */
-               if ((type & ZFS_TYPE_DATASET) && *ivalp == 0 && !isnone &&
-                   (prop == ZFS_PROP_QUOTA || prop == ZFS_PROP_REFQUOTA)) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "use 'none' to disable quota/refquota"));
-                       goto error;
-               }
-
-               /*
-                * Special handling for "*_limit=none". In this case it's not
-                * 0 but UINT64_MAX.
-                */
-               if ((type & ZFS_TYPE_DATASET) && isnone &&
-                   (prop == ZFS_PROP_FILESYSTEM_LIMIT ||
-                   prop == ZFS_PROP_SNAPSHOT_LIMIT)) {
-                       *ivalp = UINT64_MAX;
-               }
-               break;
-
-       case PROP_TYPE_INDEX:
-               if (datatype != DATA_TYPE_STRING) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "'%s' must be a string"), nvpair_name(elem));
-                       goto error;
-               }
-
-               (void) nvpair_value_string(elem, &value);
-
-               if (zprop_string_to_index(prop, value, ivalp, type) != 0) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "'%s' must be one of '%s'"), propname,
-                           zprop_values(prop, type));
-                       goto error;
-               }
-               break;
-
-       default:
-               abort();
-       }
-
-       /*
-        * Add the result to our return set of properties.
-        */
-       if (*svalp != NULL) {
-               if (nvlist_add_string(ret, propname, *svalp) != 0) {
-                       (void) no_memory(hdl);
-                       return (-1);
-               }
-       } else {
-               if (nvlist_add_uint64(ret, propname, *ivalp) != 0) {
-                       (void) no_memory(hdl);
-                       return (-1);
-               }
-       }
-
-       return (0);
-error:
-       (void) zfs_error(hdl, EZFS_BADPROP, errbuf);
-       return (-1);
-}
-
-static int
-addlist(libzfs_handle_t *hdl, char *propname, zprop_list_t **listp,
-    zfs_type_t type)
-{
-       int prop;
-       zprop_list_t *entry;
-
-       prop = zprop_name_to_prop(propname, type);
-
-       if (prop != ZPROP_INVAL && !zprop_valid_for_type(prop, type, B_FALSE))
-               prop = ZPROP_INVAL;
-
-       /*
-        * When no property table entry can be found, return failure if
-        * this is a pool property or if this isn't a user-defined
-        * dataset property,
-        */
-       if (prop == ZPROP_INVAL && ((type == ZFS_TYPE_POOL &&
-           !zpool_prop_feature(propname) &&
-           !zpool_prop_unsupported(propname)) ||
-           (type == ZFS_TYPE_DATASET && !zfs_prop_user(propname) &&
-           !zfs_prop_userquota(propname) && !zfs_prop_written(propname)))) {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "invalid property '%s'"), propname);
-               return (zfs_error(hdl, EZFS_BADPROP,
-                   dgettext(TEXT_DOMAIN, "bad property list")));
-       }
-
-       if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL)
-               return (-1);
-
-       entry->pl_prop = prop;
-       if (prop == ZPROP_INVAL) {
-               if ((entry->pl_user_prop = zfs_strdup(hdl, propname)) ==
-                   NULL) {
-                       free(entry);
-                       return (-1);
-               }
-               entry->pl_width = strlen(propname);
-       } else {
-               entry->pl_width = zprop_width(prop, &entry->pl_fixed,
-                   type);
-       }
-
-       *listp = entry;
-
-       return (0);
-}
-
-/*
- * Given a comma-separated list of properties, construct a property list
- * containing both user-defined and native properties.  This function will
- * return a NULL list if 'all' is specified, which can later be expanded
- * by zprop_expand_list().
- */
-int
-zprop_get_list(libzfs_handle_t *hdl, char *props, zprop_list_t **listp,
-    zfs_type_t type)
-{
-       *listp = NULL;
-
-       /*
-        * If 'all' is specified, return a NULL list.
-        */
-       if (strcmp(props, "all") == 0)
-               return (0);
-
-       /*
-        * If no props were specified, return an error.
-        */
-       if (props[0] == '\0') {
-               zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                   "no properties specified"));
-               return (zfs_error(hdl, EZFS_BADPROP, dgettext(TEXT_DOMAIN,
-                   "bad property list")));
-       }
-
-       /*
-        * It would be nice to use getsubopt() here, but the inclusion of column
-        * aliases makes this more effort than it's worth.
-        */
-       while (*props != '\0') {
-               size_t len;
-               char *p;
-               char c;
-
-               if ((p = strchr(props, ',')) == NULL) {
-                       len = strlen(props);
-                       p = props + len;
-               } else {
-                       len = p - props;
-               }
-
-               /*
-                * Check for empty options.
-                */
-               if (len == 0) {
-                       zfs_error_aux(hdl, dgettext(TEXT_DOMAIN,
-                           "empty property name"));
-                       return (zfs_error(hdl, EZFS_BADPROP,
-                           dgettext(TEXT_DOMAIN, "bad property list")));
-               }
-
-               /*
-                * Check all regular property names.
-                */
-               c = props[len];
-               props[len] = '\0';
-
-               if (strcmp(props, "space") == 0) {
-                       static char *spaceprops[] = {
-                               "name", "avail", "used", "usedbysnapshots",
-                               "usedbydataset", "usedbyrefreservation",
-                               "usedbychildren", NULL
-                       };
-                       int i;
-
-                       for (i = 0; spaceprops[i]; i++) {
-                               if (addlist(hdl, spaceprops[i], listp, type))
-                                       return (-1);
-                               listp = &(*listp)->pl_next;
-                       }
-               } else {
-                       if (addlist(hdl, props, listp, type))
-                               return (-1);
-                       listp = &(*listp)->pl_next;
-               }
-
-               props = p;
-               if (c == ',')
-                       props++;
-       }
-
-       return (0);
-}
-
-void
-zprop_free_list(zprop_list_t *pl)
-{
-       zprop_list_t *next;
-
-       while (pl != NULL) {
-               next = pl->pl_next;
-               free(pl->pl_user_prop);
-               free(pl);
-               pl = next;
-       }
-}
-
-typedef struct expand_data {
-       zprop_list_t    **last;
-       libzfs_handle_t *hdl;
-       zfs_type_t type;
-} expand_data_t;
-
-int
-zprop_expand_list_cb(int prop, void *cb)
-{
-       zprop_list_t *entry;
-       expand_data_t *edp = cb;
-
-       if ((entry = zfs_alloc(edp->hdl, sizeof (zprop_list_t))) == NULL)
-               return (ZPROP_INVAL);
-
-       entry->pl_prop = prop;
-       entry->pl_width = zprop_width(prop, &entry->pl_fixed, edp->type);
-       entry->pl_all = B_TRUE;
-
-       *(edp->last) = entry;
-       edp->last = &entry->pl_next;
-
-       return (ZPROP_CONT);
-}
-
-int
-zprop_expand_list(libzfs_handle_t *hdl, zprop_list_t **plp, zfs_type_t type)
-{
-       zprop_list_t *entry;
-       zprop_list_t **last;
-       expand_data_t exp;
-
-       if (*plp == NULL) {
-               /*
-                * If this is the very first time we've been called for an 'all'
-                * specification, expand the list to include all native
-                * properties.
-                */
-               last = plp;
-
-               exp.last = last;
-               exp.hdl = hdl;
-               exp.type = type;
-
-               if (zprop_iter_common(zprop_expand_list_cb, &exp, B_FALSE,
-                   B_FALSE, type) == ZPROP_INVAL)
-                       return (-1);
-
-               /*
-                * Add 'name' to the beginning of the list, which is handled
-                * specially.
-                */
-               if ((entry = zfs_alloc(hdl, sizeof (zprop_list_t))) == NULL)
-                       return (-1);
-
-               entry->pl_prop = (type == ZFS_TYPE_POOL) ?  ZPOOL_PROP_NAME :
-                   ZFS_PROP_NAME;
-               entry->pl_width = zprop_width(entry->pl_prop,
-                   &entry->pl_fixed, type);
-               entry->pl_all = B_TRUE;
-               entry->pl_next = *plp;
-               *plp = entry;
-       }
-       return (0);
-}
-
-int
-zprop_iter(zprop_func func, void *cb, boolean_t show_all, boolean_t ordered,
-    zfs_type_t type)
-{
-       return (zprop_iter_common(func, cb, show_all, ordered, type));
-}
diff --git a/zfs/lib/libzfs_core/Makefile.am b/zfs/lib/libzfs_core/Makefile.am
deleted file mode 100644 (file)
index 5eafc25..0000000
+++ /dev/null
@@ -1,23 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-lib_LTLIBRARIES = libzfs_core.la
-
-USER_C = \
-       libzfs_core.c
-
-KERNEL_C =
-
-nodist_libzfs_core_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-libzfs_core_la_LIBADD = \
-       $(top_builddir)/lib/libnvpair/libnvpair.la
-
-libzfs_core_la_LDFLAGS = -version-info 1:0:0
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libzfs_core/Makefile.in b/zfs/lib/libzfs_core/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libzfs_core/libzfs_core.c b/zfs/lib/libzfs_core/libzfs_core.c
deleted file mode 100644 (file)
index b706e6f..0000000
+++ /dev/null
@@ -1,741 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-
-/*
- * Copyright (c) 2012, 2014 by Delphix. All rights reserved.
- * Copyright (c) 2013 Steven Hartland. All rights reserved.
- */
-
-/*
- * LibZFS_Core (lzc) is intended to replace most functionality in libzfs.
- * It has the following characteristics:
- *
- *  - Thread Safe.  libzfs_core is accessible concurrently from multiple
- *  threads.  This is accomplished primarily by avoiding global data
- *  (e.g. caching).  Since it's thread-safe, there is no reason for a
- *  process to have multiple libzfs "instances".  Therefore, we store
- *  our few pieces of data (e.g. the file descriptor) in global
- *  variables.  The fd is reference-counted so that the libzfs_core
- *  library can be "initialized" multiple times (e.g. by different
- *  consumers within the same process).
- *
- *  - Committed Interface.  The libzfs_core interface will be committed,
- *  therefore consumers can compile against it and be confident that
- *  their code will continue to work on future releases of this code.
- *  Currently, the interface is Evolving (not Committed), but we intend
- *  to commit to it once it is more complete and we determine that it
- *  meets the needs of all consumers.
- *
- *  - Programmatic Error Handling.  libzfs_core communicates errors with
- *  defined error numbers, and doesn't print anything to stdout/stderr.
- *
- *  - Thin Layer.  libzfs_core is a thin layer, marshaling arguments
- *  to/from the kernel ioctls.  There is generally a 1:1 correspondence
- *  between libzfs_core functions and ioctls to /dev/zfs.
- *
- *  - Clear Atomicity.  Because libzfs_core functions are generally 1:1
- *  with kernel ioctls, and kernel ioctls are general atomic, each
- *  libzfs_core function is atomic.  For example, creating multiple
- *  snapshots with a single call to lzc_snapshot() is atomic -- it
- *  can't fail with only some of the requested snapshots created, even
- *  in the event of power loss or system crash.
- *
- *  - Continued libzfs Support.  Some higher-level operations (e.g.
- *  support for "zfs send -R") are too complicated to fit the scope of
- *  libzfs_core.  This functionality will continue to live in libzfs.
- *  Where appropriate, libzfs will use the underlying atomic operations
- *  of libzfs_core.  For example, libzfs may implement "zfs send -R |
- *  zfs receive" by using individual "send one snapshot", rename,
- *  destroy, and "receive one snapshot" operations in libzfs_core.
- *  /sbin/zfs and /zbin/zpool will link with both libzfs and
- *  libzfs_core.  Other consumers should aim to use only libzfs_core,
- *  since that will be the supported, stable interface going forwards.
- */
-
-#include <libzfs_core.h>
-#include <ctype.h>
-#include <unistd.h>
-#include <stdlib.h>
-#include <string.h>
-#include <errno.h>
-#include <fcntl.h>
-#include <pthread.h>
-#include <sys/nvpair.h>
-#include <sys/param.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <sys/zfs_ioctl.h>
-
-static int g_fd;
-static pthread_mutex_t g_lock = PTHREAD_MUTEX_INITIALIZER;
-static int g_refcount;
-
-int
-libzfs_core_init(void)
-{
-       (void) pthread_mutex_lock(&g_lock);
-       if (g_refcount == 0) {
-               g_fd = open("/dev/zfs", O_RDWR);
-               if (g_fd < 0) {
-                       (void) pthread_mutex_unlock(&g_lock);
-                       return (errno);
-               }
-       }
-       g_refcount++;
-       (void) pthread_mutex_unlock(&g_lock);
-       return (0);
-}
-
-void
-libzfs_core_fini(void)
-{
-       (void) pthread_mutex_lock(&g_lock);
-       ASSERT3S(g_refcount, >, 0);
-       g_refcount--;
-       if (g_refcount == 0)
-               (void) close(g_fd);
-       (void) pthread_mutex_unlock(&g_lock);
-}
-
-static int
-lzc_ioctl(zfs_ioc_t ioc, const char *name,
-    nvlist_t *source, nvlist_t **resultp)
-{
-       zfs_cmd_t zc = {"\0"};
-       int error = 0;
-       char *packed;
-       size_t size;
-
-       ASSERT3S(g_refcount, >, 0);
-
-       (void) strlcpy(zc.zc_name, name, sizeof (zc.zc_name));
-
-       packed = fnvlist_pack(source, &size);
-       zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed;
-       zc.zc_nvlist_src_size = size;
-
-       if (resultp != NULL) {
-               *resultp = NULL;
-               zc.zc_nvlist_dst_size = MAX(size * 2, 128 * 1024);
-               zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
-                   malloc(zc.zc_nvlist_dst_size);
-               if (zc.zc_nvlist_dst == (uint64_t)0) {
-                       error = ENOMEM;
-                       goto out;
-               }
-       }
-
-       while (ioctl(g_fd, ioc, &zc) != 0) {
-               if (errno == ENOMEM && resultp != NULL) {
-                       free((void *)(uintptr_t)zc.zc_nvlist_dst);
-                       zc.zc_nvlist_dst_size *= 2;
-                       zc.zc_nvlist_dst = (uint64_t)(uintptr_t)
-                           malloc(zc.zc_nvlist_dst_size);
-                       if (zc.zc_nvlist_dst == (uint64_t)0) {
-                               error = ENOMEM;
-                               goto out;
-                       }
-               } else {
-                       error = errno;
-                       break;
-               }
-       }
-       if (zc.zc_nvlist_dst_filled) {
-               *resultp = fnvlist_unpack((void *)(uintptr_t)zc.zc_nvlist_dst,
-                   zc.zc_nvlist_dst_size);
-       }
-
-out:
-       fnvlist_pack_free(packed, size);
-       free((void *)(uintptr_t)zc.zc_nvlist_dst);
-       return (error);
-}
-
-int
-lzc_create(const char *fsname, dmu_objset_type_t type, nvlist_t *props)
-{
-       int error;
-       nvlist_t *args = fnvlist_alloc();
-       fnvlist_add_int32(args, "type", type);
-       if (props != NULL)
-               fnvlist_add_nvlist(args, "props", props);
-       error = lzc_ioctl(ZFS_IOC_CREATE, fsname, args, NULL);
-       nvlist_free(args);
-       return (error);
-}
-
-int
-lzc_clone(const char *fsname, const char *origin,
-    nvlist_t *props)
-{
-       int error;
-       nvlist_t *args = fnvlist_alloc();
-       fnvlist_add_string(args, "origin", origin);
-       if (props != NULL)
-               fnvlist_add_nvlist(args, "props", props);
-       error = lzc_ioctl(ZFS_IOC_CLONE, fsname, args, NULL);
-       nvlist_free(args);
-       return (error);
-}
-
-/*
- * Creates snapshots.
- *
- * The keys in the snaps nvlist are the snapshots to be created.
- * They must all be in the same pool.
- *
- * The props nvlist is properties to set.  Currently only user properties
- * are supported.  { user:prop_name -> string value }
- *
- * The returned results nvlist will have an entry for each snapshot that failed.
- * The value will be the (int32) error code.
- *
- * The return value will be 0 if all snapshots were created, otherwise it will
- * be the errno of a (unspecified) snapshot that failed.
- */
-int
-lzc_snapshot(nvlist_t *snaps, nvlist_t *props, nvlist_t **errlist)
-{
-       nvpair_t *elem;
-       nvlist_t *args;
-       int error;
-       char pool[MAXNAMELEN];
-
-       *errlist = NULL;
-
-       /* determine the pool name */
-       elem = nvlist_next_nvpair(snaps, NULL);
-       if (elem == NULL)
-               return (0);
-       (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
-       pool[strcspn(pool, "/@")] = '\0';
-
-       args = fnvlist_alloc();
-       fnvlist_add_nvlist(args, "snaps", snaps);
-       if (props != NULL)
-               fnvlist_add_nvlist(args, "props", props);
-
-       error = lzc_ioctl(ZFS_IOC_SNAPSHOT, pool, args, errlist);
-       nvlist_free(args);
-
-       return (error);
-}
-
-/*
- * Destroys snapshots.
- *
- * The keys in the snaps nvlist are the snapshots to be destroyed.
- * They must all be in the same pool.
- *
- * Snapshots that do not exist will be silently ignored.
- *
- * If 'defer' is not set, and a snapshot has user holds or clones, the
- * destroy operation will fail and none of the snapshots will be
- * destroyed.
- *
- * If 'defer' is set, and a snapshot has user holds or clones, it will be
- * marked for deferred destruction, and will be destroyed when the last hold
- * or clone is removed/destroyed.
- *
- * The return value will be 0 if all snapshots were destroyed (or marked for
- * later destruction if 'defer' is set) or didn't exist to begin with.
- *
- * Otherwise the return value will be the errno of a (unspecified) snapshot
- * that failed, no snapshots will be destroyed, and the errlist will have an
- * entry for each snapshot that failed.  The value in the errlist will be
- * the (int32) error code.
- */
-int
-lzc_destroy_snaps(nvlist_t *snaps, boolean_t defer, nvlist_t **errlist)
-{
-       nvpair_t *elem;
-       nvlist_t *args;
-       int error;
-       char pool[MAXNAMELEN];
-
-       /* determine the pool name */
-       elem = nvlist_next_nvpair(snaps, NULL);
-       if (elem == NULL)
-               return (0);
-       (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
-       pool[strcspn(pool, "/@")] = '\0';
-
-       args = fnvlist_alloc();
-       fnvlist_add_nvlist(args, "snaps", snaps);
-       if (defer)
-               fnvlist_add_boolean(args, "defer");
-
-       error = lzc_ioctl(ZFS_IOC_DESTROY_SNAPS, pool, args, errlist);
-       nvlist_free(args);
-
-       return (error);
-}
-
-int
-lzc_snaprange_space(const char *firstsnap, const char *lastsnap,
-    uint64_t *usedp)
-{
-       nvlist_t *args;
-       nvlist_t *result;
-       int err;
-       char fs[MAXNAMELEN];
-       char *atp;
-
-       /* determine the fs name */
-       (void) strlcpy(fs, firstsnap, sizeof (fs));
-       atp = strchr(fs, '@');
-       if (atp == NULL)
-               return (EINVAL);
-       *atp = '\0';
-
-       args = fnvlist_alloc();
-       fnvlist_add_string(args, "firstsnap", firstsnap);
-
-       err = lzc_ioctl(ZFS_IOC_SPACE_SNAPS, lastsnap, args, &result);
-       nvlist_free(args);
-       if (err == 0)
-               *usedp = fnvlist_lookup_uint64(result, "used");
-       fnvlist_free(result);
-
-       return (err);
-}
-
-boolean_t
-lzc_exists(const char *dataset)
-{
-       /*
-        * The objset_stats ioctl is still legacy, so we need to construct our
-        * own zfs_cmd_t rather than using zfsc_ioctl().
-        */
-       zfs_cmd_t zc = {"\0"};
-
-       (void) strlcpy(zc.zc_name, dataset, sizeof (zc.zc_name));
-       return (ioctl(g_fd, ZFS_IOC_OBJSET_STATS, &zc) == 0);
-}
-
-/*
- * Create "user holds" on snapshots.  If there is a hold on a snapshot,
- * the snapshot can not be destroyed.  (However, it can be marked for deletion
- * by lzc_destroy_snaps(defer=B_TRUE).)
- *
- * The keys in the nvlist are snapshot names.
- * The snapshots must all be in the same pool.
- * The value is the name of the hold (string type).
- *
- * If cleanup_fd is not -1, it must be the result of open("/dev/zfs", O_EXCL).
- * In this case, when the cleanup_fd is closed (including on process
- * termination), the holds will be released.  If the system is shut down
- * uncleanly, the holds will be released when the pool is next opened
- * or imported.
- *
- * Holds for snapshots which don't exist will be skipped and have an entry
- * added to errlist, but will not cause an overall failure.
- *
- * The return value will be 0 if all holds, for snapshots that existed,
- * were successfully created.
- *
- * Otherwise the return value will be the errno of a (unspecified) hold that
- * failed and no holds will be created.
- *
- * In all cases the errlist will have an entry for each hold that failed
- * (name = snapshot), with its value being the error code (int32).
- */
-int
-lzc_hold(nvlist_t *holds, int cleanup_fd, nvlist_t **errlist)
-{
-       char pool[MAXNAMELEN];
-       nvlist_t *args;
-       nvpair_t *elem;
-       int error;
-
-       /* determine the pool name */
-       elem = nvlist_next_nvpair(holds, NULL);
-       if (elem == NULL)
-               return (0);
-       (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
-       pool[strcspn(pool, "/@")] = '\0';
-
-       args = fnvlist_alloc();
-       fnvlist_add_nvlist(args, "holds", holds);
-       if (cleanup_fd != -1)
-               fnvlist_add_int32(args, "cleanup_fd", cleanup_fd);
-
-       error = lzc_ioctl(ZFS_IOC_HOLD, pool, args, errlist);
-       nvlist_free(args);
-       return (error);
-}
-
-/*
- * Release "user holds" on snapshots.  If the snapshot has been marked for
- * deferred destroy (by lzc_destroy_snaps(defer=B_TRUE)), it does not have
- * any clones, and all the user holds are removed, then the snapshot will be
- * destroyed.
- *
- * The keys in the nvlist are snapshot names.
- * The snapshots must all be in the same pool.
- * The value is a nvlist whose keys are the holds to remove.
- *
- * Holds which failed to release because they didn't exist will have an entry
- * added to errlist, but will not cause an overall failure.
- *
- * The return value will be 0 if the nvl holds was empty or all holds that
- * existed, were successfully removed.
- *
- * Otherwise the return value will be the errno of a (unspecified) hold that
- * failed to release and no holds will be released.
- *
- * In all cases the errlist will have an entry for each hold that failed to
- * to release.
- */
-int
-lzc_release(nvlist_t *holds, nvlist_t **errlist)
-{
-       char pool[MAXNAMELEN];
-       nvpair_t *elem;
-
-       /* determine the pool name */
-       elem = nvlist_next_nvpair(holds, NULL);
-       if (elem == NULL)
-               return (0);
-       (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
-       pool[strcspn(pool, "/@")] = '\0';
-
-       return (lzc_ioctl(ZFS_IOC_RELEASE, pool, holds, errlist));
-}
-
-/*
- * Retrieve list of user holds on the specified snapshot.
- *
- * On success, *holdsp will be set to a nvlist which the caller must free.
- * The keys are the names of the holds, and the value is the creation time
- * of the hold (uint64) in seconds since the epoch.
- */
-int
-lzc_get_holds(const char *snapname, nvlist_t **holdsp)
-{
-       int error;
-       nvlist_t *innvl = fnvlist_alloc();
-       error = lzc_ioctl(ZFS_IOC_GET_HOLDS, snapname, innvl, holdsp);
-       fnvlist_free(innvl);
-       return (error);
-}
-
-/*
- * Generate a zfs send stream for the specified snapshot and write it to
- * the specified file descriptor.
- *
- * "snapname" is the full name of the snapshot to send (e.g. "pool/fs@snap")
- *
- * If "from" is NULL, a full (non-incremental) stream will be sent.
- * If "from" is non-NULL, it must be the full name of a snapshot or
- * bookmark to send an incremental from (e.g. "pool/fs@earlier_snap" or
- * "pool/fs#earlier_bmark").  If non-NULL, the specified snapshot or
- * bookmark must represent an earlier point in the history of "snapname").
- * It can be an earlier snapshot in the same filesystem or zvol as "snapname",
- * or it can be the origin of "snapname"'s filesystem, or an earlier
- * snapshot in the origin, etc.
- *
- * "fd" is the file descriptor to write the send stream to.
- *
- * If "flags" contains LZC_SEND_FLAG_LARGE_BLOCK, the stream is permitted
- * to contain DRR_WRITE records with drr_length > 128K, and DRR_OBJECT
- * records with drr_blksz > 128K.
- *
- * If "flags" contains LZC_SEND_FLAG_EMBED_DATA, the stream is permitted
- * to contain DRR_WRITE_EMBEDDED records with drr_etype==BP_EMBEDDED_TYPE_DATA,
- * which the receiving system must support (as indicated by support
- * for the "embedded_data" feature).
- */
-int
-lzc_send(const char *snapname, const char *from, int fd,
-    enum lzc_send_flags flags)
-{
-       nvlist_t *args;
-       int err;
-
-       args = fnvlist_alloc();
-       fnvlist_add_int32(args, "fd", fd);
-       if (from != NULL)
-               fnvlist_add_string(args, "fromsnap", from);
-       if (flags & LZC_SEND_FLAG_LARGE_BLOCK)
-               fnvlist_add_boolean(args, "largeblockok");
-       if (flags & LZC_SEND_FLAG_EMBED_DATA)
-               fnvlist_add_boolean(args, "embedok");
-       err = lzc_ioctl(ZFS_IOC_SEND_NEW, snapname, args, NULL);
-       nvlist_free(args);
-       return (err);
-}
-
-/*
- * "from" can be NULL, a snapshot, or a bookmark.
- *
- * If from is NULL, a full (non-incremental) stream will be estimated.  This
- * is calculated very efficiently.
- *
- * If from is a snapshot, lzc_send_space uses the deadlists attached to
- * each snapshot to efficiently estimate the stream size.
- *
- * If from is a bookmark, the indirect blocks in the destination snapshot
- * are traversed, looking for blocks with a birth time since the creation TXG of
- * the snapshot this bookmark was created from.  This will result in
- * significantly more I/O and be less efficient than a send space estimation on
- * an equivalent snapshot.
- */
-int
-lzc_send_space(const char *snapname, const char *from, uint64_t *spacep)
-{
-       nvlist_t *args;
-       nvlist_t *result;
-       int err;
-
-       args = fnvlist_alloc();
-       if (from != NULL)
-               fnvlist_add_string(args, "from", from);
-       err = lzc_ioctl(ZFS_IOC_SEND_SPACE, snapname, args, &result);
-       nvlist_free(args);
-       if (err == 0)
-               *spacep = fnvlist_lookup_uint64(result, "space");
-       nvlist_free(result);
-       return (err);
-}
-
-static int
-recv_read(int fd, void *buf, int ilen)
-{
-       char *cp = buf;
-       int rv;
-       int len = ilen;
-
-       do {
-               rv = read(fd, cp, len);
-               cp += rv;
-               len -= rv;
-       } while (rv > 0);
-
-       if (rv < 0 || len != 0)
-               return (EIO);
-
-       return (0);
-}
-
-/*
- * The simplest receive case: receive from the specified fd, creating the
- * specified snapshot.  Apply the specified properties a "received" properties
- * (which can be overridden by locally-set properties).  If the stream is a
- * clone, its origin snapshot must be specified by 'origin'.  The 'force'
- * flag will cause the target filesystem to be rolled back or destroyed if
- * necessary to receive.
- *
- * Return 0 on success or an errno on failure.
- *
- * Note: this interface does not work on dedup'd streams
- * (those with DMU_BACKUP_FEATURE_DEDUP).
- */
-int
-lzc_receive(const char *snapname, nvlist_t *props, const char *origin,
-    boolean_t force, int fd)
-{
-       /*
-        * The receive ioctl is still legacy, so we need to construct our own
-        * zfs_cmd_t rather than using zfsc_ioctl().
-        */
-       zfs_cmd_t zc = {"\0"};
-       char *atp;
-       char *packed = NULL;
-       size_t size;
-       dmu_replay_record_t drr;
-       int error;
-
-       ASSERT3S(g_refcount, >, 0);
-
-       /* zc_name is name of containing filesystem */
-       (void) strlcpy(zc.zc_name, snapname, sizeof (zc.zc_name));
-       atp = strchr(zc.zc_name, '@');
-       if (atp == NULL)
-               return (EINVAL);
-       *atp = '\0';
-
-       /* if the fs does not exist, try its parent. */
-       if (!lzc_exists(zc.zc_name)) {
-               char *slashp = strrchr(zc.zc_name, '/');
-               if (slashp == NULL)
-                       return (ENOENT);
-               *slashp = '\0';
-
-       }
-
-       /* zc_value is full name of the snapshot to create */
-       (void) strlcpy(zc.zc_value, snapname, sizeof (zc.zc_value));
-
-       if (props != NULL) {
-               /* zc_nvlist_src is props to set */
-               packed = fnvlist_pack(props, &size);
-               zc.zc_nvlist_src = (uint64_t)(uintptr_t)packed;
-               zc.zc_nvlist_src_size = size;
-       }
-
-       /* zc_string is name of clone origin (if DRR_FLAG_CLONE) */
-       if (origin != NULL)
-               (void) strlcpy(zc.zc_string, origin, sizeof (zc.zc_string));
-
-       /* zc_begin_record is non-byteswapped BEGIN record */
-       error = recv_read(fd, &drr, sizeof (drr));
-       if (error != 0)
-               goto out;
-       zc.zc_begin_record = drr.drr_u.drr_begin;
-
-       /* zc_cookie is fd to read from */
-       zc.zc_cookie = fd;
-
-       /* zc guid is force flag */
-       zc.zc_guid = force;
-
-       /* zc_cleanup_fd is unused */
-       zc.zc_cleanup_fd = -1;
-
-       error = ioctl(g_fd, ZFS_IOC_RECV, &zc);
-       if (error != 0)
-               error = errno;
-
-out:
-       if (packed != NULL)
-               fnvlist_pack_free(packed, size);
-       free((void*)(uintptr_t)zc.zc_nvlist_dst);
-       return (error);
-}
-
-/*
- * Roll back this filesystem or volume to its most recent snapshot.
- * If snapnamebuf is not NULL, it will be filled in with the name
- * of the most recent snapshot.
- *
- * Return 0 on success or an errno on failure.
- */
-int
-lzc_rollback(const char *fsname, char *snapnamebuf, int snapnamelen)
-{
-       nvlist_t *args;
-       nvlist_t *result;
-       int err;
-
-       args = fnvlist_alloc();
-       err = lzc_ioctl(ZFS_IOC_ROLLBACK, fsname, args, &result);
-       nvlist_free(args);
-       if (err == 0 && snapnamebuf != NULL) {
-               const char *snapname = fnvlist_lookup_string(result, "target");
-               (void) strlcpy(snapnamebuf, snapname, snapnamelen);
-       }
-       return (err);
-}
-
-/*
- * Creates bookmarks.
- *
- * The bookmarks nvlist maps from name of the bookmark (e.g. "pool/fs#bmark") to
- * the name of the snapshot (e.g. "pool/fs@snap").  All the bookmarks and
- * snapshots must be in the same pool.
- *
- * The returned results nvlist will have an entry for each bookmark that failed.
- * The value will be the (int32) error code.
- *
- * The return value will be 0 if all bookmarks were created, otherwise it will
- * be the errno of a (undetermined) bookmarks that failed.
- */
-int
-lzc_bookmark(nvlist_t *bookmarks, nvlist_t **errlist)
-{
-       nvpair_t *elem;
-       int error;
-       char pool[MAXNAMELEN];
-
-       /* determine the pool name */
-       elem = nvlist_next_nvpair(bookmarks, NULL);
-       if (elem == NULL)
-               return (0);
-       (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
-       pool[strcspn(pool, "/#")] = '\0';
-
-       error = lzc_ioctl(ZFS_IOC_BOOKMARK, pool, bookmarks, errlist);
-
-       return (error);
-}
-
-/*
- * Retrieve bookmarks.
- *
- * Retrieve the list of bookmarks for the given file system. The props
- * parameter is an nvlist of property names (with no values) that will be
- * returned for each bookmark.
- *
- * The following are valid properties on bookmarks, all of which are numbers
- * (represented as uint64 in the nvlist)
- *
- * "guid" - globally unique identifier of the snapshot it refers to
- * "createtxg" - txg when the snapshot it refers to was created
- * "creation" - timestamp when the snapshot it refers to was created
- *
- * The format of the returned nvlist as follows:
- * <short name of bookmark> -> {
- *     <name of property> -> {
- *         "value" -> uint64
- *     }
- *  }
- */
-int
-lzc_get_bookmarks(const char *fsname, nvlist_t *props, nvlist_t **bmarks)
-{
-       return (lzc_ioctl(ZFS_IOC_GET_BOOKMARKS, fsname, props, bmarks));
-}
-
-/*
- * Destroys bookmarks.
- *
- * The keys in the bmarks nvlist are the bookmarks to be destroyed.
- * They must all be in the same pool.  Bookmarks are specified as
- * <fs>#<bmark>.
- *
- * Bookmarks that do not exist will be silently ignored.
- *
- * The return value will be 0 if all bookmarks that existed were destroyed.
- *
- * Otherwise the return value will be the errno of a (undetermined) bookmark
- * that failed, no bookmarks will be destroyed, and the errlist will have an
- * entry for each bookmarks that failed.  The value in the errlist will be
- * the (int32) error code.
- */
-int
-lzc_destroy_bookmarks(nvlist_t *bmarks, nvlist_t **errlist)
-{
-       nvpair_t *elem;
-       int error;
-       char pool[MAXNAMELEN];
-
-       /* determine the pool name */
-       elem = nvlist_next_nvpair(bmarks, NULL);
-       if (elem == NULL)
-               return (0);
-       (void) strlcpy(pool, nvpair_name(elem), sizeof (pool));
-       pool[strcspn(pool, "/#")] = '\0';
-
-       error = lzc_ioctl(ZFS_IOC_DESTROY_BOOKMARKS, pool, bmarks, errlist);
-
-       return (error);
-}
diff --git a/zfs/lib/libzpool/Makefile.am b/zfs/lib/libzpool/Makefile.am
deleted file mode 100644 (file)
index 0bcb5e4..0000000
+++ /dev/null
@@ -1,124 +0,0 @@
-include $(top_srcdir)/config/Rules.am
-
-VPATH = \
-       $(top_srcdir)/module/zfs \
-       $(top_srcdir)/module/zcommon \
-       $(top_srcdir)/lib/libzpool
-
-AM_CFLAGS += $(DEBUG_STACKFLAGS) $(FRAME_LARGER_THAN)
-
-DEFAULT_INCLUDES += \
-       -I$(top_srcdir)/include \
-       -I$(top_srcdir)/lib/libspl/include
-
-lib_LTLIBRARIES = libzpool.la
-
-USER_C = \
-       kernel.c \
-       taskq.c \
-       util.c
-
-KERNEL_C = \
-       zfs_comutil.c \
-       zfs_deleg.c \
-       zfs_fletcher.c \
-       zfs_namecheck.c \
-       zfs_prop.c \
-       zfs_uio.c \
-       zpool_prop.c \
-       zprop_common.c \
-       arc.c \
-       blkptr.c \
-       bplist.c \
-       bpobj.c \
-       bptree.c \
-       dbuf.c \
-       dbuf_stats.c \
-       ddt.c \
-       ddt_zap.c \
-       dmu.c \
-       dmu_diff.c \
-       dmu_object.c \
-       dmu_objset.c \
-       dmu_send.c \
-       dmu_traverse.c \
-       dmu_tx.c \
-       dmu_zfetch.c \
-       dnode.c \
-       dnode_sync.c \
-       dsl_bookmark.c \
-       dsl_dataset.c \
-       dsl_deadlist.c \
-       dsl_deleg.c \
-       dsl_dir.c \
-       dsl_pool.c \
-       dsl_prop.c \
-       dsl_scan.c \
-       dsl_synctask.c \
-       dsl_destroy.c \
-       dsl_userhold.c \
-       fm.c \
-       gzip.c \
-       lzjb.c \
-       lz4.c \
-       metaslab.c \
-       multilist.c \
-       range_tree.c \
-       refcount.c \
-       rrwlock.c \
-       sa.c \
-       sha256.c \
-       spa.c \
-       spa_boot.c \
-       spa_config.c \
-       spa_errlog.c \
-       spa_history.c \
-       spa_misc.c \
-       spa_stats.c \
-       space_map.c \
-       space_reftree.c \
-       txg.c \
-       trace.c \
-       uberblock.c \
-       unique.c \
-       vdev.c \
-       vdev_cache.c \
-       vdev_file.c \
-       vdev_label.c \
-       vdev_mirror.c \
-       vdev_missing.c \
-       vdev_queue.c \
-       vdev_raidz.c \
-       vdev_root.c \
-       zap.c \
-       zap_leaf.c \
-       zap_micro.c \
-       zfeature.c \
-       zfeature_common.c \
-       zfs_byteswap.c \
-       zfs_debug.c \
-       zfs_fm.c \
-       zfs_fuid.c \
-       zfs_sa.c \
-       zfs_znode.c \
-       zil.c \
-       zio.c \
-       zio_checksum.c \
-       zio_compress.c \
-       zio_inject.c \
-       zle.c \
-       zrlock.c
-
-nodist_libzpool_la_SOURCES = \
-       $(USER_C) \
-       $(KERNEL_C)
-
-libzpool_la_LIBADD = \
-       $(top_builddir)/lib/libunicode/libunicode.la \
-       $(top_builddir)/lib/libuutil/libuutil.la \
-       $(top_builddir)/lib/libnvpair/libnvpair.la
-
-libzpool_la_LIBADD += $(ZLIB)
-libzpool_la_LDFLAGS = -version-info 2:0:0
-
-EXTRA_DIST = $(USER_C)
diff --git a/zfs/lib/libzpool/Makefile.in b/zfs/lib/libzpool/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/lib/libzpool/kernel.c b/zfs/lib/libzpool/kernel.c
deleted file mode 100644 (file)
index a451026..0000000
+++ /dev/null
@@ -1,1324 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <assert.h>
-#include <fcntl.h>
-#include <poll.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <zlib.h>
-#include <sys/signal.h>
-#include <sys/spa.h>
-#include <sys/stat.h>
-#include <sys/processor.h>
-#include <sys/zfs_context.h>
-#include <sys/rrwlock.h>
-#include <sys/utsname.h>
-#include <sys/time.h>
-#include <sys/systeminfo.h>
-
-/*
- * Emulation of kernel services in userland.
- */
-
-int aok;
-uint64_t physmem;
-vnode_t *rootdir = (vnode_t *)0xabcd1234;
-char hw_serial[HW_HOSTID_LEN];
-struct utsname hw_utsname;
-vmem_t *zio_arena = NULL;
-
-/* this only exists to have its address taken */
-struct proc p0;
-
-/*
- * =========================================================================
- * threads
- * =========================================================================
- */
-
-pthread_cond_t kthread_cond = PTHREAD_COND_INITIALIZER;
-pthread_mutex_t kthread_lock = PTHREAD_MUTEX_INITIALIZER;
-pthread_key_t kthread_key;
-int kthread_nr = 0;
-
-static void
-thread_init(void)
-{
-       kthread_t *kt;
-
-       VERIFY3S(pthread_key_create(&kthread_key, NULL), ==, 0);
-
-       /* Create entry for primary kthread */
-       kt = umem_zalloc(sizeof (kthread_t), UMEM_NOFAIL);
-       kt->t_tid = pthread_self();
-       kt->t_func = NULL;
-
-       VERIFY3S(pthread_setspecific(kthread_key, kt), ==, 0);
-
-       /* Only the main thread should be running at the moment */
-       ASSERT3S(kthread_nr, ==, 0);
-       kthread_nr = 1;
-}
-
-static void
-thread_fini(void)
-{
-       kthread_t *kt = curthread;
-
-       ASSERT(pthread_equal(kt->t_tid, pthread_self()));
-       ASSERT3P(kt->t_func, ==, NULL);
-
-       umem_free(kt, sizeof (kthread_t));
-
-       /* Wait for all threads to exit via thread_exit() */
-       VERIFY3S(pthread_mutex_lock(&kthread_lock), ==, 0);
-
-       kthread_nr--; /* Main thread is exiting */
-
-       while (kthread_nr > 0)
-               VERIFY3S(pthread_cond_wait(&kthread_cond, &kthread_lock), ==,
-                   0);
-
-       ASSERT3S(kthread_nr, ==, 0);
-       VERIFY3S(pthread_mutex_unlock(&kthread_lock), ==, 0);
-
-       VERIFY3S(pthread_key_delete(kthread_key), ==, 0);
-}
-
-kthread_t *
-zk_thread_current(void)
-{
-       kthread_t *kt = pthread_getspecific(kthread_key);
-
-       ASSERT3P(kt, !=, NULL);
-
-       return (kt);
-}
-
-void *
-zk_thread_helper(void *arg)
-{
-       kthread_t *kt = (kthread_t *) arg;
-
-       VERIFY3S(pthread_setspecific(kthread_key, kt), ==, 0);
-
-       VERIFY3S(pthread_mutex_lock(&kthread_lock), ==, 0);
-       kthread_nr++;
-       VERIFY3S(pthread_mutex_unlock(&kthread_lock), ==, 0);
-       (void) setpriority(PRIO_PROCESS, 0, kt->t_pri);
-
-       kt->t_tid = pthread_self();
-       ((thread_func_arg_t) kt->t_func)(kt->t_arg);
-
-       /* Unreachable, thread must exit with thread_exit() */
-       abort();
-
-       return (NULL);
-}
-
-kthread_t *
-zk_thread_create(caddr_t stk, size_t stksize, thread_func_t func, void *arg,
-    size_t len, proc_t *pp, int state, pri_t pri, int detachstate)
-{
-       kthread_t *kt;
-       pthread_attr_t attr;
-       char *stkstr;
-
-       ASSERT0(state & ~TS_RUN);
-
-       kt = umem_zalloc(sizeof (kthread_t), UMEM_NOFAIL);
-       kt->t_func = func;
-       kt->t_arg = arg;
-       kt->t_pri = pri;
-
-       VERIFY0(pthread_attr_init(&attr));
-       VERIFY0(pthread_attr_setdetachstate(&attr, detachstate));
-
-       /*
-        * We allow the default stack size in user space to be specified by
-        * setting the ZFS_STACK_SIZE environment variable.  This allows us
-        * the convenience of observing and debugging stack overruns in
-        * user space.  Explicitly specified stack sizes will be honored.
-        * The usage of ZFS_STACK_SIZE is discussed further in the
-        * ENVIRONMENT VARIABLES sections of the ztest(1) man page.
-        */
-       if (stksize == 0) {
-               stkstr = getenv("ZFS_STACK_SIZE");
-
-               if (stkstr == NULL)
-                       stksize = TS_STACK_MAX;
-               else
-                       stksize = MAX(atoi(stkstr), TS_STACK_MIN);
-       }
-
-       VERIFY3S(stksize, >, 0);
-       stksize = P2ROUNDUP(MAX(stksize, TS_STACK_MIN), PAGESIZE);
-       VERIFY0(pthread_attr_setstacksize(&attr, stksize));
-       VERIFY0(pthread_attr_setguardsize(&attr, PAGESIZE));
-
-       VERIFY0(pthread_create(&kt->t_tid, &attr, &zk_thread_helper, kt));
-       VERIFY0(pthread_attr_destroy(&attr));
-
-       return (kt);
-}
-
-void
-zk_thread_exit(void)
-{
-       kthread_t *kt = curthread;
-
-       ASSERT(pthread_equal(kt->t_tid, pthread_self()));
-
-       umem_free(kt, sizeof (kthread_t));
-
-       pthread_mutex_lock(&kthread_lock);
-       kthread_nr--;
-       pthread_mutex_unlock(&kthread_lock);
-
-       pthread_cond_broadcast(&kthread_cond);
-       pthread_exit((void *)TS_MAGIC);
-}
-
-void
-zk_thread_join(kt_did_t tid)
-{
-       void *ret;
-
-       pthread_join((pthread_t)tid, &ret);
-       VERIFY3P(ret, ==, (void *)TS_MAGIC);
-}
-
-/*
- * =========================================================================
- * kstats
- * =========================================================================
- */
-/*ARGSUSED*/
-kstat_t *
-kstat_create(const char *module, int instance, const char *name,
-    const char *class, uchar_t type, ulong_t ndata, uchar_t ks_flag)
-{
-       return (NULL);
-}
-
-/*ARGSUSED*/
-void
-kstat_install(kstat_t *ksp)
-{}
-
-/*ARGSUSED*/
-void
-kstat_delete(kstat_t *ksp)
-{}
-
-/*ARGSUSED*/
-void
-kstat_waitq_enter(kstat_io_t *kiop)
-{}
-
-/*ARGSUSED*/
-void
-kstat_waitq_exit(kstat_io_t *kiop)
-{}
-
-/*ARGSUSED*/
-void
-kstat_runq_enter(kstat_io_t *kiop)
-{}
-
-/*ARGSUSED*/
-void
-kstat_runq_exit(kstat_io_t *kiop)
-{}
-
-/*ARGSUSED*/
-void
-kstat_waitq_to_runq(kstat_io_t *kiop)
-{}
-
-/*ARGSUSED*/
-void
-kstat_runq_back_to_waitq(kstat_io_t *kiop)
-{}
-
-void
-kstat_set_raw_ops(kstat_t *ksp,
-    int (*headers)(char *buf, size_t size),
-    int (*data)(char *buf, size_t size, void *data),
-    void *(*addr)(kstat_t *ksp, loff_t index))
-{}
-
-/*
- * =========================================================================
- * mutexes
- * =========================================================================
- */
-
-void
-mutex_init(kmutex_t *mp, char *name, int type, void *cookie)
-{
-       ASSERT3S(type, ==, MUTEX_DEFAULT);
-       ASSERT3P(cookie, ==, NULL);
-       mp->m_owner = MTX_INIT;
-       mp->m_magic = MTX_MAGIC;
-       VERIFY3S(pthread_mutex_init(&mp->m_lock, NULL), ==, 0);
-}
-
-void
-mutex_destroy(kmutex_t *mp)
-{
-       ASSERT3U(mp->m_magic, ==, MTX_MAGIC);
-       ASSERT3P(mp->m_owner, ==, MTX_INIT);
-       ASSERT0(pthread_mutex_destroy(&(mp)->m_lock));
-       mp->m_owner = MTX_DEST;
-       mp->m_magic = 0;
-}
-
-void
-mutex_enter(kmutex_t *mp)
-{
-       ASSERT3U(mp->m_magic, ==, MTX_MAGIC);
-       ASSERT3P(mp->m_owner, !=, MTX_DEST);
-       ASSERT3P(mp->m_owner, !=, curthread);
-       VERIFY3S(pthread_mutex_lock(&mp->m_lock), ==, 0);
-       ASSERT3P(mp->m_owner, ==, MTX_INIT);
-       mp->m_owner = curthread;
-}
-
-int
-mutex_tryenter(kmutex_t *mp)
-{
-       ASSERT3U(mp->m_magic, ==, MTX_MAGIC);
-       ASSERT3P(mp->m_owner, !=, MTX_DEST);
-       if (0 == pthread_mutex_trylock(&mp->m_lock)) {
-               ASSERT3P(mp->m_owner, ==, MTX_INIT);
-               mp->m_owner = curthread;
-               return (1);
-       } else {
-               return (0);
-       }
-}
-
-void
-mutex_exit(kmutex_t *mp)
-{
-       ASSERT3U(mp->m_magic, ==, MTX_MAGIC);
-       ASSERT3P(mutex_owner(mp), ==, curthread);
-       mp->m_owner = MTX_INIT;
-       VERIFY3S(pthread_mutex_unlock(&mp->m_lock), ==, 0);
-}
-
-void *
-mutex_owner(kmutex_t *mp)
-{
-       ASSERT3U(mp->m_magic, ==, MTX_MAGIC);
-       return (mp->m_owner);
-}
-
-int
-mutex_held(kmutex_t *mp)
-{
-       return (mp->m_owner == curthread);
-}
-
-/*
- * =========================================================================
- * rwlocks
- * =========================================================================
- */
-
-void
-rw_init(krwlock_t *rwlp, char *name, int type, void *arg)
-{
-       ASSERT3S(type, ==, RW_DEFAULT);
-       ASSERT3P(arg, ==, NULL);
-       VERIFY3S(pthread_rwlock_init(&rwlp->rw_lock, NULL), ==, 0);
-       rwlp->rw_owner = RW_INIT;
-       rwlp->rw_wr_owner = RW_INIT;
-       rwlp->rw_readers = 0;
-       rwlp->rw_magic = RW_MAGIC;
-}
-
-void
-rw_destroy(krwlock_t *rwlp)
-{
-       ASSERT3U(rwlp->rw_magic, ==, RW_MAGIC);
-       ASSERT(rwlp->rw_readers == 0 && rwlp->rw_wr_owner == RW_INIT);
-       VERIFY3S(pthread_rwlock_destroy(&rwlp->rw_lock), ==, 0);
-       rwlp->rw_magic = 0;
-}
-
-void
-rw_enter(krwlock_t *rwlp, krw_t rw)
-{
-       ASSERT3U(rwlp->rw_magic, ==, RW_MAGIC);
-       ASSERT3P(rwlp->rw_owner, !=, curthread);
-       ASSERT3P(rwlp->rw_wr_owner, !=, curthread);
-
-       if (rw == RW_READER) {
-               VERIFY3S(pthread_rwlock_rdlock(&rwlp->rw_lock), ==, 0);
-               ASSERT3P(rwlp->rw_wr_owner, ==, RW_INIT);
-
-               atomic_inc_uint(&rwlp->rw_readers);
-       } else {
-               VERIFY3S(pthread_rwlock_wrlock(&rwlp->rw_lock), ==, 0);
-               ASSERT3P(rwlp->rw_wr_owner, ==, RW_INIT);
-               ASSERT3U(rwlp->rw_readers, ==, 0);
-
-               rwlp->rw_wr_owner = curthread;
-       }
-
-       rwlp->rw_owner = curthread;
-}
-
-void
-rw_exit(krwlock_t *rwlp)
-{
-       ASSERT3U(rwlp->rw_magic, ==, RW_MAGIC);
-       ASSERT(RW_LOCK_HELD(rwlp));
-
-       if (RW_READ_HELD(rwlp))
-               atomic_dec_uint(&rwlp->rw_readers);
-       else
-               rwlp->rw_wr_owner = RW_INIT;
-
-       rwlp->rw_owner = RW_INIT;
-       VERIFY3S(pthread_rwlock_unlock(&rwlp->rw_lock), ==, 0);
-}
-
-int
-rw_tryenter(krwlock_t *rwlp, krw_t rw)
-{
-       int rv;
-
-       ASSERT3U(rwlp->rw_magic, ==, RW_MAGIC);
-
-       if (rw == RW_READER)
-               rv = pthread_rwlock_tryrdlock(&rwlp->rw_lock);
-       else
-               rv = pthread_rwlock_trywrlock(&rwlp->rw_lock);
-
-       if (rv == 0) {
-               ASSERT3P(rwlp->rw_wr_owner, ==, RW_INIT);
-
-               if (rw == RW_READER)
-                       atomic_inc_uint(&rwlp->rw_readers);
-               else {
-                       ASSERT3U(rwlp->rw_readers, ==, 0);
-                       rwlp->rw_wr_owner = curthread;
-               }
-
-               rwlp->rw_owner = curthread;
-               return (1);
-       }
-
-       VERIFY3S(rv, ==, EBUSY);
-
-       return (0);
-}
-
-int
-rw_tryupgrade(krwlock_t *rwlp)
-{
-       ASSERT3U(rwlp->rw_magic, ==, RW_MAGIC);
-
-       return (0);
-}
-
-/*
- * =========================================================================
- * condition variables
- * =========================================================================
- */
-
-void
-cv_init(kcondvar_t *cv, char *name, int type, void *arg)
-{
-       ASSERT3S(type, ==, CV_DEFAULT);
-       cv->cv_magic = CV_MAGIC;
-       VERIFY3S(pthread_cond_init(&cv->cv, NULL), ==, 0);
-}
-
-void
-cv_destroy(kcondvar_t *cv)
-{
-       ASSERT3U(cv->cv_magic, ==, CV_MAGIC);
-       VERIFY3S(pthread_cond_destroy(&cv->cv), ==, 0);
-       cv->cv_magic = 0;
-}
-
-void
-cv_wait(kcondvar_t *cv, kmutex_t *mp)
-{
-       ASSERT3U(cv->cv_magic, ==, CV_MAGIC);
-       ASSERT3P(mutex_owner(mp), ==, curthread);
-       mp->m_owner = MTX_INIT;
-       int ret = pthread_cond_wait(&cv->cv, &mp->m_lock);
-       if (ret != 0)
-               VERIFY3S(ret, ==, EINTR);
-       mp->m_owner = curthread;
-}
-
-clock_t
-cv_timedwait(kcondvar_t *cv, kmutex_t *mp, clock_t abstime)
-{
-       int error;
-       struct timeval tv;
-       timestruc_t ts;
-       clock_t delta;
-
-       ASSERT3U(cv->cv_magic, ==, CV_MAGIC);
-
-top:
-       delta = abstime - ddi_get_lbolt();
-       if (delta <= 0)
-               return (-1);
-
-       VERIFY(gettimeofday(&tv, NULL) == 0);
-
-       ts.tv_sec = tv.tv_sec + delta / hz;
-       ts.tv_nsec = tv.tv_usec * 1000 + (delta % hz) * (NANOSEC / hz);
-       if (ts.tv_nsec >= NANOSEC) {
-               ts.tv_sec++;
-               ts.tv_nsec -= NANOSEC;
-       }
-
-       ASSERT3P(mutex_owner(mp), ==, curthread);
-       mp->m_owner = MTX_INIT;
-       error = pthread_cond_timedwait(&cv->cv, &mp->m_lock, &ts);
-       mp->m_owner = curthread;
-
-       if (error == ETIMEDOUT)
-               return (-1);
-
-       if (error == EINTR)
-               goto top;
-
-       VERIFY3S(error, ==, 0);
-
-       return (1);
-}
-
-/*ARGSUSED*/
-clock_t
-cv_timedwait_hires(kcondvar_t *cv, kmutex_t *mp, hrtime_t tim, hrtime_t res,
-    int flag)
-{
-       int error;
-       timestruc_t ts;
-       hrtime_t delta;
-
-       ASSERT(flag == 0);
-
-top:
-       delta = tim - gethrtime();
-       if (delta <= 0)
-               return (-1);
-
-       ts.tv_sec = delta / NANOSEC;
-       ts.tv_nsec = delta % NANOSEC;
-
-       ASSERT(mutex_owner(mp) == curthread);
-       mp->m_owner = NULL;
-       error = pthread_cond_timedwait(&cv->cv, &mp->m_lock, &ts);
-       mp->m_owner = curthread;
-
-       if (error == ETIME)
-               return (-1);
-
-       if (error == EINTR)
-               goto top;
-
-       ASSERT(error == 0);
-
-       return (1);
-}
-
-void
-cv_signal(kcondvar_t *cv)
-{
-       ASSERT3U(cv->cv_magic, ==, CV_MAGIC);
-       VERIFY3S(pthread_cond_signal(&cv->cv), ==, 0);
-}
-
-void
-cv_broadcast(kcondvar_t *cv)
-{
-       ASSERT3U(cv->cv_magic, ==, CV_MAGIC);
-       VERIFY3S(pthread_cond_broadcast(&cv->cv), ==, 0);
-}
-
-/*
- * =========================================================================
- * vnode operations
- * =========================================================================
- */
-/*
- * Note: for the xxxat() versions of these functions, we assume that the
- * starting vp is always rootdir (which is true for spa_directory.c, the only
- * ZFS consumer of these interfaces).  We assert this is true, and then emulate
- * them by adding '/' in front of the path.
- */
-
-/*ARGSUSED*/
-int
-vn_open(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2, int x3)
-{
-       int fd;
-       vnode_t *vp;
-       int old_umask = 0;
-       char *realpath;
-       struct stat64 st;
-       int err;
-
-       realpath = umem_alloc(MAXPATHLEN, UMEM_NOFAIL);
-
-       /*
-        * If we're accessing a real disk from userland, we need to use
-        * the character interface to avoid caching.  This is particularly
-        * important if we're trying to look at a real in-kernel storage
-        * pool from userland, e.g. via zdb, because otherwise we won't
-        * see the changes occurring under the segmap cache.
-        * On the other hand, the stupid character device returns zero
-        * for its size.  So -- gag -- we open the block device to get
-        * its size, and remember it for subsequent VOP_GETATTR().
-        */
-#if defined(__sun__) || defined(__sun)
-       if (strncmp(path, "/dev/", 5) == 0) {
-#else
-       if (0) {
-#endif
-               char *dsk;
-               fd = open64(path, O_RDONLY);
-               if (fd == -1) {
-                       err = errno;
-                       free(realpath);
-                       return (err);
-               }
-               if (fstat64(fd, &st) == -1) {
-                       err = errno;
-                       close(fd);
-                       free(realpath);
-                       return (err);
-               }
-               close(fd);
-               (void) sprintf(realpath, "%s", path);
-               dsk = strstr(path, "/dsk/");
-               if (dsk != NULL)
-                       (void) sprintf(realpath + (dsk - path) + 1, "r%s",
-                           dsk + 1);
-       } else {
-               (void) sprintf(realpath, "%s", path);
-               if (!(flags & FCREAT) && stat64(realpath, &st) == -1) {
-                       err = errno;
-                       free(realpath);
-                       return (err);
-               }
-       }
-
-       if (!(flags & FCREAT) && S_ISBLK(st.st_mode)) {
-#ifdef __linux__
-               flags |= O_DIRECT;
-#endif
-               /* We shouldn't be writing to block devices in userspace */
-               VERIFY(!(flags & FWRITE));
-       }
-
-       if (flags & FCREAT)
-               old_umask = umask(0);
-
-       /*
-        * The construct 'flags - FREAD' conveniently maps combinations of
-        * FREAD and FWRITE to the corresponding O_RDONLY, O_WRONLY, and O_RDWR.
-        */
-       fd = open64(realpath, flags - FREAD, mode);
-       free(realpath);
-
-       if (flags & FCREAT)
-               (void) umask(old_umask);
-
-       if (fd == -1)
-               return (errno);
-
-       if (fstat64_blk(fd, &st) == -1) {
-               err = errno;
-               close(fd);
-               return (err);
-       }
-
-       (void) fcntl(fd, F_SETFD, FD_CLOEXEC);
-
-       *vpp = vp = umem_zalloc(sizeof (vnode_t), UMEM_NOFAIL);
-
-       vp->v_fd = fd;
-       vp->v_size = st.st_size;
-       vp->v_path = spa_strdup(path);
-
-       return (0);
-}
-
-/*ARGSUSED*/
-int
-vn_openat(char *path, int x1, int flags, int mode, vnode_t **vpp, int x2,
-    int x3, vnode_t *startvp, int fd)
-{
-       char *realpath = umem_alloc(strlen(path) + 2, UMEM_NOFAIL);
-       int ret;
-
-       ASSERT(startvp == rootdir);
-       (void) sprintf(realpath, "/%s", path);
-
-       /* fd ignored for now, need if want to simulate nbmand support */
-       ret = vn_open(realpath, x1, flags, mode, vpp, x2, x3);
-
-       umem_free(realpath, strlen(path) + 2);
-
-       return (ret);
-}
-
-/*ARGSUSED*/
-int
-vn_rdwr(int uio, vnode_t *vp, void *addr, ssize_t len, offset_t offset,
-       int x1, int x2, rlim64_t x3, void *x4, ssize_t *residp)
-{
-       ssize_t rc, done = 0, split;
-
-       if (uio == UIO_READ) {
-               rc = pread64(vp->v_fd, addr, len, offset);
-       } else {
-               /*
-                * To simulate partial disk writes, we split writes into two
-                * system calls so that the process can be killed in between.
-                */
-               int sectors = len >> SPA_MINBLOCKSHIFT;
-               split = (sectors > 0 ? rand() % sectors : 0) <<
-                   SPA_MINBLOCKSHIFT;
-               rc = pwrite64(vp->v_fd, addr, split, offset);
-               if (rc != -1) {
-                       done = rc;
-                       rc = pwrite64(vp->v_fd, (char *)addr + split,
-                           len - split, offset + split);
-               }
-       }
-
-#ifdef __linux__
-       if (rc == -1 && errno == EINVAL) {
-               /*
-                * Under Linux, this most likely means an alignment issue
-                * (memory or disk) due to O_DIRECT, so we abort() in order to
-                * catch the offender.
-                */
-               abort();
-       }
-#endif
-       if (rc == -1)
-               return (errno);
-
-       done += rc;
-
-       if (residp)
-               *residp = len - done;
-       else if (done != len)
-               return (EIO);
-       return (0);
-}
-
-void
-vn_close(vnode_t *vp)
-{
-       close(vp->v_fd);
-       spa_strfree(vp->v_path);
-       umem_free(vp, sizeof (vnode_t));
-}
-
-/*
- * At a minimum we need to update the size since vdev_reopen()
- * will no longer call vn_openat().
- */
-int
-fop_getattr(vnode_t *vp, vattr_t *vap)
-{
-       struct stat64 st;
-       int err;
-
-       if (fstat64_blk(vp->v_fd, &st) == -1) {
-               err = errno;
-               close(vp->v_fd);
-               return (err);
-       }
-
-       vap->va_size = st.st_size;
-       return (0);
-}
-
-/*
- * =========================================================================
- * Figure out which debugging statements to print
- * =========================================================================
- */
-
-static char *dprintf_string;
-static int dprintf_print_all;
-
-int
-dprintf_find_string(const char *string)
-{
-       char *tmp_str = dprintf_string;
-       int len = strlen(string);
-
-       /*
-        * Find out if this is a string we want to print.
-        * String format: file1.c,function_name1,file2.c,file3.c
-        */
-
-       while (tmp_str != NULL) {
-               if (strncmp(tmp_str, string, len) == 0 &&
-                   (tmp_str[len] == ',' || tmp_str[len] == '\0'))
-                       return (1);
-               tmp_str = strchr(tmp_str, ',');
-               if (tmp_str != NULL)
-                       tmp_str++; /* Get rid of , */
-       }
-       return (0);
-}
-
-void
-dprintf_setup(int *argc, char **argv)
-{
-       int i, j;
-
-       /*
-        * Debugging can be specified two ways: by setting the
-        * environment variable ZFS_DEBUG, or by including a
-        * "debug=..."  argument on the command line.  The command
-        * line setting overrides the environment variable.
-        */
-
-       for (i = 1; i < *argc; i++) {
-               int len = strlen("debug=");
-               /* First look for a command line argument */
-               if (strncmp("debug=", argv[i], len) == 0) {
-                       dprintf_string = argv[i] + len;
-                       /* Remove from args */
-                       for (j = i; j < *argc; j++)
-                               argv[j] = argv[j+1];
-                       argv[j] = NULL;
-                       (*argc)--;
-               }
-       }
-
-       if (dprintf_string == NULL) {
-               /* Look for ZFS_DEBUG environment variable */
-               dprintf_string = getenv("ZFS_DEBUG");
-       }
-
-       /*
-        * Are we just turning on all debugging?
-        */
-       if (dprintf_find_string("on"))
-               dprintf_print_all = 1;
-
-       if (dprintf_string != NULL)
-               zfs_flags |= ZFS_DEBUG_DPRINTF;
-}
-
-/*
- * =========================================================================
- * debug printfs
- * =========================================================================
- */
-void
-__dprintf(const char *file, const char *func, int line, const char *fmt, ...)
-{
-       const char *newfile;
-       va_list adx;
-
-       /*
-        * Get rid of annoying "../common/" prefix to filename.
-        */
-       newfile = strrchr(file, '/');
-       if (newfile != NULL) {
-               newfile = newfile + 1; /* Get rid of leading / */
-       } else {
-               newfile = file;
-       }
-
-       if (dprintf_print_all ||
-           dprintf_find_string(newfile) ||
-           dprintf_find_string(func)) {
-               /* Print out just the function name if requested */
-               flockfile(stdout);
-               if (dprintf_find_string("pid"))
-                       (void) printf("%d ", getpid());
-               if (dprintf_find_string("tid"))
-                       (void) printf("%u ", (uint_t) pthread_self());
-               if (dprintf_find_string("cpu"))
-                       (void) printf("%u ", getcpuid());
-               if (dprintf_find_string("time"))
-                       (void) printf("%llu ", gethrtime());
-               if (dprintf_find_string("long"))
-                       (void) printf("%s, line %d: ", newfile, line);
-               (void) printf("%s: ", func);
-               va_start(adx, fmt);
-               (void) vprintf(fmt, adx);
-               va_end(adx);
-               funlockfile(stdout);
-       }
-}
-
-/*
- * =========================================================================
- * cmn_err() and panic()
- * =========================================================================
- */
-static char ce_prefix[CE_IGNORE][10] = { "", "NOTICE: ", "WARNING: ", "" };
-static char ce_suffix[CE_IGNORE][2] = { "", "\n", "\n", "" };
-
-void
-vpanic(const char *fmt, va_list adx)
-{
-       (void) fprintf(stderr, "error: ");
-       (void) vfprintf(stderr, fmt, adx);
-       (void) fprintf(stderr, "\n");
-
-       abort();        /* think of it as a "user-level crash dump" */
-}
-
-void
-panic(const char *fmt, ...)
-{
-       va_list adx;
-
-       va_start(adx, fmt);
-       vpanic(fmt, adx);
-       va_end(adx);
-}
-
-void
-vcmn_err(int ce, const char *fmt, va_list adx)
-{
-       if (ce == CE_PANIC)
-               vpanic(fmt, adx);
-       if (ce != CE_NOTE) {    /* suppress noise in userland stress testing */
-               (void) fprintf(stderr, "%s", ce_prefix[ce]);
-               (void) vfprintf(stderr, fmt, adx);
-               (void) fprintf(stderr, "%s", ce_suffix[ce]);
-       }
-}
-
-/*PRINTFLIKE2*/
-void
-cmn_err(int ce, const char *fmt, ...)
-{
-       va_list adx;
-
-       va_start(adx, fmt);
-       vcmn_err(ce, fmt, adx);
-       va_end(adx);
-}
-
-/*
- * =========================================================================
- * kobj interfaces
- * =========================================================================
- */
-struct _buf *
-kobj_open_file(char *name)
-{
-       struct _buf *file;
-       vnode_t *vp;
-
-       /* set vp as the _fd field of the file */
-       if (vn_openat(name, UIO_SYSSPACE, FREAD, 0, &vp, 0, 0, rootdir,
-           -1) != 0)
-               return ((void *)-1UL);
-
-       file = umem_zalloc(sizeof (struct _buf), UMEM_NOFAIL);
-       file->_fd = (intptr_t)vp;
-       return (file);
-}
-
-int
-kobj_read_file(struct _buf *file, char *buf, unsigned size, unsigned off)
-{
-       ssize_t resid;
-
-       vn_rdwr(UIO_READ, (vnode_t *)file->_fd, buf, size, (offset_t)off,
-           UIO_SYSSPACE, 0, 0, 0, &resid);
-
-       return (size - resid);
-}
-
-void
-kobj_close_file(struct _buf *file)
-{
-       vn_close((vnode_t *)file->_fd);
-       umem_free(file, sizeof (struct _buf));
-}
-
-int
-kobj_get_filesize(struct _buf *file, uint64_t *size)
-{
-       struct stat64 st;
-       vnode_t *vp = (vnode_t *)file->_fd;
-
-       if (fstat64(vp->v_fd, &st) == -1) {
-               vn_close(vp);
-               return (errno);
-       }
-       *size = st.st_size;
-       return (0);
-}
-
-/*
- * =========================================================================
- * misc routines
- * =========================================================================
- */
-
-void
-delay(clock_t ticks)
-{
-       poll(0, 0, ticks * (1000 / hz));
-}
-
-/*
- * Find highest one bit set.
- *     Returns bit number + 1 of highest bit that is set, otherwise returns 0.
- * High order bit is 31 (or 63 in _LP64 kernel).
- */
-int
-highbit64(uint64_t i)
-{
-       register int h = 1;
-
-       if (i == 0)
-               return (0);
-       if (i & 0xffffffff00000000ULL) {
-               h += 32; i >>= 32;
-       }
-       if (i & 0xffff0000) {
-               h += 16; i >>= 16;
-       }
-       if (i & 0xff00) {
-               h += 8; i >>= 8;
-       }
-       if (i & 0xf0) {
-               h += 4; i >>= 4;
-       }
-       if (i & 0xc) {
-               h += 2; i >>= 2;
-       }
-       if (i & 0x2) {
-               h += 1;
-       }
-       return (h);
-}
-
-static int random_fd = -1, urandom_fd = -1;
-
-static int
-random_get_bytes_common(uint8_t *ptr, size_t len, int fd)
-{
-       size_t resid = len;
-       ssize_t bytes;
-
-       ASSERT(fd != -1);
-
-       while (resid != 0) {
-               bytes = read(fd, ptr, resid);
-               ASSERT3S(bytes, >=, 0);
-               ptr += bytes;
-               resid -= bytes;
-       }
-
-       return (0);
-}
-
-int
-random_get_bytes(uint8_t *ptr, size_t len)
-{
-       return (random_get_bytes_common(ptr, len, random_fd));
-}
-
-int
-random_get_pseudo_bytes(uint8_t *ptr, size_t len)
-{
-       return (random_get_bytes_common(ptr, len, urandom_fd));
-}
-
-int
-ddi_strtoul(const char *hw_serial, char **nptr, int base, unsigned long *result)
-{
-       char *end;
-
-       *result = strtoul(hw_serial, &end, base);
-       if (*result == 0)
-               return (errno);
-       return (0);
-}
-
-int
-ddi_strtoull(const char *str, char **nptr, int base, u_longlong_t *result)
-{
-       char *end;
-
-       *result = strtoull(str, &end, base);
-       if (*result == 0)
-               return (errno);
-       return (0);
-}
-
-utsname_t *
-utsname(void)
-{
-       return (&hw_utsname);
-}
-
-/*
- * =========================================================================
- * kernel emulation setup & teardown
- * =========================================================================
- */
-static int
-umem_out_of_memory(void)
-{
-       char errmsg[] = "out of memory -- generating core dump\n";
-
-       (void) fprintf(stderr, "%s", errmsg);
-       abort();
-       return (0);
-}
-
-static unsigned long
-get_spl_hostid(void)
-{
-       FILE *f;
-       unsigned long hostid;
-
-       f = fopen("/sys/module/spl/parameters/spl_hostid", "r");
-       if (!f)
-               return (0);
-       if (fscanf(f, "%lu", &hostid) != 1)
-               hostid = 0;
-       fclose(f);
-       return (hostid & 0xffffffff);
-}
-
-unsigned long
-get_system_hostid(void)
-{
-       unsigned long system_hostid = get_spl_hostid();
-       if (system_hostid == 0)
-               system_hostid = gethostid() & 0xffffffff;
-       return (system_hostid);
-}
-
-void
-kernel_init(int mode)
-{
-       extern uint_t rrw_tsd_key;
-
-       umem_nofail_callback(umem_out_of_memory);
-
-       physmem = sysconf(_SC_PHYS_PAGES);
-
-       dprintf("physmem = %llu pages (%.2f GB)\n", physmem,
-           (double)physmem * sysconf(_SC_PAGE_SIZE) / (1ULL << 30));
-
-       (void) snprintf(hw_serial, sizeof (hw_serial), "%ld",
-           (mode & FWRITE) ? get_system_hostid() : 0);
-
-       VERIFY((random_fd = open("/dev/random", O_RDONLY)) != -1);
-       VERIFY((urandom_fd = open("/dev/urandom", O_RDONLY)) != -1);
-       VERIFY0(uname(&hw_utsname));
-
-       thread_init();
-       system_taskq_init();
-
-       spa_init(mode);
-
-       tsd_create(&rrw_tsd_key, rrw_tsd_destroy);
-}
-
-void
-kernel_fini(void)
-{
-       spa_fini();
-
-       system_taskq_fini();
-       thread_fini();
-
-       close(random_fd);
-       close(urandom_fd);
-
-       random_fd = -1;
-       urandom_fd = -1;
-}
-
-uid_t
-crgetuid(cred_t *cr)
-{
-       return (0);
-}
-
-uid_t
-crgetruid(cred_t *cr)
-{
-       return (0);
-}
-
-gid_t
-crgetgid(cred_t *cr)
-{
-       return (0);
-}
-
-int
-crgetngroups(cred_t *cr)
-{
-       return (0);
-}
-
-gid_t *
-crgetgroups(cred_t *cr)
-{
-       return (NULL);
-}
-
-int
-zfs_secpolicy_snapshot_perms(const char *name, cred_t *cr)
-{
-       return (0);
-}
-
-int
-zfs_secpolicy_rename_perms(const char *from, const char *to, cred_t *cr)
-{
-       return (0);
-}
-
-int
-zfs_secpolicy_destroy_perms(const char *name, cred_t *cr)
-{
-       return (0);
-}
-
-ksiddomain_t *
-ksid_lookupdomain(const char *dom)
-{
-       ksiddomain_t *kd;
-
-       kd = umem_zalloc(sizeof (ksiddomain_t), UMEM_NOFAIL);
-       kd->kd_name = spa_strdup(dom);
-       return (kd);
-}
-
-void
-ksiddomain_rele(ksiddomain_t *ksid)
-{
-       spa_strfree(ksid->kd_name);
-       umem_free(ksid, sizeof (ksiddomain_t));
-}
-
-char *
-kmem_vasprintf(const char *fmt, va_list adx)
-{
-       char *buf = NULL;
-       va_list adx_copy;
-
-       va_copy(adx_copy, adx);
-       VERIFY(vasprintf(&buf, fmt, adx_copy) != -1);
-       va_end(adx_copy);
-
-       return (buf);
-}
-
-char *
-kmem_asprintf(const char *fmt, ...)
-{
-       char *buf = NULL;
-       va_list adx;
-
-       va_start(adx, fmt);
-       VERIFY(vasprintf(&buf, fmt, adx) != -1);
-       va_end(adx);
-
-       return (buf);
-}
-
-/* ARGSUSED */
-int
-zfs_onexit_fd_hold(int fd, minor_t *minorp)
-{
-       *minorp = 0;
-       return (0);
-}
-
-/* ARGSUSED */
-void
-zfs_onexit_fd_rele(int fd)
-{
-}
-
-/* ARGSUSED */
-int
-zfs_onexit_add_cb(minor_t minor, void (*func)(void *), void *data,
-    uint64_t *action_handle)
-{
-       return (0);
-}
-
-/* ARGSUSED */
-int
-zfs_onexit_del_cb(minor_t minor, uint64_t action_handle, boolean_t fire)
-{
-       return (0);
-}
-
-/* ARGSUSED */
-int
-zfs_onexit_cb_data(minor_t minor, uint64_t action_handle, void **data)
-{
-       return (0);
-}
-
-fstrans_cookie_t
-spl_fstrans_mark(void)
-{
-       return ((fstrans_cookie_t) 0);
-}
-
-void
-spl_fstrans_unmark(fstrans_cookie_t cookie)
-{
-}
-
-int
-spl_fstrans_check(void)
-{
-       return (0);
-}
diff --git a/zfs/lib/libzpool/taskq.c b/zfs/lib/libzpool/taskq.c
deleted file mode 100644 (file)
index bd92e61..0000000
+++ /dev/null
@@ -1,383 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
- * Use is subject to license terms.
- */
-/*
- * Copyright 2011 Nexenta Systems, Inc. All rights reserved.
- * Copyright 2012 Garrett D'Amore <garrett@damore.org>.  All rights reserved.
- * Copyright (c) 2014 by Delphix. All rights reserved.
- */
-
-#include <sys/zfs_context.h>
-
-int taskq_now;
-taskq_t *system_taskq;
-
-#define        TASKQ_ACTIVE    0x00010000
-#define        TASKQ_NAMELEN   31
-
-struct taskq {
-       char            tq_name[TASKQ_NAMELEN + 1];
-       kmutex_t        tq_lock;
-       krwlock_t       tq_threadlock;
-       kcondvar_t      tq_dispatch_cv;
-       kcondvar_t      tq_wait_cv;
-       kthread_t       **tq_threadlist;
-       int             tq_flags;
-       int             tq_active;
-       int             tq_nthreads;
-       int             tq_nalloc;
-       int             tq_minalloc;
-       int             tq_maxalloc;
-       kcondvar_t      tq_maxalloc_cv;
-       int             tq_maxalloc_wait;
-       taskq_ent_t     *tq_freelist;
-       taskq_ent_t     tq_task;
-};
-
-static taskq_ent_t *
-task_alloc(taskq_t *tq, int tqflags)
-{
-       taskq_ent_t *t;
-       int rv;
-
-again: if ((t = tq->tq_freelist) != NULL && tq->tq_nalloc >= tq->tq_minalloc) {
-               ASSERT(!(t->tqent_flags & TQENT_FLAG_PREALLOC));
-               tq->tq_freelist = t->tqent_next;
-       } else {
-               if (tq->tq_nalloc >= tq->tq_maxalloc) {
-                       if (!(tqflags & KM_SLEEP))
-                               return (NULL);
-
-                       /*
-                        * We don't want to exceed tq_maxalloc, but we can't
-                        * wait for other tasks to complete (and thus free up
-                        * task structures) without risking deadlock with
-                        * the caller.  So, we just delay for one second
-                        * to throttle the allocation rate. If we have tasks
-                        * complete before one second timeout expires then
-                        * taskq_ent_free will signal us and we will
-                        * immediately retry the allocation.
-                        */
-                       tq->tq_maxalloc_wait++;
-                       rv = cv_timedwait(&tq->tq_maxalloc_cv,
-                           &tq->tq_lock, ddi_get_lbolt() + hz);
-                       tq->tq_maxalloc_wait--;
-                       if (rv > 0)
-                               goto again;             /* signaled */
-               }
-               mutex_exit(&tq->tq_lock);
-
-               t = kmem_alloc(sizeof (taskq_ent_t), tqflags);
-
-               mutex_enter(&tq->tq_lock);
-               if (t != NULL) {
-                       /* Make sure we start without any flags */
-                       t->tqent_flags = 0;
-                       tq->tq_nalloc++;
-               }
-       }
-       return (t);
-}
-
-static void
-task_free(taskq_t *tq, taskq_ent_t *t)
-{
-       if (tq->tq_nalloc <= tq->tq_minalloc) {
-               t->tqent_next = tq->tq_freelist;
-               tq->tq_freelist = t;
-       } else {
-               tq->tq_nalloc--;
-               mutex_exit(&tq->tq_lock);
-               kmem_free(t, sizeof (taskq_ent_t));
-               mutex_enter(&tq->tq_lock);
-       }
-
-       if (tq->tq_maxalloc_wait)
-               cv_signal(&tq->tq_maxalloc_cv);
-}
-
-taskqid_t
-taskq_dispatch(taskq_t *tq, task_func_t func, void *arg, uint_t tqflags)
-{
-       taskq_ent_t *t;
-
-       if (taskq_now) {
-               func(arg);
-               return (1);
-       }
-
-       mutex_enter(&tq->tq_lock);
-       ASSERT(tq->tq_flags & TASKQ_ACTIVE);
-       if ((t = task_alloc(tq, tqflags)) == NULL) {
-               mutex_exit(&tq->tq_lock);
-               return (0);
-       }
-       if (tqflags & TQ_FRONT) {
-               t->tqent_next = tq->tq_task.tqent_next;
-               t->tqent_prev = &tq->tq_task;
-       } else {
-               t->tqent_next = &tq->tq_task;
-               t->tqent_prev = tq->tq_task.tqent_prev;
-       }
-       t->tqent_next->tqent_prev = t;
-       t->tqent_prev->tqent_next = t;
-       t->tqent_func = func;
-       t->tqent_arg = arg;
-       t->tqent_flags = 0;
-       cv_signal(&tq->tq_dispatch_cv);
-       mutex_exit(&tq->tq_lock);
-       return (1);
-}
-
-taskqid_t
-taskq_dispatch_delay(taskq_t *tq,  task_func_t func, void *arg, uint_t tqflags,
-    clock_t expire_time)
-{
-       return (0);
-}
-
-int
-taskq_empty_ent(taskq_ent_t *t)
-{
-       return (t->tqent_next == NULL);
-}
-
-void
-taskq_init_ent(taskq_ent_t *t)
-{
-       t->tqent_next = NULL;
-       t->tqent_prev = NULL;
-       t->tqent_func = NULL;
-       t->tqent_arg = NULL;
-       t->tqent_flags = 0;
-}
-
-void
-taskq_dispatch_ent(taskq_t *tq, task_func_t func, void *arg, uint_t flags,
-    taskq_ent_t *t)
-{
-       ASSERT(func != NULL);
-
-       /*
-        * Mark it as a prealloc'd task.  This is important
-        * to ensure that we don't free it later.
-        */
-       t->tqent_flags |= TQENT_FLAG_PREALLOC;
-       /*
-        * Enqueue the task to the underlying queue.
-        */
-       mutex_enter(&tq->tq_lock);
-
-       if (flags & TQ_FRONT) {
-               t->tqent_next = tq->tq_task.tqent_next;
-               t->tqent_prev = &tq->tq_task;
-       } else {
-               t->tqent_next = &tq->tq_task;
-               t->tqent_prev = tq->tq_task.tqent_prev;
-       }
-       t->tqent_next->tqent_prev = t;
-       t->tqent_prev->tqent_next = t;
-       t->tqent_func = func;
-       t->tqent_arg = arg;
-       cv_signal(&tq->tq_dispatch_cv);
-       mutex_exit(&tq->tq_lock);
-}
-
-void
-taskq_wait(taskq_t *tq)
-{
-       mutex_enter(&tq->tq_lock);
-       while (tq->tq_task.tqent_next != &tq->tq_task || tq->tq_active != 0)
-               cv_wait(&tq->tq_wait_cv, &tq->tq_lock);
-       mutex_exit(&tq->tq_lock);
-}
-
-void
-taskq_wait_id(taskq_t *tq, taskqid_t id)
-{
-       taskq_wait(tq);
-}
-
-void
-taskq_wait_outstanding(taskq_t *tq, taskqid_t id)
-{
-       taskq_wait(tq);
-}
-
-static void
-taskq_thread(void *arg)
-{
-       taskq_t *tq = arg;
-       taskq_ent_t *t;
-       boolean_t prealloc;
-
-       mutex_enter(&tq->tq_lock);
-       while (tq->tq_flags & TASKQ_ACTIVE) {
-               if ((t = tq->tq_task.tqent_next) == &tq->tq_task) {
-                       if (--tq->tq_active == 0)
-                               cv_broadcast(&tq->tq_wait_cv);
-                       cv_wait(&tq->tq_dispatch_cv, &tq->tq_lock);
-                       tq->tq_active++;
-                       continue;
-               }
-               t->tqent_prev->tqent_next = t->tqent_next;
-               t->tqent_next->tqent_prev = t->tqent_prev;
-               t->tqent_next = NULL;
-               t->tqent_prev = NULL;
-               prealloc = t->tqent_flags & TQENT_FLAG_PREALLOC;
-               mutex_exit(&tq->tq_lock);
-
-               rw_enter(&tq->tq_threadlock, RW_READER);
-               t->tqent_func(t->tqent_arg);
-               rw_exit(&tq->tq_threadlock);
-
-               mutex_enter(&tq->tq_lock);
-               if (!prealloc)
-                       task_free(tq, t);
-       }
-       tq->tq_nthreads--;
-       cv_broadcast(&tq->tq_wait_cv);
-       mutex_exit(&tq->tq_lock);
-       thread_exit();
-}
-
-/*ARGSUSED*/
-taskq_t *
-taskq_create(const char *name, int nthreads, pri_t pri,
-       int minalloc, int maxalloc, uint_t flags)
-{
-       taskq_t *tq = kmem_zalloc(sizeof (taskq_t), KM_SLEEP);
-       int t;
-
-       if (flags & TASKQ_THREADS_CPU_PCT) {
-               int pct;
-               ASSERT3S(nthreads, >=, 0);
-               ASSERT3S(nthreads, <=, 100);
-               pct = MIN(nthreads, 100);
-               pct = MAX(pct, 0);
-
-               nthreads = (sysconf(_SC_NPROCESSORS_ONLN) * pct) / 100;
-               nthreads = MAX(nthreads, 1);    /* need at least 1 thread */
-       } else {
-               ASSERT3S(nthreads, >=, 1);
-       }
-
-       rw_init(&tq->tq_threadlock, NULL, RW_DEFAULT, NULL);
-       mutex_init(&tq->tq_lock, NULL, MUTEX_DEFAULT, NULL);
-       cv_init(&tq->tq_dispatch_cv, NULL, CV_DEFAULT, NULL);
-       cv_init(&tq->tq_wait_cv, NULL, CV_DEFAULT, NULL);
-       cv_init(&tq->tq_maxalloc_cv, NULL, CV_DEFAULT, NULL);
-       (void) strncpy(tq->tq_name, name, TASKQ_NAMELEN + 1);
-       tq->tq_flags = flags | TASKQ_ACTIVE;
-       tq->tq_active = nthreads;
-       tq->tq_nthreads = nthreads;
-       tq->tq_minalloc = minalloc;
-       tq->tq_maxalloc = maxalloc;
-       tq->tq_task.tqent_next = &tq->tq_task;
-       tq->tq_task.tqent_prev = &tq->tq_task;
-       tq->tq_threadlist = kmem_alloc(nthreads * sizeof (kthread_t *),
-           KM_SLEEP);
-
-       if (flags & TASKQ_PREPOPULATE) {
-               mutex_enter(&tq->tq_lock);
-               while (minalloc-- > 0)
-                       task_free(tq, task_alloc(tq, KM_SLEEP));
-               mutex_exit(&tq->tq_lock);
-       }
-
-       for (t = 0; t < nthreads; t++)
-               VERIFY((tq->tq_threadlist[t] = thread_create(NULL, 0,
-                   taskq_thread, tq, TS_RUN, NULL, 0, pri)) != NULL);
-
-       return (tq);
-}
-
-void
-taskq_destroy(taskq_t *tq)
-{
-       int nthreads = tq->tq_nthreads;
-
-       taskq_wait(tq);
-
-       mutex_enter(&tq->tq_lock);
-
-       tq->tq_flags &= ~TASKQ_ACTIVE;
-       cv_broadcast(&tq->tq_dispatch_cv);
-
-       while (tq->tq_nthreads != 0)
-               cv_wait(&tq->tq_wait_cv, &tq->tq_lock);
-
-       tq->tq_minalloc = 0;
-       while (tq->tq_nalloc != 0) {
-               ASSERT(tq->tq_freelist != NULL);
-               task_free(tq, task_alloc(tq, KM_SLEEP));
-       }
-
-       mutex_exit(&tq->tq_lock);
-
-       kmem_free(tq->tq_threadlist, nthreads * sizeof (kthread_t *));
-
-       rw_destroy(&tq->tq_threadlock);
-       mutex_destroy(&tq->tq_lock);
-       cv_destroy(&tq->tq_dispatch_cv);
-       cv_destroy(&tq->tq_wait_cv);
-       cv_destroy(&tq->tq_maxalloc_cv);
-
-       kmem_free(tq, sizeof (taskq_t));
-}
-
-int
-taskq_member(taskq_t *tq, kthread_t *t)
-{
-       int i;
-
-       if (taskq_now)
-               return (1);
-
-       for (i = 0; i < tq->tq_nthreads; i++)
-               if (tq->tq_threadlist[i] == t)
-                       return (1);
-
-       return (0);
-}
-
-int
-taskq_cancel_id(taskq_t *tq, taskqid_t id)
-{
-       return (ENOENT);
-}
-
-void
-system_taskq_init(void)
-{
-       system_taskq = taskq_create("system_taskq", 64, maxclsyspri, 4, 512,
-           TASKQ_DYNAMIC | TASKQ_PREPOPULATE);
-}
-
-void
-system_taskq_fini(void)
-{
-       taskq_destroy(system_taskq);
-       system_taskq = NULL; /* defensive */
-}
diff --git a/zfs/lib/libzpool/util.c b/zfs/lib/libzpool/util.c
deleted file mode 100644 (file)
index 231043d..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-/*
- * CDDL HEADER START
- *
- * The contents of this file are subject to the terms of the
- * Common Development and Distribution License (the "License").
- * You may not use this file except in compliance with the License.
- *
- * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
- * or http://www.opensolaris.org/os/licensing.
- * See the License for the specific language governing permissions
- * and limitations under the License.
- *
- * When distributing Covered Code, include this CDDL HEADER in each
- * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
- * If applicable, add the following below this CDDL HEADER, with the
- * fields enclosed by brackets "[]" replaced with your own identifying
- * information: Portions Copyright [yyyy] [name of copyright owner]
- *
- * CDDL HEADER END
- */
-/*
- * Copyright (c) 2005, 2010, Oracle and/or its affiliates. All rights reserved.
- */
-
-#include <assert.h>
-#include <sys/zfs_context.h>
-#include <sys/avl.h>
-#include <string.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <sys/spa.h>
-#include <sys/fs/zfs.h>
-#include <sys/refcount.h>
-
-/*
- * Routines needed by more than one client of libzpool.
- */
-
-void
-nicenum(uint64_t num, char *buf)
-{
-       uint64_t n = num;
-       int index = 0;
-       char u;
-
-       while (n >= 1024) {
-               n = (n + (1024 / 2)) / 1024; /* Round up or down */
-               index++;
-       }
-
-       u = " KMGTPE"[index];
-
-       if (index == 0) {
-               (void) sprintf(buf, "%llu", (u_longlong_t)n);
-       } else if (n < 10 && (num & (num - 1)) != 0) {
-               (void) sprintf(buf, "%.2f%c",
-                   (double)num / (1ULL << 10 * index), u);
-       } else if (n < 100 && (num & (num - 1)) != 0) {
-               (void) sprintf(buf, "%.1f%c",
-                   (double)num / (1ULL << 10 * index), u);
-       } else {
-               (void) sprintf(buf, "%llu%c", (u_longlong_t)n, u);
-       }
-}
-
-static void
-show_vdev_stats(const char *desc, const char *ctype, nvlist_t *nv, int indent)
-{
-       vdev_stat_t *vs;
-       vdev_stat_t v0 = { 0 };
-       uint64_t sec;
-       uint64_t is_log = 0;
-       nvlist_t **child;
-       uint_t c, children;
-       char used[6], avail[6];
-       char rops[6], wops[6], rbytes[6], wbytes[6], rerr[6], werr[6], cerr[6];
-       char *prefix = "";
-
-       if (indent == 0 && desc != NULL) {
-               (void) printf("                           "
-                   " capacity   operations   bandwidth  ---- errors ----\n");
-               (void) printf("description                "
-                   "used avail  read write  read write  read write cksum\n");
-       }
-
-       if (desc != NULL) {
-               (void) nvlist_lookup_uint64(nv, ZPOOL_CONFIG_IS_LOG, &is_log);
-
-               if (is_log)
-                       prefix = "log ";
-
-               if (nvlist_lookup_uint64_array(nv, ZPOOL_CONFIG_VDEV_STATS,
-                   (uint64_t **)&vs, &c) != 0)
-                       vs = &v0;
-
-               sec = MAX(1, vs->vs_timestamp / NANOSEC);
-
-               nicenum(vs->vs_alloc, used);
-               nicenum(vs->vs_space - vs->vs_alloc, avail);
-               nicenum(vs->vs_ops[ZIO_TYPE_READ] / sec, rops);
-               nicenum(vs->vs_ops[ZIO_TYPE_WRITE] / sec, wops);
-               nicenum(vs->vs_bytes[ZIO_TYPE_READ] / sec, rbytes);
-               nicenum(vs->vs_bytes[ZIO_TYPE_WRITE] / sec, wbytes);
-               nicenum(vs->vs_read_errors, rerr);
-               nicenum(vs->vs_write_errors, werr);
-               nicenum(vs->vs_checksum_errors, cerr);
-
-               (void) printf("%*s%s%*s%*s%*s %5s %5s %5s %5s %5s %5s %5s\n",
-                   indent, "",
-                   prefix,
-                   (int)(indent+strlen(prefix)-25-(vs->vs_space ? 0 : 12)),
-                   desc,
-                   vs->vs_space ? 6 : 0, vs->vs_space ? used : "",
-                   vs->vs_space ? 6 : 0, vs->vs_space ? avail : "",
-                   rops, wops, rbytes, wbytes, rerr, werr, cerr);
-       }
-
-       if (nvlist_lookup_nvlist_array(nv, ctype, &child, &children) != 0)
-               return;
-
-       for (c = 0; c < children; c++) {
-               nvlist_t *cnv = child[c];
-               char *cname, *tname;
-               uint64_t np;
-               if (nvlist_lookup_string(cnv, ZPOOL_CONFIG_PATH, &cname) &&
-                   nvlist_lookup_string(cnv, ZPOOL_CONFIG_TYPE, &cname))
-                       cname = "<unknown>";
-               tname = calloc(1, strlen(cname) + 2);
-               (void) strcpy(tname, cname);
-               if (nvlist_lookup_uint64(cnv, ZPOOL_CONFIG_NPARITY, &np) == 0)
-                       tname[strlen(tname)] = '0' + np;
-               show_vdev_stats(tname, ctype, cnv, indent + 2);
-               free(tname);
-       }
-}
-
-void
-show_pool_stats(spa_t *spa)
-{
-       nvlist_t *config, *nvroot;
-       char *name;
-
-       VERIFY(spa_get_stats(spa_name(spa), &config, NULL, 0) == 0);
-
-       VERIFY(nvlist_lookup_nvlist(config, ZPOOL_CONFIG_VDEV_TREE,
-           &nvroot) == 0);
-       VERIFY(nvlist_lookup_string(config, ZPOOL_CONFIG_POOL_NAME,
-           &name) == 0);
-
-       show_vdev_stats(name, ZPOOL_CONFIG_CHILDREN, nvroot, 0);
-       show_vdev_stats(NULL, ZPOOL_CONFIG_L2CACHE, nvroot, 0);
-       show_vdev_stats(NULL, ZPOOL_CONFIG_SPARES, nvroot, 0);
-
-       nvlist_free(config);
-}
diff --git a/zfs/man/Makefile.am b/zfs/man/Makefile.am
deleted file mode 100644 (file)
index 841cb9c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = man1 man5 man8
diff --git a/zfs/man/Makefile.in b/zfs/man/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/man/man1/Makefile.am b/zfs/man/man1/Makefile.am
deleted file mode 100644 (file)
index 113cd0d..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-dist_man_MANS = zhack.1 zpios.1 ztest.1
-EXTRA_DIST = cstyle.1
-
-install-data-local:
-       $(INSTALL) -d -m 0755 "$(DESTDIR)$(mandir)/man1"
diff --git a/zfs/man/man1/Makefile.in b/zfs/man/man1/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/man/man1/cstyle.1 b/zfs/man/man1/cstyle.1
deleted file mode 100644 (file)
index f467c55..0000000
+++ /dev/null
@@ -1,167 +0,0 @@
-.\" Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
-.\" Use is subject to license terms.
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.TH cstyle 1 "28 March 2005"
-.SH NAME
-.I cstyle
-\- check for some common stylistic errors in C source files
-.SH SYNOPSIS
-\fBcstyle [-chpvCP] [-o constructs] [file...]\fP
-.LP
-.SH DESCRIPTION
-.IX "OS-Net build tools" "cstyle" "" "\fBcstyle\fP"
-.LP
-.I cstyle
-inspects C source files (*.c and *.h) for common sylistic errors.  It
-attempts to check for the cstyle documented in
-\fIhttp://www.cis.upenn.edu/~lee/06cse480/data/cstyle.ms.pdf\fP.
-Note that there is much in that document that
-.I cannot
-be checked for; just because your code is \fBcstyle(1)\fP clean does not
-mean that you've followed Sun's C style.  \fICaveat emptor\fP.
-.LP
-.SH OPTIONS
-.LP
-The following options are supported:
-.TP 4
-.B \-c
-Check continuation line indentation inside of functions.  Sun's C style
-states that all statements must be indented to an appropriate tab stop,
-and any continuation lines after them must be indented \fIexactly\fP four
-spaces from the start line.  This option enables a series of checks
-designed to find contination line problems within functions only.  The
-checks have some limitations;  see CONTINUATION CHECKING, below.
-.LP
-.TP 4
-.B \-h
-Performs heuristic checks that are sometimes wrong.  Not generally used.
-.LP
-.TP 4
-.B \-p
-Performs some of the more picky checks.  Includes ANSI #else and #endif
-rules, and tries to detect spaces after casts.  Used as part of the
-putback checks.
-.LP
-.TP 4
-.B \-v
-Verbose output;  includes the text of the line of error, and, for
-\fB-c\fP, the first statement in the current continuation block.
-.LP
-.TP 4
-.B \-C
-Ignore errors in header comments (i.e. block comments starting in the
-first column).  Not generally used.
-.LP
-.TP 4
-.B \-P
-Check for use of non-POSIX types.  Historically, types like "u_int" and
-"u_long" were used, but they are now deprecated in favor of the POSIX
-types uint_t, ulong_t, etc.  This detects any use of the deprecated
-types.  Used as part of the putback checks.
-.LP
-.TP 4
-.B \-o \fIconstructs\fP
-Allow a comma-seperated list of additional constructs.  Available
-constructs include:
-.LP
-.TP 10
-.B doxygen
-Allow doxygen-style block comments (\fB/**\fP and \fB/*!\fP)
-.LP
-.TP 10
-.B splint
-Allow splint-style lint comments (\fB/*@...@*/\fP)
-.LP
-.SH NOTES
-.LP
-The cstyle rule for the OS/Net consolidation is that all new files must
-be \fB-pP\fP clean.  For existing files, the following invocations are
-run against both the old and new files:
-.LP
-.TP 4
-\fBcstyle file\fB
-.LP
-.TP 4
-\fBcstyle -p file\fB
-.LP
-.TP 4
-\fBcstyle -pP file\fB
-.LP
-If the old file gave no errors for one of the invocations, the new file
-must also give no errors.  This way, files can only become more clean.
-.LP
-.SH CONTINUATION CHECKING
-.LP
-The continuation checker is a resonably simple state machine that knows
-something about how C is layed out, and can match parenthesis, etc. over
-multiple lines.  It does have some limitations:
-.LP
-.TP 4
-.B 1.
-Preprocessor macros which cause unmatched parenthesis will confuse the
-checker for that line.  To fix this, you'll need to make sure that each
-branch of the #if statement has balanced parenthesis.
-.LP
-.TP 4
-.B 2.
-Some \fBcpp\fP macros do not require ;s after them.  Any such macros
-*must* be ALL_CAPS; any lower case letters will cause bad output.
-.LP
-The bad output will generally be corrected after the next \fB;\fP,
-\fB{\fP, or \fB}\fP.
-.LP
-Some continuation error messages deserve some additional explanation
-.LP
-.TP 4
-.B
-multiple statements continued over multiple lines
-A multi-line statement which is not broken at statement
-boundries.  For example:
-.RS 4
-.HP 4
-if (this_is_a_long_variable == another_variable) a =
-.br
-b + c;
-.LP
-Will trigger this error.  Instead, do:
-.HP 8
-if (this_is_a_long_variable == another_variable)
-.br
-a = b + c;
-.RE
-.LP
-.TP 4
-.B
-empty if/for/while body not on its own line
-For visibility, empty bodies for if, for, and while statements should be
-on their own line.  For example:
-.RS 4
-.HP 4
-while (do_something(&x) == 0);
-.LP
-Will trigger this error.  Instead, do:
-.HP 8
-while (do_something(&x) == 0)
-.br
-;
-.RE
-
diff --git a/zfs/man/man1/zhack.1 b/zfs/man/man1/zhack.1
deleted file mode 100644 (file)
index 007be77..0000000
+++ /dev/null
@@ -1,100 +0,0 @@
-'\" t
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.\"
-.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
-.\"
-.TH zhack 1 "2013 MAR 16" "ZFS on Linux" "User Commands"
-
-.SH NAME
-zhack \- libzpool debugging tool
-.SH DESCRIPTION
-This utility pokes configuration changes directly into a ZFS pool,
-which is dangerous and can cause data corruption.
-.SH SYNOPSIS
-.LP
-.BI "zhack [\-c " "cachefile" "] [\-d " "dir" "] <" "subcommand" "> [" "arguments" "]"
-.SH OPTIONS
-.HP
-.BI "\-c" " cachefile"
-.IP
-Read the \fIpool\fR configuration from the \fIcachefile\fR, which is
-/etc/zfs/zpool.cache by default.
-.HP
-.BI "\-d" " dir"
-.IP
-Search for \fIpool\fR members in the \fIdir\fR path. Can be specified
-more than once.
-.SH SUBCOMMANDS
-.LP
-.BI "feature stat " "pool"
-.IP
-List feature flags.
-.LP
-.BI "feature enable [\-d " "description" "] [\-r] " "pool guid"
-.IP
-Add a new feature to \fIpool\fR that is uniquely identified by
-\fIguid\fR, which is specified in the same form as a zfs(8) user
-property.
-.IP
-The \fIdescription\fR is a short human readable explanation of the new
-feature.
-.IP
-The \fB\-r\fR switch indicates that \fIpool\fR can be safely opened
-in read-only mode by a system that does not have the \fIguid\fR
-feature.
-.LP
-.BI "feature ref [\-d|\-m] " "pool guid"
-.IP
-Increment the reference count of the \fIguid\fR feature in \fIpool\fR.
-.IP
-The \fB\-d\fR switch decrements the reference count of the \fIguid\fR
-feature in \fIpool\fR.
-.IP
-The \fB\-m\fR switch indicates that the \fIguid\fR feature is now
-required to read the pool MOS.
-.SH EXAMPLES
-.LP
-.nf
-# zhack feature stat tank
-
-for_read_obj:
-       org.illumos:lz4_compress = 0
-for_write_obj:
-       com.delphix:async_destroy = 0
-       com.delphix:empty_bpobj = 0
-descriptions_obj:
-       com.delphix:async_destroy = Destroy filesystems asynchronously.
-       com.delphix:empty_bpobj = Snapshots use less space.
-       org.illumos:lz4_compress = LZ4 compression algorithm support.
-.LP
-# zhack feature enable -d 'Predict future disk failures.' \\
-    tank com.example:clairvoyance
-.LP
-# zhack feature ref tank com.example:clairvoyance
-.SH AUTHORS
-This man page was written by Darik Horn <dajhorn@vanadac.com>.
-.SH SEE ALSO
-.BR splat (1),
-.BR zfs (8),
-.BR zpios (1),
-.BR zpool-features (5),
-.BR ztest (1)
diff --git a/zfs/man/man1/zpios.1 b/zfs/man/man1/zpios.1
deleted file mode 100644 (file)
index 4334c03..0000000
+++ /dev/null
@@ -1,241 +0,0 @@
-'\" t
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.\"
-.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
-.\"
-.\" Copyright (c) 2015, Intel Corporation.
-.\"
-.TH zpios 1 "2013 FEB 28" "ZFS on Linux" "User Commands"
-
-.SH NAME
-zpios \- Directly test the DMU.
-.SH SYNOPSIS
-.LP
-.BI "zpios [options] <\-p " pool ">"
-
-.SH DESCRIPTION
-This utility runs in-kernel DMU performance and stress tests that do
-not depend on the ZFS Posix Layer ("ZPL").
-
-.SH OPTIONS
-.HP
-.BI "\-t" " regex" ", \-\-threadcount" " regex"
-.IP
-Start this many threads for each test series, specified as a comma
-delimited regular expression. (eg: "-t 1,2,3")
-.IP
-This option is mutually exclusive with the \fBthreadcount_*\fR
-options.
-.HP
-.BI "\-l" " regex_low" ", \-\-threadcount_low" " regex_low"
-.HP
-.BI "\-h" " regex_high" ", \-\-threadcount_high" " regex_high"
-.HP
-.BI "\-e" " regex_incr" ", \-\-threadcount_incr" " regex_incr"
-.IP
-Start \fIregex_low\fR threads for the first test,
-add \fIregex_incr\fR threads for each subsequent test,
-and start \fIregex_high\fR threads for the last test.
-.IP
-These three options must be specified together and are mutually
-exclusive with the \fBthreadcount\fR option.
-.HP
-.BI "\-n" " regex" ", \-\-regioncount" " regex"
-.IP
-Create this many regions for each test series, specified as a comma
-delimited regular expression. (eg: "-n 512,4096,65536")
-.IP
-This option is mutually exclusive with the \fBregioncount_*\fR
-options.
-.HP
-.BI "\-i" " regex_low" ", \-\-regioncount_low" " regex_low"
-.HP
-.BI "\-j" " regex_high" ", \-\-regioncount_high" " regex_high"
-.HP
-.BI "\-k" " regex_incr" ", \-\-regioncount_incr" " regex_incr"
-.IP
-Create \fIregex_low\fR regions for the first test,
-add \fIregex_incr\fR regions for each subsequent test, and
-create \fIregex_high\fR regions for the last test.
-.IP
-These three options must be specified together and are mutually
-exclusive with the \fBregioncount\fR option.
-.HP
-.BI "\-o" " size" ", \-\-offset" " size"
-.IP
-Create regions at \fIsize\fR offset for each test series, specified as
-a comma delimited regular expression with an optional unit suffix.
-(eg: "-o 4M" means four megabytes.)
-.IP
-This option is mutually exclusive with the \fBoffset_*\fR options.
-.HP
-.BI "\-m" " size_low" ", \-\-offset_low" " size_low"
-.HP
-.BI "\-q" " size_high" ", \-\-offset_high" " size_high"
-.HP
-.BI "\-r" " size_incr" ", \-\-offset_incr" " size_incr"
-.IP
-Create a region at \fIsize_low\fR offset for the first test, add
-\fIsize_incr\fR to the offset for each subsequent test, and create
-a region at \fIsize_high\fR offset for the last test.
-.IP
-These three options must be specified together and are mutually
-exclusive with the \fBoffset\fR option.
-.HP
-.BI "\-c" " size" ", \-\-chunksize" " size"
-.IP
-Use \fIsize\fR chunks for each test, specified as a comma delimited
-regular expression with an optional unit suffix. (eg: "-c 1M" means
-one megabyte.) The chunk size must be at least the region size.
-.IP
-This option is mutually exclusive with the \fBchunksize_*\fB options.
-.HP
-.BI "\-a" " size_low" ", \-\-chunksize_low" " size_low"
-.HP
-.BI "\-b" " size_high" ", \-\-chunksize_high" " size_high"
-.HP
-.BI "\-g" " size_incr" ", \-\-chunksize_incr" " size_incr"
-.IP
-Use a \fIsize_low\fR chunk size for the first test, add \fIsize_incr\fR
-to the chunk size for each subsequent test, and use a \fIsize_high\fR
-chunk size for the last test.
-.IP
-These three options must be specified together and are mutually
-exclusive with the \fBchunksize\fR option.
-.HP
-.BI "\-s" " size" ", \-\-regionsize" " size"
-.IP
-Use \fIsize\fR regions for each test, specified as a comma delimited
-regular expression with an optional unit suffix. (eg: "-s 1M" means
-one megabyte.)
-.IP
-This option is mutually exclusive with the \fBregionsize_*\fB options.
-.HP
-.BI "\-A" " size_low" ", \-\-regionsize_low" " size_low"
-.HP
-.BI "\-B" " size_high" ", \-\-regionsize_high" " size_high"
-.HP
-.BI "\-C" " size_incr" ", \-\-regionsize_incr" " size_incr"
-.IP
-Use a \fIsize_low\fR region size for the first test, add \fIsize_incr\fR
-to the region size for each subsequent test, and use a \fIsize_high\fR
-region size for the last test.
-.IP
-These three options must be specified together and are mutually
-exclusive with the \fBregionsize\fR option.
-.HP
-.BI "\-S" " size | sizes" ", \-\-blocksize" " size | sizes"
-.IP
-Use \fIsize\fR ZFS blocks for each test, specified as a comma delimited
-regular expression with an optional unit suffix. (eg: "-S 1M" means
-one megabyte.) The supported range is powers of two from 128K through 16M.
-A range of blocks can be tested as follows: "-S 128K,256K,512K,1M".
-.IP
-.HP
-.BI "\-L" " dmu_flags" ", \-\-load" " dmu_flags"
-.IP
-Specify \fIdmuio\fR for regular DMU_IO, \fIssf\fR for single shared
-file access, or \fIfpp\fR for per thread access. Use commas to delimit
-multiple flags. (eg: "-L dmuio,ssf")
-.HP
-.BI "\-p" " name" ", \-\-pool" " name"
-.IP
-The pool name, which is mandatory.
-.HP
-.BI "\-M" " test" ", \-\-name" " test"
-.IP
-An arbitrary string that appears in the program output.
-.HP
-.BI "-x, \-\-cleanup"
-.IP
-Enable the DMU_REMOVE flag.
-.HP
-.BI "\-P" " command" ", \-\-prerun" " command"
-.IP
-Invoke \fIcommand\fR from the kernel before running the test. Shell
-expansion is not performed and the environment is set to
-HOME=/; TERM=linux; PATH=/sbin:/usr/sbin:/bin:/usr/bin.
-.HP
-.BI "\-R" " command" ", \-\-postrun" " command"
-.IP
-Invoke \fIcommand\fR from the kernel after running the test. Shell
-expansion is not performed and the environment is set to
-HOME=/; TERM=linux; PATH=/sbin:/usr/sbin:/bin:/usr/bin.
-.HP
-.BI "\-G" " directory" ", \-\-log" " directory"
-.IP
-Put logging output in this directory.
-.HP
-.BI "\-I" " size" ", \-\-regionnoise" " size"
-.IP
-Randomly vary the \fBregionsize\fR parameter for each test
-modulo \fIsize\fR bytes.
-.HP
-.BI "\-N" " size" ", \-\-chunknoise" " size"
-.IP
-Randomly vary the \fBchunksize\fR parameter for each test
-modulo \fIsize\fR bytes.
-.HP
-.BI "\-T" " time" ", \-\-threaddelay" " time"
-.IP
-Randomly vary the execution time for each test
-modulo \fItime\fR kernel jiffies.
-.HP
-.BI "\-V" "" ", \-\-verify" ""
-.IP
-Enable the DMU_VERIFY flag for trivial data verification.
-.HP
-.BI "\-z" "" ", \-\-zerocopy" ""
-.IP
-Enable the DMU_READ_ZC and DMU_WRITE_ZC flags, which are
-currently unimplemented for Linux.
-.IP
-.HP
-.BI "\-O" "" ", \-\-nowait" ""
-.IP
-Enable the DMU_WRITE_NOWAIT flag.
-.HP
-.BI "\-f" "" ", \-\-noprefetch" ""
-.IP
-Enable the DMU_READ_NOPF flag.
-.HP
-.BI "\-H" "" ", \-\-human\-readable" ""
-.IP
-Print PASS and FAIL results explicitly and put unit suffixes on large
-numbers.
-.HP
-.BI "\-v" "" ", \-\-verbose" ""
-.IP
-Increase output verbosity.
-.HP
-.BI "\-?" " " ", \-\-help" " "
-.IP
-Print the usage message.
-.SH "AUTHORS"
-The original zpios implementation was created by Cluster File Systems
-Inc and adapted to ZFS on Linux by Brian Behlendorf
-<behlendorf1@llnl.gov>.
-
-This man page was written by Darik Horn <dajhorn@vanadac.com>.
-.SH "SEE ALSO"
-.BR zpool (8),
-.BR zfs (8)
diff --git a/zfs/man/man1/ztest.1 b/zfs/man/man1/ztest.1
deleted file mode 100644 (file)
index f798bcf..0000000
+++ /dev/null
@@ -1,169 +0,0 @@
-'\" t
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.\"
-.\" Copyright (c) 2009 Oracle and/or its affiliates. All rights reserved.
-.\" Copyright (c) 2009 Michael Gebetsroither <michael.geb@gmx.at>. All rights
-.\" reserved.
-.\"
-.TH ztest 1 "2009 NOV 01" "ZFS on Linux" "User Commands"
-
-.SH NAME
-\fBztest\fR \- was written by the ZFS Developers as a ZFS unit test.
-.SH SYNOPSIS
-.LP
-.BI "ztest <options>"
-.SH DESCRIPTION
-.LP
-This manual page documents briefly the \fBztest\fR command.
-.LP
-\fBztest\fR was written by the ZFS Developers as a ZFS unit test. The
-tool was developed in tandem with the ZFS functionality and was
-executed nightly as one of the many regression test against the daily
-build. As features were added to ZFS, unit tests were also added to
-\fBztest\fR.  In addition, a separate test development team wrote and
-executed more functional and stress tests.
-.LP
-By default \fBztest\fR runs for ten minutes and uses block files
-(stored in /tmp) to create pools rather than using physical disks.
-Block files afford \fBztest\fR its flexibility to play around with
-zpool components without requiring large hardware configurations.
-However, storing the block files in /tmp may not work for you if you
-have a small tmp directory.
-.LP
-By default is non-verbose. This is why entering the command above will
-result in \fBztest\fR quietly executing for 5 minutes. The -V option
-can be used to increase the verbosity of the tool. Adding multiple -V
-option is allowed and the more you add the more chatty \fBztest\fR
-becomes.
-.LP
-After the \fBztest\fR run completes, you should notice many ztest.*
-files lying around. Once the run completes you can safely remove these
-files. Note that you shouldn't remove these files during a run. You
-can re-use these files in your next \fBztest\fR run by using the -E
-option.
-.SH OPTIONS
-.HP
-.BI "\-?" ""
-.IP
-Print a help summary.
-.HP
-.BI "\-v" " vdevs" " (default: 5)
-.IP
-Number of vdevs.
-.HP
-.BI "\-s" " size_of_each_vdev" " (default: 64M)"
-.IP
-Size of each vdev.
-.HP
-.BI "\-a" " alignment_shift" " (default: 9) (use 0 for random)"
-.IP
-Used alignment in test.
-.HP
-.BI "\-m" " mirror_copies" " (default: 2)"
-.IP
-Number of mirror copies.
-.HP
-.BI "\-r" " raidz_disks" " (default: 4)"
-.IP
-Number of raidz disks.
-.HP
-.BI "\-R" " raidz_parity" " (default: 1)"
-.IP
-Raidz parity.
-.HP
-.BI "\-d" " datasets" " (default: 7)"
-.IP
-Number of datasets.
-.HP
-.BI "\-t" " threads" " (default: 23)"
-.IP
-Number of threads.
-.HP
-.BI "\-g" " gang_block_threshold" " (default: 32K)"
-.IP
-Gang block threshold.
-.HP
-.BI "\-i" " initialize_pool_i_times" " (default: 1)"
-.IP
-Number of pool initialisations.
-.HP
-.BI "\-k" " kill_percentage" " (default: 70%)"
-.IP
-Kill percentage.
-.HP
-.BI "\-p" " pool_name" " (default: ztest)"
-.IP
-Pool name.
-.HP
-.BI "\-V(erbose)"
-.IP
-Verbose (use multiple times for ever more blather).
-.HP
-.BI "\-E(xisting)"
-.IP
-Use existing pool (use existing pool instead of creating new one).
-.HP
-.BI "\-T" " time" " (default: 300 sec)"
-.IP
-Total test run time.
-.HP
-.BI "\-z" " zil_failure_rate" " (default: fail every 2^5 allocs)
-.IP
-Injected failure rate.
-.SH "EXAMPLES"
-.LP
-To override /tmp as your location for block files, you can use the -f
-option:
-.IP
-ztest -f /
-.LP
-To get an idea of what ztest is actually testing try this:
-.IP
-ztest -f / -VVV
-.LP
-Maybe you'd like to run ztest for longer? To do so simply use the -T
-option and specify the runlength in seconds like so:
-.IP
-ztest -f / -V -T 120
-
-.SH "ENVIRONMENT VARIABLES"
-.TP
-.B "ZFS_STACK_SIZE=stacksize"
-Limit the default stack size to \fBstacksize\fR bytes for the purpose of
-detecting and debugging kernel stack overflows.  For x86_64 platforms this
-value should be set as follows to simulate these platforms: \fB8192\fR
-(Linux), \fB20480\fR (Illumos), \fB16384\fR (FreeBSD).
-
-In practice you may need to set these value slightly higher because
-differences in stack usage between kernel and user space can lead to spurious
-stack overflows (especially when debugging is enabled).  The specified value
-will be rounded up to a floor of PTHREAD_STACK_MIN which is the minimum stack
-required for a NULL procedure in user space.
-
-By default the stack size is limited to 256K.
-.SH "SEE ALSO"
-.BR "zpool (1)" ","
-.BR "zfs (1)" ","
-.BR "zdb (1)" ","
-.SH "AUTHOR"
-This manual page was transvered to asciidoc by Michael Gebetsroither
-<gebi@grml.org> from http://opensolaris.org/os/community/zfs/ztest/
diff --git a/zfs/man/man5/Makefile.am b/zfs/man/man5/Makefile.am
deleted file mode 100644 (file)
index 4746914..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-dist_man_MANS = vdev_id.conf.5 zpool-features.5 zfs-module-parameters.5 zfs-events.5
-
-install-data-local:
-       $(INSTALL) -d -m 0755 "$(DESTDIR)$(mandir)/man5"
diff --git a/zfs/man/man5/Makefile.in b/zfs/man/man5/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/man/man5/vdev_id.conf.5 b/zfs/man/man5/vdev_id.conf.5
deleted file mode 100644 (file)
index 4fea831..0000000
+++ /dev/null
@@ -1,180 +0,0 @@
-.TH vdev_id.conf 5
-.SH NAME
-vdev_id.conf \- Configuration file for vdev_id
-.SH DESCRIPTION
-.I vdev_id.conf
-is the configuration file for
-.BR vdev_id (8).
-It controls the default behavior of
-.BR vdev_id (8)
-while it is mapping a disk device name to an alias.
-.PP
-The
-.I vdev_id.conf
-file uses a simple format consisting of a keyword followed by one or
-more values on a single line.  Any line not beginning with a recognized
-keyword is ignored.  Comments may optionally begin with a hash
-character.
-
-The following keywords and values are used.
-.TP
-\fIalias\fR <name> <devlink>
-Maps a device link in the /dev directory hierarchy to a new device
-name.  The udev rule defining the device link must have run prior to
-.BR vdev_id (8).
-A defined alias takes precedence over a topology-derived name, but the
-two naming methods can otherwise coexist.  For example, one might name
-drives in a JBOD with the sas_direct topology while naming an internal
-L2ARC device with an alias.
-
-\fIname\fR - the name of the link to the device that will by created in
-/dev/disk/by-vdev.
-
-\fIdevlink\fR - the name of the device link that has already been
-defined by udev.  This may be an absolute path or the base filename.
-
-.TP
-\fIchannel\fR [pci_slot] <port> <name>
-Maps a physical path to a channel name (typically representing a single
-disk enclosure).
-
-\fIpci_slot\fR - specifies the PCI SLOT of the HBA
-hosting the disk enclosure being mapped, as found in the output of
-.BR lspci (8).
-This argument is not used in sas_switch mode.
-
-\fIport\fR - specifies the numeric identifier of the HBA or SAS switch port
-connected to the disk enclosure being mapped.
-
-\fIname\fR - specifies the name of the channel.
-
-.TP
-\fIslot\fR <old> <new> [channel]
-Maps a disk slot number as reported by the operating system to an
-alternative slot number.  If the \fIchannel\fR parameter is specified
-then the mapping is only applied to slots in the named channel,
-otherwise the mapping is applied to all channels. The first-specified
-\fIslot\fR rule that can match a slot takes precedence.  Therefore a
-channel-specific mapping for a given slot should generally appear before
-a generic mapping for the same slot.  In this way a custom mapping may
-be applied to a particular channel and a default mapping applied to the
-others.
-
-.TP
-\fImultipath\fR <yes|no>
-Specifies whether
-.BR vdev_id (8)
-will handle only dm-multipath devices.  If set to "yes" then
-.BR vdev_id (8)
-will examine the first running component disk of a dm-multipath
-device as listed by the
-.BR multipath (8)
-command to determine the physical path.
-.TP
-\fItopology\fR <sas_direct|sas_switch>
-Identifies a physical topology that governs how physical paths are
-mapped to channels.
-
-\fIsas_direct\fR - in this mode a channel is uniquely identified by
-a PCI slot and a HBA port number
-
-\fIsas_switch\fR - in this mode a channel is uniquely identified by
-a SAS switch port number
-
-.TP
-\fIphys_per_port\fR <num>
-Specifies the number of PHY devices associated with a SAS HBA port or SAS
-switch port.
-.BR vdev_id (8)
-internally uses this value to determine which HBA or switch port a
-device is connected to.  The default is 4.
-
-.TP
-\fIslot\fR <bay|phy|id|lun>
-Specifies from which element of a SAS identifier the slot number is
-taken.  The default is bay.
-
-\fIbay\fR - read the slot number from the bay identifier.
-
-\fIphy\fR - read the slot number from the phy identifier.
-
-\fIid\fR - use the scsi id as the slot number.
-
-\fIlun\fR - use the scsi lun as the slot number.
-.SH EXAMPLES
-A non-multipath configuration with direct-attached SAS enclosures and an
-arbitrary slot re-mapping.
-.P
-.nf
-       multipath     no
-       topology      sas_direct
-       phys_per_port 4
-       slot          bay
-
-       #       PCI_SLOT HBA PORT  CHANNEL NAME
-       channel 85:00.0  1         A
-       channel 85:00.0  0         B
-       channel 86:00.0  1         C
-       channel 86:00.0  0         D
-
-       # Custom mapping for Channel A
-
-       #    Linux      Mapped
-       #    Slot       Slot      Channel
-       slot 1          7         A
-       slot 2          10        A
-       slot 3          3         A
-       slot 4          6         A
-
-       # Default mapping for B, C, and D
-
-       slot 1          4
-       slot 2          2
-       slot 3          1
-       slot 4          3
-.fi
-.P
-A SAS-switch topology.  Note that the
-.I channel
-keyword takes only two arguments in this example.
-.P
-.nf
-       topology      sas_switch
-
-       #       SWITCH PORT  CHANNEL NAME
-       channel 1            A
-       channel 2            B
-       channel 3            C
-       channel 4            D
-.fi
-.P
-A multipath configuration.  Note that channel names have multiple
-definitions - one per physical path.
-.P
-.nf
-       multipath yes
-
-       #       PCI_SLOT HBA PORT  CHANNEL NAME
-       channel 85:00.0  1         A
-       channel 85:00.0  0         B
-       channel 86:00.0  1         A
-       channel 86:00.0  0         B
-.fi
-.P
-A configuration using device link aliases.
-.P
-.nf
-       #     by-vdev
-       #     name     fully qualified or base name of device link
-       alias d1       /dev/disk/by-id/wwn-0x5000c5002de3b9ca
-       alias d2       wwn-0x5000c5002def789e
-.fi
-.P
-
-.SH FILES
-.TP
-.I /etc/zfs/vdev_id.conf
-The configuration file for
-.BR vdev_id (8).
-.SH SEE ALSO
-.BR vdev_id (8)
diff --git a/zfs/man/man5/zfs-events.5 b/zfs/man/man5/zfs-events.5
deleted file mode 100644 (file)
index 72f468c..0000000
+++ /dev/null
@@ -1,889 +0,0 @@
-'\" te
-.\" Copyright (c) 2013 by Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
-.\" The contents of this file are subject to the terms of the Common Development
-.\" and Distribution License (the "License").  You may not use this file except
-.\" in compliance with the License. You can obtain a copy of the license at
-.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
-.\"
-.\" See the License for the specific language governing permissions and
-.\" limitations under the License. When distributing Covered Code, include this
-.\" CDDL HEADER in each file and include the License file at
-.\" usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this
-.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
-.\" own identifying information:
-.\" Portions Copyright [yyyy] [name of copyright owner]
-.TH ZFS-EVENTS 5 "Jun 6, 2015"
-.SH NAME
-zfs\-events \- Events created by the ZFS filesystem.
-.SH DESCRIPTION
-.sp
-.LP
-Description of the different events generated by the ZFS stack.
-.sp
-Most of these don't have any description. The events generated by ZFS
-have never been publicly documented.  What is here is intended as a
-starting point to provide documentation for all possible events.
-.sp
-To view all events created since the loading of the ZFS infrastructure
-(i.e, "the module"), run
-.P
-.nf
-\fBzpool events\fR
-.fi
-.P
-to get a short list, and
-.P
-.nf
-\fBzpool events -v\fR
-.fi
-.P
-to get a full detail of the events and what information
-is available about it.
-.sp
-This man page lists the different subclasses that are issued
-in the case of an event. The full event name would be
-\fIereport.fs.zfs.SUBCLASS\fR, but we only list the last
-part here.
-
-.SS "EVENTS (SUBCLASS)"
-.sp
-.LP
-
-.sp
-.ne 2
-.na
-\fBchecksum\fR
-.ad
-.RS 12n
-Issued when a checksum error have been detected.
-.RE
-
-.sp
-.ne 2
-.na
-\fBio\fR
-.ad
-.RS 12n
-Issued when there is an I/O error in a vdev in the pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fBdata\fR
-.ad
-.RS 12n
-Issued when there have been data errors in the pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fBdelay\fR
-.ad
-.RS 12n
-Issued when an I/O was slow to complete as defined by the zio_delay_max module
-option.
-.RE
-
-.sp
-.ne 2
-.na
-\fBconfig.sync\fR
-.ad
-.RS 12n
-Issued every time a vdev change have been done to the pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzpool\fR
-.ad
-.RS 12n
-Issued when a pool cannot be imported.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzpool.destroy\fR
-.ad
-.RS 12n
-Issued when a pool is destroyed.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzpool.export\fR
-.ad
-.RS 12n
-Issued when a pool is exported.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzpool.import\fR
-.ad
-.RS 12n
-Issued when a pool is imported.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzpool.reguid\fR
-.ad
-.RS 12n
-Issued when a REGUID (new unique identifier for the pool have been regenerated) have been detected.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.unknown\fR
-.ad
-.RS 12n
-Issued when the vdev is unknown. Such as trying to clear device
-errors on a vdev that have failed/been kicked from the system/pool
-and is no longer available.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.open_failed\fR
-.ad
-.RS 12n
-Issued when a vdev could not be opened (because it didn't exist for example).
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.corrupt_data\fR
-.ad
-.RS 12n
-Issued when corrupt data have been detected on a vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.no_replicas\fR
-.ad
-.RS 12n
-Issued when there are no more replicas to sustain the pool.
-This would lead to the pool being \fIDEGRADED\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.bad_guid_sum\fR
-.ad
-.RS 12n
-Issued when a missing device in the pool have been detected.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.too_small\fR
-.ad
-.RS 12n
-Issued when the system (kernel) have removed a device, and ZFS
-notices that the device isn't there any more. This is usually
-followed by a \fBprobe_failure\fR event.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.bad_label\fR
-.ad
-.RS 12n
-Issued when the label is OK but invalid.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.bad_ashift\fR
-.ad
-.RS 12n
-Issued when the ashift alignment requirement has increased.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.remove\fR
-.ad
-.RS 12n
-Issued when a vdev is detached from a mirror (or a spare detached from a
-vdev where it have been used to replace a failed drive - only works if
-the original drive have been readded).
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.clear\fR
-.ad
-.RS 12n
-Issued when clearing device errors in a pool. Such as running \fBzpool clear\fR
-on a device in the pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.check\fR
-.ad
-.RS 12n
-Issued when a check to see if a given vdev could be opened is started.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.spare\fR
-.ad
-.RS 12n
-Issued when a spare have kicked in to replace a failed device.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev.autoexpand\fR
-.ad
-.RS 12n
-Issued when a vdev can be automatically expanded.
-.RE
-
-.sp
-.ne 2
-.na
-\fBio_failure\fR
-.ad
-.RS 12n
-Issued when there is an I/O failure in a vdev in the pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fBprobe_failure\fR
-.ad
-.RS 12n
-Issued when a probe fails on a vdev. This would occur if a vdeev
-have been kicked from the system outside of ZFS (such as the kernel
-have removed the device).
-.RE
-
-.sp
-.ne 2
-.na
-\fBlog_replay\fR
-.ad
-.RS 12n
-Issued when the intent log cannot be replayed.  The can occur in the case
-of a missing or damaged log device.
-.RE
-
-.sp
-.ne 2
-.na
-\fBresilver.start\fR
-.ad
-.RS 12n
-Issued when a resilver is started.
-.RE
-
-.sp
-.ne 2
-.na
-\fBresilver.finish\fR
-.ad
-.RS 12n
-Issued when the running resilver have finished.
-.RE
-
-.sp
-.ne 2
-.na
-\fBscrub.start\fR
-.ad
-.RS 12n
-Issued when a scrub is started on a pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fBscrub.finish\fR
-.ad
-.RS 12n
-Issued when a pool have finished scrubbing.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbootfs.vdev.attach\fR
-.ad
-.RS 12n
-.RE
-
-.SS "PAYLOADS"
-.sp
-.LP
-This is the payload (data, information) that accompanies an
-event.
-.sp
-For
-.BR zed (8),
-these are set to uppercase and prefixed with \fBZEVENT_\fR.
-
-.sp
-.ne 2
-.na
-\fBpool\fR
-.ad
-.RS 12n
-Pool name.
-.RE
-
-.sp
-.ne 2
-.na
-\fBpool_failmode\fR
-.ad
-.RS 12n
-Failmode - \fBwait\fR, \fBcontinue\fR or \fBpanic\fR.
-See
-.BR pool (8)
-(\fIfailmode\fR property) for more information.
-.RE
-
-.sp
-.ne 2
-.na
-\fBpool_guid\fR
-.ad
-.RS 12n
-The GUID of the pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fBpool_context\fR
-.ad
-.RS 12n
-The load state for the pool (0=none, 1=open, 2=import, 3=tryimport, 4=recover
-5=error).
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_guid\fR
-.ad
-.RS 12n
-The GUID of the vdev in question (the vdev failing or operated upon with
-\fBzpool clear\fR etc).
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_type\fR
-.ad
-.RS 12n
-Type of vdev - \fBdisk\fR, \fBfile\fR, \fBmirror\fR etc. See
-.BR zpool (8)
-under \fBVirtual Devices\fR for more information on possible values.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_path\fR
-.ad
-.RS 12n
-Full path of the vdev, including any \fI-partX\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_devid\fR
-.ad
-.RS 12n
-ID of vdev (if any).
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_fru\fR
-.ad
-.RS 12n
-Physical FRU location.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_state\fR
-.ad
-.RS 12n
-State of vdev (0=uninitialized, 1=closed, 2=offline, 3=removed, 4=failed to open, 5=faulted, 6=degraded, 7=healty).
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_ashift\fR
-.ad
-.RS 12n
-The ashift value of the vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_complete_ts\fR
-.ad
-.RS 12n
-The time the last I/O completed for the specified vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_delta_ts\fR
-.ad
-.RS 12n
-The time since the last I/O completed for the specified vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_spare_paths\fR
-.ad
-.RS 12n
-List of spares, including full path and any \fI-partX\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_spare_guids\fR
-.ad
-.RS 12n
-GUID(s) of spares.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_read_errors\fR
-.ad
-.RS 12n
-How many read errors that have been detected on the vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_write_errors\fR
-.ad
-.RS 12n
-How many write errors that have been detected on the vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBvdev_cksum_errors\fR
-.ad
-.RS 12n
-How many checkum errors that have been detected on the vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBparent_guid\fR
-.ad
-.RS 12n
-GUID of the vdev parent.
-.RE
-
-.sp
-.ne 2
-.na
-\fBparent_type\fR
-.ad
-.RS 12n
-Type of parent. See \fBvdev_type\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBparent_path\fR
-.ad
-.RS 12n
-Path of the vdev parent (if any).
-.RE
-
-.sp
-.ne 2
-.na
-\fBparent_devid\fR
-.ad
-.RS 12n
-ID of the vdev parent (if any).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_objset\fR
-.ad
-.RS 12n
-The object set number for a given I/O.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_object\fR
-.ad
-.RS 12n
-The object number for a given I/O.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_level\fR
-.ad
-.RS 12n
-The block level for a given I/O.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_blkid\fR
-.ad
-.RS 12n
-The block ID for a given I/O.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_err\fR
-.ad
-.RS 12n
-The errno for a failure when handling a given I/O.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_offset\fR
-.ad
-.RS 12n
-The offset in bytes of where to write the I/O for the specified vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_size\fR
-.ad
-.RS 12n
-The size in bytes of the I/O.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_flags\fR
-.ad
-.RS 12n
-The current flags describing how the I/O should be handled.  See the
-\fBI/O FLAGS\fR section for the full list of I/O flags.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_stage\fR
-.ad
-.RS 12n
-The current stage of the I/O in the pipeline.  See the \fBI/O STAGES\fR
-section for a full list of all the I/O stages.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_pipeline\fR
-.ad
-.RS 12n
-The valid pipeline stages for the I/O.  See the \fBI/O STAGES\fR section for a
-full list of all the I/O stages.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_delay\fR
-.ad
-.RS 12n
-The time in ticks (HZ) required for the block layer to service the I/O.  Unlike
-\fBzio_delta\fR this does not include any vdev queuing time and is therefore
-solely a measure of the block layer performance.  On most modern Linux systems
-HZ is defined as 1000 making a tick equivalent to 1 millisecond.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_timestamp\fR
-.ad
-.RS 12n
-The time when a given I/O was submitted.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_delta\fR
-.ad
-.RS 12n
-The time required to service a given I/O.
-.RE
-
-.sp
-.ne 2
-.na
-\fBprev_state\fR
-.ad
-.RS 12n
-The previous state of the vdev.
-.RE
-
-.sp
-.ne 2
-.na
-\fBcksum_expected\fR
-.ad
-.RS 12n
-The expected checksum value.
-.RE
-
-.sp
-.ne 2
-.na
-\fBcksum_actual\fR
-.ad
-.RS 12n
-The actual/current checksum value.
-.RE
-
-.sp
-.ne 2
-.na
-\fBcksum_algorithm\fR
-.ad
-.RS 12n
-Checksum algorithm used. See \fBzfs\fR(8) for more information on checksum algorithms available.
-.RE
-
-.sp
-.ne 2
-.na
-\fBcksum_byteswap\fR
-.ad
-.RS 12n
-Checksum value is byte swapped.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_ranges\fR
-.ad
-.RS 12n
-Checksum bad offset ranges.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_ranges_min_gap\fR
-.ad
-.RS 12n
-Checksum allowed minimum gap.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_range_sets\fR
-.ad
-.RS 12n
-Checksum for each range the number of bits set.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_range_clears\fR
-.ad
-.RS 12n
-Checksum for each range the number of bits cleared.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_set_bits\fR
-.ad
-.RS 12n
-Checksum array of bits set.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_cleared_bits\fR
-.ad
-.RS 12n
-Checksum array of bits cleared.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_set_histogram\fR
-.ad
-.RS 12n
-Checksum histogram of set bits by bit number in a 64-bit word.
-.RE
-
-.sp
-.ne 2
-.na
-\fBbad_cleared_histogram\fR
-.ad
-.RS 12n
-Checksum histogram of cleared bits by bit number in a 64-bit word.
-.RE
-
-.SS "I/O STAGES"
-.sp
-.LP
-The ZFS I/O pipeline is comprised of various stages which are defined
-below.  The individual stages are used to construct these basic I/O
-operations: Read, Write, Free, Claim, and Ioctl.  These stages may be
-set on an event to describe the life cycle of a given I/O.
-
-.TS
-tab(:);
-l l l .
-Stage:Bit Mask:Operations
-_:_:_
-ZIO_STAGE_OPEN:0x00000001:RWFCI
-
-ZIO_STAGE_READ_BP_INIT:0x00000002:R----
-ZIO_STAGE_FREE_BP_INIT:0x00000004:--F--
-ZIO_STAGE_ISSUE_ASYNC:0x00000008:RWF--
-ZIO_STAGE_WRITE_BP_INIT:0x00000010:-W---
-
-ZIO_STAGE_CHECKSUM_GENERATE:0x00000020:-W---
-
-ZIO_STAGE_NOP_WRITE:0x00000040:-W---
-
-ZIO_STAGE_DDT_READ_START:0x00000080:R----
-ZIO_STAGE_DDT_READ_DONE:0x00000100:R----
-ZIO_STAGE_DDT_WRITE:0x00000200:-W---
-ZIO_STAGE_DDT_FREE:0x00000400:--F--
-
-ZIO_STAGE_GANG_ASSEMBLE:0x00000800:RWFC-
-ZIO_STAGE_GANG_ISSUE:0x00001000:RWFC-
-
-ZIO_STAGE_DVA_ALLOCATE:0x00002000:-W---
-ZIO_STAGE_DVA_FREE:0x00004000:--F--
-ZIO_STAGE_DVA_CLAIM:0x00008000:---C-
-
-ZIO_STAGE_READY:0x00010000:RWFCI
-
-ZIO_STAGE_VDEV_IO_START:0x00020000:RW--I
-ZIO_STAGE_VDEV_IO_DONE:0x00040000:RW--I
-ZIO_STAGE_VDEV_IO_ASSESS:0x00080000:RW--I
-
-ZIO_STAGE_CHECKSUM_VERIFY0:0x00100000:R----
-
-ZIO_STAGE_DONE:0x00200000:RWFCI
-.TE
-
-.SS "I/O FLAGS"
-.sp
-.LP
-Every I/O in the pipeline contains a set of flags which describe its
-function and are used to govern its behavior.  These flags will be set
-in an event as an \fBzio_flags\fR payload entry.
-
-.TS
-tab(:);
-l l .
-Flag:Bit Mask
-_:_
-ZIO_FLAG_DONT_AGGREGATE:0x00000001
-ZIO_FLAG_IO_REPAIR:0x00000002
-ZIO_FLAG_SELF_HEAL:0x00000004
-ZIO_FLAG_RESILVER:0x00000008
-ZIO_FLAG_SCRUB:0x00000010
-ZIO_FLAG_SCAN_THREAD:0x00000020
-ZIO_FLAG_PHYSICAL:0x00000040
-
-ZIO_FLAG_CANFAIL:0x00000080
-ZIO_FLAG_SPECULATIVE:0x00000100
-ZIO_FLAG_CONFIG_WRITER:0x00000200
-ZIO_FLAG_DONT_RETRY:0x00000400
-ZIO_FLAG_DONT_CACHE:0x00000800
-ZIO_FLAG_NODATA:0x00001000
-ZIO_FLAG_INDUCE_DAMAGE:0x00002000
-
-ZIO_FLAG_IO_RETRY:0x00004000
-ZIO_FLAG_PROBE:0x00008000
-ZIO_FLAG_TRYHARD:0x00010000
-ZIO_FLAG_OPTIONAL:0x00020000
-
-ZIO_FLAG_DONT_QUEUE:0x00040000
-ZIO_FLAG_DONT_PROPAGATE:0x00080000
-ZIO_FLAG_IO_BYPASS:0x00100000
-ZIO_FLAG_IO_REWRITE:0x00200000
-ZIO_FLAG_RAW:0x00400000
-ZIO_FLAG_GANG_CHILD:0x00800000
-ZIO_FLAG_DDT_CHILD:0x01000000
-ZIO_FLAG_GODFATHER:0x02000000
-ZIO_FLAG_NOPWRITE:0x04000000
-ZIO_FLAG_REEXECUTED:0x08000000
-ZIO_FLAG_DELEGATED:0x10000000
-ZIO_FLAG_FASTWRITE:0x20000000
-.TE
diff --git a/zfs/man/man5/zfs-module-parameters.5 b/zfs/man/man5/zfs-module-parameters.5
deleted file mode 100644 (file)
index 015ab01..0000000
+++ /dev/null
@@ -1,1831 +0,0 @@
-'\" te
-.\" Copyright (c) 2013 by Turbo Fredriksson <turbo@bayour.com>. All rights reserved.
-.\" The contents of this file are subject to the terms of the Common Development
-.\" and Distribution License (the "License").  You may not use this file except
-.\" in compliance with the License. You can obtain a copy of the license at
-.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
-.\"
-.\" See the License for the specific language governing permissions and
-.\" limitations under the License. When distributing Covered Code, include this
-.\" CDDL HEADER in each file and include the License file at
-.\" usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this
-.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
-.\" own identifying information:
-.\" Portions Copyright [yyyy] [name of copyright owner]
-.TH ZFS-MODULE-PARAMETERS 5 "Nov 16, 2013"
-.SH NAME
-zfs\-module\-parameters \- ZFS module parameters
-.SH DESCRIPTION
-.sp
-.LP
-Description of the different parameters to the ZFS module.
-
-.SS "Module parameters"
-.sp
-.LP
-
-.sp
-.ne 2
-.na
-\fBl2arc_feed_again\fR (int)
-.ad
-.RS 12n
-Turbo L2ARC warmup
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR to disable.
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_feed_min_ms\fR (ulong)
-.ad
-.RS 12n
-Min feed interval in milliseconds
-.sp
-Default value: \fB200\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_feed_secs\fR (ulong)
-.ad
-.RS 12n
-Seconds between L2ARC writing
-.sp
-Default value: \fB1\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_headroom\fR (ulong)
-.ad
-.RS 12n
-Number of max device writes to precache
-.sp
-Default value: \fB2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_headroom_boost\fR (ulong)
-.ad
-.RS 12n
-Compressed l2arc_headroom multiplier
-.sp
-Default value: \fB200\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_nocompress\fR (int)
-.ad
-.RS 12n
-Skip compressing L2ARC buffers
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_noprefetch\fR (int)
-.ad
-.RS 12n
-Skip caching prefetched buffers
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR to disable.
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_norw\fR (int)
-.ad
-.RS 12n
-No reads during writes
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_write_boost\fR (ulong)
-.ad
-.RS 12n
-Extra write bytes during device warmup
-.sp
-Default value: \fB8,388,608\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBl2arc_write_max\fR (ulong)
-.ad
-.RS 12n
-Max write bytes per interval
-.sp
-Default value: \fB8,388,608\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslab_aliquot\fR (ulong)
-.ad
-.RS 12n
-Metaslab granularity, in bytes. This is roughly similar to what would be
-referred to as the "stripe size" in traditional RAID arrays. In normal
-operation, ZFS will try to write this amount of data to a top-level vdev
-before moving on to the next one.
-.sp
-Default value: \fB524,288\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslab_bias_enabled\fR (int)
-.ad
-.RS 12n
-Enable metaslab group biasing based on its vdev's over- or under-utilization
-relative to the pool.
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR for no.
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslab_debug_load\fR (int)
-.ad
-.RS 12n
-Load all metaslabs during pool import.
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslab_debug_unload\fR (int)
-.ad
-.RS 12n
-Prevent metaslabs from being unloaded.
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslab_fragmentation_factor_enabled\fR (int)
-.ad
-.RS 12n
-Enable use of the fragmentation metric in computing metaslab weights.
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR for no.
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslabs_per_vdev\fR (int)
-.ad
-.RS 12n
-When a vdev is added, it will be divided into approximately (but no more than) this number of metaslabs.
-.sp
-Default value: \fB200\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslab_preload_enabled\fR (int)
-.ad
-.RS 12n
-Enable metaslab group preloading.
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR for no.
-.RE
-
-.sp
-.ne 2
-.na
-\fBmetaslab_lba_weighting_enabled\fR (int)
-.ad
-.RS 12n
-Give more weight to metaslabs with lower LBAs, assuming they have
-greater bandwidth as is typically the case on a modern constant
-angular velocity disk drive.
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR for no.
-.RE
-
-.sp
-.ne 2
-.na
-\fBspa_config_path\fR (charp)
-.ad
-.RS 12n
-SPA config file
-.sp
-Default value: \fB/etc/zfs/zpool.cache\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBspa_asize_inflation\fR (int)
-.ad
-.RS 12n
-Multiplication factor used to estimate actual disk consumption from the
-size of data being written. The default value is a worst case estimate,
-but lower values may be valid for a given pool depending on its
-configuration.  Pool administrators who understand the factors involved
-may wish to specify a more realistic inflation factor, particularly if
-they operate close to quota or capacity limits.
-.sp
-Default value: 24
-.RE
-
-.sp
-.ne 2
-.na
-\fBspa_load_verify_data\fR (int)
-.ad
-.RS 12n
-Whether to traverse data blocks during an "extreme rewind" (\fB-X\fR)
-import.  Use 0 to disable and 1 to enable.
-
-An extreme rewind import normally performs a full traversal of all
-blocks in the pool for verification.  If this parameter is set to 0,
-the traversal skips non-metadata blocks.  It can be toggled once the
-import has started to stop or start the traversal of non-metadata blocks.
-.sp
-Default value: 1
-.RE
-
-.sp
-.ne 2
-.na
-\fBspa_load_verify_metadata\fR (int)
-.ad
-.RS 12n
-Whether to traverse blocks during an "extreme rewind" (\fB-X\fR)
-pool import.  Use 0 to disable and 1 to enable.
-
-An extreme rewind import normally performs a full traversal of all
-blocks in the pool for verification.  If this parameter is set to 1,
-the traversal is not performed.  It can be toggled once the import has
-started to stop or start the traversal.
-.sp
-Default value: 1
-.RE
-
-.sp
-.ne 2
-.na
-\fBspa_load_verify_maxinflight\fR (int)
-.ad
-.RS 12n
-Maximum concurrent I/Os during the traversal performed during an "extreme
-rewind" (\fB-X\fR) pool import.
-.sp
-Default value: 10000
-.RE
-
-.sp
-.ne 2
-.na
-\fBspa_slop_shift\fR (int)
-.ad
-.RS 12n
-Normally, we don't allow the last 3.2% (1/(2^spa_slop_shift)) of space
-in the pool to be consumed.  This ensures that we don't run the pool
-completely out of space, due to unaccounted changes (e.g. to the MOS).
-It also limits the worst-case time to allocate space.  If we have
-less than this amount of free space, most ZPL operations (e.g. write,
-create) will return ENOSPC.
-.sp
-Default value: 5
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfetch_array_rd_sz\fR (ulong)
-.ad
-.RS 12n
-If prefetching is enabled, disable prefetching for reads larger than this size.
-.sp
-Default value: \fB1,048,576\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfetch_block_cap\fR (uint)
-.ad
-.RS 12n
-Max number of blocks to prefetch at a time
-.sp
-Default value: \fB256\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfetch_max_streams\fR (uint)
-.ad
-.RS 12n
-Max number of streams per zfetch (prefetch streams per file).
-.sp
-Default value: \fB8\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfetch_min_sec_reap\fR (uint)
-.ad
-.RS 12n
-Min time before an active prefetch stream can be reclaimed
-.sp
-Default value: \fB2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_average_blocksize\fR (int)
-.ad
-.RS 12n
-The ARC's buffer hash table is sized based on the assumption of an average
-block size of \fBzfs_arc_average_blocksize\fR (default 8K).  This works out
-to roughly 1MB of hash table per 1GB of physical memory with 8-byte pointers.
-For configurations with a known larger average block size this value can be
-increased to reduce the memory footprint.
-
-.sp
-Default value: \fB8192\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_evict_batch_limit\fR (int)
-.ad
-.RS 12n
-Number ARC headers to evict per sub-list before proceeding to another sub-list.
-This batch-style operation prevents entire sub-lists from being evicted at once
-but comes at a cost of additional unlocking and locking.
-.sp
-Default value: \fB10\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_grow_retry\fR (int)
-.ad
-.RS 12n
-Seconds before growing arc size
-.sp
-Default value: \fB5\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_lotsfree_percent\fR (int)
-.ad
-.RS 12n
-Throttle I/O when free system memory drops below this percentage of total
-system memory.  Setting this value to 0 will disable the throttle.
-.sp
-Default value: \fB10\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_max\fR (ulong)
-.ad
-.RS 12n
-Max arc size
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_meta_limit\fR (ulong)
-.ad
-.RS 12n
-The maximum allowed size in bytes that meta data buffers are allowed to
-consume in the ARC.  When this limit is reached meta data buffers will
-be reclaimed even if the overall arc_c_max has not been reached.  This
-value defaults to 0 which indicates that 3/4 of the ARC may be used
-for meta data.
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_meta_min\fR (ulong)
-.ad
-.RS 12n
-The minimum allowed size in bytes that meta data buffers may consume in
-the ARC.  This value defaults to 0 which disables a floor on the amount
-of the ARC devoted meta data.
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_meta_prune\fR (int)
-.ad
-.RS 12n
-The number of dentries and inodes to be scanned looking for entries
-which can be dropped.  This may be required when the ARC reaches the
-\fBzfs_arc_meta_limit\fR because dentries and inodes can pin buffers
-in the ARC.  Increasing this value will cause to dentry and inode caches
-to be pruned more aggressively.  Setting this value to 0 will disable
-pruning the inode and dentry caches.
-.sp
-Default value: \fB10,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_meta_adjust_restarts\fR (ulong)
-.ad
-.RS 12n
-The number of restart passes to make while scanning the ARC attempting
-the free buffers in order to stay below the \fBzfs_arc_meta_limit\fR.
-This value should not need to be tuned but is available to facilitate
-performance analysis.
-.sp
-Default value: \fB4096\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_min\fR (ulong)
-.ad
-.RS 12n
-Min arc size
-.sp
-Default value: \fB100\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_min_prefetch_lifespan\fR (int)
-.ad
-.RS 12n
-Min life of prefetch block
-.sp
-Default value: \fB100\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_num_sublists_per_state\fR (int)
-.ad
-.RS 12n
-To allow more fine-grained locking, each ARC state contains a series
-of lists for both data and meta data objects.  Locking is performed at
-the level of these "sub-lists".  This parameters controls the number of
-sub-lists per ARC state.
-.sp
-Default value: 1 or the number of on-online CPUs, whichever is greater
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_overflow_shift\fR (int)
-.ad
-.RS 12n
-The ARC size is considered to be overflowing if it exceeds the current
-ARC target size (arc_c) by a threshold determined by this parameter.
-The threshold is calculated as a fraction of arc_c using the formula
-"arc_c >> \fBzfs_arc_overflow_shift\fR".
-
-The default value of 8 causes the ARC to be considered to be overflowing
-if it exceeds the target size by 1/256th (0.3%) of the target size.
-
-When the ARC is overflowing, new buffer allocations are stalled until
-the reclaim thread catches up and the overflow condition no longer exists.
-.sp
-Default value: \fB8\fR.
-.RE
-
-.sp
-.ne 2
-.na
-
-\fBzfs_arc_p_min_shift\fR (int)
-.ad
-.RS 12n
-arc_c shift to calc min/max arc_p
-.sp
-Default value: \fB4\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_p_aggressive_disable\fR (int)
-.ad
-.RS 12n
-Disable aggressive arc_p growth
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR to disable.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_p_dampener_disable\fR (int)
-.ad
-.RS 12n
-Disable arc_p adapt dampener
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR to disable.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_shrink_shift\fR (int)
-.ad
-.RS 12n
-log2(fraction of arc to reclaim)
-.sp
-Default value: \fB5\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_arc_sys_free\fR (ulong)
-.ad
-.RS 12n
-The target number of bytes the ARC should leave as free memory on the system.
-Defaults to the larger of 1/64 of physical memory or 512K.  Setting this
-option to a non-zero value will override the default.
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_autoimport_disable\fR (int)
-.ad
-.RS 12n
-Disable pool import at module load by ignoring the cache file (typically \fB/etc/zfs/zpool.cache\fR).
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR for no.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dbgmsg_enable\fR (int)
-.ad
-.RS 12n
-Internally ZFS keeps a small log to facilitate debugging.  By default the log
-is disabled, to enable it set this option to 1.  The contents of the log can
-be accessed by reading the /proc/spl/kstat/zfs/dbgmsg file.  Writing 0 to
-this proc file clears the log.
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dbgmsg_maxsize\fR (int)
-.ad
-.RS 12n
-The maximum size in bytes of the internal ZFS debug log.
-.sp
-Default value: \fB4M\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dbuf_state_index\fR (int)
-.ad
-.RS 12n
-Calculate arc header index
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_deadman_enabled\fR (int)
-.ad
-.RS 12n
-Enable deadman timer
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR to disable.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_deadman_synctime_ms\fR (ulong)
-.ad
-.RS 12n
-Expiration time in milliseconds. This value has two meanings. First it is
-used to determine when the spa_deadman() logic should fire. By default the
-spa_deadman() will fire if spa_sync() has not completed in 1000 seconds.
-Secondly, the value determines if an I/O is considered "hung". Any I/O that
-has not completed in zfs_deadman_synctime_ms is considered "hung" resulting
-in a zevent being logged.
-.sp
-Default value: \fB1,000,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dedup_prefetch\fR (int)
-.ad
-.RS 12n
-Enable prefetching dedup-ed blks
-.sp
-Use \fB1\fR for yes and \fB0\fR to disable (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_delay_min_dirty_percent\fR (int)
-.ad
-.RS 12n
-Start to delay each transaction once there is this amount of dirty data,
-expressed as a percentage of \fBzfs_dirty_data_max\fR.
-This value should be >= zfs_vdev_async_write_active_max_dirty_percent.
-See the section "ZFS TRANSACTION DELAY".
-.sp
-Default value: \fB60\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_delay_scale\fR (int)
-.ad
-.RS 12n
-This controls how quickly the transaction delay approaches infinity.
-Larger values cause longer delays for a given amount of dirty data.
-.sp
-For the smoothest delay, this value should be about 1 billion divided
-by the maximum number of operations per second.  This will smoothly
-handle between 10x and 1/10th this number.
-.sp
-See the section "ZFS TRANSACTION DELAY".
-.sp
-Note: \fBzfs_delay_scale\fR * \fBzfs_dirty_data_max\fR must be < 2^64.
-.sp
-Default value: \fB500,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dirty_data_max\fR (int)
-.ad
-.RS 12n
-Determines the dirty space limit in bytes.  Once this limit is exceeded, new
-writes are halted until space frees up. This parameter takes precedence
-over \fBzfs_dirty_data_max_percent\fR.
-See the section "ZFS TRANSACTION DELAY".
-.sp
-Default value: 10 percent of all memory, capped at \fBzfs_dirty_data_max_max\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dirty_data_max_max\fR (int)
-.ad
-.RS 12n
-Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed in bytes.
-This limit is only enforced at module load time, and will be ignored if
-\fBzfs_dirty_data_max\fR is later changed.  This parameter takes
-precedence over \fBzfs_dirty_data_max_max_percent\fR. See the section
-"ZFS TRANSACTION DELAY".
-.sp
-Default value: 25% of physical RAM.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dirty_data_max_max_percent\fR (int)
-.ad
-.RS 12n
-Maximum allowable value of \fBzfs_dirty_data_max\fR, expressed as a
-percentage of physical RAM.  This limit is only enforced at module load
-time, and will be ignored if \fBzfs_dirty_data_max\fR is later changed.
-The parameter \fBzfs_dirty_data_max_max\fR takes precedence over this
-one. See the section "ZFS TRANSACTION DELAY".
-.sp
-Default value: 25
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dirty_data_max_percent\fR (int)
-.ad
-.RS 12n
-Determines the dirty space limit, expressed as a percentage of all
-memory.  Once this limit is exceeded, new writes are halted until space frees
-up.  The parameter \fBzfs_dirty_data_max\fR takes precedence over this
-one.  See the section "ZFS TRANSACTION DELAY".
-.sp
-Default value: 10%, subject to \fBzfs_dirty_data_max_max\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_dirty_data_sync\fR (int)
-.ad
-.RS 12n
-Start syncing out a transaction group if there is at least this much dirty data.
-.sp
-Default value: \fB67,108,864\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_free_max_blocks\fR (ulong)
-.ad
-.RS 12n
-Maximum number of blocks freed in a single txg.
-.sp
-Default value: \fB100,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_async_read_max_active\fR (int)
-.ad
-.RS 12n
-Maxium asynchronous read I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB3\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_async_read_min_active\fR (int)
-.ad
-.RS 12n
-Minimum asynchronous read I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB1\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_async_write_active_max_dirty_percent\fR (int)
-.ad
-.RS 12n
-When the pool has more than
-\fBzfs_vdev_async_write_active_max_dirty_percent\fR dirty data, use
-\fBzfs_vdev_async_write_max_active\fR to limit active async writes.  If
-the dirty data is between min and max, the active I/O limit is linearly
-interpolated. See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB60\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_async_write_active_min_dirty_percent\fR (int)
-.ad
-.RS 12n
-When the pool has less than
-\fBzfs_vdev_async_write_active_min_dirty_percent\fR dirty data, use
-\fBzfs_vdev_async_write_min_active\fR to limit active async writes.  If
-the dirty data is between min and max, the active I/O limit is linearly
-interpolated. See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB30\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_async_write_max_active\fR (int)
-.ad
-.RS 12n
-Maxium asynchronous write I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB10\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_async_write_min_active\fR (int)
-.ad
-.RS 12n
-Minimum asynchronous write I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB1\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_max_active\fR (int)
-.ad
-.RS 12n
-The maximum number of I/Os active to each device.  Ideally, this will be >=
-the sum of each queue's max_active.  It must be at least the sum of each
-queue's min_active.  See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB1,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_scrub_max_active\fR (int)
-.ad
-.RS 12n
-Maxium scrub I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_scrub_min_active\fR (int)
-.ad
-.RS 12n
-Minimum scrub I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB1\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_sync_read_max_active\fR (int)
-.ad
-.RS 12n
-Maxium synchronous read I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB10\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_sync_read_min_active\fR (int)
-.ad
-.RS 12n
-Minimum synchronous read I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB10\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_sync_write_max_active\fR (int)
-.ad
-.RS 12n
-Maxium synchronous write I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB10\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_sync_write_min_active\fR (int)
-.ad
-.RS 12n
-Minimum synchronous write I/Os active to each device.
-See the section "ZFS I/O SCHEDULER".
-.sp
-Default value: \fB10\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_disable_dup_eviction\fR (int)
-.ad
-.RS 12n
-Disable duplicate buffer eviction
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_expire_snapshot\fR (int)
-.ad
-.RS 12n
-Seconds to expire .zfs/snapshot
-.sp
-Default value: \fB300\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_admin_snapshot\fR (int)
-.ad
-.RS 12n
-Allow the creation, removal, or renaming of entries in the .zfs/snapshot
-directory to cause the creation, destruction, or renaming of snapshots.
-When enabled this functionality works both locally and over NFS exports
-which have the 'no_root_squash' option set. This functionality is disabled
-by default.
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_flags\fR (int)
-.ad
-.RS 12n
-Set additional debugging flags. The following flags may be bitwise-or'd
-together.
-.sp
-.TS
-box;
-rB lB
-lB lB
-r l.
-Value  Symbolic Name
-       Description
-_
-1      ZFS_DEBUG_DPRINTF
-       Enable dprintf entries in the debug log.
-_
-2      ZFS_DEBUG_DBUF_VERIFY *
-       Enable extra dbuf verifications.
-_
-4      ZFS_DEBUG_DNODE_VERIFY *
-       Enable extra dnode verifications.
-_
-8      ZFS_DEBUG_SNAPNAMES
-       Enable snapshot name verification.
-_
-16     ZFS_DEBUG_MODIFY
-       Check for illegally modified ARC buffers.
-_
-32     ZFS_DEBUG_SPA
-       Enable spa_dbgmsg entries in the debug log.
-_
-64     ZFS_DEBUG_ZIO_FREE
-       Enable verification of block frees.
-_
-128    ZFS_DEBUG_HISTOGRAM_VERIFY
-       Enable extra spacemap histogram verifications.
-.TE
-.sp
-* Requires debug build.
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_free_leak_on_eio\fR (int)
-.ad
-.RS 12n
-If destroy encounters an EIO while reading metadata (e.g. indirect
-blocks), space referenced by the missing metadata can not be freed.
-Normally this causes the background destroy to become "stalled", as
-it is unable to make forward progress.  While in this stalled state,
-all remaining space to free from the error-encountering filesystem is
-"temporarily leaked".  Set this flag to cause it to ignore the EIO,
-permanently leak the space from indirect blocks that can not be read,
-and continue to free everything else that it can.
-
-The default, "stalling" behavior is useful if the storage partially
-fails (i.e. some but not all i/os fail), and then later recovers.  In
-this case, we will be able to continue pool operations while it is
-partially failed, and when it recovers, we can continue to free the
-space, with no leaks.  However, note that this case is actually
-fairly rare.
-
-Typically pools either (a) fail completely (but perhaps temporarily,
-e.g. a top-level vdev going offline), or (b) have localized,
-permanent errors (e.g. disk returns the wrong data due to bit flip or
-firmware bug).  In case (a), this setting does not matter because the
-pool will be suspended and the sync thread will not be able to make
-forward progress regardless.  In case (b), because the error is
-permanent, the best we can do is leak the minimum amount of space,
-which is what setting this flag will do.  Therefore, it is reasonable
-for this flag to normally be set, but we chose the more conservative
-approach of not setting it, so that there is no possibility of
-leaking space in the "partial temporary" failure case.
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_free_min_time_ms\fR (int)
-.ad
-.RS 12n
-Min millisecs to free per txg
-.sp
-Default value: \fB1,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_immediate_write_sz\fR (long)
-.ad
-.RS 12n
-Largest data block to write to zil
-.sp
-Default value: \fB32,768\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_max_recordsize\fR (int)
-.ad
-.RS 12n
-We currently support block sizes from 512 bytes to 16MB.  The benefits of
-larger blocks, and thus larger IO, need to be weighed against the cost of
-COWing a giant block to modify one byte.  Additionally, very large blocks
-can have an impact on i/o latency, and also potentially on the memory
-allocator.  Therefore, we do not allow the recordsize to be set larger than
-zfs_max_recordsize (default 1MB).  Larger blocks can be created by changing
-this tunable, and pools with larger blocks can always be imported and used,
-regardless of this setting.
-.sp
-Default value: \fB1,048,576\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_mdcomp_disable\fR (int)
-.ad
-.RS 12n
-Disable meta data compression
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_metaslab_fragmentation_threshold\fR (int)
-.ad
-.RS 12n
-Allow metaslabs to keep their active state as long as their fragmentation
-percentage is less than or equal to this value. An active metaslab that
-exceeds this threshold will no longer keep its active status allowing
-better metaslabs to be selected.
-.sp
-Default value: \fB70\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_mg_fragmentation_threshold\fR (int)
-.ad
-.RS 12n
-Metaslab groups are considered eligible for allocations if their
-fragmenation metric (measured as a percentage) is less than or equal to
-this value. If a metaslab group exceeds this threshold then it will be
-skipped unless all metaslab groups within the metaslab class have also
-crossed this threshold.
-.sp
-Default value: \fB85\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_mg_noalloc_threshold\fR (int)
-.ad
-.RS 12n
-Defines a threshold at which metaslab groups should be eligible for
-allocations.  The value is expressed as a percentage of free space
-beyond which a metaslab group is always eligible for allocations.
-If a metaslab group's free space is less than or equal to the
-the threshold, the allocator will avoid allocating to that group
-unless all groups in the pool have reached the threshold.  Once all
-groups have reached the threshold, all groups are allowed to accept
-allocations.  The default value of 0 disables the feature and causes
-all metaslab groups to be eligible for allocations.
-
-This parameter allows to deal with pools having heavily imbalanced
-vdevs such as would be the case when a new vdev has been added.
-Setting the threshold to a non-zero percentage will stop allocations
-from being made to vdevs that aren't filled to the specified percentage
-and allow lesser filled vdevs to acquire more allocations than they
-otherwise would under the old \fBzfs_mg_alloc_failures\fR facility.
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_no_scrub_io\fR (int)
-.ad
-.RS 12n
-Set for no scrub I/O
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_no_scrub_prefetch\fR (int)
-.ad
-.RS 12n
-Set for no scrub prefetching
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_nocacheflush\fR (int)
-.ad
-.RS 12n
-Disable cache flushes
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_nopwrite_enabled\fR (int)
-.ad
-.RS 12n
-Enable NOP writes
-.sp
-Use \fB1\fR for yes (default) and \fB0\fR to disable.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_pd_bytes_max\fR (int)
-.ad
-.RS 12n
-The number of bytes which should be prefetched.
-.sp
-Default value: \fB52,428,800\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_prefetch_disable\fR (int)
-.ad
-.RS 12n
-Disable all ZFS prefetching
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_read_chunk_size\fR (long)
-.ad
-.RS 12n
-Bytes to read per chunk
-.sp
-Default value: \fB1,048,576\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_read_history\fR (int)
-.ad
-.RS 12n
-Historic statistics for the last N reads
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_read_history_hits\fR (int)
-.ad
-.RS 12n
-Include cache hits in read history
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_recover\fR (int)
-.ad
-.RS 12n
-Set to attempt to recover from fatal errors. This should only be used as a
-last resort, as it typically results in leaked space, or worse.
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_resilver_delay\fR (int)
-.ad
-.RS 12n
-Number of ticks to delay prior to issuing a resilver I/O operation when
-a non-resilver or non-scrub I/O operation has occurred within the past
-\fBzfs_scan_idle\fR ticks.
-.sp
-Default value: \fB2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_resilver_min_time_ms\fR (int)
-.ad
-.RS 12n
-Min millisecs to resilver per txg
-.sp
-Default value: \fB3,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_scan_idle\fR (int)
-.ad
-.RS 12n
-Idle window in clock ticks.  During a scrub or a resilver, if
-a non-scrub or non-resilver I/O operation has occurred during this
-window, the next scrub or resilver operation is delayed by, respectively
-\fBzfs_scrub_delay\fR or \fBzfs_resilver_delay\fR ticks.
-.sp
-Default value: \fB50\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_scan_min_time_ms\fR (int)
-.ad
-.RS 12n
-Min millisecs to scrub per txg
-.sp
-Default value: \fB1,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_scrub_delay\fR (int)
-.ad
-.RS 12n
-Number of ticks to delay prior to issuing a scrub I/O operation when
-a non-scrub or non-resilver I/O operation has occurred within the past
-\fBzfs_scan_idle\fR ticks.
-.sp
-Default value: \fB4\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_send_corrupt_data\fR (int)
-.ad
-.RS 12n
-Allow to send corrupt data (ignore read/checksum errors when sending data)
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_sync_pass_deferred_free\fR (int)
-.ad
-.RS 12n
-Defer frees starting in this pass
-.sp
-Default value: \fB2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_sync_pass_dont_compress\fR (int)
-.ad
-.RS 12n
-Don't compress starting in this pass
-.sp
-Default value: \fB5\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_sync_pass_rewrite\fR (int)
-.ad
-.RS 12n
-Rewrite new bps starting in this pass
-.sp
-Default value: \fB2\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_top_maxinflight\fR (int)
-.ad
-.RS 12n
-Max I/Os per top-level vdev during scrub or resilver operations.
-.sp
-Default value: \fB32\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_txg_history\fR (int)
-.ad
-.RS 12n
-Historic statistics for the last N txgs
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_txg_timeout\fR (int)
-.ad
-.RS 12n
-Max seconds worth of delta per txg
-.sp
-Default value: \fB5\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_aggregation_limit\fR (int)
-.ad
-.RS 12n
-Max vdev I/O aggregation size
-.sp
-Default value: \fB131,072\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_cache_bshift\fR (int)
-.ad
-.RS 12n
-Shift size to inflate reads too
-.sp
-Default value: \fB16\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_cache_max\fR (int)
-.ad
-.RS 12n
-Inflate reads small than max
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_cache_size\fR (int)
-.ad
-.RS 12n
-Total size of the per-disk cache
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_mirror_switch_us\fR (int)
-.ad
-.RS 12n
-Switch mirrors every N usecs
-.sp
-Default value: \fB10,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_read_gap_limit\fR (int)
-.ad
-.RS 12n
-Aggregate read I/O over gap
-.sp
-Default value: \fB32,768\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_scheduler\fR (charp)
-.ad
-.RS 12n
-I/O scheduler
-.sp
-Default value: \fBnoop\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_vdev_write_gap_limit\fR (int)
-.ad
-.RS 12n
-Aggregate write I/O over gap
-.sp
-Default value: \fB4,096\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_zevent_cols\fR (int)
-.ad
-.RS 12n
-Max event column width
-.sp
-Default value: \fB80\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_zevent_console\fR (int)
-.ad
-.RS 12n
-Log events to the console
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzfs_zevent_len_max\fR (int)
-.ad
-.RS 12n
-Max event queue length
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzil_replay_disable\fR (int)
-.ad
-.RS 12n
-Disable intent logging replay
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzil_slog_limit\fR (ulong)
-.ad
-.RS 12n
-Max commit bytes to separate log device
-.sp
-Default value: \fB1,048,576\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_delay_max\fR (int)
-.ad
-.RS 12n
-Max zio millisec delay before posting event
-.sp
-Default value: \fB30,000\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzio_requeue_io_start_cut_in_line\fR (int)
-.ad
-.RS 12n
-Prioritize requeued I/O
-.sp
-Default value: \fB0\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzvol_inhibit_dev\fR (uint)
-.ad
-.RS 12n
-Do not create zvol device nodes
-.sp
-Use \fB1\fR for yes and \fB0\fR for no (default).
-.RE
-
-.sp
-.ne 2
-.na
-\fBzvol_major\fR (uint)
-.ad
-.RS 12n
-Major number for zvol device
-.sp
-Default value: \fB230\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzvol_max_discard_blocks\fR (ulong)
-.ad
-.RS 12n
-Max number of blocks to discard at once
-.sp
-Default value: \fB16,384\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fBzvol_prefetch_bytes\fR (uint)
-.ad
-.RS 12n
-When adding a zvol to the system prefetch \fBzvol_prefetch_bytes\fR
-from the start and end of the volume.  Prefetching these regions
-of the volume is desirable because they are likely to be accessed
-immediately by \fBblkid(8)\fR or by the kernel scanning for a partition
-table.
-.sp
-Default value: \fB131,072\fR.
-.RE
-
-.SH ZFS I/O SCHEDULER
-ZFS issues I/O operations to leaf vdevs to satisfy and complete I/Os.
-The I/O scheduler determines when and in what order those operations are
-issued.  The I/O scheduler divides operations into five I/O classes
-prioritized in the following order: sync read, sync write, async read,
-async write, and scrub/resilver.  Each queue defines the minimum and
-maximum number of concurrent operations that may be issued to the
-device.  In addition, the device has an aggregate maximum,
-\fBzfs_vdev_max_active\fR. Note that the sum of the per-queue minimums
-must not exceed the aggregate maximum.  If the sum of the per-queue
-maximums exceeds the aggregate maximum, then the number of active I/Os
-may reach \fBzfs_vdev_max_active\fR, in which case no further I/Os will
-be issued regardless of whether all per-queue minimums have been met.
-.sp
-For many physical devices, throughput increases with the number of
-concurrent operations, but latency typically suffers. Further, physical
-devices typically have a limit at which more concurrent operations have no
-effect on throughput or can actually cause it to decrease.
-.sp
-The scheduler selects the next operation to issue by first looking for an
-I/O class whose minimum has not been satisfied. Once all are satisfied and
-the aggregate maximum has not been hit, the scheduler looks for classes
-whose maximum has not been satisfied. Iteration through the I/O classes is
-done in the order specified above. No further operations are issued if the
-aggregate maximum number of concurrent operations has been hit or if there
-are no operations queued for an I/O class that has not hit its maximum.
-Every time an I/O is queued or an operation completes, the I/O scheduler
-looks for new operations to issue.
-.sp
-In general, smaller max_active's will lead to lower latency of synchronous
-operations.  Larger max_active's may lead to higher overall throughput,
-depending on underlying storage.
-.sp
-The ratio of the queues' max_actives determines the balance of performance
-between reads, writes, and scrubs.  E.g., increasing
-\fBzfs_vdev_scrub_max_active\fR will cause the scrub or resilver to complete
-more quickly, but reads and writes to have higher latency and lower throughput.
-.sp
-All I/O classes have a fixed maximum number of outstanding operations
-except for the async write class. Asynchronous writes represent the data
-that is committed to stable storage during the syncing stage for
-transaction groups. Transaction groups enter the syncing state
-periodically so the number of queued async writes will quickly burst up
-and then bleed down to zero. Rather than servicing them as quickly as
-possible, the I/O scheduler changes the maximum number of active async
-write I/Os according to the amount of dirty data in the pool.  Since
-both throughput and latency typically increase with the number of
-concurrent operations issued to physical devices, reducing the
-burstiness in the number of concurrent operations also stabilizes the
-response time of operations from other -- and in particular synchronous
--- queues. In broad strokes, the I/O scheduler will issue more
-concurrent operations from the async write queue as there's more dirty
-data in the pool.
-.sp
-Async Writes
-.sp
-The number of concurrent operations issued for the async write I/O class
-follows a piece-wise linear function defined by a few adjustable points.
-.nf
-
-       |              o---------| <-- zfs_vdev_async_write_max_active
-  ^    |             /^         |
-  |    |            / |         |
-active |           /  |         |
- I/O   |          /   |         |
-count  |         /    |         |
-       |        /     |         |
-       |-------o      |         | <-- zfs_vdev_async_write_min_active
-      0|_______^______|_________|
-       0%      |      |       100% of zfs_dirty_data_max
-               |      |
-               |      `-- zfs_vdev_async_write_active_max_dirty_percent
-               `--------- zfs_vdev_async_write_active_min_dirty_percent
-
-.fi
-Until the amount of dirty data exceeds a minimum percentage of the dirty
-data allowed in the pool, the I/O scheduler will limit the number of
-concurrent operations to the minimum. As that threshold is crossed, the
-number of concurrent operations issued increases linearly to the maximum at
-the specified maximum percentage of the dirty data allowed in the pool.
-.sp
-Ideally, the amount of dirty data on a busy pool will stay in the sloped
-part of the function between \fBzfs_vdev_async_write_active_min_dirty_percent\fR
-and \fBzfs_vdev_async_write_active_max_dirty_percent\fR. If it exceeds the
-maximum percentage, this indicates that the rate of incoming data is
-greater than the rate that the backend storage can handle. In this case, we
-must further throttle incoming writes, as described in the next section.
-
-.SH ZFS TRANSACTION DELAY
-We delay transactions when we've determined that the backend storage
-isn't able to accommodate the rate of incoming writes.
-.sp
-If there is already a transaction waiting, we delay relative to when
-that transaction will finish waiting.  This way the calculated delay time
-is independent of the number of threads concurrently executing
-transactions.
-.sp
-If we are the only waiter, wait relative to when the transaction
-started, rather than the current time.  This credits the transaction for
-"time already served", e.g. reading indirect blocks.
-.sp
-The minimum time for a transaction to take is calculated as:
-.nf
-    min_time = zfs_delay_scale * (dirty - min) / (max - dirty)
-    min_time is then capped at 100 milliseconds.
-.fi
-.sp
-The delay has two degrees of freedom that can be adjusted via tunables.  The
-percentage of dirty data at which we start to delay is defined by
-\fBzfs_delay_min_dirty_percent\fR. This should typically be at or above
-\fBzfs_vdev_async_write_active_max_dirty_percent\fR so that we only start to
-delay after writing at full speed has failed to keep up with the incoming write
-rate. The scale of the curve is defined by \fBzfs_delay_scale\fR. Roughly speaking,
-this variable determines the amount of delay at the midpoint of the curve.
-.sp
-.nf
-delay
- 10ms +-------------------------------------------------------------*+
-      |                                                             *|
-  9ms +                                                             *+
-      |                                                             *|
-  8ms +                                                             *+
-      |                                                            * |
-  7ms +                                                            * +
-      |                                                            * |
-  6ms +                                                            * +
-      |                                                            * |
-  5ms +                                                           *  +
-      |                                                           *  |
-  4ms +                                                           *  +
-      |                                                           *  |
-  3ms +                                                          *   +
-      |                                                          *   |
-  2ms +                                              (midpoint) *    +
-      |                                                  |    **     |
-  1ms +                                                  v ***       +
-      |             zfs_delay_scale ---------->     ********         |
-    0 +-------------------------------------*********----------------+
-      0%                    <- zfs_dirty_data_max ->               100%
-.fi
-.sp
-Note that since the delay is added to the outstanding time remaining on the
-most recent transaction, the delay is effectively the inverse of IOPS.
-Here the midpoint of 500us translates to 2000 IOPS. The shape of the curve
-was chosen such that small changes in the amount of accumulated dirty data
-in the first 3/4 of the curve yield relatively small differences in the
-amount of delay.
-.sp
-The effects can be easier to understand when the amount of delay is
-represented on a log scale:
-.sp
-.nf
-delay
-100ms +-------------------------------------------------------------++
-      +                                                              +
-      |                                                              |
-      +                                                             *+
- 10ms +                                                             *+
-      +                                                           ** +
-      |                                              (midpoint)  **  |
-      +                                                  |     **    +
-  1ms +                                                  v ****      +
-      +             zfs_delay_scale ---------->        *****         +
-      |                                             ****             |
-      +                                          ****                +
-100us +                                        **                    +
-      +                                       *                      +
-      |                                      *                       |
-      +                                     *                        +
- 10us +                                     *                        +
-      +                                                              +
-      |                                                              |
-      +                                                              +
-      +--------------------------------------------------------------+
-      0%                    <- zfs_dirty_data_max ->               100%
-.fi
-.sp
-Note here that only as the amount of dirty data approaches its limit does
-the delay start to increase rapidly. The goal of a properly tuned system
-should be to keep the amount of dirty data out of that range by first
-ensuring that the appropriate limits are set for the I/O scheduler to reach
-optimal throughput on the backend storage, and then by changing the value
-of \fBzfs_delay_scale\fR to increase the steepness of the curve.
diff --git a/zfs/man/man5/zpool-features.5 b/zfs/man/man5/zpool-features.5
deleted file mode 100644 (file)
index a1dac42..0000000
+++ /dev/null
@@ -1,436 +0,0 @@
-'\" te
-.\" Copyright (c) 2013 by Delphix. All rights reserved.
-.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
-.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
-.\" The contents of this file are subject to the terms of the Common Development
-.\" and Distribution License (the "License").  You may not use this file except
-.\" in compliance with the License. You can obtain a copy of the license at
-.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
-.\"
-.\" See the License for the specific language governing permissions and
-.\" limitations under the License. When distributing Covered Code, include this
-.\" CDDL HEADER in each file and include the License file at
-.\" usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this
-.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
-.\" own identifying information:
-.\" Portions Copyright [yyyy] [name of copyright owner]
-.TH ZPOOL-FEATURES 5 "Aug 27, 2013"
-.SH NAME
-zpool\-features \- ZFS pool feature descriptions
-.SH DESCRIPTION
-.sp
-.LP
-ZFS pool on\-disk format versions are specified via "features" which replace
-the old on\-disk format numbers (the last supported on\-disk format number is
-28). To enable a feature on a pool use the \fBupgrade\fR subcommand of the
-\fBzpool\fR(8) command, or set the \fBfeature@\fR\fIfeature_name\fR property
-to \fBenabled\fR.
-.sp
-.LP
-The pool format does not affect file system version compatibility or the ability
-to send file systems between pools.
-.sp
-.LP
-Since most features can be enabled independently of each other the on\-disk
-format of the pool is specified by the set of all features marked as
-\fBactive\fR on the pool. If the pool was created by another software version
-this set may include unsupported features.
-.SS "Identifying features"
-.sp
-.LP
-Every feature has a guid of the form \fIcom.example:feature_name\fR. The reverse
-DNS name ensures that the feature's guid is unique across all ZFS
-implementations. When unsupported features are encountered on a pool they will
-be identified by their guids. Refer to the documentation for the ZFS
-implementation that created the pool for information about those features.
-.sp
-.LP
-Each supported feature also has a short name. By convention a feature's short
-name is the portion of its guid which follows the ':' (e.g.
-\fIcom.example:feature_name\fR would have the short name \fIfeature_name\fR),
-however a feature's short name may differ across ZFS implementations if
-following the convention would result in name conflicts.
-.SS "Feature states"
-.sp
-.LP
-Features can be in one of three states:
-.sp
-.ne 2
-.na
-\fB\fBactive\fR\fR
-.ad
-.RS 12n
-This feature's on\-disk format changes are in effect on the pool. Support for
-this feature is required to import the pool in read\-write mode. If this
-feature is not read-only compatible, support is also required to import the pool
-in read\-only mode (see "Read\-only compatibility").
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBenabled\fR\fR
-.ad
-.RS 12n
-An administrator has marked this feature as enabled on the pool, but the
-feature's on\-disk format changes have not been made yet. The pool can still be
-imported by software that does not support this feature, but changes may be made
-to the on\-disk format at any time which will move the feature to the
-\fBactive\fR state. Some features may support returning to the \fBenabled\fR
-state after becoming \fBactive\fR. See feature\-specific documentation for
-details.
-.RE
-
-.sp
-.ne 2
-.na
-\fBdisabled\fR
-.ad
-.RS 12n
-This feature's on\-disk format changes have not been made and will not be made
-unless an administrator moves the feature to the \fBenabled\fR state. Features
-cannot be disabled once they have been enabled.
-.RE
-
-.sp
-.LP
-The state of supported features is exposed through pool properties of the form
-\fIfeature@short_name\fR.
-.SS "Read\-only compatibility"
-.sp
-.LP
-Some features may make on\-disk format changes that do not interfere with other
-software's ability to read from the pool. These features are referred to as
-"read\-only compatible". If all unsupported features on a pool are read\-only
-compatible, the pool can be imported in read\-only mode by setting the
-\fBreadonly\fR property during import (see \fBzpool\fR(8) for details on
-importing pools).
-.SS "Unsupported features"
-.sp
-.LP
-For each unsupported feature enabled on an imported pool a pool property
-named \fIunsupported@feature_guid\fR will indicate why the import was allowed
-despite the unsupported feature. Possible values for this property are:
-
-.sp
-.ne 2
-.na
-\fB\fBinactive\fR\fR
-.ad
-.RS 12n
-The feature is in the \fBenabled\fR state and therefore the pool's on\-disk
-format is still compatible with software that does not support this feature.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBreadonly\fR\fR
-.ad
-.RS 12n
-The feature is read\-only compatible and the pool has been imported in
-read\-only mode.
-.RE
-
-.SS "Feature dependencies"
-.sp
-.LP
-Some features depend on other features being enabled in order to function
-properly. Enabling a feature will automatically enable any features it
-depends on.
-.SH FEATURES
-.sp
-.LP
-The following features are supported on this system:
-.sp
-.ne 2
-.na
-\fB\fBasync_destroy\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:async_destroy
-READ\-ONLY COMPATIBLE  yes
-DEPENDENCIES   none
-.TE
-
-Destroying a file system requires traversing all of its data in order to
-return its used space to the pool. Without \fBasync_destroy\fR the file system
-is not fully removed until all space has been reclaimed. If the destroy
-operation is interrupted by a reboot or power outage the next attempt to open
-the pool will need to complete the destroy operation synchronously.
-
-When \fBasync_destroy\fR is enabled the file system's data will be reclaimed
-by a background process, allowing the destroy operation to complete without
-traversing the entire file system. The background process is able to resume
-interrupted destroys after the pool has been opened, eliminating the need
-to finish interrupted destroys as part of the open operation. The amount
-of space remaining to be reclaimed by the background process is available
-through the \fBfreeing\fR property.
-
-This feature is only \fBactive\fR while \fBfreeing\fR is non\-zero.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBempty_bpobj\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:empty_bpobj
-READ\-ONLY COMPATIBLE  yes
-DEPENDENCIES   none
-.TE
-
-This feature increases the performance of creating and using a large
-number of snapshots of a single filesystem or volume, and also reduces
-the disk space required.
-
-When there are many snapshots, each snapshot uses many Block Pointer
-Objects (bpobj's) to track blocks associated with that snapshot.
-However, in common use cases, most of these bpobj's are empty.  This
-feature allows us to create each bpobj on-demand, thus eliminating the
-empty bpobjs.
-
-This feature is \fBactive\fR while there are any filesystems, volumes,
-or snapshots which were created after enabling this feature.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBfilesystem_limits\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.joyent:filesystem_limits
-READ\-ONLY COMPATIBLE  yes
-DEPENDENCIES   extensible_dataset
-.TE
-
-This feature enables filesystem and snapshot limits. These limits can be used
-to control how many filesystems and/or snapshots can be created at the point in
-the tree on which the limits are set.
-
-This feature is \fBactive\fR once either of the limit properties has been
-set on a dataset. Once activated the feature is never deactivated.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBlz4_compress\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   org.illumos:lz4_compress
-READ\-ONLY COMPATIBLE  no
-DEPENDENCIES   none
-.TE
-
-\fBlz4\fR is a high-performance real-time compression algorithm that
-features significantly faster compression and decompression as well as a
-higher compression ratio than the older \fBlzjb\fR compression.
-Typically, \fBlz4\fR compression is approximately 50% faster on
-compressible data and 200% faster on incompressible data than
-\fBlzjb\fR. It is also approximately 80% faster on decompression, while
-giving approximately 10% better compression ratio.
-
-When the \fBlz4_compress\fR feature is set to \fBenabled\fR, the
-administrator can turn on \fBlz4\fR compression on any dataset on the
-pool using the \fBzfs\fR(8) command. Please note that doing so will
-immediately activate the \fBlz4_compress\fR feature on the underlying
-pool using the \fBzfs\fR(1M) command. Also, all newly written metadata
-will be compressed with \fBlz4\fR algorithm. Since this feature is not
-read-only compatible, this operation will render the pool unimportable
-on systems without support for the \fBlz4_compress\fR feature. Booting
-off of \fBlz4\fR-compressed root pools is supported.
-
-This feature becomes \fBactive\fR as soon as it is enabled and will
-never return to being \fBenabled\fB.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBspacemap_histogram\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:spacemap_histogram
-READ\-ONLY COMPATIBLE  yes
-DEPENDENCIES   none
-.TE
-
-This features allows ZFS to maintain more information about how free space
-is organized within the pool. If this feature is \fBenabled\fR, ZFS will
-set this feature to \fBactive\fR when a new space map object is created or
-an existing space map is upgraded to the new format. Once the feature is
-\fBactive\fR, it will remain in that state until the pool is destroyed.
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBextensible_dataset\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:extensible_dataset
-READ\-ONLY COMPATIBLE  no
-DEPENDENCIES   none
-.TE
-
-This feature allows more flexible use of internal ZFS data structures,
-and exists for other features to depend on.
-
-This feature will be \fBactive\fR when the first dependent feature uses it,
-and will be returned to the \fBenabled\fR state when all datasets that use
-this feature are destroyed.
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBbookmarks\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:bookmarks
-READ\-ONLY COMPATIBLE  yes
-DEPENDENCIES   extensible_dataset
-.TE
-
-This feature enables use of the \fBzfs bookmark\fR subcommand.
-
-This feature is \fBactive\fR while any bookmarks exist in the pool.
-All bookmarks in the pool can be listed by running
-\fBzfs list -t bookmark -r \fIpoolname\fR\fR.
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBenabled_txg\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:enabled_txg
-READ\-ONLY COMPATIBLE  yes
-DEPENDENCIES   none
-.TE
-
-Once this feature is enabled ZFS records the transaction group number
-in which new features are enabled. This has no user-visible impact,
-but other features may depend on this feature.
-
-This feature becomes \fBactive\fR as soon as it is enabled and will
-never return to being \fBenabled\fB.
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBhole_birth\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:hole_birth
-READ\-ONLY COMPATIBLE  no
-DEPENDENCIES   enabled_txg
-.TE
-
-This feature improves performance of incremental sends ("zfs send -i")
-and receives for objects with many holes. The most common case of
-hole-filled objects is zvols.
-
-An incremental send stream from snapshot \fBA\fR to snapshot \fBB\fR
-contains information about every block that changed between \fBA\fR and
-\fBB\fR. Blocks which did not change between those snapshots can be
-identified and omitted from the stream using a piece of metadata called
-the 'block birth time', but birth times are not recorded for holes (blocks
-filled only with zeroes). Since holes created after \fBA\fR cannot be
-distinguished from holes created before \fBA\fR, information about every
-hole in the entire filesystem or zvol is included in the send stream.
-
-For workloads where holes are rare this is not a problem. However, when
-incrementally replicating filesystems or zvols with many holes (for
-example a zvol formatted with another filesystem) a lot of time will
-be spent sending and receiving unnecessary information about holes that
-already exist on the receiving side.
-
-Once the \fBhole_birth\fR feature has been enabled the block birth times
-of all new holes will be recorded. Incremental sends between snapshots
-created after this feature is enabled will use this new metadata to avoid
-sending information about holes that already exist on the receiving side.
-
-This feature becomes \fBactive\fR as soon as it is enabled and will
-never return to being \fBenabled\fB.
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBembedded_data\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   com.delphix:embedded_data
-READ\-ONLY COMPATIBLE  no
-DEPENDENCIES   none
-.TE
-
-This feature improves the performance and compression ratio of
-highly-compressible blocks.  Blocks whose contents can compress to 112 bytes
-or smaller can take advantage of this feature.
-
-When this feature is enabled, the contents of highly-compressible blocks are
-stored in the block "pointer" itself (a misnomer in this case, as it contains
-the compresseed data, rather than a pointer to its location on disk).  Thus
-the space of the block (one sector, typically 512 bytes or 4KB) is saved,
-and no additional i/o is needed to read and write the data block.
-
-This feature becomes \fBactive\fR as soon as it is enabled and will
-never return to being \fBenabled\fR.
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBlarge_blocks\fR\fR
-.ad
-.RS 4n
-.TS
-l l .
-GUID   org.open-zfs:large_block
-READ\-ONLY COMPATIBLE  no
-DEPENDENCIES   extensible_dataset
-.TE
-
-The \fBlarge_block\fR feature allows the record size on a dataset to be
-set larger than 128KB.
-
-This feature becomes \fBactive\fR once a \fBrecordsize\fR property has been
-set larger than 128KB, and will return to being \fBenabled\fR once all
-filesystems that have ever had their recordsize larger than 128KB are destroyed.
-.RE
-
-.SH "SEE ALSO"
-\fBzpool\fR(8)
diff --git a/zfs/man/man8/.gitignore b/zfs/man/man8/.gitignore
deleted file mode 100644 (file)
index be7e904..0000000
+++ /dev/null
@@ -1 +0,0 @@
-/zed.8
diff --git a/zfs/man/man8/Makefile.am b/zfs/man/man8/Makefile.am
deleted file mode 100644 (file)
index b89e34d..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-dist_man_MANS = \
-       fsck.zfs.8 \
-       mount.zfs.8 \
-       vdev_id.8 \
-       zdb.8 \
-       zfs.8 \
-       zinject.8 \
-       zpool.8 \
-       zstreamdump.8
-
-nodist_man_MANS = \
-       zed.8
-
-EXTRA_DIST = \
-       zed.8.in
-
-zed.8: $(srcdir)/zed.8.in
-
-do_subst = $(SED) \
-       -e 's|@libexecdir[@]|$(libexecdir)|g' \
-       -e 's|@runstatedir[@]|$(runstatedir)|g' \
-       -e 's|@sysconfdir[@]|$(sysconfdir)|g'
-
-$(nodist_man_MANS): Makefile
-       $(RM) $@ $@.tmp
-       srcdir=''; \
-         test -f ./$@.in || srcdir=$(srcdir)/; \
-         $(do_subst) $${srcdir}$@.in >$@.tmp
-       mv $@.tmp $@
-
-install-data-local:
-       $(INSTALL) -d -m 0755 "$(DESTDIR)$(mandir)/man8"
-
-CLEANFILES = \
-       $(nodist_man_MANS)
diff --git a/zfs/man/man8/Makefile.in b/zfs/man/man8/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/man/man8/fsck.zfs.8 b/zfs/man/man8/fsck.zfs.8
deleted file mode 100644 (file)
index baa8c33..0000000
+++ /dev/null
@@ -1,67 +0,0 @@
-'\" t
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.\"
-.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
-.\"
-.TH fsck.zfs 8 "2013 MAR 16" "ZFS on Linux" "System Administration Commands"
-
-.SH NAME
-fsck.zfs \- Dummy ZFS filesystem checker.
-
-.SH SYNOPSIS
-.LP
-.BI "fsck.zfs [" "options" "] <" "dataset" ">"
-
-.SH DESCRIPTION
-.LP
-\fBfsck.zfs\fR is a shell stub that does nothing and always returns
-true. It is installed by ZoL because some Linux distributions expect
-a fsck helper for all filesystems.
-
-.SH OPTIONS
-.HP
-All \fIoptions\fR and the \fIdataset\fR are ignored.
-
-.SH "NOTES"
-.LP
-ZFS datasets are checked by running \fBzpool scrub\fR on the
-containing pool. An individual ZFS dataset is never checked
-independently of its pool, which is unlike a regular filesystem.
-
-.SH "BUGS"
-.LP
-On some systems, if the \fIdataset\fR is in a degraded pool, then it
-might be appropriate for \fBfsck.zfs\fR to return exit code 4 to
-indicate an uncorrected filesystem error.
-.LP
-Similarly, if the \fIdataset\fR is in a faulted pool and has a legacy
-/etc/fstab record, then \fBfsck.zfs\fR should return exit code 8 to
-indicate a fatal operational error.
-
-.SH "AUTHORS"
-.LP
-Darik Horn <dajhorn@vanadac.com>.
-
-.SH "SEE ALSO"
-.BR fsck (8),
-.BR fstab (5),
-.BR zpool (8)
diff --git a/zfs/man/man8/mount.zfs.8 b/zfs/man/man8/mount.zfs.8
deleted file mode 100644 (file)
index 362a833..0000000
+++ /dev/null
@@ -1,144 +0,0 @@
-'\" t
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.\"
-.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
-.\"
-.TH mount.zfs 8 "2013 FEB 28" "ZFS on Linux" "System Administration Commands"
-
-.SH NAME
-mount.zfs \- mount a ZFS filesystem
-.SH SYNOPSIS
-.LP
-.BI "mount.zfs [\-sfnvh] [\-o " options "]" " dataset mountpoint
-
-.SH DESCRIPTION
-.BR mount.zfs
-is part of the zfsutils package for Linux. It is a helper program that
-is usually invoked by the
-.BR mount (8)
-or
-.BR zfs (8)
-commands to mount a ZFS dataset.
-
-All
-.I options
-are handled according to the FILESYSTEM INDEPENDENT MOUNT OPTIONS
-section in the
-.BR mount (8)
-manual, except for those described below.
-
-The
-.I dataset
-parameter is a ZFS filesystem name, as output by the
-.B "zfs list -H -o name
-command. This parameter never has a leading slash character and is
-not a device name.
-
-The
-.I mountpoint
-parameter is the path name of a directory.
-
-
-.SH OPTIONS
-.TP
-.BI "\-s"
-Ignore bad or sloppy mount options.
-.TP
-.BI "\-f"
-Do a fake mount; do not perform the mount operation.
-.TP
-.BI "\-n"
-Do not update the /etc/mtab file.
-.TP
-.BI "\-v"
-Increase verbosity.
-.TP
-.BI "\-h"
-Print the usage message.
-.TP
-.BI "\-o context"
-This flag sets the SELinux context for all files in the filesytem
-under that mountpoint.
-.TP
-.BI "\-o fscontext"
-This flag sets the SELinux context for the filesytem being mounted.
-.TP
-.BI "\-o defcontext"
-This flag sets the SELinux context for unlabeled files.
-.TP
-.BI "\-o rootcontext"
-This flag sets the SELinux context for the root inode of the filesystem.
-.TP
-.BI "\-o legacy"
-This private flag indicates that the
-.I dataset
-has an entry in the /etc/fstab file.
-.TP
-.BI "\-o noxattr"
-This private flag disables extended attributes.
-.TP
-.BI "\-o xattr
-This private flag enables directory-based extended attributes and, if
-appropriate, adds a ZFS context to the selinux system policy.
-.TP
-.BI "\-o saxattr
-This private flag enables system attributed-based extended attributes and, if
-appropriate, adds a ZFS context to the selinux system policy.
-.TP
-.BI "\-o dirxattr
-Equivalent to
-.BR xattr .
-.TP
-.BI "\-o zfsutil"
-This private flag indicates that
-.BR mount (8)
-is being called by the
-.BR zfs (8)
-command.
-
-.SH NOTES
-ZFS conventionally requires that the
-.I mountpoint
-be an empty directory, but the Linux implementation inconsistently
-enforces the requirement.
-
-The
-.BR mount.zfs
-helper does not mount the contents of zvols.
-
-.SH FILES
-.TP 18n
-.I /etc/fstab
-The static filesystem table.
-.TP
-.I /etc/mtab
-The mounted filesystem table.
-.SH "AUTHORS"
-The primary author of
-.BR mount.zfs
-is Brian Behlendorf <behlendorf1@llnl.gov>.
-
-This man page was written by Darik Horn <dajhorn@vanadac.com>.
-.SH "SEE ALSO"
-.BR fstab (5),
-.BR mount (8),
-.BR zfs (8)
diff --git a/zfs/man/man8/vdev_id.8 b/zfs/man/man8/vdev_id.8
deleted file mode 100644 (file)
index 70956c6..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-.TH vdev_id 8
-.SH NAME
-vdev_id \- generate user-friendly names for JBOD disks
-.SH SYNOPSIS
-.LP
-.nf
-\fBvdev_id\fR <-d dev> [-c config_file] [-g sas_direct|sas_switch]
-                 [-m] [-p phys_per_port]
-\fBvdev_id\fR -h
-.fi
-.SH DESCRIPTION
-The \fBvdev_id\fR command is a udev helper which parses the file
-.BR /etc/zfs/vdev_id.conf (5)
-to map a physical path in a storage topology to a channel name.  The
-channel name is combined with a disk enclosure slot number to create an
-alias that reflects the physical location of the drive.  This is
-particularly helpful when it comes to tasks like replacing failed
-drives.  Slot numbers may also be re-mapped in case the default
-numbering is unsatisfactory.  The drive aliases will be created as
-symbolic links in /dev/disk/by-vdev.
-
-The currently supported topologies are sas_direct and sas_switch.  A
-multipath mode is supported in which dm-mpath devices are handled by
-examining the first-listed running component disk as reported by the
-.BR multipath (8)
-command.  In multipath mode the configuration file should contain a
-channel definition with the same name for each path to a given
-enclosure.
-
-.BR vdev_id
-also supports creating aliases based on existing udev links in the /dev
-hierarchy using the \fIalias\fR configuration file keyword.  See the
-.BR vdev_id.conf (5)
-man page for details.
-
-.SH OPTIONS
-.TP
-\fB\-c\fR <config_file>
-Specifies the path to an alternate configuration file.  The default is
-/etc/zfs/vdev_id.conf.
-.TP
-\fB\-d\fR <device>
-This is the only mandatory argument.  Specifies the name of a device
-in /dev, i.e. "sda".
-.TP
-\fB\-g\fR <sas_direct|sas_switch>
-Identifies a physical topology that governs how physical paths are
-mapped to channels.
-
-\fIsas_direct\fR - in this mode a channel is uniquely identified by
-a PCI slot and a HBA port number
-
-\fIsas_switch\fR - in this mode a channel is uniquely identified by
-a SAS switch port number
-.TP
-\fB\-m\fR
-Specifies that
-.BR vdev_id (8)
-will handle only dm-multipath devices.  If set to "yes" then
-.BR vdev_id (8)
-will examine the first running component disk of a dm-multipath
-device as listed by the
-.BR multipath (8)
-command to determine the physical path.
-.TP
-\fB\-p\fR <phys_per_port>
-Specifies the number of PHY devices associated with a SAS HBA port or SAS
-switch port.
-.BR vdev_id (8)
-internally uses this value to determine which HBA or switch port a
-device is connected to.  The default is 4.
-.TP
-\fB\-h\fR
-Print a usage summary.
-.SH SEE ALSO
-.LP
-\fBvdev_id.conf\fR(5)
diff --git a/zfs/man/man8/zdb.8 b/zfs/man/man8/zdb.8
deleted file mode 100644 (file)
index d19e4a3..0000000
+++ /dev/null
@@ -1,540 +0,0 @@
-'\" t
-.\"
-.\" This file and its contents are supplied under the terms of the
-.\" Common Development and Distribution License ("CDDL"), version 1.0.
-.\" You may only use this file in accordance with the terms of version
-.\" 1.0 of the CDDL.
-.\"
-.\" A full copy of the text of the CDDL should have accompanied this
-.\" source.  A copy of the CDDL is also available via the Internet at
-.\" http://www.illumos.org/license/CDDL.
-.\"
-.\"
-.\" Copyright 2012, Richard Lowe.
-.\" Copyright (c) 2012 by Delphix. All rights reserved.
-.\"
-.TH "ZDB" "8" "February 15, 2012" "" ""
-
-.SH "NAME"
-\fBzdb\fR - Display zpool debugging and consistency information
-
-.SH "SYNOPSIS"
-\fBzdb\fR [-CumdibcsDvhLMXFPA] [-e [-p \fIpath\fR...]] [-t \fItxg\fR]
-    [-U \fIcache\fR] [-I \fIinflight I/Os\fR]
-    [\fIpoolname\fR [\fIobject\fR ...]]
-
-.P
-\fBzdb\fR [-divPA] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
-    \fIdataset\fR [\fIobject\fR ...]
-
-.P
-\fBzdb\fR -m [-MLXFPA] [-t \fItxg\fR] [-e [-p \fIpath\fR...]] [-U \fIcache\fR]
-    \fIpoolname\fR [\fIvdev\fR [\fImetaslab\fR ...]]
-
-.P
-\fBzdb\fR -R [-A] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
-    \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
-
-.P
-\fBzdb\fR -S [-AP] [-e [-p \fIpath\fR...]] [-U \fIcache\fR] \fIpoolname\fR
-
-.P
-\fBzdb\fR -l [-uA] \fIdevice\fR
-
-.P
-\fBzdb\fR -C [-A] [-U \fIcache\fR]
-
-.SH "DESCRIPTION"
-The \fBzdb\fR utility displays information about a ZFS pool useful for
-debugging and performs some amount of consistency checking. It is a not a
-general purpose tool and options (and facilities) may change. This is neither
-a fsck(8) nor an fsdb(8) utility.
-
-.P
-The output of this command in general reflects the on-disk structure of a ZFS
-pool, and is inherently unstable. The precise output of most invocations is
-not documented, a knowledge of ZFS internals is assumed.
-
-.P
-If the \fIdataset\fR argument does not contain any \fB/\fR or \fB@\fR
-characters, it is interpreted as a pool name.  The root dataset can be
-specified as \fIpool\fB/\fR (pool name followed by a slash).
-
-.P
-When operating on an imported and active pool it is possible, though unlikely,
-that zdb may interpret inconsistent pool data and behave erratically.
-
-.SH "OPTIONS"
-Display options:
-
-.sp
-.ne 2
-.na
-\fB-b\fR
-.ad
-.sp .6
-.RS 4n
-Display statistics regarding the number, size (logical, physical and
-allocated) and deduplication of blocks.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-c\fR
-.ad
-.sp .6
-.RS 4n
-Verify the checksum of all metadata blocks while printing block statistics
-(see \fB-b\fR).
-.sp
-If specified multiple times, verify the checksums of all blocks.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-C\fR
-.ad
-.sp .6
-.RS 4n
-Display information about the configuration. If specified with no other
-options, instead display information about the cache file
-(\fB/etc/zfs/zpool.cache\fR). To specify the cache file to display, see
-\fB-U\fR.
-.P
-If specified multiple times, and a pool name is also specified display both
-the cached configuration and the on-disk configuration.  If specified multiple
-times with \fB-e\fR also display the configuration that would be used were the
-pool to be imported.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-d\fR
-.ad
-.sp .6
-.RS 4n
-Display information about datasets. Specified once, displays basic dataset
-information: ID, create transaction, size, and object count.
-.sp
-If specified multiple times provides greater and greater verbosity.
-.sp
-If object IDs are specified, display information about those specific objects only.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-D\fR
-.ad
-.sp .6
-.RS 4n
-Display deduplication statistics, including the deduplication ratio (dedup),
-compression ratio (compress), inflation due to the zfs copies property
-(copies), and an overall effective ratio (dedup * compress / copies).
-.sp
-If specified twice, display a histogram of deduplication statistics, showing
-the allocated (physically present on disk) and referenced (logically
-referenced in the pool) block counts and sizes by reference count.
-.sp
-If specified a third time, display the statistics independently for each deduplication table.
-.sp
-If specified a fourth time, dump the contents of the deduplication tables describing duplicate blocks.
-.sp
-If specified a fifth time, also dump the contents of the deduplication tables describing unique blocks.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-h\fR
-.ad
-.sp .6
-.RS 4n
-Display pool history similar to \fBzpool history\fR, but include internal
-changes, transaction, and dataset information.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-i\fR
-.ad
-.sp .6
-.RS 4n
-Display information about intent log (ZIL) entries relating to each
-dataset. If specified multiple times, display counts of each intent log
-transaction type.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-l\fR \fIdevice\fR
-.ad
-.sp .6
-.RS 4n
-Display the vdev labels from the specified device. If the \fB-u\fR option is
-also specified, also display the uberblocks on this device.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-L\fR
-.ad
-.sp .6
-.RS 4n
-Disable leak tracing and the loading of space maps.  By default, \fBzdb\fR
-verifies that all non-free blocks are referenced, which can be very expensive.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-m\fR
-.ad
-.sp .6
-.RS 4n
-Display the offset, spacemap, and free space of each metaslab.
-When specified twice, also display information about the on-disk free
-space histogram associated with each metaslab. When specified three time,
-display the maximum contiguous free space, the in-core free space histogram,
-and the percentage of free space in each space map.  When specified
-four times display every spacemap record.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-M\fR
-.ad
-.sp .6
-.RS 4n
-Display the offset, spacemap, and free space of each metaslab.
-When specified twice, also display information about the maximum contiguous
-free space and the percentage of free space in each space map.  When specified
-three times display every spacemap record.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-R\fR \fIpoolname\fR \fIvdev\fR:\fIoffset\fR:\fIsize\fR[:\fIflags\fR]
-.ad
-.sp .6
-.RS 4n
-Read and display a block from the specified device. By default the block is
-displayed as a hex dump, but see the description of the \'r\' flag, below.
-.sp
-The block is specified in terms of a colon-separated tuple \fIvdev\fR (an
-integer vdev identifier) \fIoffset\fR (the offset within the vdev) \fIsize\fR
-(the size of the block to read) and, optionally, \fIflags\fR (a set of flags,
-described below).
-
-.sp
-.ne 2
-.na
-\fBb\fR \fIoffset\fR
-.ad
-.sp .6
-.RS 4n
-Print block pointer
-.RE
-
-.sp
-.ne 2
-.na
-\fBd\fR
-.ad
-.sp .6
-.RS 4n
-Decompress the block
-.RE
-
-.sp
-.ne 2
-.na
-\fBe\fR
-.ad
-.sp .6
-.RS 4n
-Byte swap the block
-.RE
-
-.sp
-.ne 2
-.na
-\fBg\fR
-.ad
-.sp .6
-.RS 4n
-Dump gang block header
-.RE
-
-.sp
-.ne 2
-.na
-\fBi\fR
-.ad
-.sp .6
-.RS 4n
-Dump indirect block
-.RE
-
-.sp
-.ne 2
-.na
-\fBr\fR
-.ad
-.sp .6
-.RS 4n
-Dump raw uninterpreted block data
-.RE
-.RE
-
-.sp
-.ne 2
-.na
-\fB-s\fR
-.ad
-.sp .6
-.RS 4n
-Report statistics on \fBzdb\fR\'s I/O. Display operation counts, bandwidth,
-and error counts of I/O to the pool from \fBzdb\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-S\fR
-.ad
-.sp .6
-.RS 4n
-Simulate the effects of deduplication, constructing a DDT and then display
-that DDT as with \fB-DD\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-u\fR
-.ad
-.sp .6
-.RS 4n
-Display the current uberblock.
-.RE
-
-.P
-Other options:
-
-.sp
-.ne 2
-.na
-\fB-A\fR
-.ad
-.sp .6
-.RS 4n
-Do not abort should any assertion fail.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-AA\fR
-.ad
-.sp .6
-.RS 4n
-Enable panic recovery, certain errors which would otherwise be fatal are
-demoted to warnings.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-AAA\fR
-.ad
-.sp .6
-.RS 4n
-Do not abort if asserts fail and also enable panic recovery.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-e\fR [-p \fIpath\fR]...
-.ad
-.sp .6
-.RS 4n
-Operate on an exported pool, not present in \fB/etc/zfs/zpool.cache\fR. The
-\fB-p\fR flag specifies the path under which devices are to be searched.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-F\fR
-.ad
-.sp .6
-.RS 4n
-Attempt to make an unreadable pool readable by trying progressively older
-transactions.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-I \fIinflight I/Os\fR \fR
-.ad
-.sp .6
-.RS 4n
-Limit the number of outstanding checksum I/Os to the specified value. The
-default value is 200. This option affects the performance of the \fB-c\fR
-option.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-P\fR
-.ad
-.sp .6
-.RS 4n
-Print numbers in an unscaled form more amenable to parsing, eg. 1000000 rather
-than 1M.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-t\fR \fItransaction\fR
-.ad
-.sp .6
-.RS 4n
-Specify the highest transaction to use when searching for uberblocks. See also
-the \fB-u\fR and \fB-l\fR options for a means to see the available uberblocks
-and their associated transaction numbers.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-U\fR \fIcachefile\fR
-.ad
-.sp .6
-.RS 4n
-Use a cache file other than \fB/etc/zfs/zpool.cache\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-v\fR
-.ad
-.sp .6
-.RS 4n
-Enable verbosity. Specify multiple times for increased verbosity.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-X\fR
-.ad
-.sp .6
-.RS 4n
-Attempt \'extreme\' transaction rewind, that is attempt the same recovery as
-\fB-F\fR but read transactions otherwise deemed too old.
-.RE
-
-.sp
-.ne 2
-.na
-\fB-V\fR
-.ad
-.sp .6
-.RS 4n
-Attempt a verbatim import. This mimics the behavior of the kernel when loading
-a pool from a cachefile.
-.RE
-
-.P
-Specifying a display option more than once enables verbosity for only that
-option, with more occurrences enabling more verbosity.
-.P
-If no options are specified, all information about the named pool will be
-displayed at default verbosity.
-
-.SH "EXAMPLES"
-.LP
-\fBExample 1 \fRDisplay the configuration of imported pool 'rpool'
-.sp
-.in +2
-.nf
-# zdb -C rpool
-
-MOS Configuration:
-        version: 28
-        name: 'rpool'
- ...
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 2 \fRDisplay basic dataset information about 'rpool'
-.sp
-.in +2
-.nf
-# zdb -d rpool
-Dataset mos [META], ID 0, cr_txg 4, 26.9M, 1051 objects
-Dataset rpool/swap [ZVOL], ID 59, cr_txg 356, 486M, 2 objects
- ...
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 3 \fRDisplay basic information about object 0
-in 'rpool/export/home'
-.sp
-.in +2
-.nf
-# zdb -d rpool/export/home 0
-Dataset rpool/export/home [ZPL], ID 137, cr_txg 1546, 32K, 8 objects
-
-    Object  lvl   iblk   dblk  dsize  lsize   %full  type
-         0    7    16K    16K  15.0K    16K   25.00  DMU dnode
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 4 \fRDisplay the predicted effect of enabling deduplication on 'rpool'
-.sp
-.in +2
-.nf
-# zdb -S rpool
-Simulated DDT histogram:
-
-bucket              allocated                       referenced          
-______   ______________________________   ______________________________
-refcnt   blocks   LSIZE   PSIZE   DSIZE   blocks   LSIZE   PSIZE   DSIZE
-------   ------   -----   -----   -----   ------   -----   -----   -----
-     1     694K   27.1G   15.0G   15.0G     694K   27.1G   15.0G   15.0G
-     2    35.0K   1.33G    699M    699M    74.7K   2.79G   1.45G   1.45G
- ...
-dedup = 1.11, compress = 1.80, copies = 1.00, dedup * compress / copies = 2.00
-.fi
-.in -2
-.sp
-
-.SH "ENVIRONMENT VARIABLES"
-.TP
-.B "SPA_CONFIG_PATH"
-Override the default \fBspa_config_path\fR (\fI/etc/zfs/zpool.cache\fR) setting. If \fB-U\fR flag is specified it will override this environment variable settings once again.
-
-.SH "SEE ALSO"
-zfs(8), zpool(8)
index 2ab088d98a3c621590690889f917bf0705a47dc7..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,252 +1,2 @@
-.\"
-.\" This file is part of the ZFS Event Daemon (ZED)
-.\" for ZFS on Linux (ZoL) <http://zfsonlinux.org/>.
-.\" Developed at Lawrence Livermore National Laboratory (LLNL-CODE-403049).
-.\" Copyright (C) 2013-2014 Lawrence Livermore National Security, LLC.
-.\" Refer to the ZoL git commit log for authoritative copyright attribution.
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License Version 1.0 (CDDL-1.0).
-.\" You can obtain a copy of the license from the top-level file
-.\" "OPENSOLARIS.LICENSE" or at <http://opensource.org/licenses/CDDL-1.0>.
-.\" You may not use this file except in compliance with the license.
-.\"
-.TH ZED 8 "Octember 1, 2013" "ZFS on Linux" "System Administration Commands"
-
-.SH NAME
-ZED \- ZFS Event Daemon
-
-.SH SYNOPSIS
-.HP
-.B zed
-.\" [\fB\-c\fR \fIconfigfile\fR]
-[\fB\-d\fR \fIzedletdir\fR]
-[\fB\-f\fR]
-[\fB\-F\fR]
-[\fB\-h\fR]
-[\fB\-L\fR]
-[\fB\-M\fR]
-[\fB\-p\fR \fIpidfile\fR]
-[\fB\-s\fR \fIstatefile\fR]
-[\fB\-v\fR]
-[\fB\-V\fR]
-[\fB\-Z\fR]
-
-.SH DESCRIPTION
-.PP
-\fBZED\fR (ZFS Event Daemon) monitors events generated by the ZFS kernel
-module.  When a zevent (ZFS Event) is posted, \fBZED\fR will run any ZEDLETs
-(ZFS Event Daemon Linkage for Executable Tasks) that have been enabled for the
-corresponding zevent class.
-
-.SH OPTIONS
-.TP
-.BI \-h
-Display a summary of the command-line options.
-.TP
-.BI \-L
-Display license information.
-.TP
-.BI \-V
-Display version information.
-.TP
-.BI \-v
-Be verbose.
-.TP
-.BI \-f
-Force the daemon to run if at all possible, disabling security checks and
-throwing caution to the wind.  Not recommended for use in production.
-.TP
-.BI \-F
-Run the daemon in the foreground.
-.TP
-.BI \-M
-Lock all current and future pages in the virtual memory address space.
-This may help the daemon remain responsive when the system is under heavy
-memory pressure.
-.TP
-.BI \-Z
-Zero the daemon's state, thereby allowing zevents still within the kernel
-to be reprocessed.
-.\" .TP
-.\" .BI \-c\  configfile
-.\" Read the configuration from the specified file.
-.TP
-.BI \-d\  zedletdir
-Read the enabled ZEDLETs from the specified directory.
-.TP
-.BI \-p\  pidfile
-Write the daemon's process ID to the specified file.
-.TP
-.BI \-s\  statefile
-Write the daemon's state to the specified file.
-
-.SH ZEVENTS
-.PP
-A zevent is comprised of a list of nvpairs (name/value pairs).  Each zevent
-contains an EID (Event IDentifier) that uniquely identifies it throughout
-the lifetime of the loaded ZFS kernel module; this EID is a monotonically
-increasing integer that resets to 1 each time the kernel module is loaded.
-Each zevent also contains a class string that identifies the type of event.
-For brevity, a subclass string is defined that omits the leading components
-of the class string.  Additional nvpairs exist to provide event details.
-.PP
-The kernel maintains a list of recent zevents that can be viewed (along with
-their associated lists of nvpairs) using the "\fBzpool events \-v\fR" command.
-
-.SH CONFIGURATION
-.PP
-ZEDLETs to be invoked in response to zevents are located in the
-\fIenabled-zedlets\fR directory.  These can be symlinked or copied from the
-\fIinstalled-zedlets\fR directory; symlinks allow for automatic updates
-from the installed ZEDLETs, whereas copies preserve local modifications.
-As a security measure, ZEDLETs must be owned by root.  They must have
-execute permissions for the user, but they must not have write permissions
-for group or other.  Dotfiles are ignored.
-.PP
-ZEDLETs are named after the zevent class for which they should be invoked.
-In particular, a ZEDLET will be invoked for a given zevent if either its
-class or subclass string is a prefix of its filename (and is followed by
-a non-alphabetic character).  As a special case, the prefix "all" matches
-all zevents.  Multiple ZEDLETs may be invoked for a given zevent.
-
-.SH ZEDLETS
-.PP
-ZEDLETs are executables invoked by the ZED in response to a given zevent.
-They should be written under the presumption they can be invoked concurrently,
-and they should use appropriate locking to access any shared resources.
-Common variables used by ZEDLETs can be stored in the default rc file which
-is sourced by scripts; these variables should be prefixed with "ZED_".
-.PP
-The zevent nvpairs are passed to ZEDLETs as environment variables.
-Each nvpair name is converted to an environment variable in the following
-manner: 1) it is prefixed with "ZEVENT_", 2) it is converted to uppercase,
-and 3) each non-alphanumeric character is converted to an underscore.
-Some additional environment variables have been defined to present certain
-nvpair values in a more convenient form.  An incomplete list of zevent
-environment variables is as follows:
-.TP
-.B
-ZEVENT_EID
-The Event IDentifier.
-.TP
-.B
-ZEVENT_CLASS
-The zevent class string.
-.TP
-.B
-ZEVENT_SUBCLASS
-The zevent subclass string.
-.TP
-.B
-ZEVENT_TIME
-The time at which the zevent was posted as
-"\fIseconds\fR\ \fInanoseconds\fR" since the Epoch.
-.TP
-.B
-ZEVENT_TIME_SECS
-The \fIseconds\fR component of ZEVENT_TIME.
-.TP
-.B
-ZEVENT_TIME_NSECS
-The \fInanoseconds\fR component of ZEVENT_TIME.
-.TP
-.B
-ZEVENT_TIME_STRING
-An almost-RFC3339-compliant string for ZEVENT_TIME.
-.PP
-Additionally, the following ZED & ZFS variables are defined:
-.TP
-.B
-ZED_PID
-The daemon's process ID.
-.TP
-.B
-ZED_ZEDLET_DIR
-The daemon's current \fIenabled-zedlets\fR directory.
-.TP
-.B
-ZFS_ALIAS
-The ZFS alias (\fIname-version-release\fR) string used to build the daemon.
-.TP
-.B
-ZFS_VERSION
-The ZFS version used to build the daemon.
-.TP
-.B
-ZFS_RELEASE
-The ZFS release used to build the daemon.
-.PP
-ZEDLETs may need to call other ZFS commands.  The installation paths of
-the following executables are defined: \fBZDB\fR, \fBZED\fR, \fBZFS\fR,
-\fBZINJECT\fR, and \fBZPOOL\fR.  These variables can be overridden in the
-rc file if needed.
-
-.SH FILES
-.\" .TP
-.\" @sysconfdir@/zfs/zed.conf
-.\" The default configuration file for the daemon.
-.TP
-.I @sysconfdir@/zfs/zed.d
-The default directory for enabled ZEDLETs.
-.TP
-.I @sysconfdir@/zfs/zed.d/zed.rc
-The default rc file for common variables used by ZEDLETs.
-.TP
-.I @libexecdir@/zfs/zed.d
-The default directory for installed ZEDLETs.
-.TP
-.I @runstatedir@/zed.pid
-The default file containing the daemon's process ID.
-.TP
-.I @runstatedir@/zed.state
-The default file containing the daemon's state.
-
-.SH SIGNALS
-.TP
-.B HUP
-Reconfigure the daemon and rescan the directory for enabled ZEDLETs.
-.TP
-.B TERM
-Terminate the daemon.
-
-.SH NOTES
-.PP
-\fBZED\fR requires root privileges.
-.\" Do not taunt zed.
-
-.SH BUGS
-.PP
-Events are processed synchronously by a single thread.  This can delay the
-processing of simultaneous zevents.
-.PP
-There is no maximum timeout for ZEDLET execution.  Consequently, a misbehaving
-ZEDLET can delay the processing of subsequent zevents.
-.PP
-The ownership and permissions of the \fIenabled-zedlets\fR directory (along
-with all parent directories) are not checked.  If any of these directories
-are improperly owned or permissioned, an unprivileged user could insert a
-ZEDLET to be executed as root.  The requirement that ZEDLETs be owned by
-root mitigates this to some extent.
-.PP
-ZEDLETs are unable to return state/status information to the kernel.
-.PP
-Some zevent nvpair types are not handled.  These are denoted by zevent
-environment variables having a "_NOT_IMPLEMENTED_" value.
-.PP
-Internationalization support via gettext has not been added.
-.PP
-The configuration file is not yet implemented.
-.PP
-The diagnosis engine is not yet implemented.
-
-.SH LICENSE
-.PP
-\fBZED\fR (ZFS Event Daemon) is distributed under the terms of the
-Common Development and Distribution License Version 1.0 (CDDL\-1.0).
-.PP
-Developed at Lawrence Livermore National Laboratory (LLNL\-CODE\-403049).
-
-.SH SEE ALSO
-.BR zfs (8),
-.BR zpool (8)
+%:
+       #
diff --git a/zfs/man/man8/zfs.8 b/zfs/man/man8/zfs.8
deleted file mode 100644 (file)
index 4509ff3..0000000
+++ /dev/null
@@ -1,3894 +0,0 @@
-'\" t
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.\"
-.\" Copyright (c) 2009 Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright 2011 Joshua M. Clulow <josh@sysmgr.org>
-.\" Copyright (c) 2014 by Delphix. All rights reserved.
-.\" Copyright (c) 2014, Joyent, Inc. All rights reserved.
-.\" Copyright 2012 Nexenta Systems, Inc. All Rights Reserved.
-.\" Copyright (c) 2013 by Saso Kiselkov. All rights reserved.
-.\"
-.TH zfs 8 "Nov 19, 2013" "ZFS pool 28, filesystem 5" "System Administration Commands"
-.SH NAME
-zfs \- configures ZFS file systems
-.SH SYNOPSIS
-.LP
-.nf
-\fBzfs\fR [\fB-?\fR]
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBcreate\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBcreate\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBdestroy\fR [\fB-fnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBdestroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...]
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBdestroy\fR \fIfilesystem\fR|\fIvolume\fR#\fIbookmark\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBsnapshot | snap\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... 
-      \fIfilesystem@snapname\fR|\fIvolume@snapname\fR ...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBrollback\fR [\fB-rRf\fR] \fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBclone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBpromote\fR \fIclone-filesystem\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBrename\fR [\fB-f\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
-     \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBrename\fR [\fB-fp\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBrename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIproperty\fR[,\fIproperty\fR]...] [\fB-t\fR \fItype\fR[,\fItype\fR]..]
-     [\fB-s\fR \fIproperty\fR] ... [\fB-S\fR \fIproperty\fR] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBset\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBget\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR][\fB-Hp\fR][\fB-o\fR \fIfield\fR[,...]] [\fB-t\fR \fItype\fR[,...]] 
-    [\fB-s\fR \fIsource\fR[,...]] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBinherit\fR [\fB-rS\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume|snapshot\fR ...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBupgrade\fR [\fB-v\fR]
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBupgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIfilesystem\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIfield\fR] ...
-    [\fB-S\fR \fIfield\fR] ... [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]] [\fB-s\fR \fIfield\fR] ...
-    [\fB-S\fR \fIfield\fR] ... [\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBmount\fR 
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBmount\fR [\fB-vO\fR] [\fB-o \fIoptions\fR\fR] \fB-a\fR | \fIfilesystem\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBunmount | umount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBshare\fR \fB-a\fR | \fIfilesystem\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBunshare\fR \fB-a\fR \fIfilesystem\fR|\fImountpoint\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBbookmark\fR \fIsnapshot\fR \fIbookmark\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBsend\fR [\fB-DnPpRveL\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBsend\fR [\fB-eL\fR] [\fB-i \fIsnapshot\fR|\fIbookmark\fR]\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBreceive | recv\fR [\fB-vnFu\fR] [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBallow\fR \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBallow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|\fI@setname\fR[,...] 
-     \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBallow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBallow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBallow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBunallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[,... ]] 
-     \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBunallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[ ... ]] \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBunallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,... ]] \fIfilesystem\fR|\fIvolume\fR
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBhold\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBholds\fR [\fB-r\fR] \fIsnapshot\fR...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBrelease\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...
-.fi
-
-.LP
-.nf
-\fBzfs\fR \fBdiff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR
-
-.SH DESCRIPTION
-.LP
-The \fBzfs\fR command configures \fBZFS\fR datasets within a \fBZFS\fR storage pool, as described in \fBzpool\fR(8). A dataset is identified by a unique path within the \fBZFS\fR namespace. For example:
-.sp
-.in +2
-.nf
-pool/{filesystem,volume,snapshot}
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-where the maximum length of a dataset name is \fBMAXNAMELEN\fR (256 bytes).
-.sp
-.LP
-A dataset can be one of the following:
-.sp
-.ne 2
-.mk
-.na
-\fB\fIfile system\fR\fR
-.ad
-.sp .6
-.RS 4n
-A \fBZFS\fR dataset of type \fBfilesystem\fR can be mounted within the standard system namespace and behaves like other file systems. While \fBZFS\fR file systems are designed to be \fBPOSIX\fR compliant, known issues exist that prevent compliance in some cases. Applications that depend on standards conformance might fail due to nonstandard behavior when checking file system free space.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-A logical volume exported as a raw or block device. This type of dataset should only be used under special circumstances. File systems are typically used in most environments.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIsnapshot\fR\fR
-.ad
-.sp .6
-.RS 4n
-A read-only version of a file system or volume at a given point in time. It is specified as \fIfilesystem@name\fR or \fIvolume@name\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIbookmark\fR\fR
-.ad
-.sp .6
-.RS 4n
-Much like a \fIsnapshot\fR, but without the hold on on-disk data. It can be used as the source of a send (but not for a receive).
-It is specified as \fIfilesystem#name\fR or \fIvolume#name\fR.
-.RE
-
-.SS "ZFS File System Hierarchy"
-.LP
-A \fBZFS\fR storage pool is a logical collection of devices that provide space for datasets. A storage pool is also the root of the \fBZFS\fR file system hierarchy.
-.sp
-.LP
-The root of the pool can be accessed as a file system, such as mounting and unmounting, taking snapshots, and setting properties. The physical storage characteristics, however, are managed by the \fBzpool\fR(8) command.
-.sp
-.LP
-See \fBzpool\fR(8) for more information on creating and administering pools.
-.SS "Snapshots"
-.LP
-A snapshot is a read-only copy of a file system or volume. Snapshots can be created extremely quickly, and initially consume no additional space within the pool. As data within the active dataset changes, the snapshot consumes more data than would otherwise be shared with the active dataset.
-.sp
-.LP
-Snapshots can have arbitrary names. Snapshots of volumes can be cloned or rolled back.  Visibility is determined by the \fBsnapdev\fR property of the parent volume.
-.sp
-.LP
-File system snapshots can be accessed under the \fB\&.zfs/snapshot\fR directory in the root of the file system. Snapshots are automatically mounted on demand and may be unmounted at regular intervals. The visibility of the \fB\&.zfs\fR directory can be controlled by the \fBsnapdir\fR property.
-.SS "Bookmarks"
-.LP
-A bookmark is like a snapshot, a read-only copy of a file system or volume. Bookmarks can be created extremely quickly, compared to snapshots, and they consume no additional space within the pool.  Bookmarks can also have arbitrary names, much like snapshots.
-.sp
-.LP
-Unlike snapshots, bookmarks can not be accessed through the filesystem in any way. From a storage standpoint a bookmark just provides a way to reference when a snapshot was created as a distinct object.  Bookmarks are initially tied to a snapshot, not the filesystem/volume, and they will survive if the snapshot itself is destroyed.  Since they are very light weight there's little incentive to destroy them.
-.SS "Clones"
-.LP
-A clone is a writable volume or file system whose initial contents are the same as another dataset. As with snapshots, creating a clone is nearly instantaneous, and initially consumes no additional space.
-.sp
-.LP
-Clones can only be created from a snapshot. When a snapshot is cloned, it creates an implicit dependency between the parent and child. Even though the clone is created somewhere else in the dataset hierarchy, the original snapshot cannot be destroyed as long as a clone exists. The \fBorigin\fR property exposes this dependency, and the \fBdestroy\fR command lists any such dependencies, if they exist.
-.sp
-.LP
-The clone parent-child dependency relationship can be reversed by using the \fBpromote\fR subcommand. This causes the "origin" file system to become a clone of the specified file system, which makes it possible to destroy the file system that the clone was created from.
-.SS "Mount Points"
-.LP
-Creating a \fBZFS\fR file system is a simple operation, so the number of file systems per system is likely to be numerous. To cope with this, \fBZFS\fR automatically manages mounting and unmounting file systems without the need to edit the \fB/etc/fstab\fR file. All automatically managed file systems are mounted by \fBZFS\fR at boot time.
-.sp
-.LP
-By default, file systems are mounted under \fB/\fIpath\fR\fR, where \fIpath\fR is the name of the file system in the \fBZFS\fR namespace. Directories are created and destroyed as needed.
-.sp
-.LP
-A file system can also have a mount point set in the \fBmountpoint\fR property. This directory is created as needed, and \fBZFS\fR automatically mounts the file system when the \fBzfs mount -a\fR command is invoked (without editing \fB/etc/fstab\fR). The \fBmountpoint\fR property can be inherited, so if \fBpool/home\fR has a mount point of \fB/export/stuff\fR, then \fBpool/home/user\fR automatically inherits a mount point of \fB/export/stuff/user\fR.
-.sp
-.LP
-A file system \fBmountpoint\fR property of \fBnone\fR prevents the file system from being mounted.
-.sp
-.LP
-If needed, \fBZFS\fR file systems can also be managed with traditional tools (\fBmount\fR, \fBumount\fR, \fB/etc/fstab\fR). If a file system's mount point is set to \fBlegacy\fR, \fBZFS\fR makes no attempt to manage the file system, and the administrator is responsible for mounting and unmounting the file system.
-.SS "Deduplication"
-.LP
-Deduplication is the process for removing redundant data at the block-level, reducing the total amount of data stored. If a file system has the \fBdedup\fR property enabled, duplicate data blocks are removed synchronously.  The result is that only unique data is stored and common components are shared among files.
-.sp
-\fBWARNING: DO NOT ENABLE DEDUPLICATION UNLESS YOU NEED IT AND KNOW EXACTLY WHAT YOU ARE DOING!\fR
-.sp
-Deduplicating data is a very resource-intensive operation. It is generally recommended that you have \fIat least\fR 1.25 GB of RAM per 1 TB of storage when you enable deduplication. But calculating the exact requirenments is a somewhat complicated affair. Please see the \fBOracle Dedup Guide\fR for more information..
-.sp
-Enabling deduplication on an improperly-designed system will result in extreme performance issues (extremely slow filesystem and snapshot deletions etc.) and can potentially lead to data loss (i.e. unimportable pool due to memory exhaustion) if your system is not built for this purpose. Deduplication affects the processing power (CPU), disks (and the controller) as well as primary (real) memory.
-.sp
-Before creating a pool with deduplication enabled, ensure that you have planned your hardware requirements appropriately and implemented appropriate recovery practices, such as regular backups.
-.sp
-Unless necessary, deduplication should NOT be enabled on a system. Instead, consider using \fIcompression=lz4\fR, as a less resource-intensive alternative.
-.SS "Native Properties"
-.LP
-Properties are divided into two types, native properties and user-defined (or "user") properties. Native properties either export internal statistics or control \fBZFS\fR behavior. In addition, native properties are either editable or read-only. User properties have no effect on \fBZFS\fR behavior, but you can use them to annotate datasets in a way that is meaningful in your environment. For more information about user properties, see the "User Properties" section, below.
-.sp
-.LP
-Every dataset has a set of properties that export statistics about the dataset as well as control various behaviors. Properties are inherited from the parent unless overridden by the child. Some properties apply only to certain types of datasets (file systems, volumes, or snapshots).
-.sp
-.LP
-The values of numeric properties can be specified using human-readable suffixes (for example, \fBk\fR, \fBKB\fR, \fBM\fR, \fBGb\fR, and so forth, up to \fBZ\fR for zettabyte). The following are all valid (and equal) specifications: 
-.sp
-.in +2
-.nf
-1536M, 1.5g, 1.50GB
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-The values of non-numeric properties are case sensitive and must be lowercase, except for \fBmountpoint\fR, \fBsharenfs\fR, and \fBsharesmb\fR.
-.sp
-.LP
-The following native properties consist of read-only statistics about the dataset. These properties can be neither set, nor inherited. Native properties apply to all dataset types unless otherwise noted.
-.sp
-.ne 2
-.mk
-.na
-\fB\fBavailable\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space available to the dataset and all its children, assuming that there is no other activity in the pool. Because space is shared within a pool, availability can be limited by any number of factors, including physical pool size, quotas, reservations, or other datasets within the pool.
-.sp
-This property can also be referred to by its shortened column name, \fBavail\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcompressratio\fR\fR
-.ad
-.sp .6
-.RS 4n
-For non-snapshots, the compression ratio achieved for the \fBused\fR space of this dataset, expressed as a multiplier.  The \fBused\fR property includes descendant datasets, and, for clones, does not include the space shared with the origin snapshot.  For snapshots, the \fBcompressratio\fR is the same as the \fBrefcompressratio\fR property.  Compression can be turned on by running: \fBzfs set compression=on \fIdataset\fR\fR. The default value is \fBoff\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcreation\fR\fR
-.ad
-.sp .6
-.RS 4n
-The time this dataset was created.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBclones\fR\fR
-.ad
-.sp .6
-.RS 4n
-For snapshots, this property is a comma-separated list of filesystems or
-volumes which are clones of this snapshot.  The clones' \fBorigin\fR property
-is this snapshot.  If the \fBclones\fR property is not empty, then this
-snapshot can not be destroyed (even with the \fB-r\fR or \fB-f\fR options).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBdefer_destroy\fR\fR
-.ad
-.sp .6
-.RS 4n
-This property is \fBon\fR if the snapshot has been marked for deferred destruction by using the \fBzfs destroy\fR \fB-d\fR command. Otherwise, the property is \fBoff\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfilesystem_count\fR
-.ad
-.sp .6
-.RS 4n
-The total number of filesystems and volumes that exist under this location in the
-dataset tree.  This value is only available when a \fBfilesystem_limit\fR has
-been set somewhere in the tree under which the dataset resides.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBlogicalreferenced\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space that is "logically" accessible by this dataset.  See
-the \fBreferenced\fR property.  The logical space ignores the effect of
-the \fBcompression\fR and \fBcopies\fR properties, giving a quantity
-closer to the amount of data that applications see.  However, it does
-include space consumed by metadata.
-.sp
-This property can also be referred to by its shortened column name,
-\fBlrefer\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBlogicalused\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space that is "logically" consumed by this dataset and all
-its descendents.  See the \fBused\fR property.  The logical space
-ignores the effect of the \fBcompression\fR and \fBcopies\fR properties,
-giving a quantity closer to the amount of data that applications see.
-However, it does include space consumed by metadata.
-.sp
-This property can also be referred to by its shortened column name,
-\fBlused\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBmounted\fR\fR
-.ad
-.sp .6
-.RS 4n
-For file systems, indicates whether the file system is currently mounted. This property can be either \fByes\fR or \fBno\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBorigin\fR\fR
-.ad
-.sp .6
-.RS 4n
-For cloned file systems or volumes, the snapshot from which the clone was created. See also the \fBclones\fR property.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBreferenced\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of data that is accessible by this dataset, which may or may not be shared with other datasets in the pool. When a snapshot or clone is created, it initially references the same amount of space as the file system or snapshot it was created from, since its contents are identical.
-.sp
-This property can also be referred to by its shortened column name, \fBrefer\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBrefcompressratio\fR\fR
-.ad
-.sp .6
-.RS 4n
-The compression ratio achieved for the \fBreferenced\fR space of this
-dataset, expressed as a multiplier.  See also the \fBcompressratio\fR
-property.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsnapshot_count\fR
-.ad
-.sp .6
-.RS 4n
-The total number of snapshots that exist under this location in the dataset tree.
-This value is only available when a \fBsnapshot_limit\fR has been set somewhere
-in the tree under which the dataset resides.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBtype\fR\fR
-.ad
-.sp .6
-.RS 4n
-The type of dataset: \fBfilesystem\fR, \fBvolume\fR, or \fBsnapshot\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBused\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space consumed by this dataset and all its descendents. This is the value that is checked against this dataset's quota and reservation. The space used does not include this dataset's reservation, but does take into account the reservations of any descendent datasets. The amount of space that a dataset consumes from its parent, as well as the amount of space that are freed if this dataset is recursively destroyed, is the greater of its space used and its reservation.
-.sp
-When snapshots (see the "Snapshots" section) are created, their space is initially shared between the snapshot and the file system, and possibly with previous snapshots. As the file system changes, space that was previously shared becomes unique to the snapshot, and counted in the snapshot's space used. Additionally, deleting snapshots can increase the amount of space unique to (and used by) other snapshots.
-.sp
-The amount of space used, available, or referenced does not take into account pending changes. Pending changes are generally accounted for within a few seconds. Committing a change to a disk using \fBfsync\fR(2) or \fBO_SYNC\fR does not necessarily guarantee that the space usage information is updated immediately.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBusedby*\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBusedby*\fR properties decompose the \fBused\fR properties into the various reasons that space is used. Specifically, \fBused\fR = \fBusedbychildren\fR + \fBusedbydataset\fR + \fBusedbyrefreservation\fR +, \fBusedbysnapshots\fR. These properties are only available for datasets created on \fBzpool\fR "version 13" pools.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBusedbychildren\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space used by children of this dataset, which would be freed if all the dataset's children were destroyed.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBusedbydataset\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space used by this dataset itself, which would be freed if the dataset were destroyed (after first removing any \fBrefreservation\fR and destroying any necessary snapshots or descendents).
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBusedbyrefreservation\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space used by a \fBrefreservation\fR set on this dataset, which would be freed if the \fBrefreservation\fR was removed.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBusedbysnapshots\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space consumed by snapshots of this dataset. In particular, it is the amount of space that would be freed if all of this dataset's snapshots were destroyed. Note that this is not simply the sum of the snapshots' \fBused\fR properties because space can be shared by multiple snapshots.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBuserused@\fR\fIuser\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space consumed by the specified user in this dataset. Space is charged to the owner of each file, as displayed by \fBls\fR \fB-l\fR. The amount of space charged is displayed by \fBdu\fR and \fBls\fR \fB-s\fR. See the \fBzfs userspace\fR subcommand for more information.
-.sp
-Unprivileged users can access only their own space usage. The root user, or a user who has been granted the \fBuserused\fR privilege with \fBzfs allow\fR, can access everyone's usage.
-.sp
-The \fBuserused@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms:
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fIPOSIX name\fR (for example, \fBjoe\fR)
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fIPOSIX numeric ID\fR (for example, \fB789\fR)
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fISID name\fR (for example, \fBjoe.smith@mydomain\fR)
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fISID numeric ID\fR (for example, \fBS-1-123-456-789\fR)
-.RE
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBuserrefs\fR\fR
-.ad
-.sp .6
-.RS 4n
-This property is set to the number of user holds on this snapshot. User holds are set by using the \fBzfs hold\fR command.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBgroupused@\fR\fIgroup\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of space consumed by the specified group in this dataset. Space is charged to the group of each file, as displayed by \fBls\fR \fB-l\fR. See the \fBuserused@\fR\fIuser\fR property for more information.
-.sp
-Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBgroupused\fR privilege with \fBzfs allow\fR, can access all groups' usage.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBvolblocksize\fR=\fIblocksize\fR\fR
-.ad
-.sp .6
-.RS 4n
-For volumes, specifies the block size of the volume. The \fBblocksize\fR cannot be changed once the volume has been written, so it should be set at volume creation time. The default \fBblocksize\fR for volumes is 8 Kbytes. Any power of 2 from 512 bytes to 128 Kbytes is valid.
-.sp
-This property can also be referred to by its shortened column name, \fBvolblock\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBwritten\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of \fBreferenced\fR space written to this dataset since the
-previous snapshot.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBwritten@\fR\fIsnapshot\fR\fR
-.ad
-.sp .6
-.RS 4n
-The amount of \fBreferenced\fR space written to this dataset since the
-specified snapshot.  This is the space that is referenced by this dataset
-but was not referenced by the specified snapshot.
-.sp
-The \fIsnapshot\fR may be specified as a short snapshot name (just the part
-after the \fB@\fR), in which case it will be interpreted as a snapshot in
-the same filesystem as this dataset.
-The \fIsnapshot\fR be a full snapshot name (\fIfilesystem\fR@\fIsnapshot\fR),
-which for clones may be a snapshot in the origin's filesystem (or the origin
-of the origin's filesystem, etc).
-.RE
-
-.sp
-.LP
-The following native properties can be used to change the behavior of a \fBZFS\fR dataset.
-.sp
-.ne 2
-.mk
-.na
-\fB\fBaclinherit\fR=\fBdiscard\fR | \fBnoallow\fR | \fBrestricted\fR | \fBpassthrough\fR | \fBpassthrough-x\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls how \fBACL\fR entries are inherited when files and directories are created. A file system with an \fBaclinherit\fR property of \fBdiscard\fR does not inherit any \fBACL\fR entries. A file system with an \fBaclinherit\fR property value of \fBnoallow\fR only inherits inheritable \fBACL\fR entries that specify "deny" permissions. The property value \fBrestricted\fR (the default) removes the \fBwrite_acl\fR and \fBwrite_owner\fR permissions when the \fBACL\fR entry is inherited. A file system with an \fBaclinherit\fR property value of \fBpassthrough\fR inherits all inheritable \fBACL\fR entries without any modifications made to the \fBACL\fR entries when they are inherited. A file system with an \fBaclinherit\fR property value of \fBpassthrough-x\fR has the same meaning as \fBpassthrough\fR, except that the \fBowner@\fR, \fBgroup@\fR, and \fBeveryone@\fR \fBACE\fRs inherit the execute permission only if the file creation mode also requests the execute bit.
-.sp
-When the property value is set to \fBpassthrough\fR, files are created with a mode determined by the inheritable \fBACE\fRs. If no inheritable \fBACE\fRs exist that affect the mode, then the mode is set in accordance to the requested mode from the application.
-.sp
-The \fBaclinherit\fR property does not apply to Posix ACLs.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBacltype\fR=\fBnoacl\fR | \fBposixacl\fR \fR
-.ad
-.sp .6
-.RS 4n
-Controls whether ACLs are enabled and if so what type of ACL to use.  When
-a file system has the \fBacltype\fR property set to \fBnoacl\fR (the default)
-then ACLs are disabled.  Setting the \fBacltype\fR property to \fBposixacl\fR
-indicates Posix ACLs should be used.  Posix ACLs are specific to Linux and
-are not functional on other platforms.  Posix ACLs are stored as an xattr and
-therefore will not overwrite any existing ZFS/NFSv4 ACLs which may be set.
-Currently only \fBposixacls\fR are supported on Linux.
-.sp
-To obtain the best performance when setting \fBposixacl\fR users are strongly
-encouraged to set the \fBxattr=sa\fR property.  This will result in the
-Posix ACL being stored more efficiently on disk.  But as a consequence of this
-all new xattrs will only be accessible from ZFS implementations which support
-the \fBxattr=sa\fR property.  See the \fBxattr\fR property for more details.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBatime\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the access time for files is updated when they are read. Turning this property off avoids producing write traffic when reading files and can result in significant performance gains, though it might confuse mailers and other similar utilities. The default value is \fBon\fR.  See also \fBrelatime\fR below.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcanmount\fR=\fBon\fR | \fBoff\fR | \fBnoauto\fR\fR
-.ad
-.sp .6
-.RS 4n
-If this property is set to \fBoff\fR, the file system cannot be mounted, and is ignored by \fBzfs mount -a\fR. Setting this property to \fBoff\fR is similar to setting the \fBmountpoint\fR property to \fBnone\fR, except that the dataset still has a normal \fBmountpoint\fR property, which can be inherited. Setting this property to \fBoff\fR allows datasets to be used solely as a mechanism to inherit properties. One example of setting \fBcanmount=\fR\fBoff\fR is to have two datasets with the same \fBmountpoint\fR, so that the children of both datasets appear in the same directory, but might have different inherited characteristics.
-.sp
-When the \fBnoauto\fR option is set, a dataset can only be mounted and unmounted explicitly. The dataset is not mounted automatically when the dataset is created or imported, nor is it mounted by the \fBzfs mount -a\fR command or unmounted by the \fBzfs unmount -a\fR command.
-.sp
-This property is not inherited.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBchecksum\fR=\fBon\fR | \fBoff\fR | \fBfletcher2,\fR| \fBfletcher4\fR | \fBsha256\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the checksum used to verify data integrity. The default value is \fBon\fR, which automatically selects an appropriate algorithm (currently, \fBfletcher4\fR, but this may change in future releases). The value \fBoff\fR disables integrity checking on user data. Disabling checksums is \fBNOT\fR a recommended practice.
-.sp
-Changing this property affects only newly-written data.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcompression\fR=\fBon\fR | \fBoff\fR | \fBlzjb\fR | \fBlz4\fR |
-\fBgzip\fR | \fBgzip-\fR\fIN\fR | \fBzle\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the compression algorithm used for this dataset.
-.sp
-Setting compression to \fBon\fR indicates that the current default
-compression algorithm should be used.  The default balances compression
-and decompression speed, with compression ratio and is expected to
-work well on a wide variety of workloads.  Unlike all other settings for
-this property, \fBon\fR does not select a fixed compression type.  As
-new compression algorithms are added to ZFS and enabled on a pool, the
-default compression algorithm may change.  The current default compression
-algorthm is either \fBlzjb\fR or, if the \fBlz4_compress\fR feature is
-enabled, \fBlz4\fR.
-.sp
-The \fBlzjb\fR compression algorithm is optimized for performance while
-providing decent data compression.
-.sp
-The \fBlz4\fR compression algorithm is a high-performance replacement
-for the \fBlzjb\fR algorithm. It features significantly faster
-compression and decompression, as well as a moderately higher
-compression ratio than \fBlzjb\fR, but can only be used on pools with
-the \fBlz4_compress\fR feature set to \fIenabled\fR. See
-\fBzpool-features\fR(5) for details on ZFS feature flags and the
-\fBlz4_compress\fR feature.
-.sp
-The \fBgzip\fR compression algorithm uses the same compression as
-the \fBgzip\fR(1) command. You can specify the \fBgzip\fR level by using the
-value \fBgzip-\fR\fIN\fR where \fIN\fR is an integer from 1 (fastest) to 9
-(best compression ratio). Currently, \fBgzip\fR is equivalent to \fBgzip-6\fR
-(which is also the default for \fBgzip\fR(1)). The \fBzle\fR compression
-algorithm compresses runs of zeros.
-.sp
-This property can also be referred to by its shortened column name
-\fBcompress\fR. Changing this property affects only newly-written data.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcopies\fR=\fB1\fR | \fB2\fR | \fB3\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the number of copies of data stored for this dataset. These copies are in addition to any redundancy provided by the pool, for example, mirroring or RAID-Z. The copies are stored on different disks, if possible. The space used by multiple copies is charged to the associated file and dataset, changing the \fBused\fR property and counting against quotas and reservations.
-.sp
-Changing this property only affects newly-written data. Therefore, set this property at file system creation time by using the \fB-o\fR \fBcopies=\fR\fIN\fR option.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBdedup\fR=\fBon\fR | \fBoff\fR | \fBverify\fR | \fBsha256\fR[,\fBverify\fR]\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether deduplication is in effect for a dataset. The default value is \fBoff\fR. The default checksum used for deduplication is \fBsha256\fR (subject to change). When \fBdedup\fR is enabled, the \fBdedup\fR checksum algorithm overrides the \fBchecksum\fR property. Setting the value to \fBverify\fR is equivalent to specifying \fBsha256,verify\fR.
-.sp
-If the property is set to \fBverify\fR, then, whenever two blocks have the same signature, ZFS will do a byte-for-byte comparison with the existing block to ensure that the contents are identical.
-.sp
-Unless necessary, deduplication should NOT be enabled on a system. See \fBDeduplication\fR above.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBdevices\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether device nodes can be opened on this file system. The default value is \fBon\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBexec\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether processes can be executed from within this file system. The default value is \fBon\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBmlslabel\fR=\fIlabel\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-The \fBmlslabel\fR property is a sensitivity label that determines if a dataset  can be mounted in a zone on a system with Trusted Extensions enabled. If the labeled dataset matches the labeled zone, the dataset can be mounted  and accessed from the labeled zone.
-.sp
-When the \fBmlslabel\fR property is not set, the default value is \fBnone\fR. Setting the  \fBmlslabel\fR property to \fBnone\fR is equivalent to removing the property.
-.sp
-The \fBmlslabel\fR property can be modified only when Trusted Extensions is enabled and only with appropriate privilege. Rights to modify it cannot be delegated. When changing a label to a higher label or setting the initial dataset label, the \fB{PRIV_FILE_UPGRADE_SL}\fR privilege is required. When changing a label to a lower label or the default (\fBnone\fR), the \fB{PRIV_FILE_DOWNGRADE_SL}\fR privilege is required. Changing the dataset to labels other than the default can be done only when the dataset is not mounted. When a dataset with the default label is mounted into a labeled-zone, the mount operation automatically sets the \fBmlslabel\fR property to the label of that zone.
-.sp
-When Trusted Extensions is \fBnot\fR enabled, only datasets with the default label (\fBnone\fR) can be mounted.
-.sp
-Zones are a Solaris feature and are not relevant on Linux.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfilesystem_limit\fR=\fIcount\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-Limits the number of filesystems and volumes that can exist under this point in
-the dataset tree.  The limit is not enforced if the user is allowed to change
-the limit. Setting a filesystem_limit on a descendent of a filesystem that
-already has a filesystem_limit does not override the ancestor's filesystem_limit,
-but rather imposes an additional limit. This feature must be enabled to be used
-(see \fBzpool-features\fR(5)).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBmountpoint\fR=\fIpath\fR | \fBnone\fR | \fBlegacy\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the mount point used for this file system. See the "Mount Points" section for more information on how this property is used. 
-.sp
-When the \fBmountpoint\fR property is changed for a file system, the file system and any children that inherit the mount point are unmounted. If the new value is \fBlegacy\fR, then they remain unmounted. Otherwise, they are automatically remounted in the new location if the property was previously \fBlegacy\fR or \fBnone\fR, or if they were mounted before the property was changed. In addition, any shared file systems are unshared and shared in the new location.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBnbmand\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the file system should be mounted with \fBnbmand\fR (Non Blocking mandatory locks). This is used for \fBCIFS\fR clients. Changes to this property only take effect when the file system is umounted and remounted. See \fBmount\fR(8) for more information on \fBnbmand\fR mounts.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBprimarycache\fR=\fBall\fR | \fBnone\fR | \fBmetadata\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls what is cached in the primary cache (ARC). If this property is set to \fBall\fR, then both user data and metadata is cached. If this property is set to \fBnone\fR, then neither user data nor metadata is cached. If this property is set to \fBmetadata\fR, then only metadata is cached. The default value is \fBall\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBquota\fR=\fIsize\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-Limits the amount of space a dataset and its descendents can consume. This property enforces a hard limit on the amount of space used. This includes all space consumed by descendents, including file systems and snapshots. Setting a quota on a descendent of a dataset that already has a quota does not override the ancestor's quota, but rather imposes an additional limit.
-.sp
-Quotas cannot be set on volumes, as the \fBvolsize\fR property acts as an implicit quota.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsnapshot_limit\fR=\fIcount\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-Limits the number of snapshots that can be created on a dataset and its
-descendents. Setting a snapshot_limit on a descendent of a dataset that already
-has a snapshot_limit does not override the ancestor's snapshot_limit, but
-rather imposes an additional limit. The limit is not enforced if the user is
-allowed to change the limit. For example, this means that recursive snapshots
-taken from the global zone are counted against each delegated dataset within
-a zone. This feature must be enabled to be used (see \fBzpool-features\fR(5)).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBuserquota@\fR\fIuser\fR=\fIsize\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-Limits the amount of space consumed by the specified user. Similar to the \fBrefquota\fR property, the \fBuserquota\fR space calculation does not include space that is used by descendent datasets, such as snapshots and clones. User space consumption is identified by the \fBuserspace@\fR\fIuser\fR property.
-.sp
-Enforcement of user quotas may be delayed by several seconds. This delay means that a user might exceed their quota before the system notices that they are over quota and begins to refuse additional writes with the \fBEDQUOT\fR error message . See the \fBzfs userspace\fR subcommand for more information.
-.sp
-Unprivileged users can only access their own groups' space usage. The root user, or a user who has been granted the \fBuserquota\fR privilege with \fBzfs allow\fR, can get and set everyone's quota.
-.sp
-This property is not available on volumes, on file systems before version 4, or on pools before version 15. The \fBuserquota@\fR... properties are not displayed by \fBzfs get all\fR. The user's name must be appended after the \fB@\fR symbol, using one of the following forms:
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fIPOSIX name\fR (for example, \fBjoe\fR)
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fIPOSIX numeric ID\fR (for example, \fB789\fR)
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fISID name\fR (for example, \fBjoe.smith@mydomain\fR)
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-\fISID numeric ID\fR (for example, \fBS-1-123-456-789\fR)
-.RE
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBgroupquota@\fR\fIgroup\fR=\fIsize\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-Limits the amount of space consumed by the specified group. Group space consumption is identified by the \fBuserquota@\fR\fIuser\fR property.
-.sp
-Unprivileged users can access only their own groups' space usage. The root user, or a user who has been granted the \fBgroupquota\fR privilege with \fBzfs allow\fR, can get and set all groups' quotas.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBreadonly\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether this dataset can be modified. The default value is \fBoff\fR.
-.sp
-This property can also be referred to by its shortened column name, \fBrdonly\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBrecordsize\fR=\fIsize\fR\fR
-.ad
-.sp .6
-.RS 4n
-Specifies a suggested block size for files in the file system. This property is designed solely for use with database workloads that access files in fixed-size records. \fBZFS\fR automatically tunes block sizes according to internal algorithms optimized for typical access patterns. 
-.sp
-For databases that create very large files but access them in small random chunks, these algorithms may be suboptimal. Specifying a \fBrecordsize\fR greater than or equal to the record size of the database can result in significant performance gains. Use of this property for general purpose file systems is strongly discouraged, and may adversely affect performance.
-.sp
-The size specified must be a power of two greater than or equal to 512 and less than or equal to 128 Kbytes.
-.sp
-Changing the file system's \fBrecordsize\fR affects only files created afterward; existing files are unaffected.
-.sp
-This property can also be referred to by its shortened column name, \fBrecsize\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBredundant_metadata\fR=\fBall\fR | \fBmost\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls what types of metadata are stored redundantly.  ZFS stores an
-extra copy of metadata, so that if a single block is corrupted, the
-amount of user data lost is limited.  This extra copy is in addition to
-any redundancy provided at the pool level (e.g. by mirroring or RAID-Z),
-and is in addition to an extra copy specified by the \fBcopies\fR
-property (up to a total of 3 copies).  For example if the pool is
-mirrored, \fBcopies\fR=2, and \fBredundant_metadata\fR=most, then ZFS
-stores 6 copies of most metadata, and 4 copies of data and some
-metadata.
-.sp
-When set to \fBall\fR, ZFS stores an extra copy of all metadata.  If a
-single on-disk block is corrupt, at worst a single block of user data
-(which is \fBrecordsize\fR bytes long) can be lost.
-.sp
-When set to \fBmost\fR, ZFS stores an extra copy of most types of
-metadata.  This can improve performance of random writes, because less
-metadata must be written.  In practice, at worst about 100 blocks (of
-\fBrecordsize\fR bytes each) of user data can be lost if a single
-on-disk block is corrupt.  The exact behavior of which metadata blocks
-are stored redundantly may change in future releases.
-.sp
-The default value is \fBall\fR.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBrefquota\fR=\fIsize\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-Limits the amount of space a dataset can consume. This property enforces a hard limit on the amount of space used. This hard limit does not include space used by descendents, including file systems and snapshots.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBrefreservation\fR=\fIsize\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-The minimum amount of space guaranteed to a dataset, not including its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by \fBrefreservation\fR. The \fBrefreservation\fR reservation is accounted for in the parent datasets' space used, and counts against the parent datasets' quotas and reservations.
-.sp
-If \fBrefreservation\fR is set, a snapshot is only allowed if there is enough free pool space outside of this reservation to accommodate the current number of "referenced" bytes in the dataset.
-.sp
-This property can also be referred to by its shortened column name, \fBrefreserv\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBrelatime\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the manner in which the access time is updated when \fBatime=on\fR is set.  Turning this property \fBon\fR causes the access time to be updated relative to the modify or change time.  Access time is only updated if the previous access time was earlier than the current modify or change time or if the existing access time hasn't been updated within the past 24 hours.  The default value is \fBoff\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBreservation\fR=\fIsize\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-The minimum amount of space guaranteed to a dataset and its descendents. When the amount of space used is below this value, the dataset is treated as if it were taking up the amount of space specified by its reservation. Reservations are accounted for in the parent datasets' space used, and count against the parent datasets' quotas and reservations.
-.sp
-This property can also be referred to by its shortened column name, \fBreserv\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsecondarycache\fR=\fBall\fR | \fBnone\fR | \fBmetadata\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls what is cached in the secondary cache (L2ARC). If this property is set to \fBall\fR, then both user data and metadata is cached. If this property is set to \fBnone\fR, then neither user data nor metadata is cached. If this property is set to \fBmetadata\fR, then only metadata is cached. The default value is \fBall\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsetuid\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the set-\fBUID\fR bit is respected for the file system. The default value is \fBon\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsharesmb\fR=\fBon\fR | \fBoff\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the file system is shared by using \fBSamba USERSHARES\fR, and what options are to be used. Otherwise, the file system is automatically shared and unshared with the \fBzfs share\fR and \fBzfs unshare\fR commands. If the property is set to \fBon\fR, the \fBnet\fR(8) command is invoked to create a \fBUSERSHARE\fR.
-.sp
-Because \fBSMB\fR shares requires a resource name, a unique resource name is constructed from the dataset name. The constructed name is a copy of the dataset name except that the characters in the dataset name, which would be illegal in the resource name, are replaced with underscore (\fB_\fR) characters. The ZFS On Linux driver does not (yet) support additional options which might be available in the Solaris version.
-.sp
-If the \fBsharesmb\fR property is set to \fBoff\fR, the file systems are unshared.
-.sp
-In Linux, the share is created with the ACL (Access Control List) "Everyone:F" ("F" stands for "full permissions", ie. read and write permissions) and no guest access (which means samba must be able to authenticate a real user, system passwd/shadow, ldap or smbpasswd based) by default. This means that any additional access control (dissalow specific user specific access etc) must be done on the underlaying filesystem.
-.sp
-.in +2
-Example to mount a SMB filesystem shared through ZFS (share/tmp):
-.mk
-Note that a user and his/her password \fBmust\fR be given!
-.sp
-.in +2
-smbmount //127.0.0.1/share_tmp /mnt/tmp -o user=workgroup/turbo,password=obrut,uid=1000
-.in -2
-.in -2
-.sp
-.ne 2
-.mk
-.na
-\fBMinimal /etc/samba/smb.conf configuration\fR
-.sp
-.in +2
-* Samba will need to listen to 'localhost' (127.0.0.1) for the zfs utilities to communitate with samba.  This is the default behavior for most Linux distributions.
-.sp
-* Samba must be able to authenticate a user. This can be done in a number of ways, depending on if using the system password file, LDAP or the Samba specific smbpasswd file. How to do this is outside the scope of this manual. Please refer to the smb.conf(5) manpage for more information.
-.sp
-* See the \fBUSERSHARE\fR section of the \fBsmb.conf\fR(5) man page for all configuration options in case you need to modify any options to the share afterwards. Do note that any changes done with the 'net' command will be undone if the share is every unshared (such as at a reboot etc). In the future, ZoL will be able to set specific options directly using sharesmb=<option>.
-.sp
-.in -2
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsharenfs\fR=\fBon\fR | \fBoff\fR | \fIopts\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the file system is shared via \fBNFS\fR, and what options are used. A file system with a \fBsharenfs\fR property of \fBoff\fR is managed with the \fBexportfs\fR(8) command and entries in \fB/etc/exports\fR file. Otherwise, the file system is automatically shared and unshared with the \fBzfs share\fR and \fBzfs unshare\fR commands. If the property is set to \fBon\fR, the dataset is shared using the \fBexportfs\fR(8) command in the following manner (see \fBexportfs\fR(8) for the meaning of the different options):
-.sp
-.in +4
-.nf
-/usr/sbin/exportfs -i -o sec=sys,rw,no_subtree_check,no_root_squash,mountpoint *:<mountpoint of dataset>
-.fi
-.in -4
-.sp
-Otherwise, the \fBexportfs\fR(8) command is invoked with options equivalent to the contents of this property.
-.sp
-When the \fBsharenfs\fR property is changed for a dataset, the dataset and any children inheriting the property are re-shared with the new options, only if the property was previously \fBoff\fR, or if they were shared before the property was changed. If the new property is \fBoff\fR, the file systems are unshared.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBlogbias\fR = \fBlatency\fR | \fBthroughput\fR\fR
-.ad
-.sp .6
-.RS 4n
-Provide a hint to ZFS about handling of synchronous requests in this dataset. If \fBlogbias\fR is set to \fBlatency\fR (the default), ZFS will use pool log devices (if configured) to handle the requests at low latency. If \fBlogbias\fR is set to \fBthroughput\fR, ZFS will not use configured pool log devices. ZFS will instead optimize synchronous operations for global pool throughput and efficient use of resources.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsnapdev\fR=\fBhidden\fR | \fBvisible\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the snapshots devices of zvol's are hidden or visible. The default value is \fBhidden\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsnapdir\fR=\fBhidden\fR | \fBvisible\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the \fB\&.zfs\fR directory is hidden or visible in the root of the file system as discussed in the "Snapshots" section. The default value is \fBhidden\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsync\fR=\fBstandard\fR | \fBalways\fR | \fBdisabled\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the behavior of synchronous requests (e.g. fsync, O_DSYNC).
-\fBstandard\fR is the POSIX specified behavior of ensuring all synchronous
-requests are written to stable storage and all devices are flushed to ensure
-data is not cached by device controllers (this is the default). \fBalways\fR
-causes every file system transaction to be written and flushed before its
-system call returns. This has a large performance penalty. \fBdisabled\fR
-disables synchronous requests. File system transactions are only committed to
-stable storage periodically. This option will give the highest performance.
-However, it is very dangerous as ZFS would be ignoring the synchronous
-transaction demands of applications such as databases or NFS.  Administrators
-should only use this option when the risks are understood.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBversion\fR=\fB1\fR | \fB2\fR | \fBcurrent\fR\fR
-.ad
-.sp .6
-.RS 4n
-The on-disk version of this file system, which is independent of the pool version. This property can only be set to later supported versions. See the \fBzfs upgrade\fR command.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBvolsize\fR=\fIsize\fR\fR
-.ad
-.sp .6
-.RS 4n
-For volumes, specifies the logical size of the volume. By default, creating a volume establishes a reservation of equal size. For storage pools with a version number of 9 or higher, a \fBrefreservation\fR is set instead. Any changes to \fBvolsize\fR are reflected in an equivalent change to the reservation (or \fBrefreservation\fR). The \fBvolsize\fR can only be set to a multiple of \fBvolblocksize\fR, and cannot be zero.
-.sp
-The reservation is kept equal to the volume's logical size to prevent unexpected behavior for consumers. Without the reservation, the volume could run out of space, resulting in undefined behavior or data corruption, depending on how the volume is used. These effects can also occur when the volume size is changed while it is in use (particularly when shrinking the size). Extreme care should be used when adjusting the volume size.
-.sp
-Though not recommended, a "sparse volume" (also known as "thin provisioning") can be created by specifying the \fB-s\fR option to the \fBzfs create -V\fR command, or by changing the reservation after the volume has been created. A "sparse volume" is a volume where the reservation is less then the volume size. Consequently, writes to a sparse volume can fail with \fBENOSPC\fR when the pool is low on space. For a sparse volume, changes to \fBvolsize\fR are not reflected in the reservation.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBvscan\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether regular files should be scanned for viruses when a file is opened and closed. In addition to enabling this property, the virus scan service must also be enabled for virus scanning to occur. The default value is \fBoff\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBxattr\fR=\fBon\fR | \fBoff\fR | \fBsa\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether extended attributes are enabled for this file system.  Two
-styles of extended attributes are supported either directory based or system
-attribute based.
-.sp
-The default value of \fBon\fR enables directory based extended attributes.
-This style of xattr imposes no practical limit on either the size or number of
-xattrs which may be set on a file.  Although under Linux the \fBgetxattr\fR(2)
-and \fBsetxattr\fR(2) system calls limit the maximum xattr size to 64K.  This
-is the most compatible style of xattr and it is supported by the majority of
-ZFS implementations.
-.sp
-System attribute based xattrs may be enabled by setting the value to \fBsa\fR.
-The key advantage of this type of xattr is improved performance.  Storing
-xattrs as system attributes significantly decreases the amount of disk IO
-required.  Up to 64K of xattr data may be stored per file in the space reserved
-for system attributes.  If there is not enough space available for an xattr then
-it will be automatically written as a directory based xattr.  System attribute
-based xattrs are not accessible on platforms which do not support the
-\fBxattr=sa\fR feature.
-.sp
-The use of system attribute based xattrs is strongly encouraged for users of
-SELinux or Posix ACLs.  Both of these features heavily rely of xattrs and
-benefit significantly from the reduced xattr access time.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzoned\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether the dataset is managed from a non-global zone. Zones are a Solaris feature and are not relevant on Linux. The default value is \fBoff\fR.
-.RE
-
-.sp
-.LP
-The following three properties cannot be changed after the file system is created, and therefore, should be set when the file system is created. If the properties are not set with the \fBzfs create\fR or \fBzpool create\fR commands, these properties are inherited from the parent dataset. If the parent dataset lacks these properties due to having been created prior to these features being supported, the new file system will have the default values for these properties.
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcasesensitivity\fR=\fBsensitive\fR | \fBinsensitive\fR | \fBmixed\fR\fR
-.ad
-.sp .6
-.RS 4n
-Indicates whether the file name matching algorithm used by the file system should be case-sensitive, case-insensitive, or allow a combination of both styles of matching. The default value for the \fBcasesensitivity\fR property is \fBsensitive\fR. Traditionally, UNIX and POSIX file systems have case-sensitive file names.
-.sp
-The \fBmixed\fR value for the \fBcasesensitivity\fR property indicates that the file system can support requests for both case-sensitive and case-insensitive matching behavior. Currently, case-insensitive matching behavior on a file system that supports mixed behavior is limited to the Solaris CIFS server product. For more information about the \fBmixed\fR value behavior, see the \fISolaris ZFS Administration Guide\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBnormalization\fR = \fBnone\fR | \fBformC\fR | \fBformD\fR | \fBformKC\fR | \fBformKD\fR\fR
-.ad
-.sp .6
-.RS 4n
-Indicates whether the file system should perform a \fBunicode\fR normalization of file names whenever two file names are compared, and which normalization algorithm should be used. File names are always stored unmodified, names are normalized as part of any comparison process. If this property is set to a legal value other than \fBnone\fR, and the \fButf8only\fR property was left unspecified, the \fButf8only\fR property is automatically set to \fBon\fR. The default value of the \fBnormalization\fR property is \fBnone\fR. This property cannot be changed after the file system is created.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fButf8only\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Indicates whether the file system should reject file names that include characters that are not present in the \fBUTF-8\fR character code set. If this property is explicitly set to \fBoff\fR, the normalization property must either not be explicitly set or be set to \fBnone\fR. The default value for the \fButf8only\fR property is \fBoff\fR. This property cannot be changed after the file system is created.
-.RE
-
-.sp
-.LP
-The \fBcasesensitivity\fR, \fBnormalization\fR, and \fButf8only\fR properties are also new permissions that can be assigned to non-privileged users by using the \fBZFS\fR delegated administration feature.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcontext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
-.ad
-.sp .6
-.RS 4n
-This flag sets the SELinux context for all files in the filesytem under the mountpoint for that filesystem.  See \fBselinux\fR(8) for more information.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfscontext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
-.ad
-.sp .6
-.RS 4n
-This flag sets the SELinux context for the filesytem being mounted.  See \fBselinux\fR(8) for more information.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBdefntext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
-.ad
-.sp .6
-.RS 4n
-This flag sets the SELinux context for unlabeled files.  See \fBselinux\fR(8) for more information.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBrootcontext\fR=\fBSELinux_User:SElinux_Role:Selinux_Type:Sensitivity_Level\fR\fR
-.ad
-.sp .6
-.RS 4n
-This flag sets the SELinux context for the root inode of the filesystem.  See \fBselinux\fR(8) for more information.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBoverlay\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Allow mounting on a busy directory or a directory which already contains files/directories. This is the default mount behavior for Linux filesystems.  However, for consistency with ZFS on other platforms overlay mounts are disabled by default.  Set \fBoverlay=on\fR to enable overlay mounts.
-.RE
-
-.SS "Temporary Mount Point Properties"
-.LP
-When a file system is mounted, either through \fBmount\fR(8) for legacy mounts or the \fBzfs mount\fR command for normal file systems, its mount options are set according to its properties. The correlation between properties and mount options is as follows:
-.sp
-.in +2
-.nf
-    PROPERTY                MOUNT OPTION
-     devices                 devices/nodevices
-     exec                    exec/noexec
-     readonly                ro/rw
-     setuid                  setuid/nosetuid
-     xattr                   xattr/noxattr
-     atime                   atime/noatime
-     relatime                relatime/norelatime
-     nbmand                  nbmand/nonbmand
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-In addition, these options can be set on a per-mount basis using the \fB-o\fR option, without affecting the property that is stored on disk. The values specified on the command line override the values stored in the dataset. The \fB-nosuid\fR option is an alias for \fBnodevices,nosetuid\fR. These properties are reported as "temporary" by the \fBzfs get\fR command. If the properties are changed while the dataset is mounted, the new setting overrides any temporary settings.
-.SS "User Properties"
-.LP
-In addition to the standard native properties, \fBZFS\fR supports arbitrary user properties. User properties have no effect on \fBZFS\fR behavior, but applications or administrators can use them to annotate datasets (file systems, volumes, and snapshots).
-.sp
-.LP
-User property names must contain a colon (\fB:\fR) character to distinguish them from native properties. They may contain lowercase letters, numbers, and the following punctuation characters: colon (\fB:\fR), dash (\fB-\fR), period (\fB\&.\fR), and underscore (\fB_\fR). The expected convention is that the property name is divided into two portions such as \fImodule\fR\fB:\fR\fIproperty\fR, but this namespace is not enforced by \fBZFS\fR. User property names can be at most 256 characters, and cannot begin with a dash (\fB-\fR).
-.sp
-.LP
-When making programmatic use of user properties, it is strongly suggested to use a reversed \fBDNS\fR domain name for the \fImodule\fR component of property names to reduce the chance that two independently-developed packages use the same property name for different purposes. For example, property names beginning with \fBcom.sun\fR. are reserved for use by Oracle Corporation (which acquired Sun Microsystems).
-.sp
-.LP
-The values of user properties are arbitrary strings, are always inherited, and are never validated. All of the commands that operate on properties (\fBzfs list\fR, \fBzfs get\fR, \fBzfs set\fR, and so forth) can be used to manipulate both native properties and user properties. Use the \fBzfs inherit\fR command to clear a user property . If the property is not defined in any parent dataset, it is removed entirely. Property values are limited to 1024 characters.
-.SS "ZFS Volumes as Swap"
-.LP
-\fBZFS\fR volumes may be used as Linux swap devices.  After creating the volume
-with the \fBzfs create\fR command set up and enable the swap area using the
-\fBmkswap\fR(8) and \fBswapon\fR(8) commands.  Do not swap to a file on a
-\fBZFS\fR file system. A \fBZFS\fR swap file configuration is not supported.
-.SH SUBCOMMANDS
-.LP
-All subcommands that modify state are logged persistently to the pool in their original form.
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs ?\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays a help message.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs create\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates a new \fBZFS\fR file system. The file system is automatically mounted according to the \fBmountpoint\fR property inherited from the parent.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the specified property as if the command \fBzfs set\fR \fIproperty\fR=\fIvalue\fR was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs create\fR [\fB-ps\fR] [\fB-b\fR \fIblocksize\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fB-V\fR \fIsize\fR \fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates a volume of the given size. The volume is exported as a block device in \fB/dev/zvol/\fR\fIpath\fR, where \fIpath\fR is the name of the volume in the \fBZFS\fR namespace. The size represents the logical size as exported by the device. By default, a reservation of equal size is created.
-.sp
-\fIsize\fR is automatically rounded up to the nearest 128 Kbytes to ensure that the volume has an integral number of blocks regardless of \fIblocksize\fR.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. Any property specified on the command line using the \fB-o\fR option is ignored. If the target filesystem already exists, the operation completes successfully.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-s\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates a sparse volume with no reservation. See \fBvolsize\fR in the Native Properties section for more information about sparse volumes.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the specified property as if the \fBzfs set\fR \fIproperty\fR=\fIvalue\fR command was invoked at the same time the dataset was created. Any editable \fBZFS\fR property can also be set at creation time. Multiple \fB-o\fR options can be specified. An error results if the same property is specified in multiple \fB-o\fR options.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-b\fR \fIblocksize\fR\fR
-.ad
-.sp .6
-.RS 4n
-Equivalent to \fB-o\fR \fBvolblocksize\fR=\fIblocksize\fR. If this option is specified in conjunction with \fB-o\fR \fBvolblocksize\fR, the resulting behavior is undefined.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzfs destroy\fR [\fB-fnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR
-.ad
-.sp .6
-.RS 4n
-Destroys the given dataset. By default, the command unshares any file systems that are currently shared, unmounts any file systems that are currently mounted, and refuses to destroy a dataset that has active dependents (children or clones).
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively destroy all children.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively destroy all dependents, including cloned file systems outside the target hierarchy.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-Force an unmount of any file systems using the \fBunmount -f\fR command. This option has no effect on non-file systems or unmounted file systems.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-n\fR\fR
-.ad
-.sp .6
-.RS 4n
-Do a dry-run ("No-op") deletion.  No data will be deleted.  This is
-useful in conjunction with the \fB-v\fR or \fB-p\fR flags to determine what
-data would be deleted.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print machine-parsable verbose information about the deleted data.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print verbose information about the deleted data.
-.RE
-.sp
-
-Extreme care should be taken when applying either the \fB-r\fR or the \fB-R\fR options, as they can destroy large portions of a pool and cause unexpected behavior for mounted file systems in use.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzfs destroy\fR [\fB-dnpRrv\fR] \fIfilesystem\fR|\fIvolume\fR@\fIsnap\fR[%\fIsnap\fR][,...]
-.ad
-.sp .6
-.RS 4n
-The given snapshots are destroyed immediately if and only if the \fBzfs destroy\fR command without the \fB-d\fR option would have destroyed it. Such immediate destruction would occur, for example, if the snapshot had no clones and the user-initiated reference count were zero.
-.sp
-If a snapshot does not qualify for immediate destruction, it is marked for deferred destruction. In this state, it exists as a usable, visible snapshot until both of the preconditions listed above are met, at which point it is destroyed.
-.sp
-An inclusive range of snapshots may be specified by separating the
-first and last snapshots with a percent sign.
-The first and/or last snapshots may be left blank, in which case the
-filesystem's oldest or newest snapshot will be implied.
-.sp
-Multiple snapshots
-(or ranges of snapshots) of the same filesystem or volume may be specified
-in a comma-separated list of snapshots.
-Only the snapshot's short name (the
-part after the \fB@\fR) should be specified when using a range or
-comma-separated list to identify multiple snapshots.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR\fR
-.ad
-.sp .6
-.RS 4n
-Defer snapshot deletion.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Destroy (or mark for deferred destruction) all snapshots with this name in descendent file systems.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively destroy all clones of these snapshots, including the clones,
-snapshots, and children.  If this flag is specified, the \fB-d\fR flag will
-have no effect.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-n\fR\fR
-.ad
-.sp .6
-.RS 4n
-Do a dry-run ("No-op") deletion.  No data will be deleted.  This is
-useful in conjunction with the \fB-v\fR or \fB-p\fR flags to determine what
-data would be deleted.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print machine-parsable verbose information about the deleted data.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print verbose information about the deleted data.
-.RE
-
-.sp
-Extreme care should be taken when applying either the \fB-r\fR or the \fB-R\fR
-options, as they can destroy large portions of a pool and cause unexpected
-behavior for mounted file systems in use.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzfs destroy\fR \fIfilesystem\fR|\fIvolume\fR#\fIbookmark\fR
-.ad
-.sp .6
-.RS 4n
-The given bookmark is destroyed.
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBzfs snapshot\fR [\fB-r\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIfilesystem@snapname\fR|\fIvolume@snapname\fR\fR ...
-.ad
-.sp .6
-.RS 4n
-Creates snapshots with the given names. All previous modifications by successful system calls to the file system are part of the snapshots. Snapshots are taken atomically, so that all snapshots correspond to the same moment in time. See the "Snapshots" section for details.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively create snapshots of all descendent datasets.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the specified property; see \fBzfs create\fR for details.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs rollback\fR [\fB-rRf\fR] \fIsnapshot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Roll back the given dataset to a previous snapshot. When a dataset is rolled back, all data that has changed since the snapshot is discarded, and the dataset reverts to the state at the time of the snapshot. By default, the command refuses to roll back to a snapshot other than the most recent one. In order to do so, all intermediate snapshots and bookmarks must be destroyed by specifying the \fB-r\fR option.
-.sp
-The \fB-rR\fR options do not recursively destroy the child snapshots of a recursive snapshot. Only direct snapshots of the specified filesystem are destroyed by either of these options. To completely roll back a recursive snapshot, you must rollback the individual child snapshots.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Destroy any snapshots and bookmarks more recent than the one specified.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively destroy any more recent snapshots and bookmarks, as well as any clones of those snapshots.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-Used with the \fB-R\fR option to force an unmount of any clone file systems that are to be destroyed.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs clone\fR [\fB-p\fR] [\fB-o\fR \fIproperty\fR=\fIvalue\fR] ... \fIsnapshot\fR \fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates a clone of the given snapshot. See the "Clones" section for details. The target dataset can be located anywhere in the \fBZFS\fR hierarchy, and is created as the same type as the original.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates all the non-existing parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent. If the target filesystem or volume already exists, the operation completes successfully.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty\fR=\fIvalue\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the specified property; see \fBzfs create\fR for details.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs promote\fR \fIclone-filesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Promotes a clone file system to no longer be dependent on its "origin" snapshot. This makes it possible to destroy the file system that the clone was created from. The clone parent-child dependency relationship is reversed, so that the origin file system becomes a clone of the specified file system. 
-.sp
-The snapshot that was cloned, and any snapshots previous to this snapshot, are now owned by the promoted clone. The space they use moves from the origin file system to the promoted clone, so enough space must be available to accommodate these snapshots. No new space is consumed by this operation, but the space accounting is adjusted. The promoted clone must not have any conflicting snapshot names of its own. The \fBrename\fR subcommand can be used to rename any conflicting snapshots.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs rename\fR [\fB-f\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
-.ad
-.br
-.na
-\fB\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
-.ad
-.br
-.na
-\fB\fBzfs rename\fR [\fB-fp\fR] \fIfilesystem\fR|\fIvolume\fR \fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Renames the given dataset. The new target can be located anywhere in the \fBZFS\fR hierarchy, with the exception of snapshots. Snapshots can only be renamed within the parent file system or volume. When renaming a snapshot, the parent file system of the snapshot does not need to be specified as part of the second argument. Renamed file systems can inherit new mount points, in which case they are unmounted and remounted at the new mount point.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates all the nonexistent parent datasets. Datasets created in this manner are automatically mounted according to the \fBmountpoint\fR property inherited from their parent.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-Force unmount any filesystems that need to be unmounted in the process.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs rename\fR \fB-r\fR \fIsnapshot\fR \fIsnapshot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively rename the snapshots of all descendent datasets. Snapshots are the only dataset that can be renamed recursively.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs\fR \fBlist\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR \fIproperty\fR[,\fI\&...\fR]] [ \fB-t\fR \fItype\fR[,\fI\&...\fR]] [ \fB-s\fR \fIproperty\fR ] ... [ \fB-S\fR \fIproperty\fR ] ... [\fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR] ...\fR
-.ad
-.sp .6
-.RS 4n
-Lists the property information for the given datasets in tabular form. If specified, you can list property information by the absolute pathname or the relative pathname. By default, all file systems and volumes are displayed. Snapshots are displayed if the \fBlistsnaps\fR property is \fBon\fR (the default is \fBoff\fR). When listing hundreds or thousands of snapshots performance can be improved by restricting the output to only the name.  In that case, it is recommended to use \fB-o name -s name\fR. The following fields are displayed by default, \fBname,used,available,referenced,mountpoint\fR.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-H\fR\fR
-.ad
-.sp .6
-.RS 4n
-Used for scripting mode. Do not print headers and separate fields by a single tab instead of arbitrary white space.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.sp .6
-.RS 4n
-Display numbers in parsable (exact) values.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively display any children of the dataset on the command line. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR \fIdepth\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively display any children of the dataset, limiting the recursion to \fIdepth\fR. A depth of \fB1\fR will display only the dataset and its direct children.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty\fR\fR
-.ad
-.sp .6
-.RS 4n
-A comma-separated list of properties to display. The property must be:
-.RS +4
-.TP
-.ie t \(bu
-.el o
-One of the properties described in the "Native Properties" section
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-A user property
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-The value \fBname\fR to display the dataset name
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-The value \fBspace\fR to display space usage properties on file systems and volumes. This is a shortcut for specifying \fB-o name,avail,used,usedsnap,usedds,usedrefreserv,usedchild\fR \fB-t filesystem,volume\fR syntax.
-.RE
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-s\fR \fIproperty\fR\fR
-.ad
-.sp .6
-.RS 4n
-A property for sorting the output by column in ascending order based on the value of the property. The property must be one of the properties described in the "Properties" section, or the special value \fBname\fR to sort by the dataset name. Multiple properties can be specified at one time using multiple \fB-s\fR property options. Multiple \fB-s\fR options are evaluated from left to right in decreasing order of importance.
-.sp
-The following is a list of sorting criteria:
-.RS +4
-.TP
-.ie t \(bu
-.el o
-Numeric types sort in numeric order.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-String types sort in alphabetical order.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-Types inappropriate for a row sort that row to the literal bottom, regardless of the specified ordering.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-If no sorting options are specified the existing behavior of \fBzfs list\fR is preserved.
-.RE
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-S\fR \fIproperty\fR\fR
-.ad
-.sp .6
-.RS 4n
-Same as the \fB-s\fR option, but sorts by property in descending order. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-t\fR \fItype\fR\fR
-.ad
-.sp .6
-.RS 4n
-A comma-separated list of types to display, where \fItype\fR is one of \fBfilesystem\fR, \fBsnapshot\fR, \fBsnap\fR, \fBvolume\fR, \fBbookmark\fR, or \fBall\fR. For example, specifying \fB-t snapshot\fR displays only snapshots.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs set\fR \fIproperty\fR=\fIvalue\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Sets the property to the given value for each dataset. Only some properties can be edited. See the "Properties" section for more information on what properties can be set and acceptable values. Numeric values can be specified as exact values, or in a human-readable form with a suffix of \fBB\fR, \fBK\fR, \fBM\fR, \fBG\fR, \fBT\fR, \fBP\fR, \fBE\fR, \fBZ\fR (for bytes, kilobytes, megabytes, gigabytes, terabytes, petabytes, exabytes, or zettabytes, respectively). User properties can be set on snapshots. For more information, see the "User Properties" section.
-.RE
-
-.sp
-.ne 2
-.mk .na
-\fB\fBzfs get\fR [\fB-r\fR|\fB-d\fR \fIdepth\fR] [\fB-Hp\fR] [\fB-o\fR \fIfield\fR[,...] [\fB-t\fR \fItype\fR[,...]] [\fB-s\fR \fIsource\fR[,...] "\fIall\fR" | \fIproperty\fR[,...] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Displays properties for the given datasets. If no datasets are specified, then the command displays properties for all datasets on the system. For each property, the following columns are displayed:
-.sp
-.in +2
-.nf
-    name      Dataset name
-     property  Property name
-     value     Property value
-     source    Property source. Can either be local, default,
-               temporary, inherited, received, or none (-).
-.fi
-.in -2
-.sp
-
-All columns are displayed by default, though this can be controlled by using the \fB-o\fR option. This command takes a comma-separated list of properties as described in the "Native Properties" and "User Properties" sections.
-.sp
-The special value \fBall\fR can be used to display all properties that apply to the given dataset's type (filesystem, volume snapshot, or bookmark).
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively display properties for any children.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR \fIdepth\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively display any children of the dataset, limiting the recursion to \fIdepth\fR. A depth of \fB1\fR will display only the dataset and its direct children.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-H\fR\fR
-.ad
-.sp .6
-.RS 4n
-Display output in a form more easily parsed by scripts. Any headers are omitted, and fields are explicitly separated by a single tab instead of an arbitrary amount of space.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIfield\fR\fR
-.ad
-.sp .6
-.RS 4n
-A comma-separated list of columns to display. \fBname,property,value,source\fR is the default value. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-s\fR \fIsource\fR\fR
-.ad
-.sp .6
-.RS 4n
-A comma-separated list of sources to display. Those properties coming from a source other than those in this list are ignored. Each source must be one of the following: \fBlocal,default,inherited,received,temporary,none\fR. The default value is all sources.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Display numbers in parsable (exact) values.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs inherit\fR [\fB-rS\fR] \fIproperty\fR \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Clears the specified property, causing it to be inherited from an ancestor, restored to default if no ancestor has the property set, or with the \fB-S\fR option reverted to the received value if one exists.  See the "Properties" section for a listing of default values, and details on which properties can be inherited.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively inherit the given property for all children.
-.RE
-.sp
-.ne 2
-.na
-\fB\fB-S\fR\fR
-.ad
-.sp .6
-.RS 4n
-Revert the property to the received value if one exists; otherwise operate as
-if the \fB-S\fR option was not specified.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs upgrade\fR [\fB-v\fR]\fR
-.ad
-.sp .6
-.RS 4n
-Displays a list of file systems that are not the most recent version.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs upgrade\fR [\fB-r\fR] [\fB-V\fR \fIversion\fR] [\fB-a\fR | \fIfilesystem\fR]\fR
-.ad
-.sp .6
-.RS 4n
-Upgrades file systems to a new on-disk version. Once this is done, the file systems will no longer be accessible on systems running older versions of the software. \fBzfs send\fR streams generated from new snapshots of these file systems cannot be accessed on systems running older versions of the software.
-.sp
-In general, the file system version is independent of the pool version. See \fBzpool\fR(8) for information on the \fBzpool upgrade\fR command. 
-.sp
-In some cases, the file system version and the pool version are interrelated and the pool version must be upgraded before the file system version can be upgraded.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.sp .6
-.RS 4n
-Upgrade all file systems on all imported pools.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIfilesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Upgrade the specified file system. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Upgrade the specified file system and all descendent file systems 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-V\fR \fIversion\fR\fR
-.ad
-.sp .6
-.RS 4n
-Upgrade to the specified \fIversion\fR. If the \fB-V\fR flag is not specified, this command upgrades to the most recent version. This option can only be used to increase the version number, and only up to the most recent version supported by this software.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzfs\fR \fBuserspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]]
-[\fB-s\fR \fIfield\fR] ...
-[\fB-S\fR \fIfield\fR] ...
-[\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
-.ad
-.sp .6
-.RS 4n
-Displays space consumed by, and quotas on, each user in the specified
-filesystem or snapshot. This corresponds to the \fBuserused@\fR\fIuser\fR and
-\fBuserquota@\fR\fIuser\fR properties.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-n\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print numeric ID instead of user/group name.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-H\fR\fR
-.ad
-.sp .6
-.RS 4n
-Do not print headers, use tab-delimited output.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Use exact (parsable) numeric output.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIfield\fR[,...]\fR
-.ad
-.sp .6
-.RS 4n
-Display only the specified fields from the following
-set: \fBtype, name, used, quota\fR. The default is to display all fields.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-s\fR \fIfield\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sort output by this field. The \fIs\fR and \fIS\fR flags may be specified
-multiple times to sort first by one field, then by another. The default is
-\fB-s type\fR \fB-s name\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-S\fR \fIfield\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sort by this field in reverse order. See \fB-s\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-t\fR \fItype\fR[,...]\fR
-.ad
-.sp .6
-.RS 4n
-Print only the specified types from the following
-set: \fBall, posixuser, smbuser, posixgroup, smbgroup\fR. The default
-is \fB-t posixuser,smbuser\fR. The default can be changed to include group
-types.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-i\fR\fR
-.ad
-.sp .6
-.RS 4n
-Translate SID to POSIX ID. The POSIX ID may be ephemeral if no mapping exists.
-Normal POSIX interfaces (for example, \fBstat\fR(2), \fBls\fR \fB-l\fR) perform
-this translation, so the \fB-i\fR option allows the output from \fBzfs
-userspace\fR to be compared directly with those utilities. However, \fB-i\fR
-may lead to confusion if some files were created by an SMB user before a
-SMB-to-POSIX name mapping was established. In such a case, some files will be owned
-by the SMB entity and some by the POSIX entity. However, the \fB-i\fR option
-will report that the POSIX entity has the total usage and quota for both.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzfs\fR \fBgroupspace\fR [\fB-Hinp\fR] [\fB-o\fR \fIfield\fR[,...]]
-[\fB-s\fR \fIfield\fR] ...
-[\fB-S\fR \fIfield\fR] ...
-[\fB-t\fR \fItype\fR[,...]] \fIfilesystem\fR|\fIsnapshot\fR
-.ad
-.sp .6
-.RS 4n
-Displays space consumed by, and quotas on, each group in the specified
-filesystem or snapshot. This subcommand is identical to \fBzfs userspace\fR,
-except that the default types to display are \fB-t posixgroup,smbgroup\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs mount\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays all \fBZFS\fR file systems currently mounted.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs mount\fR [\fB-vO\fR] [\fB-o\fR \fIoptions\fR] \fB-a\fR | \fIfilesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Mounts \fBZFS\fR file systems. Invoked automatically as part of the boot process.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIoptions\fR\fR
-.ad
-.sp .6
-.RS 4n
-An optional, comma-separated list of mount options to use temporarily for the
-duration of the mount. See the "Temporary Mount Point Properties" section for
-details.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-O\fR\fR
-.ad
-.sp .6
-.RS 4n
-Perform an overlay mount. See \fBmount\fR(8) for more information.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Report mount progress.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.sp .6
-.RS 4n
-Mount all available \fBZFS\fR file systems. Invoked automatically as part of
-the boot process.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIfilesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Mount the specified filesystem.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs unmount\fR [\fB-f\fR] \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
-.ad
-.sp .6
-.RS 4n
-Unmounts currently mounted \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-Forcefully unmount the file system, even if it is currently in use.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.sp .6
-.RS 4n
-Unmount all available \fBZFS\fR file systems. Invoked automatically as part of the shutdown process.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIfilesystem\fR|\fImountpoint\fR\fR
-.ad
-.sp .6
-.RS 4n
-Unmount the specified filesystem. The command can also be given a path to a \fBZFS\fR file system mount point on the system.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs share\fR \fB-a\fR | \fIfilesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Shares available \fBZFS\fR file systems. 
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.sp .6
-.RS 4n
-Share all available \fBZFS\fR file systems. Invoked automatically as part of the boot process. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIfilesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Share the specified filesystem according to the \fBsharenfs\fR and \fBsharesmb\fR properties. File systems are shared when the \fBsharenfs\fR or \fBsharesmb\fR property is set.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs unshare\fR \fB-a\fR | \fIfilesystem\fR|\fImountpoint\fR\fR
-.ad
-.sp .6
-.RS 4n
-Unshares currently shared \fBZFS\fR file systems. This is invoked automatically as part of the shutdown process.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.sp .6
-.RS 4n
-Unshare all available \fBZFS\fR file systems. Invoked automatically as part of the boot process. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fIfilesystem\fR|\fImountpoint\fR\fR
-.ad
-.sp .6
-.RS 4n
-Unshare the specified filesystem. The command can also be given a path to a \fBZFS\fR file system shared on the system.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs bookmark\fR \fIsnapshot\fR \fIbookmark\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates a bookmark of the given snapshot.  Bookmarks mark the point in time
-when the snapshot was created, and can be used as the incremental source for
-a \fBzfs send\fR command.
-.sp
-This feature must be enabled to be used.
-See \fBzpool-features\fR(5) for details on ZFS feature flags and the
-\fBbookmarks\fR feature.
-.RE
-
-
-.RE
-.sp
-.ne 2
-.na
-\fBzfs send\fR [\fB-DnPpRveL\fR] [\fB-\fR[\fBiI\fR] \fIsnapshot\fR] \fIsnapshot\fR
-.ad
-.sp .6
-.RS 4n
-Creates a stream representation of the second \fIsnapshot\fR, which is written to standard output. The output can be redirected to a file or to a different system (for example, using \fBssh\fR(1). By default, a full stream is generated.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-i\fR \fIsnapshot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate an incremental stream from the first \fIsnapshot\fR (the incremental source) to the second \fIsnapshot\fR (the incremental target).  The incremental source can be specified as the last component of the snapshot name (the \fB@\fR character and following) and it is assumed to be from the same file system as the incremental target.
-.sp
-If the destination is a clone, the source may be the origin snapshot, which must be fully specified (for example, \fBpool/fs@origin\fR, not just \fB@origin\fR).
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-I\fR \fIsnapshot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate a stream package that sends all intermediary snapshots from the first snapshot to the second snapshot. For example, \fB-I @a fs@d\fR is similar to \fB-i @a fs@b; -i @b fs@c; -i @c fs@d\fR. The incremental source may be specified as with the \fB-i\fR option.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate a replication stream package, which will replicate the specified filesystem, and all descendent file systems, up to the named snapshot. When received, all properties, snapshots, descendent file systems, and clones are preserved.
-.sp
-If the \fB-i\fR or \fB-I\fR flags are used in conjunction with the \fB-R\fR flag, an incremental replication stream is generated. The current values of properties, and current snapshot and file system names are set when the stream is received. If the \fB-F\fR flag is specified when this stream is received, snapshots and file systems that do not exist on the sending side are destroyed. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-D\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate a deduplicated stream. Blocks which would have been sent multiple times in the send stream will only be sent once. The receiving system must also support this feature to receive a deduplicated stream.  This flag can be used regardless of the dataset's dedup  property, but performance will be much better if the filesystem uses a dedup-capable checksum (eg.  sha256).
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-L\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate a stream which may contain blocks larger than 128KB.  This flag
-has no effect if the \fBlarge_blocks\fR pool feature is disabled, or if
-the \fRrecordsize\fR property of this filesystem has never been set above
-128KB.  The receiving system must have the \fBlarge_blocks\fR pool feature
-enabled as well.  See \fBzpool-features\fR(5) for details on ZFS feature
-flags and the \fBlarge_blocks\fR feature.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-e\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate a more compact stream by using WRITE_EMBEDDED records for blocks
-which are stored more compactly on disk by the \fBembedded_data\fR pool
-feature.  This flag has no effect if the \fBembedded_data\fR feature is
-disabled.  The receiving system must have the \fBembedded_data\fR feature
-enabled.  If the \fBlz4_compress\fR feature is active on the sending system,
-then the receiving system must have that feature enabled as well. See
-\fBzpool-features\fR(5) for details on ZFS feature flags and the
-\fBembedded_data\fR feature.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-p\fR\fR
-.ad
-.sp .6
-.RS 4n
-Include the dataset's properties in the stream.  This flag is implicit when -R is specified.  The receiving system must also support this feature.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-n\fR\fR
-.ad
-.sp .6
-.RS 4n
-Do a dry-run ("No-op") send.  Do not generate any actual send data.  This is
-useful in conjunction with the \fB-v\fR or \fB-P\fR flags to determine what
-data will be sent.  In this case, the verbose output will be written to
-standard output (contrast with a non-dry-run, where the stream is written
-to standard output and the verbose output goes to standard error).
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-P\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print machine-parsable verbose information about the stream package generated.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print verbose information about the stream package generated.  This information
-includes a per-second report of how much data has been sent.
-.RE
-
-The format of the stream is committed. You will be able to receive your streams on future versions of \fBZFS\fR.
-.RE
-
-.RE
-.sp
-.ne 2
-.na
-\fBzfs send\fR [\fB-eL\fR] [\fB-i\fR \fIsnapshot\fR|\fIbookmark\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR
-.ad
-.sp .6
-.RS 4n
-Generate a send stream, which may be of a filesystem, and may be
-incremental from a bookmark.  If the destination is a filesystem or volume,
-the pool must be read-only, or the filesystem must not be mounted.  When the
-stream generated from a filesystem or volume is received, the default snapshot
-name will be "--head--".
-
-.sp
-.ne 2
-.na
-\fB-i\fR \fIsnapshot\fR|\fIbookmark\fR
-.ad
-.sp .6
-.RS 4n
-Generate an incremental send stream.  The incremental source must be an earlier
-snapshot in the destination's history. It will commonly be an earlier
-snapshot in the destination's filesystem, in which case it can be
-specified as the last component of the name (the \fB#\fR or \fB@\fR character
-and following).
-.sp
-If the incremental target is a clone, the incremental source can
-be the origin snapshot, or an earlier snapshot in the origin's filesystem,
-or the origin's origin, etc.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-L\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate a stream which may contain blocks larger than 128KB.  This flag
-has no effect if the \fBlarge_blocks\fR pool feature is disabled, or if
-the \fRrecordsize\fR property of this filesystem has never been set above
-128KB.  The receiving system must have the \fBlarge_blocks\fR pool feature
-enabled as well.  See \fBzpool-features\fR(5) for details on ZFS feature
-flags and the \fBlarge_blocks\fR feature.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-e\fR\fR
-.ad
-.sp .6
-.RS 4n
-Generate a more compact stream by using WRITE_EMBEDDED records for blocks
-which are stored more compactly on disk by the \fBembedded_data\fR pool
-feature.  This flag has no effect if the \fBembedded_data\fR feature is
-disabled.  The receiving system must have the \fBembedded_data\fR feature
-enabled.  If the \fBlz4_compress\fR feature is active on the sending system,
-then the receiving system must have that feature enabled as well. See
-\fBzpool-features\fR(5) for details on ZFS feature flags and the
-\fBembedded_data\fR feature.
-.RE
-
-.RE
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs receive\fR [\fB-vnFu\fR] \fIfilesystem\fR|\fIvolume\fR|\fIsnapshot\fR\fR
-.ad
-.br
-.na
-\fB\fBzfs receive\fR [\fB-vnFu\fR] [\fB-d\fR|\fB-e\fR] \fIfilesystem\fR\fR
-.ad
-.sp .6
-.RS 4n
-Creates a snapshot whose contents are as specified in the stream provided on standard input. If a full stream is received, then a new file system is created as well. Streams are created using the \fBzfs send\fR subcommand, which by default creates a full stream. \fBzfs recv\fR can be used as an alias for \fBzfs receive\fR.
-.sp
-If an incremental stream is received, then the destination file system must already exist, and its most recent snapshot must match the incremental stream's source. For \fBzvols\fR, the destination device link is destroyed and recreated, which means the \fBzvol\fR cannot be accessed during the \fBreceive\fR operation.
-.sp
-When a snapshot replication package stream that is generated by using the \fBzfs send\fR \fB-R\fR command is  received, any snapshots that do not exist on the sending location are destroyed by using the \fBzfs destroy\fR \fB-d\fR command.
-.sp
-The name of the snapshot (and file system, if a full stream is received) that this subcommand creates depends on the argument type and the use of the \fB-d\fR or \fB-e\fR options.
-.sp
-If the argument is a snapshot name, the specified \fIsnapshot\fR is created. If the argument is a file system or volume name, a snapshot with the same name as the sent snapshot is created within the specified \fIfilesystem\fR or \fIvolume\fR.  If neither of the \fB-d\fR or \fB-e\fR options are specified, the provided target snapshot name is used exactly as provided.
-.sp
-The \fB-d\fR and \fB-e\fR options cause the file system name of the target snapshot to be determined by appending a portion of the sent snapshot's name to the specified target \fIfilesystem\fR. If the \fB-d\fR option is specified, all but the first element of the sent snapshot's file system path (usually the pool name) is used and any required intermediate file systems within the specified one are created.  If the \fB-e\fR option is specified, then only the last element of the sent snapshot's file system name (i.e. the name of the source file system itself) is used as the target file system name.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR\fR
-.ad
-.sp .6
-.RS 4n
-Discard the first element of the sent snapshot's file system name, using the remaining elements to determine the name of the target file system for the new snapshot as described in the paragraph above.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-e\fR\fR
-.ad
-.sp .6
-.RS 4n
-Discard all but the last element of the sent snapshot's file system name, using that element to determine the name of the target file system for the new snapshot as described in the paragraph above.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-u\fR\fR
-.ad
-.sp .6
-.RS 4n
-File system that is associated with the received stream is not mounted.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Print verbose information about the stream and the time required to perform the receive operation.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-n\fR\fR
-.ad
-.sp .6
-.RS 4n
-Do not actually receive the stream. This can be useful in conjunction with the \fB-v\fR option to verify the name the receive operation would use.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-F\fR\fR
-.ad
-.sp .6
-.RS 4n
-Force a rollback of the file system to the most recent snapshot before performing the receive operation. If receiving an incremental replication stream (for example, one generated by \fBzfs send -R -[iI]\fR), destroy snapshots and file systems that do not exist on the sending side.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs allow\fR \fIfilesystem\fR | \fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays permissions that have been delegated on the specified filesystem or volume. See the other forms of \fBzfs allow\fR for more information.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs allow\fR [\fB-ldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR| \fIvolume\fR\fR
-.ad
-.br
-.na
-\fB\fBzfs allow\fR [\fB-ld\fR] \fB-e\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR | \fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Delegates \fBZFS\fR administration permission for the file systems to non-privileged users.
-.sp
-.ne 2
-.mk
-.na
-\fB[\fB-ug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...]\fR
-.ad
-.sp .6
-.RS 4n
-Specifies to whom the permissions are delegated. Multiple entities can be specified as a comma-separated list. If neither of the \fB-ug\fR options are specified, then the argument is interpreted preferentially as the keyword "everyone", then as a user name, and lastly as a group name. To specify a user or group named "everyone", use the \fB-u\fR or \fB-g\fR options. To specify a group with the same name as a user, use the \fB-g\fR options.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB[\fB-e\fR] \fIperm\fR|@\fIsetname\fR[,...]\fR
-.ad
-.sp .6
-.RS 4n
-Specifies that the permissions be delegated to "everyone." Multiple permissions may be specified as a comma-separated list. Permission names are the same as \fBZFS\fR subcommand and property names. See the property list below. Property set names, which begin with an at sign (\fB@\fR) , may be specified. See the \fB-s\fR form below for details.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB[\fB-ld\fR] \fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Specifies where the permissions are delegated. If neither of the \fB-ld\fR options are specified, or both are, then the permissions are allowed for the file system or volume, and all of its descendents. If only the \fB-l\fR option is used, then is allowed "locally" only for the specified file system. If only the \fB-d\fR option is used, then is allowed only for the descendent file systems.
-.RE
-
-.RE
-
-.sp
-.LP
-Permissions are generally the ability to use a \fBZFS\fR subcommand or change a \fBZFS\fR property. The following permissions are available:
-.sp
-.in +2
-.nf
-NAME             TYPE           NOTES
-allow            subcommand     Must also have the permission that is being
-                                allowed
-clone            subcommand     Must also have the 'create' ability and 'mount'
-                                ability in the origin file system
-create           subcommand     Must also have the 'mount' ability
-destroy          subcommand     Must also have the 'mount' ability
-diff             subcommand     Allows lookup of paths within a dataset
-                                given an object number, and the ability to
-                                create snapshots necessary to 'zfs diff'.
-mount            subcommand     Allows mount/umount of ZFS datasets
-promote          subcommand     Must also have the 'mount'
-                                and 'promote' ability in the origin file system
-receive          subcommand     Must also have the 'mount' and 'create' ability
-rename           subcommand     Must also have the 'mount' and 'create'
-                                ability in the new parent
-rollback         subcommand     Must also have the 'mount' ability
-send             subcommand     
-share            subcommand     Allows sharing file systems over NFS or SMB
-                                protocols
-snapshot         subcommand     Must also have the 'mount' ability
-groupquota       other          Allows accessing any groupquota@... property
-groupused        other          Allows reading any groupused@... property
-userprop         other          Allows changing any user property
-userquota        other          Allows accessing any userquota@... property
-userused         other          Allows reading any userused@... property
-
-acltype          property
-aclinherit       property       
-atime            property       
-canmount         property       
-casesensitivity  property       
-checksum         property       
-compression      property       
-copies           property       
-dedup            property
-devices          property       
-exec             property       
-filesystem_limit property
-logbias          property
-mlslabel         property
-mountpoint       property       
-nbmand           property       
-normalization    property       
-primarycache     property       
-quota            property       
-readonly         property       
-recordsize       property       
-refquota         property       
-refreservation   property       
-reservation      property       
-secondarycache   property       
-setuid           property       
-sharenfs         property       
-sharesmb         property       
-snapdir          property       
-snapshot_limit   property
-utf8only         property       
-version          property       
-volblocksize     property       
-volsize          property       
-vscan            property       
-xattr            property       
-zoned            property       
-.fi
-.in -2
-.sp
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs allow\fR \fB-c\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets "create time" permissions. These permissions are granted (locally) to the creator of any newly-created descendent file system.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs allow\fR \fB-s\fR @\fIsetname\fR \fIperm\fR|@\fIsetname\fR[,...] \fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Defines or adds permissions to a permission set. The set can be used by other \fBzfs allow\fR commands for the specified file system and its descendents. Sets are evaluated dynamically, so changes to a set are immediately reflected. Permission sets follow the same naming restrictions as ZFS file systems, but the name must begin with an "at sign" (\fB@\fR), and can be no more than 64 characters long.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs unallow\fR [\fB-rldug\fR] "\fIeveryone\fR"|\fIuser\fR|\fIgroup\fR[,...] [\fIperm\fR|@\fIsetname\fR[, ...]] \fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.br
-.na
-\fB\fBzfs unallow\fR [\fB-rld\fR] \fB-e\fR [\fIperm\fR|@\fIsetname\fR [,...]] \fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.br
-.na
-\fB\fBzfs unallow\fR [\fB-r\fR] \fB-c\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
-.ad
-.br
-.na
-\fB\fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Removes permissions that were granted with the \fBzfs allow\fR command. No permissions are explicitly denied, so other permissions granted are still in effect. For example, if the permission is granted by an ancestor. If no permissions are specified, then all permissions for the specified \fIuser\fR, \fIgroup\fR, or \fIeveryone\fR are removed. Specifying "everyone" (or using the \fB-e\fR option) only removes the permissions that were granted to "everyone", not all permissions for every user and group. See the \fBzfs allow\fR command for a description of the \fB-ldugec\fR options.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively remove the permissions from this file system and all descendents.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs unallow\fR [\fB-r\fR] \fB-s\fR @\fIsetname\fR [\fIperm\fR|@\fIsetname\fR[,...]]\fR
-.ad
-.br
-.na
-\fB\fIfilesystem\fR|\fIvolume\fR\fR
-.ad
-.sp .6
-.RS 4n
-Removes permissions from a permission set. If no permissions are specified, then all permissions are removed, thus removing the set entirely.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs hold\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...\fR
-.ad
-.sp .6
-.RS 4n
-Adds a single reference, named with the \fItag\fR argument, to the specified snapshot or snapshots. Each snapshot has its own tag namespace, and tags must be unique within that space.
-.sp
-If a hold exists on a snapshot, attempts to destroy that snapshot by using the \fBzfs destroy\fR command return \fBEBUSY\fR.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Specifies that a hold with the given tag is applied recursively to the snapshots of all descendent file systems.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs holds\fR [\fB-r\fR] \fIsnapshot\fR...\fR
-.ad
-.sp .6
-.RS 4n
-Lists all existing user references for the given snapshot or snapshots.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Lists the holds that are set on the named descendent snapshots, in addition to listing the holds on the named snapshot.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs release\fR [\fB-r\fR] \fItag\fR \fIsnapshot\fR...\fR
-.ad
-.sp .6
-.RS 4n
-Removes a single reference, named with the \fItag\fR argument, from the specified snapshot or snapshots. The tag must already exist for each snapshot.
-.sp
-If a hold exists on a snapshot, attempts to destroy that snapshot by using the \fBzfs destroy\fR command return \fBEBUSY\fR.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-r\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recursively releases a hold with the given tag on the snapshots of all descendent file systems.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzfs diff\fR [\fB-FHt\fR] \fIsnapshot\fR \fIsnapshot|filesystem\fR
-.ad
-.sp .6
-.RS 4n
-Display the difference between a snapshot of a given filesystem and another
-snapshot of that filesystem from a later time or the current contents of the
-filesystem.  The first column is a character indicating the type of change,
-the other columns indicate pathname, new pathname (in case of rename), change
-in link count, and optionally file type and/or change time.
-
-The types of change are:
-.in +2
-.nf
--       The path has been removed
-+       The path has been created
-M       The path has been modified
-R       The path has been renamed
-.fi
-.in -2
-.sp
-.ne 2
-.na
-\fB-F\fR
-.ad
-.sp .6
-.RS 4n
-Display an indication of the type of file, in a manner similar to the \fB-F\fR
-option of \fBls\fR(1).
-.in +2
-.nf
-B       Block device
-C       Character device
-/       Directory
->       Door
-|       Named pipe
-@       Symbolic link
-P       Event port
-=       Socket
-F       Regular file
-.fi
-.in -2
-.RE
-.sp
-.ne 2
-.na
-\fB-H\fR
-.ad
-.sp .6
-.RS 4n
-Give more parsable tab-separated output, without header lines and without arrows.
-.RE
-.sp
-.ne 2
-.na
-\fB-t\fR
-.ad
-.sp .6
-.RS 4n
-Display the path's inode change time as the first column of output.
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRCreating a ZFS File System Hierarchy
-.sp
-.LP
-The following commands create a file system named \fBpool/home\fR and a file system named \fBpool/home/bob\fR. The mount point \fB/export/home\fR is set for the parent file system, and is automatically inherited by the child file system.
-
-.sp
-.in +2
-.nf
-# \fBzfs create pool/home\fR
-# \fBzfs set mountpoint=/export/home pool/home\fR
-# \fBzfs create pool/home/bob\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 2 \fRCreating a ZFS Snapshot
-.sp
-.LP
-The following command creates a snapshot named \fByesterday\fR. This snapshot is mounted on demand in the \fB\&.zfs/snapshot\fR directory at the root of the \fBpool/home/bob\fR file system.
-
-.sp
-.in +2
-.nf
-# \fBzfs snapshot pool/home/bob@yesterday\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 3 \fRCreating and Destroying Multiple Snapshots
-.sp
-.LP
-The following command creates snapshots named \fByesterday\fR of \fBpool/home\fR and all of its descendent file systems. Each snapshot is mounted on demand in the \fB\&.zfs/snapshot\fR directory at the root of its file system. The second command destroys the newly created snapshots.
-
-.sp
-.in +2
-.nf
-# \fBzfs snapshot -r pool/home@yesterday\fR
-# \fBzfs destroy -r pool/home@yesterday\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 4 \fRDisabling and Enabling File System Compression
-.sp
-.LP
-The following command disables the \fBcompression\fR property for all file systems under \fBpool/home\fR. The next command explicitly enables \fBcompression\fR for \fBpool/home/anne\fR.
-
-.sp
-.in +2
-.nf
-# \fBzfs set compression=off pool/home\fR
-# \fBzfs set compression=on pool/home/anne\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 5 \fRListing ZFS Datasets
-.sp
-.LP
-The following command lists all active file systems and volumes in the system. Snapshots are displayed if the \fBlistsnaps\fR property is \fBon\fR. The default is \fBoff\fR. See \fBzpool\fR(8) for more information on pool properties.
-
-.sp
-.in +2
-.nf
-# \fBzfs list\fR
-   NAME                      USED  AVAIL  REFER  MOUNTPOINT
-   pool                      450K   457G    18K  /pool
-   pool/home                 315K   457G    21K  /export/home
-   pool/home/anne             18K   457G    18K  /export/home/anne
-   pool/home/bob             276K   457G   276K  /export/home/bob
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 6 \fRSetting a Quota on a ZFS File System
-.sp
-.LP
-The following command sets a quota of 50 Gbytes for \fBpool/home/bob\fR.
-
-.sp
-.in +2
-.nf
-# \fBzfs set quota=50G pool/home/bob\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 7 \fRListing ZFS Properties
-.sp
-.LP
-The following command lists all properties for \fBpool/home/bob\fR.
-
-.sp
-.in +2
-.nf
-# \fBzfs get all pool/home/bob\fR
-NAME           PROPERTY              VALUE                  SOURCE
-pool/home/bob  type                  filesystem             -
-pool/home/bob  creation              Tue Jul 21 15:53 2009  -
-pool/home/bob  used                  21K                    -
-pool/home/bob  available             20.0G                  -
-pool/home/bob  referenced            21K                    -
-pool/home/bob  compressratio         1.00x                  -
-pool/home/bob  mounted               yes                    -
-pool/home/bob  quota                 20G                    local
-pool/home/bob  reservation           none                   default
-pool/home/bob  recordsize            128K                   default
-pool/home/bob  mountpoint            /pool/home/bob         default
-pool/home/bob  sharenfs              off                    default
-pool/home/bob  checksum              on                     default
-pool/home/bob  compression           on                     local
-pool/home/bob  atime                 on                     default
-pool/home/bob  devices               on                     default
-pool/home/bob  exec                  on                     default
-pool/home/bob  setuid                on                     default
-pool/home/bob  readonly              off                    default
-pool/home/bob  zoned                 off                    default
-pool/home/bob  snapdir               hidden                 default
-pool/home/bob  acltype               off                    default
-pool/home/bob  aclinherit            restricted             default
-pool/home/bob  canmount              on                     default
-pool/home/bob  xattr                 on                     default
-pool/home/bob  copies                1                      default
-pool/home/bob  version               4                      -
-pool/home/bob  utf8only              off                    -
-pool/home/bob  normalization         none                   -
-pool/home/bob  casesensitivity       sensitive              -
-pool/home/bob  vscan                 off                    default
-pool/home/bob  nbmand                off                    default
-pool/home/bob  sharesmb              off                    default
-pool/home/bob  refquota              none                   default
-pool/home/bob  refreservation        none                   default
-pool/home/bob  primarycache          all                    default
-pool/home/bob  secondarycache        all                    default
-pool/home/bob  usedbysnapshots       0                      -
-pool/home/bob  usedbydataset         21K                    -
-pool/home/bob  usedbychildren        0                      -
-pool/home/bob  usedbyrefreservation  0                      -
-pool/home/bob  logbias               latency                default
-pool/home/bob  dedup                 off                    default
-pool/home/bob  mlslabel              none                   default
-pool/home/bob  relatime              off                    default
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-The following command gets a single property value.
-
-.sp
-.in +2
-.nf
-# \fBzfs get -H -o value compression pool/home/bob\fR
-on
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-The following command lists all properties with local settings for \fBpool/home/bob\fR.
-
-.sp
-.in +2
-.nf
-# \fBzfs get -r -s local -o name,property,value all pool/home/bob\fR
-NAME           PROPERTY              VALUE
-pool/home/bob  quota                 20G
-pool/home/bob  compression           on
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 8 \fRRolling Back a ZFS File System
-.sp
-.LP
-The following command reverts the contents of \fBpool/home/anne\fR to the snapshot named \fByesterday\fR, deleting all intermediate snapshots.
-
-.sp
-.in +2
-.nf
-# \fBzfs rollback -r pool/home/anne@yesterday\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 9 \fRCreating a ZFS Clone
-.sp
-.LP
-The following command creates a writable file system whose initial contents are the same as \fBpool/home/bob@yesterday\fR.
-
-.sp
-.in +2
-.nf
-# \fBzfs clone pool/home/bob@yesterday pool/clone\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 10 \fRPromoting a ZFS Clone
-.sp
-.LP
-The following commands illustrate how to test out changes to a file system, and then replace the original file system with the changed one, using clones, clone promotion, and renaming:
-
-.sp
-.in +2
-.nf
-# \fBzfs create pool/project/production\fR
-  populate /pool/project/production with data
-# \fBzfs snapshot pool/project/production@today\fR
-# \fBzfs clone pool/project/production@today pool/project/beta\fR
-make changes to /pool/project/beta and test them
-# \fBzfs promote pool/project/beta\fR
-# \fBzfs rename pool/project/production pool/project/legacy\fR
-# \fBzfs rename pool/project/beta pool/project/production\fR
-once the legacy version is no longer needed, it can be destroyed
-# \fBzfs destroy pool/project/legacy\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 11 \fRInheriting ZFS Properties
-.sp
-.LP
-The following command causes \fBpool/home/bob\fR and \fBpool/home/anne\fR to inherit the \fBchecksum\fR property from their parent.
-
-.sp
-.in +2
-.nf
-# \fBzfs inherit checksum pool/home/bob pool/home/anne\fR
-.fi
-.in -2
-.sp
-.LP
-The following command causes \fBpool/home/bob\fR to revert to the received
-value for the \fBquota\fR property if it exists.
-
-.sp
-.in +2
-.nf
-# \fBzfs inherit -S quota pool/home/bob
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 12 \fRRemotely Replicating ZFS Data
-.sp
-.LP
-The following commands send a full stream and then an incremental stream to a remote machine, restoring them into \fBpoolB/received/fs@a\fRand \fBpoolB/received/fs@b\fR, respectively. \fBpoolB\fR must contain the file system \fBpoolB/received\fR, and must not initially contain \fBpoolB/received/fs\fR.
-
-.sp
-.in +2
-.nf
-# \fBzfs send pool/fs@a | \e\fR
-   \fBssh host zfs receive poolB/received/fs@a\fR
-# \fBzfs send -i a pool/fs@b | ssh host \e\fR
-   \fBzfs receive poolB/received/fs\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 13 \fRUsing the \fBzfs receive\fR \fB-d\fR Option
-.sp
-.LP
-The following command sends a full stream of \fBpoolA/fsA/fsB@snap\fR to a remote machine, receiving it into \fBpoolB/received/fsA/fsB@snap\fR. The \fBfsA/fsB@snap\fR portion of the received snapshot's name is determined from the name of the sent snapshot. \fBpoolB\fR must contain the file system \fBpoolB/received\fR. If \fBpoolB/received/fsA\fR does not exist, it is created as an empty file system.
-
-.sp
-.in +2
-.nf
-# \fBzfs send poolA/fsA/fsB@snap | \e
-   ssh host zfs receive -d poolB/received\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 14 \fRSetting User Properties
-.sp
-.LP
-The following example sets the user-defined \fBcom.example:department\fR property for a dataset.
-
-.sp
-.in +2
-.nf
-# \fBzfs set com.example:department=12345 tank/accounting\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 15 \fRPerforming a Rolling Snapshot
-.sp
-.LP
-The following example shows how to maintain a history of snapshots with a consistent naming scheme. To keep a week's worth of snapshots, the user destroys the oldest snapshot, renames the remaining snapshots, and then creates a new snapshot, as follows:
-
-.sp
-.in +2
-.nf
-# \fBzfs destroy -r pool/users@7daysago\fR
-# \fBzfs rename -r pool/users@6daysago @7daysago\fR
-# \fBzfs rename -r pool/users@5daysago @6daysago\fR
-# \fBzfs rename -r pool/users@4daysago @5daysago\fR
-# \fBzfs rename -r pool/users@3daysago @4daysago\fR
-# \fBzfs rename -r pool/users@2daysago @3daysago\fR
-# \fBzfs rename -r pool/users@yesterday @2daysago\fR
-# \fBzfs rename -r pool/users@today @yesterday\fR
-# \fBzfs snapshot -r pool/users@today\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 16 \fRSetting \fBsharenfs\fR Property Options on a ZFS File System
-.sp
-.LP
-The following commands show how to set \fBsharenfs\fR property options to enable \fBrw\fR access for a set of \fBIP\fR addresses and to enable root access for system \fBneo\fR on the \fBtank/home\fR file system.
-
-.sp
-.in +2
-.nf
-# \fBzfs set sharenfs='rw=@123.123.0.0/16,root=neo' tank/home\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-If you are using \fBDNS\fR for host name resolution, specify the fully qualified hostname.
-
-.LP
-\fBExample 17 \fRDelegating ZFS Administration Permissions on a ZFS Dataset
-.sp
-.LP
-The following example shows how to set permissions so that user \fBcindys\fR can create, destroy, mount, and take snapshots on \fBtank/cindys\fR. The permissions on \fBtank/cindys\fR are also displayed.
-
-.sp
-.in +2
-.nf
-# \fBzfs allow cindys create,destroy,mount,snapshot tank/cindys\fR
-# \fBzfs allow tank/cindys\fR
--------------------------------------------------------------
-Local+Descendent permissions on (tank/cindys)
-          user cindys create,destroy,mount,snapshot
--------------------------------------------------------------
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Because the \fBtank/cindys\fR mount point permission is set to 755 by default, user \fBcindys\fR will be unable to mount file systems under \fBtank/cindys\fR. Set an \fBACL\fR similar to the following syntax to provide mount point access:
-.sp
-.in +2
-.nf
-# \fBchmod A+user:cindys:add_subdirectory:allow /tank/cindys\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 18 \fRDelegating Create Time Permissions on a ZFS Dataset
-.sp
-.LP
-The following example shows how to grant anyone in the group \fBstaff\fR to create file systems in \fBtank/users\fR. This syntax also allows staff members to destroy their own file systems, but not destroy anyone else's file system. The permissions on \fBtank/users\fR are also displayed.
-
-.sp
-.in +2
-.nf
-# \fBzfs allow staff create,mount tank/users\fR
-# \fBzfs allow -c destroy tank/users\fR
-# \fBzfs allow tank/users\fR
--------------------------------------------------------------
-Create time permissions on (tank/users)
-          create,destroy
-Local+Descendent permissions on (tank/users)
-          group staff create,mount
-------------------------------------------------------------- 
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 19 \fRDefining and Granting a Permission Set on a ZFS Dataset
-.sp
-.LP
-The following example shows how to define and grant a permission set on the \fBtank/users\fR file system. The permissions on \fBtank/users\fR are also displayed.
-
-.sp
-.in +2
-.nf
-# \fBzfs allow -s @pset create,destroy,snapshot,mount tank/users\fR
-# \fBzfs allow staff @pset tank/users\fR
-# \fBzfs allow tank/users\fR
--------------------------------------------------------------
-Permission sets on (tank/users)
-        @pset create,destroy,mount,snapshot
-Create time permissions on (tank/users)
-        create,destroy
-Local+Descendent permissions on (tank/users)
-        group staff @pset,create,mount
--------------------------------------------------------------
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 20 \fRDelegating Property Permissions on a ZFS Dataset
-.sp
-.LP
-The following example shows to grant the ability to set quotas and reservations on the \fBusers/home\fR file system. The permissions on \fBusers/home\fR are also displayed.
-
-.sp
-.in +2
-.nf
-# \fBzfs allow cindys quota,reservation users/home\fR
-# \fBzfs allow users/home\fR
--------------------------------------------------------------
-Local+Descendent permissions on (users/home)
-        user cindys quota,reservation
--------------------------------------------------------------
-cindys% \fBzfs set quota=10G users/home/marks\fR
-cindys% \fBzfs get quota users/home/marks\fR
-NAME              PROPERTY  VALUE             SOURCE
-users/home/marks  quota     10G               local 
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 21 \fRRemoving ZFS Delegated Permissions on a ZFS Dataset
-.sp
-.LP
-The following example shows how to remove the snapshot permission from the \fBstaff\fR group on the \fBtank/users\fR file system. The permissions on \fBtank/users\fR are also displayed.
-
-.sp
-.in +2
-.nf
-# \fBzfs unallow staff snapshot tank/users\fR
-# \fBzfs allow tank/users\fR
--------------------------------------------------------------
-Permission sets on (tank/users)
-        @pset create,destroy,mount,snapshot
-Create time permissions on (tank/users)
-        create,destroy
-Local+Descendent permissions on (tank/users)
-        group staff @pset,create,mount
-------------------------------------------------------------- 
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 22\fR Showing the differences between a snapshot and a ZFS Dataset
-.sp
-.LP
-The following example shows how to see what has changed between a prior
-snapshot of a ZFS Dataset and its current state.  The \fB-F\fR option is used
-to indicate type information for the files affected.
-
-.sp
-.in +2
-.nf
-# zfs diff -F tank/test@before tank/test
-M       /       /tank/test/
-M       F       /tank/test/linked      (+1)
-R       F       /tank/test/oldname -> /tank/test/newname
--       F       /tank/test/deleted
-+       F       /tank/test/created
-M       F       /tank/test/modified
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 23\fR Creating a bookmark
-.sp
-.LP
-The following example create a bookmark to a snapshot. This bookmark can then
-be used instead of snapshot in send streams.
-
-.sp
-.in +2
-.nf
-# zfs bookmark rpool@snapshot rpool#bookmark
-.fi
-.in -2
-.sp
-
-.SH "ENVIRONMENT VARIABLES"
-.TP
-.B "ZFS_ABORT
-Cause \fBzfs\fR to dump core on exit for the purposes of running \fB::findleaks\fR.
-
-.SH EXIT STATUS
-.LP
-The following exit values are returned:
-.sp
-.ne 2
-.mk
-.na
-\fB\fB0\fR\fR
-.ad
-.sp .6
-.RS 4n
-Successful completion. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB1\fR\fR
-.ad
-.sp .6
-.RS 4n
-An error occurred.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB2\fR\fR
-.ad
-.sp .6
-.RS 4n
-Invalid command line options were specified.
-.RE
-
-.SH SEE ALSO
-.LP
-\fBchmod\fR(2), \fBfsync\fR(2), \fBgzip\fR(1), \fBmount\fR(8), \fBssh\fR(1), \fBstat\fR(2), \fBwrite\fR(2), \fBzpool\fR(8)
diff --git a/zfs/man/man8/zinject.8 b/zfs/man/man8/zinject.8
deleted file mode 100644 (file)
index c21d66a..0000000
+++ /dev/null
@@ -1,151 +0,0 @@
-'\" t
-.\"
-.\" CDDL HEADER START
-.\"
-.\" The contents of this file are subject to the terms of the
-.\" Common Development and Distribution License (the "License").
-.\" You may not use this file except in compliance with the License.
-.\"
-.\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-.\" or http://www.opensolaris.org/os/licensing.
-.\" See the License for the specific language governing permissions
-.\" and limitations under the License.
-.\"
-.\" When distributing Covered Code, include this CDDL HEADER in each
-.\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-.\" If applicable, add the following below this CDDL HEADER, with the
-.\" fields enclosed by brackets "[]" replaced with your own identifying
-.\" information: Portions Copyright [yyyy] [name of copyright owner]
-.\"
-.\" CDDL HEADER END
-.\"
-.\"
-.\" Copyright 2013 Darik Horn <dajhorn@vanadac.com>. All rights reserved.
-.\"
-.TH zinject 8 "2013 FEB 28" "ZFS on Linux" "System Administration Commands"
-
-.SH NAME
-zinject \- ZFS Fault Injector
-.SH DESCRIPTION
-.BR zinject
-creates artificial problems in a ZFS pool by simulating data corruption or device failures. This program is dangerous.
-.SH SYNOPSIS
-.TP
-.B "zinject"
-List injection records.
-.TP
-.B "zinject \-b \fIobjset:object:level:blkd\fB [\-f \fIfrequency\fB] [\-amu] \fIpool\fB"
-Force an error into the pool at a bookmark.
-.TP
-.B "zinject \-c <\fIid\fB | all>
-Cancel injection records.
-.TP
-.B "zinject \-d \fIvdev\fB \-A <degrade|fault> \fIpool\fB
-Force a vdev into the DEGRADED or FAULTED state.
-.TP
-.B "zinject \-d \fIvdev\fB [\-e \fIdevice_error\fB] [\-L \fIlabel_error\fB] [\-T \fIfailure\fB] [\-F] \fIpool\fB"
-Force a vdev error.
-.TP
-.B "zinject \-I [\-s \fIseconds\fB | \-g \fItxgs\fB] \fIpool\fB"
-Simulate a hardware failure that fails to honor a cache flush.
-.TP
-.B "zinject \-p \fIfunction\fB \fIpool\fB
-Panic inside the specified function.
-.TP
-.B "zinject \-t data [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-r \fIrange\fB] [\-amq] \fIpath\fB"
-Force an error into the contents of a file.
-.TP
-.B "zinject \-t dnode [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-amq] \fIpath\fB"
-Force an error into the metadnode for a file or directory.
-.TP
-.B "zinject \-t \fImos_type\fB [\-e \fIdevice_error\fB] [\-f \fIfrequency\fB] [\-l \fIlevel\fB] [\-r \fIrange\fB] [\-amqu] \fIpool\fB"
-Force an error into the MOS of a pool.
-.SH OPTIONS
-.TP
-.BI "\-a"
-Flush the ARC before injection.
-.TP
-.BI "\-b" " objset:object:level:start:end"
-Force an error into the pool at this bookmark tuple. Each number is
-in hexidecimal, and only one block can be specified.
-.TP
-.BI "\-d" " vdev"
-A vdev specified by path or GUID.
-.TP
-.BI "\-e" " device_error"
-Specify
-.BR "checksum" " for an ECKSUM error,"
-.BR "dtl" " for an ECHILD error,"
-.BR "io" " for an EIO error where reopening the device will succeed, or"
-.BR "nxio" " for an ENXIO error where reopening the device will fail."
-.TP
-.BI "\-f" " frequency"
-Only inject errors a fraction of the time. Expressed as an integer
-percentage between 1 and 100.
-.TP
-.BI "\-F"
-Fail faster. Do fewer checks.
-.TP
-.BI "\-g" " txgs"
-Run for this many transaction groups before reporting failure.
-.TP
-.BI "\-h"
-Print the usage message.
-.TP
-.BI "\-l" " level"
-Inject an error at a particular block level. The default is 0.
-.TP
-.BI "\-L" " label_error"
-Set the label error region to one of
-.BR " nvlist" ","
-.BR " pad1" ","
-.BR " pad2" ", or"
-.BR " uber" "."
-.TP
-.BI "\-m"
-Automatically remount the underlying filesystem.
-.TP
-.BI "\-q"
-Quiet mode. Only print the handler number added.
-.TP
-.BI "\-r" " range"
-Inject an error over a particular logical range of an object, which
-will be translated to the appropriate blkid range according to the
-object's properties.
-.TP
-.BI "\-s" " seconds"
-Run for this many seconds before reporting failure.
-.TP
-.BI "\-T" " failure"
-Set the failure type to one of
-.BR " all" ","
-.BR " claim" ","
-.BR " free" ","
-.BR " read" ", or"
-.BR " write" "."
-.TP
-.BI "\-t" " mos_type"
-Set this to
-.BR "mos " "for any data in the MOS,"
-.BR "mosdir " "for an object directory,"
-.BR "config " "for the pool configuration,"
-.BR "bpobj " "for the block pointer list,"
-.BR "spacemap " "for the space map,"
-.BR "metaslab " "for the metaslab, or"
-.BR "errlog " "for the persistent error log."
-.TP
-.BI "\-u"
-Unload the pool after injection.
-
-.SH "ENVIRONMENT VARIABLES"
-.TP
-.B "ZINJECT_DEBUG"
-Run \fBzinject\fR in debug mode.
-
-.SH "AUTHORS"
-This man page was written by Darik Horn <dajhorn@vanadac.com>
-excerpting the \fBzinject\fR usage message and source code.
-
-.SH "SEE ALSO"
-.BR zpool (8),
-.BR zfs (8)
diff --git a/zfs/man/man8/zpool.8 b/zfs/man/man8/zpool.8
deleted file mode 100644 (file)
index 062b5ae..0000000
+++ /dev/null
@@ -1,2408 +0,0 @@
-'\" te
-.\" Copyright (c) 2007, Sun Microsystems, Inc. All Rights Reserved.
-.\" Copyright 2011 Nexenta Systems, Inc.  All rights reserved.
-.\" Copyright (c) 2013 by Delphix. All rights reserved.
-.\" Copyright (c) 2012 Cyril Plisko. All Rights Reserved.
-.\" The contents of this file are subject to the terms of the Common Development
-.\" and Distribution License (the "License"). You may not use this file except
-.\" in compliance with the License. You can obtain a copy of the license at
-.\" usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
-.\"
-.\" See the License for the specific language governing permissions and
-.\" limitations under the License. When distributing Covered Code, include this
-.\" CDDL HEADER in each file and include the License file at
-.\" usr/src/OPENSOLARIS.LICENSE. If applicable, add the following below this
-.\" CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your
-.\" own identifying information:
-.\" Portions Copyright [yyyy] [name of copyright owner]
-.TH zpool 8 "14 December 2012" "ZFS pool 28, filesystem 5" "System Administration Commands"
-.SH NAME
-zpool \- configures ZFS storage pools
-.SH SYNOPSIS
-.LP
-.nf
-\fBzpool\fR [\fB-?\fR]
-.fi
-
-.LP
-.nf
-\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR
-.fi
-
-.LP
-.nf
-\fBzpool clear\fR \fIpool\fR [\fIdevice\fR]
-.fi
-
-.LP
-.nf
-\fBzpool create\fR [\fB-fnd\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR]
-     ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] [\fB-t\fR \fItname\fR] \fIpool\fR \fIvdev\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR
-.fi
-
-.LP
-.nf
-\fBzpool detach\fR \fIpool\fR \fIdevice\fR
-.fi
-
-.LP
-.nf
-\fBzpool events\fR [\fB-vHfc\fR] [\fIpool\fR] ...
-.fi
-
-.LP
-.nf
-\fBzpool export\fR [\fB-a\fR] [\fB-f\fR] \fIpool\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool get\fR [\fB-pH\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...
-.fi
-
-.LP
-.nf
-\fBzpool import\fR [\fB-d\fR \fIdir\fR] [\fB-D\fR]
-.fi
-
-.LP
-.nf
-\fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
-     [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR] [\fB-X\fR\] [\fB-T\fR\]] \fB-a\fR
-.fi
-
-.LP
-.nf
-\fBzpool import\fR [\fB-o \fImntopts\fR\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR]
-     [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR] [\fB-X\fR] [\fB-T\fR\]] [\fB-t\fR]] \fIpool\fR |\fIid\fR [\fInewpool\fR]
-.fi
-
-.LP
-.nf
-\fBzpool iostat\fR [\fB-T\fR d | u ] [\fB-v\fR] [\fB-y\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]
-.fi
-
-.LP
-.nf
-\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
-.fi
-
-.LP
-.nf
-\fBzpool list\fR [\fB-T\fR d | u ] [\fB-Hv\fR] [\fB-o\fR \fIproperty\fR[,...]] [\fIpool\fR] ...
-     [\fIinterval\fR[\fIcount\fR]]
-.fi
-
-.LP
-.nf
-\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool online\fR \fIpool\fR \fIdevice\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool reguid\fR \fIpool\fR
-.fi
-
-.LP
-.nf
-\fBzpool reopen\fR \fIpool\fR
-.fi
-
-.LP
-.nf
-\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool replace\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR]  \fIpool\fR \fIdevice\fR [\fInew_device\fR]
-.fi
-
-.LP
-.nf
-\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...
-.fi
-
-.LP
-.nf
-\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR
-.fi
-
-.LP
-.nf
-\fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR [\fIdevice\fR ...]
-.fi
-
-.LP
-.nf
-\fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
-.fi
-
-.LP
-.nf
-\fBzpool upgrade\fR 
-.fi
-
-.LP
-.nf
-\fBzpool upgrade\fR \fB-v\fR
-.fi
-
-.LP
-.nf
-\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBzpool\fR command configures \fBZFS\fR storage pools. A storage pool is a collection of devices that provides physical storage and data replication for \fBZFS\fR datasets.
-.sp
-.LP
-All datasets within a storage pool share the same space. See \fBzfs\fR(8) for information on managing datasets.
-.SS "Virtual Devices (\fBvdev\fRs)"
-.sp
-.LP
-A "virtual device" describes a single device or a collection of devices organized according to certain performance and fault characteristics. The following virtual devices are supported:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBdisk\fR\fR
-.ad
-.RS 10n
-.rt  
-A block device, typically located under \fB/dev\fR. \fBZFS\fR can use individual partitions, though the recommended mode of operation is to use whole disks. A disk can be specified by a full path, or it can be a shorthand name (the relative portion of the path under "/dev"). For example, "sda" is equivalent to "/dev/sda". A whole disk can be specified by omitting the partition designation. When given a whole disk, \fBZFS\fR automatically labels the disk, if necessary.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfile\fR\fR
-.ad
-.RS 10n
-.rt  
-A regular file. The use of files as a backing store is strongly discouraged. It is designed primarily for experimental purposes, as the fault tolerance of a file is only as good as the file system of which it is a part. A file must be specified by a full path.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBmirror\fR\fR
-.ad
-.RS 10n
-.rt  
-A mirror of two or more devices. Data is replicated in an identical fashion across all components of a mirror. A mirror with \fIN\fR disks of size \fIX\fR can hold \fIX\fR bytes and can withstand (\fIN-1\fR) devices failing before data integrity is compromised.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBraidz\fR\fR
-.ad
-.br
-.na
-\fB\fBraidz1\fR\fR
-.ad
-.br
-.na
-\fB\fBraidz2\fR\fR
-.ad
-.br
-.na
-\fB\fBraidz3\fR\fR
-.ad
-.RS 10n
-.rt  
-A variation on \fBRAID-5\fR that allows for better distribution of parity and eliminates the "\fBRAID-5\fR write hole" (in which data and parity become inconsistent after a power loss). Data and parity is striped across all disks within a \fBraidz\fR group.
-.sp
-A \fBraidz\fR group can have single-, double- , or triple parity, meaning that the \fBraidz\fR group can sustain one, two, or three failures, respectively, without losing any data. The \fBraidz1\fR \fBvdev\fR type specifies a single-parity \fBraidz\fR group; the \fBraidz2\fR \fBvdev\fR type specifies a double-parity \fBraidz\fR group; and the \fBraidz3\fR \fBvdev\fR type specifies a triple-parity \fBraidz\fR group. The \fBraidz\fR \fBvdev\fR type is an alias for \fBraidz1\fR.
-.sp
-A \fBraidz\fR group with \fIN\fR disks of size \fIX\fR with \fIP\fR parity disks can hold approximately (\fIN-P\fR)*\fIX\fR bytes and can withstand \fIP\fR device(s) failing before data integrity is compromised. The minimum number of devices in a \fBraidz\fR group is one more than the number of parity disks. The recommended number is between 3 and 9 to help increase performance.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBspare\fR\fR
-.ad
-.RS 10n
-.rt  
-A special pseudo-\fBvdev\fR which keeps track of available hot spares for a pool. For more information, see the "Hot Spares" section.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBlog\fR\fR
-.ad
-.RS 10n
-.rt  
-A separate-intent log device. If more than one log device is specified, then writes are load-balanced between devices. Log devices can be mirrored. However, \fBraidz\fR \fBvdev\fR types are not supported for the intent log. For more information, see the "Intent Log" section.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcache\fR\fR
-.ad
-.RS 10n
-.rt  
-A device used to cache storage pool data. A cache device cannot be configured as a mirror or \fBraidz\fR group. For more information, see the "Cache Devices" section.
-.RE
-
-.sp
-.LP
-Virtual devices cannot be nested, so a mirror or \fBraidz\fR virtual device can only contain files or disks. Mirrors of mirrors (or other combinations) are not allowed.
-.sp
-.LP
-A pool can have any number of virtual devices at the top of the configuration (known as "root vdevs"). Data is dynamically distributed across all top-level devices to balance data among devices. As new virtual devices are added, \fBZFS\fR automatically places data on the newly available devices.
-.sp
-.LP
-Virtual devices are specified one at a time on the command line, separated by whitespace. The keywords "mirror" and "raidz" are used to distinguish where a group ends and another begins. For example, the following creates two root vdevs, each a mirror of two disks:
-.sp
-.in +2
-.nf
-# \fBzpool create mypool mirror sda sdb mirror sdc sdd\fR
-.fi
-.in -2
-.sp
-
-.SS "Device Failure and Recovery"
-.sp
-.LP
-\fBZFS\fR supports a rich set of mechanisms for handling device failure and data corruption. All metadata and data is checksummed, and \fBZFS\fR automatically repairs bad data from a good copy when corruption is detected.
-.sp
-.LP
-In order to take advantage of these features, a pool must make use of some form of redundancy, using either mirrored or \fBraidz\fR groups. While \fBZFS\fR supports running in a non-redundant configuration, where each root vdev is simply a disk or file, this is strongly discouraged. A single case of bit corruption can render some or all of your data unavailable.
-.sp
-.LP
-A pool's health status is described by one of three states: online, degraded, or faulted. An online pool has all devices operating normally. A degraded pool is one in which one or more devices have failed, but the data is still available due to a redundant configuration. A faulted pool has corrupted metadata, or one or more faulted devices, and insufficient replicas to continue functioning. 
-.sp
-.LP
-The health of the top-level vdev, such as mirror or \fBraidz\fR device, is potentially impacted by the state of its associated vdevs, or component devices. A top-level vdev or component device is in one of the following states:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBDEGRADED\fR\fR
-.ad
-.RS 12n
-.rt  
-One or more top-level vdevs is in the degraded state because one or more component devices are offline. Sufficient replicas exist to continue functioning.
-.sp
-One or more component devices is in the degraded or faulted state, but sufficient replicas exist to continue functioning. The underlying conditions are as follows:
-.RS +4
-.TP
-.ie t \(bu
-.el o
-The number of checksum errors exceeds acceptable levels and the device is degraded as an indication that something may be wrong. \fBZFS\fR continues to use the device as necessary.
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-The number of I/O errors exceeds acceptable levels. The device could not be marked as faulted because there are insufficient replicas to continue functioning.
-.RE
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBFAULTED\fR\fR
-.ad
-.RS 12n
-.rt  
-One or more top-level vdevs is in the faulted state because one or more component devices are offline. Insufficient replicas exist to continue functioning. 
-.sp
-One or more component devices is in the faulted state, and insufficient replicas exist to continue functioning. The underlying conditions are as follows:
-.RS +4
-.TP
-.ie t \(bu
-.el o
-The device could be opened, but the contents did not match expected values. 
-.RE
-.RS +4
-.TP
-.ie t \(bu
-.el o
-The number of I/O errors exceeds acceptable levels and the device is faulted to prevent further use of the device.
-.RE
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBOFFLINE\fR\fR
-.ad
-.RS 12n
-.rt  
-The device was explicitly taken offline by the "\fBzpool offline\fR" command.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBONLINE\fR\fR
-.ad
-.RS 12n
-.rt  
-The device is online and functioning.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBREMOVED\fR\fR
-.ad
-.RS 12n
-.rt  
-The device was physically removed while the system was running. Device removal detection is hardware-dependent and may not be supported on all platforms.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBUNAVAIL\fR\fR
-.ad
-.RS 12n
-.rt  
-The device could not be opened. If a pool is imported when a device was unavailable, then the device will be identified by a unique identifier instead of its path since the path was never correct in the first place.
-.RE
-
-.sp
-.LP
-If a device is removed and later re-attached to the system, \fBZFS\fR attempts to put the device online automatically. Device attach detection is hardware-dependent and might not be supported on all platforms.
-.SS "Hot Spares"
-.sp
-.LP
-\fBZFS\fR allows devices to be associated with pools as "hot spares". These devices are not actively used in the pool, but when an active device fails, it is automatically replaced by a hot spare. To create a pool with hot spares, specify a "spare" \fBvdev\fR with any number of devices. For example, 
-.sp
-.in +2
-.nf
-# zpool create pool mirror sda sdb spare sdc sdd
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Spares can be shared across multiple pools, and can be added with the "\fBzpool add\fR" command and removed with the "\fBzpool remove\fR" command. Once a spare replacement is initiated, a new "spare" \fBvdev\fR is created within the configuration that will remain there until the original device is replaced. At this point, the hot spare becomes available again.
-.sp
-.LP
-If a pool has a shared spare that is currently being used, the pool can not be exported since other pools may use this shared spare, which may lead to potential data corruption.
-.sp
-.LP
-An in-progress spare replacement can be cancelled by detaching the hot spare. If the original faulted device is detached, then the hot spare assumes its place in the configuration, and is removed from the spare list of all active pools.
-.sp
-.LP
-Spares cannot replace log devices.
-.SS "Intent Log"
-.sp
-.LP
-The \fBZFS\fR Intent Log (\fBZIL\fR) satisfies \fBPOSIX\fR requirements for synchronous transactions. For instance, databases often require their transactions to be on stable storage devices when returning from a system call. \fBNFS\fR and other applications can also use \fBfsync\fR() to ensure data stability. By default, the intent log is allocated from blocks within the main pool. However, it might be possible to get better performance using separate intent log devices such as \fBNVRAM\fR or a dedicated disk. For example:
-.sp
-.in +2
-.nf
-\fB# zpool create pool sda sdb log sdc\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Multiple log devices can also be specified, and they can be mirrored. See the EXAMPLES section for an example of mirroring multiple log devices.
-.sp
-.LP
-Log devices can be added, replaced, attached, detached, and imported and exported as part of the larger pool. Mirrored log devices can be removed by specifying the top-level mirror for the log.
-.SS "Cache Devices"
-.sp
-.LP
-Devices can be added to a storage pool as "cache devices." These devices provide an additional layer of caching between main memory and disk. For read-heavy workloads, where the working set size is much larger than what can be cached in main memory, using cache devices allow much more of this working set to be served from low latency media. Using cache devices provides the greatest performance improvement for random read-workloads of mostly static content.
-.sp
-.LP
-To create a pool with cache devices, specify a "cache" \fBvdev\fR with any number of devices. For example:
-.sp
-.in +2
-.nf
-\fB# zpool create pool sda sdb cache sdc sdd\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Cache devices cannot be mirrored or part of a \fBraidz\fR configuration. If a read error is encountered on a cache device, that read \fBI/O\fR is reissued to the original storage pool device, which might be part of a mirrored or \fBraidz\fR configuration.
-.sp
-.LP
-The content of the cache devices is considered volatile, as is the case with other system caches.
-.SS "Properties"
-.sp
-.LP
-Each pool has several properties associated with it. Some properties are read-only statistics while others are configurable and change the behavior of the pool. The following are read-only properties:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBavailable\fR\fR
-.ad
-.RS 20n
-.rt  
-Amount of storage available within the pool. This property can also be referred to by its shortened column name, "avail".
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcapacity\fR\fR
-.ad
-.RS 20n
-.rt  
-Percentage of pool space used. This property can also be referred to by its shortened column name, "cap".
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBexpandsize\fR\fR
-.ad
-.RS 20n
-.rt
-Amount of uninitialized space within the pool or device that can be used to
-increase the total capacity of the pool.  Uninitialized space consists of
-any space on an EFI labeled vdev which has not been brought online
-(i.e. zpool online -e).  This space occurs when a LUN is dynamically expanded.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfragmentation\fR\fR
-.ad
-.RS 20n
-.rt
-The amount of fragmentation in the pool.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfree\fR\fR
-.ad
-.RS 20n
-.rt
-The amount of free space available in the pool.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfreeing\fR\fR
-.ad
-.RS 20n
-.rt
-After a file system or snapshot is destroyed, the space it was using is
-returned to the pool asynchronously. \fB\fBfreeing\fR\fR is the amount of
-space remaining to be reclaimed. Over time \fB\fBfreeing\fR\fR will decrease
-while \fB\fBfree\fR\fR increases.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBhealth\fR\fR
-.ad
-.RS 20n
-.rt  
-The current health of the pool. Health can be "\fBONLINE\fR", "\fBDEGRADED\fR", "\fBFAULTED\fR", " \fBOFFLINE\fR", "\fBREMOVED\fR", or "\fBUNAVAIL\fR".
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBguid\fR\fR
-.ad
-.RS 20n
-.rt  
-A unique identifier for the pool.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBsize\fR\fR
-.ad
-.RS 20n
-.rt  
-Total size of the storage pool.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBunsupported@\fR\fIfeature_guid\fR\fR
-.ad
-.RS 20n
-.rt
-.sp
-Information about unsupported features that are enabled on the pool. See
-\fBzpool-features\fR(5) for details.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBused\fR\fR
-.ad
-.RS 20n
-.rt  
-Amount of storage space used within the pool.
-.RE
-
-.sp
-.LP
-The space usage properties report actual physical space available to the storage pool. The physical space can be different from the total amount of space that any contained datasets can actually use. The amount of space used in a \fBraidz\fR configuration depends on the characteristics of the data being written. In addition, \fBZFS\fR reserves some space for internal accounting that the \fBzfs\fR(8) command takes into account, but the \fBzpool\fR command does not. For non-full pools of a reasonable size, these effects should be invisible. For small pools, or pools that are close to being completely full, these discrepancies may become more noticeable.
-
-.sp
-.LP
-The following property can be set at creation time:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBashift\fR\fR
-.ad
-.sp .6
-.RS 4n
-Pool sector size exponent, to the power of 2 (internally referred to as "ashift"). I/O operations will be aligned to the specified size boundaries. Additionally, the minimum (disk) write size will be set to the specified size, so this represents a space vs. performance trade-off. The typical case for setting this property is when performance is important and the underlying disks use 4KiB sectors but report 512B sectors to the OS (for compatibility reasons); in that case, set \fBashift=12\fR (which is 1<<12 = 4096).
-.LP
-For optimal performance, the pool sector size should be greater than or equal to the sector size of the underlying disks. Since the property cannot be changed after pool creation, if in a given pool, you \fIever\fR want to use drives that \fIreport\fR 4KiB sectors, you must set \fBashift=12\fR at pool creation time.
-.LP
-Keep in mind is that the \fBashift\fR is \fIvdev\fR specific and is not a \fIpool\fR global.  This means that when adding new vdevs to an existing pool you may need to specify the \fBashift\fR.
-.RE
-
-.sp
-.LP
-The following property can be set at creation time and import time:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBaltroot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Alternate root directory. If set, this directory is prepended to any mount points within the pool. This can be used when examining an unknown pool where the mount points cannot be trusted, or in an alternate boot environment, where the typical paths are not valid. \fBaltroot\fR is not a persistent property. It is valid only while the system is up. Setting \fBaltroot\fR defaults to using \fBcachefile\fR=none, though this may be overridden using an explicit setting.
-.RE
-
-.sp
-.LP
-The following property can only be set at import time:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBreadonly\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-If set to \fBon\fR, the pool will be imported in read-only mode: Synchronous data in the intent log will not be accessible, properties of the pool can not be changed and datasets of the pool can only be mounted read-only.  The \fBreadonly\fR property of its datasets will be implicitly set to \fBon\fR.
-
-It can also be specified by its column name of \fBrdonly\fR.
-
-To write to a read-only pool, a export and import of the pool is required.
-.RE
-
-.sp
-.LP
-The following properties can be set at creation time and import time, and later changed with the \fBzpool set\fR command:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBautoexpand\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls automatic pool expansion when the underlying LUN is grown. If set to \fBon\fR, the pool will be resized according to the size of the expanded device. If the device is part of a mirror or \fBraidz\fR then all devices within that mirror/\fBraidz\fR group must be expanded before the new space is made available to the pool. The default behavior is \fBoff\fR. This property can also be referred to by its shortened column name, \fBexpand\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBautoreplace\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls automatic device replacement. If set to "\fBoff\fR", device replacement must be initiated by the administrator by using the "\fBzpool replace\fR" command. If set to "\fBon\fR", any new device, found in the same physical location as a device that previously belonged to the pool, is automatically formatted and replaced. The default behavior is "\fBoff\fR". This property can also be referred to by its shortened column name, "replace".
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBbootfs\fR=\fIpool\fR/\fIdataset\fR\fR
-.ad
-.sp .6
-.RS 4n
-Identifies the default bootable dataset for the root pool. This property is expected to be set mainly by the installation and upgrade programs.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcachefile\fR=\fIpath\fR | \fBnone\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the location of where the pool configuration is cached. Discovering all pools on system startup requires a cached copy of the configuration data that is stored on the root file system. All pools in this cache are automatically imported when the system boots. Some environments, such as install and clustering, need to cache this information in a different location so that pools are not automatically imported. Setting this property caches the pool configuration in a different location that can later be imported with "\fBzpool import -c\fR". Setting it to the special value "\fBnone\fR" creates a temporary pool that is never cached, and the special value \fB\&''\fR (empty string) uses the default location. 
-.sp
-Multiple pools can share the same cache file. Because the kernel destroys and recreates this file when pools are added and removed, care should be taken when attempting to access this file. When the last pool using a \fBcachefile\fR is exported or destroyed, the file is removed.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcomment\fR=\fB\fItext\fR\fR
-.ad
-.sp .6
-.RS 4n
-A text string consisting of printable ASCII characters that will be stored such that it is available even if the pool becomes faulted.  An administrator can provide additional information about a pool using this property.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBdedupditto\fR=\fB\fInumber\fR\fR
-.ad
-.sp .6
-.RS 4n
-Threshold for the number of block ditto copies. If the reference count for a deduplicated block increases above this number, a new ditto copy of this block is automatically stored. The default setting is 0 which causes no ditto copies to be created for deduplicated blocks.  The miniumum legal nonzero setting is 100.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBdelegation\fR=\fBon\fR | \fBoff\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether a non-privileged user is granted access based on the dataset permissions defined on the dataset. See \fBzfs\fR(8) for more information on \fBZFS\fR delegated administration.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBfailmode\fR=\fBwait\fR | \fBcontinue\fR | \fBpanic\fR\fR
-.ad
-.sp .6
-.RS 4n
-Controls the system behavior in the event of catastrophic pool failure. This condition is typically a result of a loss of connectivity to the underlying storage device(s) or a failure of all devices within the pool. The behavior of such an event is determined as follows:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBwait\fR\fR
-.ad
-.RS 12n
-.rt  
-Blocks all \fBI/O\fR access until the device connectivity is recovered and the errors are cleared. This is the default behavior.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBcontinue\fR\fR
-.ad
-.RS 12n
-.rt  
-Returns \fBEIO\fR to any new write \fBI/O\fR requests but allows reads to any of the remaining healthy devices. Any write requests that have yet to be committed to disk would be blocked.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBpanic\fR\fR
-.ad
-.RS 12n
-.rt  
-Prints out a message to the console and generates a system crash dump.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBfeature@\fR\fIfeature_name\fR=\fBenabled\fR\fR
-.ad
-.RS 4n
-The value of this property is the current state of \fIfeature_name\fR. The
-only valid value when setting this property is \fBenabled\fR which moves
-\fIfeature_name\fR to the enabled state. See \fBzpool-features\fR(5) for
-details on feature states.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBlistsnaps\fR=on | off\fR
-.ad
-.sp .6
-.RS 4n
-Controls whether information about snapshots associated with this pool is output when "\fBzfs list\fR" is run without the \fB-t\fR option. The default value is "off".
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBversion\fR=\fIversion\fR\fR
-.ad
-.sp .6
-.RS 4n
-The current on-disk version of the pool. This can be increased, but never decreased. The preferred method of updating pools is with the "\fBzpool upgrade\fR" command, though this property can be used when a specific version is needed for backwards compatibility. Once feature flags are enabled on a pool this property will no longer have a value.
-.RE
-
-.SS "Subcommands"
-.sp
-.LP
-All subcommands that modify state are logged persistently to the pool in their original form.
-.sp
-.LP
-The \fBzpool\fR command provides subcommands to create and destroy storage pools, add capacity to storage pools, and provide information about the storage pools. The following subcommands are supported:
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool\fR \fB-?\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays a help message.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool add\fR [\fB-fn\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIvdev\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Adds the specified virtual devices to the given pool. The \fIvdev\fR specification is described in the "Virtual Devices" section. The behavior of the \fB-f\fR option, and the device checks performed are described in the "zpool create" subcommand.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 6n
-.rt  
-Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-n\fR\fR
-.ad
-.RS 6n
-.rt  
-Displays the configuration that would be used without actually adding the \fBvdev\fRs. The actual pool creation can still fail due to insufficient privileges or device sharing.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty=value\fR
-.ad
-.sp .6
-.RS 4n
-Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is \fBashift\fR.  \fBDo note\fR that some properties (among them \fBashift\fR) are \fInot\fR inherited from a previous vdev. They are vdev specific, not pool specific.
-.RE
-
-Do not add a disk that is currently configured as a quorum device to a zpool. After a disk is in the pool, that disk can then be configured as a quorum device.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool attach\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIdevice\fR \fInew_device\fR\fR
-.ad
-.sp .6
-.RS 4n
-Attaches \fInew_device\fR to an existing \fBzpool\fR device. The existing device cannot be part of a \fBraidz\fR configuration. If \fIdevice\fR is not currently part of a mirrored configuration, \fIdevice\fR automatically transforms into a two-way mirror of \fIdevice\fR and \fInew_device\fR. If \fIdevice\fR is part of a two-way mirror, attaching \fInew_device\fR creates a three-way mirror, and so on. In either case, \fInew_device\fR begins to resilver immediately.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 6n
-.rt  
-Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty=value\fR
-.ad
-.sp .6
-.RS 4n
-Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is "ashift".
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool clear\fR \fIpool\fR [\fIdevice\fR] ...\fR
-.ad
-.sp .6
-.RS 4n
-Clears device errors in a pool. If no arguments are specified, all device errors within the pool are cleared. If one or more devices is specified, only those errors associated with the specified device or devices are cleared.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool create\fR [\fB-fnd\fR] [\fB-o\fR \fIproperty=value\fR] ... [\fB-O\fR \fIfile-system-property=value\fR] ... [\fB-m\fR \fImountpoint\fR] [\fB-R\fR \fIroot\fR] [\fB-t\fR \fItname\fR] \fIpool\fR \fIvdev\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Creates a new storage pool containing the virtual devices specified on the command line. The pool name must begin with a letter, and can only contain alphanumeric characters as well as underscore ("_"), dash ("-"), period ("."), colon (":"), and space (" "). The pool names "mirror", "raidz", "spare" and "log" are reserved, as are names beginning with the pattern "c[0-9]". The \fBvdev\fR specification is described in the "Virtual Devices" section.
-.sp
-The command verifies that each device specified is accessible and not currently in use by another subsystem. There are some uses, such as being currently mounted, or specified as the dedicated dump device, that prevents a device from ever being used by \fBZFS\fR. Other uses, such as having a preexisting \fBUFS\fR file system, can be overridden with the \fB-f\fR option.
-.sp
-The command also checks that the replication strategy for the pool is consistent. An attempt to combine redundant and non-redundant storage in a single pool, or to mix disks and files, results in an error unless \fB-f\fR is specified. The use of differently sized devices within a single \fBraidz\fR or mirror group is also flagged as an error unless \fB-f\fR is specified.
-.sp
-Unless the \fB-R\fR option is specified, the default mount point is "/\fIpool\fR". The mount point must not exist or must be empty, or else the root dataset cannot be mounted. This can be overridden with the \fB-m\fR option.
-.sp
-By default all supported features are enabled on the new pool unless the \fB-d\fR option is specified.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-Forces use of \fBvdev\fRs, even if they appear in use or specify a conflicting replication level. Not all devices can be overridden in this manner.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-n\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays the configuration that would be used without actually creating the pool. The actual pool creation can still fail due to insufficient privileges or device sharing.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR\fR
-.ad
-.sp .6
-.RS 4n
-Do not enable any features on the new pool. Individual features can be enabled by setting their corresponding properties to \fBenabled\fR with the \fB-o\fR option. See \fBzpool-features\fR(5) for details about feature properties.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-o\fR \fIproperty=value\fR [\fB-o\fR \fIproperty=value\fR] ...\fR
-.ad
-.sp .6
-.RS 4n
-Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-O\fR \fIfile-system-property=value\fR\fR
-.ad
-.br
-.na
-\fB[\fB-O\fR \fIfile-system-property=value\fR] ...\fR
-.ad
-.sp .6
-.RS 4n
-Sets the given file system properties in the root file system of the pool. See the "Properties" section of \fBzfs\fR(8) for a list of valid properties that can be set.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR \fIroot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Equivalent to "-o cachefile=none,altroot=\fIroot\fR"
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-m\fR \fImountpoint\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the mount point for the root dataset. The default mount point is "/\fIpool\fR" or "\fBaltroot\fR/\fIpool\fR" if \fBaltroot\fR is specified. The mount point must be an absolute path, "\fBlegacy\fR", or "\fBnone\fR". For more information on dataset mount points, see \fBzfs\fR(8).
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-t\fR \fItname\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the in-core pool name to "\fBtname\fR" while the on-disk name will be the name specified as the pool name "\fBpool\fR". This will set the default cachefile property to none. This is intended to handle name space collisions when creating pools for other systems, such as virtual machines or physical machines whose pools live on network block devices.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool destroy\fR [\fB-f\fR] \fIpool\fR\fR
-.ad
-.sp .6
-.RS 4n
-Destroys the given pool, freeing up any devices for other use. This command tries to unmount any active datasets before destroying the pool.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 6n
-.rt  
-Forces any active datasets contained within the pool to be unmounted.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool detach\fR \fIpool\fR \fIdevice\fR\fR
-.ad
-.sp .6
-.RS 4n
-Detaches \fIdevice\fR from a mirror. The operation is refused if there are no other valid replicas of the data.  If \fIdevice\fR may be re-added to the pool later on then consider the "\fBzpool offline\fR" command instead.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzpool events\fR [\fB-vHfc\fR] [\fIpool\fR] ...
-.ad
-.sp .6
-.RS 4n
-Description of the different events generated by the ZFS kernel modules. See \fBzfs-events\fR(5) for more information about the subclasses and event payloads that can be generated.
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-v\fR\fR
-.ad
-.RS 6n
-.rt
-Get a full detail of the events and what information is available about it.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-H\fR\fR
-.ad
-.RS 6n
-.rt
-Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 6n
-.rt
-Follow mode.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-c\fR\fR
-.ad
-.RS 6n
-.rt
-Clear all previous events.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool export\fR [\fB-a\fR] [\fB-f\fR] \fIpool\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Exports the given pools from the system. All devices are marked as exported, but are still considered in use by other subsystems. The devices can be moved between systems (even those of different endianness) and imported as long as a sufficient number of devices are present.
-.sp
-Before exporting the pool, all datasets within the pool are unmounted. A pool can not be exported if it has a shared spare that is currently being used.
-.sp
-For pools to be portable, you must give the \fBzpool\fR command whole disks, not just partitions, so that \fBZFS\fR can label the disks with portable \fBEFI\fR labels. Otherwise, disk drivers on platforms of different endianness will not recognize the disks.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.RS 6n
-.rt
-Exports all pools imported on the system.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 6n
-.rt
-Forcefully unmount all datasets, using the "\fBunmount -f\fR" command.
-.sp
-This command will forcefully export the pool even if it has a shared spare that is currently being used. This may lead to potential data corruption.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool get\fR [\fB-p\fR] "\fIall\fR" | \fIproperty\fR[,...] \fIpool\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Retrieves the given list of properties (or all properties if "\fBall\fR" is used) for the specified storage pool(s). These properties are displayed with the following fields:
-.sp
-.in +2
-.nf
-       name          Name of storage pool
-        property      Property name
-        value         Property value
-        source        Property source, either 'default' or 'local'.
-.fi
-.in -2
-.sp
-
-See the "Properties" section for more information on the available pool properties.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-p\fR\fR
-.ad
-.RS 6n
-.rt
-Display numbers in parseable (exact) values.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-H\fR\fR
-.ad
-.RS 6n
-.rt
-Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool history\fR [\fB-il\fR] [\fIpool\fR] ...\fR
-.ad
-.sp .6
-.RS 4n
-Displays the command history of the specified pools or all pools if no pool is specified.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-i\fR\fR
-.ad
-.RS 6n
-.rt  
-Displays internally logged \fBZFS\fR events in addition to user initiated events.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-l\fR\fR
-.ad
-.RS 6n
-.rt  
-Displays log records in long format, which in addition to standard format includes, the user name, the hostname, and the zone in which the operation was performed.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool import\fR [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR]\fR
-.ad
-.sp .6
-.RS 4n
-Lists pools available to import. If the \fB-d\fR option is not specified, this command searches for devices in "/dev". The \fB-d\fR option can be specified multiple times, and all directories are searched. If the device appears to be part of an exported pool, this command displays a summary of the pool with the name of the pool, a numeric identifier, as well as the \fIvdev\fR layout and current health of the device for each device or file. Destroyed pools, pools that were previously destroyed with the "\fBzpool destroy\fR" command, are not listed unless the \fB-D\fR option is specified. 
-.sp
-The numeric identifier is unique, and can be used instead of the pool name when multiple exported pools of the same name are available.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-c\fR \fIcachefile\fR\fR
-.ad
-.RS 16n
-.rt  
-Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR \fIdir\fR\fR
-.ad
-.RS 16n
-.rt  
-Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-D\fR\fR
-.ad
-.RS 16n
-.rt  
-Lists destroyed pools only.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-N\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] \fB-a\fR\fR
-.ad
-.sp .6
-.RS 4n
-Imports all pools found in the search directories. Identical to the previous command, except that all pools with a sufficient number of devices available are imported. Destroyed pools, pools that were previously destroyed with the "\fBzpool destroy\fR" command, will not be imported unless the \fB-D\fR option is specified.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fImntopts\fR\fR
-.ad
-.RS 21n
-.rt  
-Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty=value\fR\fR
-.ad
-.RS 21n
-.rt  
-Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-c\fR \fIcachefile\fR\fR
-.ad
-.RS 21n
-.rt  
-Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR \fIdir\fR\fR
-.ad
-.RS 21n
-.rt  
-Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-D\fR\fR
-.ad
-.RS 21n
-.rt  
-Imports destroyed pools only. The \fB-f\fR option is also required.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 21n
-.rt  
-Forces import, even if the pool appears to be potentially active.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-F\fR\fR
-.ad
-.RS 21n
-Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.RS 21n
-.rt  
-Searches for and imports all pools found. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-m\fR\fR
-.ad
-.RS 21n
-Allows a pool to import when there is a missing log device.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR \fIroot\fR\fR
-.ad
-.RS 21n
-.rt  
-Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-N\fR\fR
-.ad
-.RS 21n
-Import the pool without mounting any file systems.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-n\fR\fR
-.ad
-.RS 21n
-Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the \fB-F\fR option, above.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-X\fR\fR
-.ad
-.RS 21n
-Used with the \fB-F\fR recovery option. Determines whether extreme measures to find a valid txg should take place.  This allows the pool to be rolled back to a txg which is no longer guaranteed to be consistent.  Pools imported at an inconsistent txg may contain uncorrectable checksum errors.  For more details about pool recovery mode, see the \fB-F\fR option, above.
-\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-T\fR\fR
-.ad
-.RS 21n
-Specify the txg to use for rollback.  Implies \fB-FX\fR. For more details about pool recovery mode, see the \fB-X\fR option, above.
-\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool import\fR [\fB-o\fR \fImntopts\fR] [ \fB-o\fR \fIproperty\fR=\fIvalue\fR] ... [\fB-d\fR \fIdir\fR | \fB-c\fR \fIcachefile\fR] [\fB-D\fR] [\fB-f\fR] [\fB-m\fR] [\fB-R\fR \fIroot\fR] [\fB-F\fR [\fB-n\fR]] [\fB-t\fR]] \fIpool\fR | \fIid\fR [\fInewpool\fR]\fR
-.ad
-.sp .6
-.RS 4n
-Imports a specific pool. A pool can be identified by its name or the numeric identifier. If \fInewpool\fR is specified, the pool is imported using the name \fInewpool\fR. Otherwise, it is imported with the same name as its exported name.
-.sp
-If a device is removed from a system without running "\fBzpool export\fR" first, the device appears as potentially active. It cannot be determined if this was a failed export, or whether the device is really in use from another host. To import a pool in this state, the \fB-f\fR option is required.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fImntopts\fR\fR
-.ad
-.sp .6
-.RS 4n
-Comma-separated list of mount options to use when mounting datasets within the pool. See \fBzfs\fR(8) for a description of dataset properties and mount options.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty=value\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the specified property on the imported pool. See the "Properties" section for more information on the available pool properties.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-c\fR \fIcachefile\fR\fR
-.ad
-.sp .6
-.RS 4n
-Reads configuration from the given \fBcachefile\fR that was created with the "\fBcachefile\fR" pool property. This \fBcachefile\fR is used instead of searching for devices.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-d\fR \fIdir\fR\fR
-.ad
-.sp .6
-.RS 4n
-Searches for devices or files in \fIdir\fR. The \fB-d\fR option can be specified multiple times. This option is incompatible with the \fB-c\fR option.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-D\fR\fR
-.ad
-.sp .6
-.RS 4n
-Imports destroyed pool. The \fB-f\fR option is also required.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.sp .6
-.RS 4n
-Forces import, even if the pool appears to be potentially active.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-F\fR\fR
-.ad
-.sp .6
-.RS 4n
-Recovery mode for a non-importable pool. Attempt to return the pool to an importable state by discarding the last few transactions. Not all damaged pools can be recovered by using this option. If successful, the data from the discarded transactions is irretrievably lost. This option is ignored if the pool is importable or already imported.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR \fIroot\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the "\fBcachefile\fR" property to "\fBnone\fR" and the "\fIaltroot\fR" property to "\fIroot\fR".
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-n\fR\fR
-.ad
-.sp .6
-.RS 4n
-Used with the \fB-F\fR recovery option. Determines whether a non-importable pool can be made importable again, but does not actually perform the pool recovery. For more details about pool recovery mode, see the \fB-F\fR option, above.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-X\fR\fR
-.ad
-.sp .6
-.RS 4n
-Used with the \fB-F\fR recovery option. Determines whether extreme measures to find a valid txg should take place.  This allows the pool to be rolled back to a txg which is no longer guaranteed to be consistent.  Pools imported at an inconsistent txg may contain uncorrectable checksum errors.  For more details about pool recovery mode, see the \fB-F\fR option, above.
-\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-T\fR\fR
-.ad
-.sp .6
-.RS 4n
-Specify the txg to use for rollback.  Implies \fB-FX\fR. For more details about pool recovery mode, see the \fB-X\fR option, above.
-\fBWARNING\fR: This option can be extremely hazardous to the health of your pool and should only be used as a last resort.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-t\fR\fR
-.ad
-.sp .6
-.RS 4n
-Used with "\fBnewpool\fR". Specifies that "\fBnewpool\fR" is temporary. Temporary pool names last until export. Ensures that the original pool name will be used in all label updates and therefore is retained upon export. Will also set -o cachefile=none when not explicitly specified.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-m\fR\fR
-.ad
-.sp .6
-.RS 4n
-Allows a pool to import when there is a missing log device.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool iostat\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-v\fR] [\fB-y\fR] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
-.ad
-.sp .6
-.RS 4n
-Displays \fBI/O\fR statistics for the given pools. When given an interval, the statistics are printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If no \fIpools\fR are specified, statistics for every pool in the system is shown. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-T\fR \fBu\fR | \fBd\fR\fR
-.ad
-.RS 12n
-.rt  
-Display a time stamp.
-.sp
-Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-v\fR\fR
-.ad
-.RS 12n
-.rt  
-Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wide statistics.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-y\fR\fR
-.ad
-.RS 12n
-.rt
-Omit statistics since boot.  Normally the first line of output reports the statistics since boot.  This option suppresses that first line of output.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool labelclear\fR [\fB-f\fR] \fIdevice\fR
-.ad
-.sp .6
-.RS 4n
-Removes ZFS label information from the specified device. The device must not be part of an active pool configuration.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 12n
-.rt
-Treat exported or foreign devices as inactive.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool list\fR [\fB-T\fR \fBd\fR | \fBu\fR] [\fB-Hv\fR] [\fB-o\fR \fIprops\fR[,...]] [\fIpool\fR] ... [\fIinterval\fR[\fIcount\fR]]\fR
-.ad
-.sp .6
-.RS 4n
-Lists the given pools along with a health status and space usage. If no \fIpools\fR are specified, all pools in the system are listed. When given an \fIinterval\fR, the information is printed every \fIinterval\fR seconds until \fBCtrl-C\fR is pressed. If \fIcount\fR is specified, the command exits after \fIcount\fR reports are printed.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-H\fR\fR
-.ad
-.RS 12n
-.rt  
-Scripted mode. Do not display headers, and separate fields by a single tab instead of arbitrary space.
-.RE
-
-.ne 2
-.mk
-.na
-\fB\fB-T\fR \fBd\fR | \fBu\fR\fR
-.ad
-.RS 12n
-.rt  
-Display a time stamp.
-.sp
-Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIprops\fR\fR
-.ad
-.RS 12n
-.rt  
-Comma-separated list of properties to display. See the "Properties" section for a list of valid properties. The default list is "name, size, used, available, fragmentation, expandsize, capacity, dedupratio, health, altroot"
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-v\fR\fR
-.ad
-.RS 12n
-.rt
-Verbose statistics. Reports usage statistics for individual \fIvdevs\fR within the pool, in addition to the pool-wise statistics.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool offline\fR [\fB-t\fR] \fIpool\fR \fIdevice\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Takes the specified physical device offline. While the \fIdevice\fR is offline, no attempt is made to read or write to the device.
-.sp
-This command is not applicable to spares or cache devices.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-t\fR\fR
-.ad
-.RS 6n
-.rt  
-Temporary. Upon reboot, the specified physical device reverts to its previous state.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool online\fR [\fB-e\fR] \fIpool\fR \fIdevice\fR...\fR
-.ad
-.sp .6
-.RS 4n
-Brings the specified physical device online.
-.sp
-This command is not applicable to spares or cache devices.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-e\fR\fR
-.ad
-.RS 6n
-.rt  
-Expand the device to use all available space. If the device is part of a mirror or \fBraidz\fR then all devices must be expanded before the new space will become available to the pool.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool reguid\fR \fIpool\fR
-.ad
-.sp .6
-.RS 4n
-Generates a new unique identifier for the pool. You must ensure that all
-devices in this pool are online and healthy before performing this action.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBzpool reopen\fR \fIpool\fR
-.ad
-.sp .6
-.RS 4n
-Reopen all the vdevs associated with the pool.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fBzpool remove\fR \fIpool\fR \fIdevice\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Removes the specified device from the pool. This command currently only supports removing hot spares, cache, and log devices. A mirrored log device can be removed by specifying the top-level mirror for the log. Non-log devices that are part of a mirrored configuration can be removed using the \fBzpool detach\fR command. Non-redundant and \fBraidz\fR devices cannot be removed from a pool.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool replace\fR [\fB-f\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fIold_device\fR [\fInew_device\fR]\fR
-.ad
-.sp .6
-.RS 4n
-Replaces \fIold_device\fR with \fInew_device\fR. This is equivalent to attaching \fInew_device\fR, waiting for it to resilver, and then detaching \fIold_device\fR.
-.sp
-The size of \fInew_device\fR must be greater than or equal to the minimum size of all the devices in a mirror or \fBraidz\fR configuration.
-.sp
-\fInew_device\fR is required if the pool is not redundant. If \fInew_device\fR is not specified, it defaults to \fIold_device\fR. This form of replacement is useful after an existing disk has failed and has been physically replaced. In this case, the new disk may have the same \fB/dev\fR path as the old device, even though it is actually a different disk. \fBZFS\fR recognizes this.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-f\fR\fR
-.ad
-.RS 6n
-.rt  
-Forces use of \fInew_device\fR, even if its appears to be in use. Not all devices can be overridden in this manner.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty=value\fR
-.ad
-.sp .6n
-.RS 6n
-Sets the given pool properties. See the "Properties" section for a list of valid properties that can be set. The only property supported at the moment is \fBashift\fR.  \fBDo note\fR that some properties (among them \fBashift\fR) are \fInot\fR inherited from a previous vdev. They are vdev specific, not pool specific.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool scrub\fR [\fB-s\fR] \fIpool\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Begins a scrub. The scrub examines all data in the specified pools to verify that it checksums correctly. For replicated (mirror or \fBraidz\fR) devices, \fBZFS\fR automatically repairs any damage discovered during the scrub. The "\fBzpool status\fR" command reports the progress of the scrub and summarizes the results of the scrub upon completion.
-.sp
-Scrubbing and resilvering are very similar operations. The difference is that resilvering only examines data that \fBZFS\fR knows to be out of date (for example, when attaching a new device to a mirror or replacing an existing device), whereas scrubbing examines all data to discover silent errors due to hardware faults or disk failure.
-.sp
-Because scrubbing and resilvering are \fBI/O\fR-intensive operations, \fBZFS\fR only allows one at a time. If a scrub is already in progress, the "\fBzpool scrub\fR" command terminates it and starts a new scrub. If a resilver is in progress, \fBZFS\fR does not allow a scrub to be started until the resilver completes.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-s\fR\fR
-.ad
-.RS 6n
-.rt  
-Stop scrubbing.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool set\fR \fIproperty\fR=\fIvalue\fR \fIpool\fR\fR
-.ad
-.sp .6
-.RS 4n
-Sets the given property on the specified pool. See the "Properties" section for more information on what properties can be set and acceptable values.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzpool split\fR [\fB-n\fR] [\fB-R\fR \fIaltroot\fR] [\fB-o\fR \fIproperty=value\fR] \fIpool\fR \fInewpool\fR [\fIdevice\fR ...]
-.ad
-.sp .6
-.RS 4n
-Split devices off \fIpool\fR creating \fInewpool\fR. All \fBvdev\fRs in \fIpool\fR must be mirrors and the pool must not be in the process of resilvering. At the time of the split, \fInewpool\fR will be a replica of \fIpool\fR. By default, the last device in each mirror is split from \fIpool\fR to create \fInewpool\fR.
-
-The optional \fIdevice\fR specification causes the specified device(s) to be included in the new pool and, should any devices remain unspecified, the last device in each mirror is used as would be by default.
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-n\fR \fR
-.ad
-.sp .6
-.RS 4n
-Do dry run, do not actually perform the split. Print out the expected configuration of \fInewpool\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-R\fR \fIaltroot\fR \fR
-.ad
-.sp .6
-.RS 4n
-Set \fIaltroot\fR for \fInewpool\fR and automaticaly import it.  This can be useful to avoid mountpoint collisions if \fInewpool\fR is imported on the same filesystem as \fIpool\fR.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-o\fR \fIproperty=value\fR \fR
-.ad
-.sp .6
-.RS 4n
-Sets the specified property for \fInewpool\fR. See the “Properties” section for more information on the available pool properties.
-.RE
-
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fBzpool status\fR [\fB-xvD\fR] [\fB-T\fR d | u] [\fIpool\fR] ... [\fIinterval\fR [\fIcount\fR]]
-.ad
-.sp .6
-.RS 4n
-Displays the detailed health status for the given pools. If no \fIpool\fR is specified, then the status of each pool in the system is displayed. For more information on pool and device health, see the "Device Failure and Recovery" section.
-.sp
-If a scrub or resilver is in progress, this command reports the percentage done and the estimated time to completion. Both of these are only approximate, because the amount of data in the pool and the other workloads on the system can change.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-x\fR\fR
-.ad
-.RS 12n
-.rt  
-Only display status for pools that are exhibiting errors or are otherwise unavailable. Warnings about pools not using the latest on-disk format will not be included.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-v\fR\fR
-.ad
-.RS 12n
-.rt  
-Displays verbose data error information, printing out a complete list of all data errors since the last complete pool scrub.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-D\fR\fR
-.ad
-.RS 12n
-.rt
-Display a histogram of deduplication statistics, showing the allocated (physically present on disk) and
-referenced (logically referenced in the pool) block counts and sizes by reference count.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-T\fR \fBd\fR | \fBu\fR\fR
-.ad
-.RS 12n
-.rt
-Display a time stamp.
-.sp
-Specify \fBu\fR for a printed representation of the internal representation of time. See \fBtime\fR(2). Specify \fBd\fR for standard date format. See \fBdate\fR(1).
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool upgrade\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays pools which do not have all supported features enabled and pools formatted using a legacy ZFS version number. These pools can continue to be used, but some features may not be available. Use "\fBzpool upgrade -a\fR" to enable all features on all pools.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool upgrade\fR \fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Displays legacy \fBZFS\fR versions supported by the current software. See \fBzfs-features\fR(5) for a description of feature flags features supported by the current software.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fBzpool upgrade\fR [\fB-V\fR \fIversion\fR] \fB-a\fR | \fIpool\fR ...\fR
-.ad
-.sp .6
-.RS 4n
-Enables all supported features on the given pool. Once this is done, the pool will no longer be accessible on systems that do not support feature flags. See \fBzfs-features\fR(5) for details on compatibility with systems that support feature flags, but do not support all features enabled on the pool.
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-a\fR\fR
-.ad
-.RS 14n
-.rt
-Enables all supported features on all pools.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB-V\fR \fIversion\fR\fR
-.ad
-.RS 14n
-.rt
-Upgrade to the specified legacy version. If the \fB-V\fR flag is specified, no features will be enabled on the pool. This option can only be used to increase the version number up to the last supported legacy version number.
-.RE
-
-.RE
-
-.SH EXAMPLES
-.LP
-\fBExample 1 \fRCreating a RAID-Z Storage Pool
-.sp
-.LP
-The following command creates a pool with a single \fBraidz\fR root \fIvdev\fR that consists of six disks.
-
-.sp
-.in +2
-.nf
-# \fBzpool create tank raidz sda sdb sdc sdd sde sdf\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 2 \fRCreating a Mirrored Storage Pool
-.sp
-.LP
-The following command creates a pool with two mirrors, where each mirror contains two disks.
-
-.sp
-.in +2
-.nf
-# \fBzpool create tank mirror sda sdb mirror sdc sdd\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 3 \fRCreating a ZFS Storage Pool by Using Partitions
-.sp
-.LP
-The following command creates an unmirrored pool using two disk partitions.
-
-.sp
-.in +2
-.nf
-# \fBzpool create tank sda1 sdb2\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 4 \fRCreating a ZFS Storage Pool by Using Files
-.sp
-.LP
-The following command creates an unmirrored pool using files. While not recommended, a pool based on files can be useful for experimental purposes.
-
-.sp
-.in +2
-.nf
-# \fBzpool create tank /path/to/file/a /path/to/file/b\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 5 \fRAdding a Mirror to a ZFS Storage Pool
-.sp
-.LP
-The following command adds two mirrored disks to the pool \fItank\fR, assuming the pool is already made up of two-way mirrors. The additional space is immediately available to any datasets within the pool.
-
-.sp
-.in +2
-.nf
-# \fBzpool add tank mirror sda sdb\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 6 \fRListing Available ZFS Storage Pools
-.sp
-.LP
-The following command lists all available pools on the system. In this case, the pool \fIzion\fR is faulted due to a missing device.
-
-.sp
-.LP
-The results from this command are similar to the following:
-
-.sp
-.in +2
-.nf
-# \fBzpool list\fR
-NAME    SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
-rpool  19.9G  8.43G  11.4G    33%         -    42%  1.00x  ONLINE  -
-tank   61.5G  20.0G  41.5G    48%         -    32%  1.00x  ONLINE  -
-zion       -      -      -      -         -      -      -  FAULTED -
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 7 \fRDestroying a ZFS Storage Pool
-.sp
-.LP
-The following command destroys the pool \fItank\fR and any datasets contained within.
-
-.sp
-.in +2
-.nf
-# \fBzpool destroy -f tank\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 8 \fRExporting a ZFS Storage Pool
-.sp
-.LP
-The following command exports the devices in pool \fItank\fR so that they can be relocated or later imported.
-
-.sp
-.in +2
-.nf
-# \fBzpool export tank\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 9 \fRImporting a ZFS Storage Pool
-.sp
-.LP
-The following command displays available pools, and then imports the pool \fItank\fR for use on the system.
-
-.sp
-.LP
-The results from this command are similar to the following:
-
-.sp
-.in +2
-.nf
-# \fBzpool import\fR
-  pool: tank
-    id: 15451357997522795478
- state: ONLINE
-action: The pool can be imported using its name or numeric identifier.
-config:
-
-        tank        ONLINE
-          mirror    ONLINE
-            sda     ONLINE
-            sdb     ONLINE
-
-# \fBzpool import tank\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 10 \fRUpgrading All ZFS Storage Pools to the Current Version
-.sp
-.LP
-The following command upgrades all ZFS Storage pools to the current version of the software.
-
-.sp
-.in +2
-.nf
-# \fBzpool upgrade -a\fR
-This system is currently running ZFS pool version 28.
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 11 \fRManaging Hot Spares
-.sp
-.LP
-The following command creates a new pool with an available hot spare:
-
-.sp
-.in +2
-.nf
-# \fBzpool create tank mirror sda sdb spare sdc\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-If one of the disks were to fail, the pool would be reduced to the degraded state. The failed device can be replaced using the following command:
-
-.sp
-.in +2
-.nf
-# \fBzpool replace tank sda sdd\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Once the data has been resilvered, the spare is automatically removed and is made available for use should another device fails. The hot spare can be permanently removed from the pool using the following command:
-
-.sp
-.in +2
-.nf
-# \fBzpool remove tank sdc\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 12 \fRCreating a ZFS Pool with Mirrored Separate Intent Logs
-.sp
-.LP
-The following command creates a ZFS storage pool consisting of two, two-way mirrors and mirrored log devices:
-
-.sp
-.in +2
-.nf
-# \fBzpool create pool mirror sda sdb mirror sdc sdd log mirror \e
-   sde sdf\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 13 \fRAdding Cache Devices to a ZFS Pool
-.sp
-.LP
-The following command adds two disks for use as cache devices to a ZFS storage pool:
-
-.sp
-.in +2
-.nf
-# \fBzpool add pool cache sdc sdd\fR
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-Once added, the cache devices gradually fill with content from main memory. Depending on the size of your cache devices, it could take over an hour for them to fill. Capacity and reads can be monitored using the \fBiostat\fR option as follows: 
-
-.sp
-.in +2
-.nf
-# \fBzpool iostat -v pool 5\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 14 \fRRemoving a Mirrored Log Device
-.sp
-.LP
-The following command removes the mirrored log device \fBmirror-2\fR.
-
-.sp
-.LP
-Given this configuration:
-
-.sp
-.in +2
-.nf
-   pool: tank
-  state: ONLINE
-  scrub: none requested
-config:
-
-         NAME        STATE     READ WRITE CKSUM
-         tank        ONLINE       0     0     0
-           mirror-0  ONLINE       0     0     0
-             sda     ONLINE       0     0     0
-             sdb     ONLINE       0     0     0
-           mirror-1  ONLINE       0     0     0
-             sdc     ONLINE       0     0     0
-             sdd     ONLINE       0     0     0
-         logs
-           mirror-2  ONLINE       0     0     0
-             sde     ONLINE       0     0     0
-             sdf     ONLINE       0     0     0
-.fi
-.in -2
-.sp
-
-.sp
-.LP
-The command to remove the mirrored log \fBmirror-2\fR is:
-
-.sp
-.in +2
-.nf
-# \fBzpool remove tank mirror-2\fR
-.fi
-.in -2
-.sp
-
-.LP
-\fBExample 15 \fRDisplaying expanded space on a device
-.sp
-.LP
-The following command displays the detailed information for the \fIdata\fR
-pool. This pool is comprised of a single \fIraidz\fR vdev where one of its
-devices increased its capacity by 10GB. In this example, the pool will not 
-be able to utilized this extra capacity until all the devices under the
-\fIraidz\fR vdev have been expanded.
-
-.sp
-.in +2
-.nf
-# \fBzpool list -v data\fR
-NAME         SIZE  ALLOC   FREE   FRAG  EXPANDSZ    CAP  DEDUP  HEALTH  ALTROOT
-data        23.9G  14.6G  9.30G    48%         -    61%  1.00x  ONLINE  -
-  raidz1    23.9G  14.6G  9.30G    48%         -
-    c1t1d0      -      -      -      -         -
-    c1t2d0      -      -      -      -       10G
-    c1t3d0      -      -      -      -         -
-.fi
-.in -2
-
-.SH EXIT STATUS
-.sp
-.LP
-The following exit values are returned:
-.sp
-.ne 2
-.mk
-.na
-\fB\fB0\fR\fR
-.ad
-.RS 5n
-.rt  
-Successful completion. 
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB1\fR\fR
-.ad
-.RS 5n
-.rt  
-An error occurred.
-.RE
-
-.sp
-.ne 2
-.mk
-.na
-\fB\fB2\fR\fR
-.ad
-.RS 5n
-.rt  
-Invalid command line options were specified.
-.RE
-
-.SH "ENVIRONMENT VARIABLES"
-.TP
-.B "ZFS_ABORT
-Cause \fBzpool\fR to dump core on exit for the purposes of running \fB::findleaks\fR.
-.TP
-.B "ZPOOL_IMPORT_PATH"
-The search path for devices or files to use with the pool. This is a colon-separated list of directories in which \fBzpool\fR looks for device nodes and files.
-Similar to the \fB-d\fR option in \fIzpool import\fR.
-
-.SH SEE ALSO
-.sp
-.LP
-\fBzfs\fR(8), \fBzpool-features\fR(5), \fBzfs-events\fR(5)
diff --git a/zfs/man/man8/zstreamdump.8 b/zfs/man/man8/zstreamdump.8
deleted file mode 100644 (file)
index dc88dfb..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-'\" te
-.\" Copyright (c) 2009, Sun Microsystems, Inc. All Rights Reserved
-.\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License. You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.
-.\"  See the License for the specific language governing permissions and limitations under the License. When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with
-.\" the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
-.TH zstreamdump 8 "29 Aug 2012" "ZFS pool 28, filesystem 5" "System Administration Commands"
-.SH NAME
-zstreamdump \- filter data in zfs send stream
-.SH SYNOPSIS
-.LP
-.nf
-\fBzstreamdump\fR [\fB-C\fR] [\fB-v\fR]
-.fi
-
-.SH DESCRIPTION
-.sp
-.LP
-The \fBzstreamdump\fR utility reads from the output of the \fBzfs send\fR
-command, then displays headers and some statistics from that output.  See
-\fBzfs\fR(1M).
-.SH OPTIONS
-.sp
-.LP
-The following options are supported:
-.sp
-.ne 2
-.na
-\fB\fB-C\fR\fR
-.ad
-.sp .6
-.RS 4n
-Suppress the validation of checksums.
-.RE
-
-.sp
-.ne 2
-.na
-\fB\fB-v\fR\fR
-.ad
-.sp .6
-.RS 4n
-Verbose. Dump all headers, not only begin and end headers.
-.RE
-
-.SH SEE ALSO
-.sp
-.LP
-\fBzfs\fR(8)
diff --git a/zfs/module/.gitignore b/zfs/module/.gitignore
deleted file mode 100644 (file)
index 9a413ae..0000000
+++ /dev/null
@@ -1,9 +0,0 @@
-*.ko
-*.ko.unsigned
-*.ko.out
-*.ko.out.sig
-.*.cmd
-
-/.tmp_versions
-/Module.markers
-/Module.symvers
index e8d34c894b3d9ece2d1e8f5319e0903b79c6fb8f..d4ddee2f429f9b5eca4770457fab606bf590cf56 100644 (file)
@@ -47,7 +47,7 @@ modules_install:
                KERNELRELEASE=@LINUX_VERSION@
        @# Remove extraneous build products when packaging
        kmoddir=$(DESTDIR)$(INSTALL_MOD_PATH)/lib/modules/@LINUX_VERSION@; \
-       if [ -n $$kmoddir ]; then \
+       if [ -n "$(DESTDIR)" ]; then \
                find $$kmoddir -name 'modules.*' | xargs $(RM); \
        fi
        sysmap=$(DESTDIR)$(INSTALL_MOD_PATH)/boot/System.map-@LINUX_VERSION@; \
index 4e7e059248776b4eb3b0b7a76bc5d2708de3f97e..729f8936e329269f7a9bf831807b8ae1c6df0095 100644 (file)
@@ -3762,8 +3762,7 @@ arc_adapt(int bytes, arc_state_t *state)
         * If we're within (2 * maxblocksize) bytes of the target
         * cache size, increment the target cache size
         */
-       ASSERT3U(arc_c, >=, 2ULL << SPA_MAXBLOCKSHIFT);
-       arc_c = MAX(arc_c, 2ULL << SPA_MAXBLOCKSHIFT);
+       VERIFY3U(arc_c, >=, 2ULL << SPA_MAXBLOCKSHIFT);
        if (arc_size >= arc_c - (2ULL << SPA_MAXBLOCKSHIFT)) {
                atomic_add_64(&arc_c, (int64_t)bytes);
                if (arc_c > arc_c_max)
@@ -5250,7 +5249,7 @@ arc_tuning_update(void)
                arc_c_max = zfs_arc_max;
                arc_c = arc_c_max;
                arc_p = (arc_c >> 1);
-               arc_meta_limit = MIN(arc_meta_limit, (3 * arc_c_max) / 4);
+               arc_meta_limit = MIN(arc_meta_limit, arc_c_max);
        }
 
        /* Valid range: 32M - <arc_c_max> */
index 2e23a341fb13119ecd98902715543e53c038834f..b4831a724c36554deb249c32391063616621d099 100644 (file)
@@ -867,7 +867,7 @@ spa_taskqs_init(spa_t *spa, zio_type_t t, zio_taskq_type_t q)
        case ZTI_MODE_BATCH:
                batch = B_TRUE;
                flags |= TASKQ_THREADS_CPU_PCT;
-               value = zio_taskq_batch_pct;
+               value = MIN(zio_taskq_batch_pct, 100);
                break;
 
        default:
@@ -6804,4 +6804,9 @@ MODULE_PARM_DESC(spa_load_verify_metadata,
 module_param(spa_load_verify_data, int, 0644);
 MODULE_PARM_DESC(spa_load_verify_data,
        "Set to traverse data on pool import");
+
+module_param(zio_taskq_batch_pct, uint, 0444);
+MODULE_PARM_DESC(zio_taskq_batch_pct,
+       "Percentage of CPUs to run an IO worker thread");
+
 #endif
index 4a4544f29ed2d3024ca4381700f7b82828b21474..0c62a6fa3c7df4b3de618166dab6c710d7b6642a 100644 (file)
@@ -502,6 +502,7 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
        boolean_t stretch = B_FALSE;
        avl_tree_t *t = vdev_queue_type_tree(vq, zio->io_type);
        enum zio_flag flags = zio->io_flags & ZIO_FLAG_AGG_INHERIT;
+       void *buf;
 
        if (zio->io_flags & ZIO_FLAG_DONT_AGGREGATE)
                return (NULL);
@@ -608,8 +609,12 @@ vdev_queue_aggregate(vdev_queue_t *vq, zio_t *zio)
        size = IO_SPAN(first, last);
        ASSERT3U(size, <=, zfs_vdev_aggregation_limit);
 
+       buf = zio_buf_alloc_flags(size, KM_NOSLEEP);
+       if (buf == NULL)
+               return (NULL);
+
        aio = zio_vdev_delegated_io(first->io_vd, first->io_offset,
-           zio_buf_alloc(size), size, first->io_type, zio->io_priority,
+           buf, size, first->io_type, zio->io_priority,
            flags | ZIO_FLAG_DONT_CACHE | ZIO_FLAG_DONT_QUEUE,
            vdev_queue_agg_io_done, NULL);
        aio->io_timestamp = first->io_timestamp;
index c5ea392b6a1d510637a0dc15bc1f5aed720f5fd9..c9398e885fdafc40c955516ae432b3faf26ff58c 100644 (file)
@@ -504,6 +504,16 @@ zap_get_leaf_byblk(zap_t *zap, uint64_t blkid, dmu_tx_t *tx, krw_t lt,
 
        ASSERT(RW_LOCK_HELD(&zap->zap_rwlock));
 
+       /*
+        * If system crashed just after dmu_free_long_range in zfs_rmnode, we
+        * would be left with an empty xattr dir in delete queue. blkid=0
+        * would be passed in when doing zfs_purgedir. If that's the case we
+        * should just return immediately. The underlying objects should
+        * already be freed, so this should be perfectly fine.
+        */
+       if (blkid == 0)
+               return (ENOENT);
+
        err = dmu_buf_hold(zap->zap_objset, zap->zap_object,
            blkid << bs, NULL, &db, DMU_READ_NO_PREFETCH);
        if (err)
index 29406e660c5b733514dc417ea7d51b8bceacf34a..85b465b0528465fd8673fecebafe5367526c55c5 100644 (file)
@@ -813,6 +813,28 @@ zap_lookup_norm(objset_t *os, uint64_t zapobj, const char *name,
        return (err);
 }
 
+int
+zap_prefetch(objset_t *os, uint64_t zapobj, const char *name)
+{
+       zap_t *zap;
+       int err;
+       zap_name_t *zn;
+
+       err = zap_lockdir(os, zapobj, NULL, RW_READER, TRUE, FALSE, &zap);
+       if (err)
+               return (err);
+       zn = zap_name_alloc(zap, name, MT_EXACT);
+       if (zn == NULL) {
+               zap_unlockdir(zap);
+               return (SET_ERROR(ENOTSUP));
+       }
+
+       fzap_prefetch(zn);
+       zap_name_free(zn);
+       zap_unlockdir(zap);
+       return (err);
+}
+
 int
 zap_prefetch_uint64(objset_t *os, uint64_t zapobj, const uint64_t *key,
     int key_numints)
@@ -1427,6 +1449,7 @@ EXPORT_SYMBOL(zap_lookup);
 EXPORT_SYMBOL(zap_lookup_norm);
 EXPORT_SYMBOL(zap_lookup_uint64);
 EXPORT_SYMBOL(zap_contains);
+EXPORT_SYMBOL(zap_prefetch);
 EXPORT_SYMBOL(zap_prefetch_uint64);
 EXPORT_SYMBOL(zap_count_write);
 EXPORT_SYMBOL(zap_add);
index 745a467b708fea9ac6fefc745b62b047a045aa19..fc46a7307f441ce78fa6976c10a8028703d72975 100644 (file)
@@ -81,6 +81,7 @@
 #include <sys/zfs_vnops.h>
 #include <sys/stat.h>
 #include <sys/dmu.h>
+#include <sys/dmu_objset.h>
 #include <sys/dsl_destroy.h>
 #include <sys/dsl_deleg.h>
 #include <sys/mount.h>
  */
 static avl_tree_t zfs_snapshots_by_name;
 static avl_tree_t zfs_snapshots_by_objsetid;
-static kmutex_t zfs_snapshot_lock;
+static krwlock_t zfs_snapshot_lock;
 
 /*
  * Control Directory Tunables (.zfs)
@@ -117,6 +118,7 @@ static taskq_t *zfs_expire_taskq;
 typedef struct {
        char            *se_name;       /* full snapshot name */
        char            *se_path;       /* full mount path */
+       spa_t           *se_spa;        /* pool spa */
        uint64_t        se_objsetid;    /* snapshot objset id */
        struct dentry   *se_root_dentry; /* snapshot root dentry */
        taskqid_t       se_taskqid;     /* scheduled unmount taskqid */
@@ -132,8 +134,8 @@ static void zfsctl_snapshot_unmount_delay_impl(zfs_snapentry_t *se, int delay);
  * the snapshot name and provided mount point.  No reference is taken.
  */
 static zfs_snapentry_t *
-zfsctl_snapshot_alloc(char *full_name, char *full_path, uint64_t objsetid,
-    struct dentry *root_dentry)
+zfsctl_snapshot_alloc(char *full_name, char *full_path, spa_t *spa,
+    uint64_t objsetid, struct dentry *root_dentry)
 {
        zfs_snapentry_t *se;
 
@@ -141,6 +143,7 @@ zfsctl_snapshot_alloc(char *full_name, char *full_path, uint64_t objsetid,
 
        se->se_name = strdup(full_name);
        se->se_path = strdup(full_path);
+       se->se_spa = spa;
        se->se_objsetid = objsetid;
        se->se_root_dentry = root_dentry;
        se->se_taskqid = -1;
@@ -192,7 +195,7 @@ zfsctl_snapshot_rele(zfs_snapentry_t *se)
 static void
 zfsctl_snapshot_add(zfs_snapentry_t *se)
 {
-       ASSERT(MUTEX_HELD(&zfs_snapshot_lock));
+       ASSERT(RW_WRITE_HELD(&zfs_snapshot_lock));
        refcount_add(&se->se_refcount, NULL);
        avl_add(&zfs_snapshots_by_name, se);
        avl_add(&zfs_snapshots_by_objsetid, se);
@@ -207,7 +210,7 @@ zfsctl_snapshot_add(zfs_snapentry_t *se)
 static void
 zfsctl_snapshot_remove(zfs_snapentry_t *se)
 {
-       ASSERT(MUTEX_HELD(&zfs_snapshot_lock));
+       ASSERT(RW_WRITE_HELD(&zfs_snapshot_lock));
        avl_remove(&zfs_snapshots_by_name, se);
        avl_remove(&zfs_snapshots_by_objsetid, se);
        zfsctl_snapshot_rele(se);
@@ -242,6 +245,9 @@ snapentry_compare_by_objsetid(const void *a, const void *b)
        const zfs_snapentry_t *se_a = a;
        const zfs_snapentry_t *se_b = b;
 
+       if (se_a->se_spa != se_b->se_spa)
+               return ((ulong_t)se_a->se_spa < (ulong_t)se_b->se_spa ? -1 : 1);
+
        if (se_a->se_objsetid < se_b->se_objsetid)
                return (-1);
        else if (se_a->se_objsetid > se_b->se_objsetid)
@@ -262,7 +268,7 @@ zfsctl_snapshot_find_by_name(char *snapname)
 {
        zfs_snapentry_t *se, search;
 
-       ASSERT(MUTEX_HELD(&zfs_snapshot_lock));
+       ASSERT(RW_LOCK_HELD(&zfs_snapshot_lock));
 
        search.se_name = snapname;
        se = avl_find(&zfs_snapshots_by_name, &search, NULL);
@@ -278,12 +284,13 @@ zfsctl_snapshot_find_by_name(char *snapname)
  * as zfsctl_snapshot_find_by_name().
  */
 static zfs_snapentry_t *
-zfsctl_snapshot_find_by_objsetid(uint64_t objsetid)
+zfsctl_snapshot_find_by_objsetid(spa_t *spa, uint64_t objsetid)
 {
        zfs_snapentry_t *se, search;
 
-       ASSERT(MUTEX_HELD(&zfs_snapshot_lock));
+       ASSERT(RW_LOCK_HELD(&zfs_snapshot_lock));
 
+       search.se_spa = spa;
        search.se_objsetid = objsetid;
        se = avl_find(&zfs_snapshots_by_objsetid, &search, NULL);
        if (se)
@@ -301,7 +308,7 @@ zfsctl_snapshot_rename(char *old_snapname, char *new_snapname)
 {
        zfs_snapentry_t *se;
 
-       ASSERT(MUTEX_HELD(&zfs_snapshot_lock));
+       ASSERT(RW_WRITE_HELD(&zfs_snapshot_lock));
 
        se = zfsctl_snapshot_find_by_name(old_snapname);
        if (se == NULL)
@@ -323,8 +330,14 @@ static void
 snapentry_expire(void *data)
 {
        zfs_snapentry_t *se = (zfs_snapentry_t *)data;
+       spa_t *spa = se->se_spa;
        uint64_t objsetid = se->se_objsetid;
 
+       if (zfs_expire_snapshot <= 0) {
+               zfsctl_snapshot_rele(se);
+               return;
+       }
+
        se->se_taskqid = -1;
        (void) zfsctl_snapshot_unmount(se->se_name, MNT_EXPIRE);
        zfsctl_snapshot_rele(se);
@@ -333,12 +346,12 @@ snapentry_expire(void *data)
         * Reschedule the unmount if the zfs_snapentry_t wasn't removed.
         * This can occur when the snapshot is busy.
         */
-       mutex_enter(&zfs_snapshot_lock);
-       if ((se = zfsctl_snapshot_find_by_objsetid(objsetid)) != NULL) {
+       rw_enter(&zfs_snapshot_lock, RW_READER);
+       if ((se = zfsctl_snapshot_find_by_objsetid(spa, objsetid)) != NULL) {
                zfsctl_snapshot_unmount_delay_impl(se, zfs_expire_snapshot);
                zfsctl_snapshot_rele(se);
        }
-       mutex_exit(&zfs_snapshot_lock);
+       rw_exit(&zfs_snapshot_lock);
 }
 
 /*
@@ -349,7 +362,7 @@ snapentry_expire(void *data)
 static void
 zfsctl_snapshot_unmount_cancel(zfs_snapentry_t *se)
 {
-       ASSERT(MUTEX_HELD(&zfs_snapshot_lock));
+       ASSERT(RW_LOCK_HELD(&zfs_snapshot_lock));
 
        if (taskq_cancel_id(zfs_expire_taskq, se->se_taskqid) == 0) {
                se->se_taskqid = -1;
@@ -365,9 +378,12 @@ zfsctl_snapshot_unmount_delay_impl(zfs_snapentry_t *se, int delay)
 {
        ASSERT3S(se->se_taskqid, ==, -1);
 
+       if (delay <= 0)
+               return;
+
+       zfsctl_snapshot_hold(se);
        se->se_taskqid = taskq_dispatch_delay(zfs_expire_taskq,
            snapentry_expire, se, TQ_SLEEP, ddi_get_lbolt() + delay * HZ);
-       zfsctl_snapshot_hold(se);
 }
 
 /*
@@ -377,19 +393,19 @@ zfsctl_snapshot_unmount_delay_impl(zfs_snapentry_t *se, int delay)
  * and held until the outstanding task is handled or cancelled.
  */
 int
-zfsctl_snapshot_unmount_delay(uint64_t objsetid, int delay)
+zfsctl_snapshot_unmount_delay(spa_t *spa, uint64_t objsetid, int delay)
 {
        zfs_snapentry_t *se;
        int error = ENOENT;
 
-       mutex_enter(&zfs_snapshot_lock);
-       if ((se = zfsctl_snapshot_find_by_objsetid(objsetid)) != NULL) {
+       rw_enter(&zfs_snapshot_lock, RW_READER);
+       if ((se = zfsctl_snapshot_find_by_objsetid(spa, objsetid)) != NULL) {
                zfsctl_snapshot_unmount_cancel(se);
                zfsctl_snapshot_unmount_delay_impl(se, delay);
                zfsctl_snapshot_rele(se);
                error = 0;
        }
-       mutex_exit(&zfs_snapshot_lock);
+       rw_exit(&zfs_snapshot_lock);
 
        return (error);
 }
@@ -404,12 +420,12 @@ zfsctl_snapshot_ismounted(char *snapname)
        zfs_snapentry_t *se;
        boolean_t ismounted = B_FALSE;
 
-       mutex_enter(&zfs_snapshot_lock);
+       rw_enter(&zfs_snapshot_lock, RW_READER);
        if ((se = zfsctl_snapshot_find_by_name(snapname)) != NULL) {
                zfsctl_snapshot_rele(se);
                ismounted = B_TRUE;
        }
-       mutex_exit(&zfs_snapshot_lock);
+       rw_exit(&zfs_snapshot_lock);
 
        return (ismounted);
 }
@@ -560,15 +576,17 @@ zfsctl_destroy(zfs_sb_t *zsb)
 {
        if (zsb->z_issnap) {
                zfs_snapentry_t *se;
+               spa_t *spa = zsb->z_os->os_spa;
                uint64_t objsetid = dmu_objset_id(zsb->z_os);
 
-               mutex_enter(&zfs_snapshot_lock);
-               if ((se = zfsctl_snapshot_find_by_objsetid(objsetid)) != NULL) {
+               rw_enter(&zfs_snapshot_lock, RW_WRITER);
+               if ((se = zfsctl_snapshot_find_by_objsetid(spa, objsetid))
+                   != NULL) {
                        zfsctl_snapshot_unmount_cancel(se);
                        zfsctl_snapshot_remove(se);
                        zfsctl_snapshot_rele(se);
                }
-               mutex_exit(&zfs_snapshot_lock);
+               rw_exit(&zfs_snapshot_lock);
        } else if (zsb->z_ctldir) {
                iput(zsb->z_ctldir);
                zsb->z_ctldir = NULL;
@@ -879,13 +897,13 @@ zfsctl_snapdir_rename(struct inode *sdip, char *snm,
                goto out;
        }
 
-       mutex_enter(&zfs_snapshot_lock);
+       rw_enter(&zfs_snapshot_lock, RW_WRITER);
 
        error = dsl_dataset_rename_snapshot(fsname, snm, tnm, B_FALSE);
        if (error == 0)
                (void) zfsctl_snapshot_rename(snm, tnm);
 
-       mutex_exit(&zfs_snapshot_lock);
+       rw_exit(&zfs_snapshot_lock);
 out:
        kmem_free(from, MAXNAMELEN);
        kmem_free(to, MAXNAMELEN);
@@ -1006,12 +1024,12 @@ zfsctl_snapshot_unmount(char *snapname, int flags)
        zfs_snapentry_t *se;
        int error;
 
-       mutex_enter(&zfs_snapshot_lock);
+       rw_enter(&zfs_snapshot_lock, RW_READER);
        if ((se = zfsctl_snapshot_find_by_name(snapname)) == NULL) {
-               mutex_exit(&zfs_snapshot_lock);
+               rw_exit(&zfs_snapshot_lock);
                return (ENOENT);
        }
-       mutex_exit(&zfs_snapshot_lock);
+       rw_exit(&zfs_snapshot_lock);
 
        argv[2] = kmem_asprintf(SET_UNMOUNT_CMD,
            flags & MNT_FORCE ? "-f " : "", se->se_path);
@@ -1076,7 +1094,7 @@ zfsctl_snapshot_mount(struct path *path, int flags)
         * The snapshot may be manually mounted as many times as desired.
         */
        if (zfsctl_snapshot_ismounted(full_name)) {
-               error = SET_ERROR(EISDIR);
+               error = 0;
                goto error;
        }
 
@@ -1127,12 +1145,13 @@ zfsctl_snapshot_mount(struct path *path, int flags)
                dentry = spath.dentry;
                spath.mnt->mnt_flags |= MNT_SHRINKABLE;
 
-               mutex_enter(&zfs_snapshot_lock);
+               rw_enter(&zfs_snapshot_lock, RW_WRITER);
                se = zfsctl_snapshot_alloc(full_name, full_path,
-                   dmu_objset_id(snap_zsb->z_os), dentry);
+                   snap_zsb->z_os->os_spa, dmu_objset_id(snap_zsb->z_os),
+                   dentry);
                zfsctl_snapshot_add(se);
                zfsctl_snapshot_unmount_delay_impl(se, zfs_expire_snapshot);
-               mutex_exit(&zfs_snapshot_lock);
+               rw_exit(&zfs_snapshot_lock);
        }
        path_put(&spath);
 error:
@@ -1152,6 +1171,7 @@ zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid, zfs_sb_t **zsbp)
 {
        zfs_snapentry_t *se;
        int error;
+       spa_t *spa = ((zfs_sb_t *)(sb->s_fs_info))->z_os->os_spa;
 
        /*
         * Verify that the snapshot is mounted then lookup the mounted root
@@ -1160,8 +1180,8 @@ zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid, zfs_sb_t **zsbp)
         * process.  This race cannot occur to an expired mount point
         * because we hold the zfs_snapshot_lock to prevent the race.
         */
-       mutex_enter(&zfs_snapshot_lock);
-       if ((se = zfsctl_snapshot_find_by_objsetid(objsetid)) != NULL) {
+       rw_enter(&zfs_snapshot_lock, RW_READER);
+       if ((se = zfsctl_snapshot_find_by_objsetid(spa, objsetid)) != NULL) {
                zfs_sb_t *zsb;
 
                zsb = ITOZSB(se->se_root_dentry->d_inode);
@@ -1170,7 +1190,8 @@ zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid, zfs_sb_t **zsbp)
                if (time_after(jiffies, zsb->z_snap_defer_time +
                    MAX(zfs_expire_snapshot * HZ / 2, HZ))) {
                        zsb->z_snap_defer_time = jiffies;
-                       zfsctl_snapshot_unmount_delay(objsetid,
+                       zfsctl_snapshot_unmount_cancel(se);
+                       zfsctl_snapshot_unmount_delay_impl(se,
                            zfs_expire_snapshot);
                }
 
@@ -1180,7 +1201,7 @@ zfsctl_lookup_objset(struct super_block *sb, uint64_t objsetid, zfs_sb_t **zsbp)
        } else {
                error = SET_ERROR(ENOENT);
        }
-       mutex_exit(&zfs_snapshot_lock);
+       rw_exit(&zfs_snapshot_lock);
 
        /*
         * Automount the snapshot given the objset id by constructing the
@@ -1254,7 +1275,7 @@ zfsctl_init(void)
        avl_create(&zfs_snapshots_by_objsetid, snapentry_compare_by_objsetid,
            sizeof (zfs_snapentry_t), offsetof(zfs_snapentry_t,
            se_node_objsetid));
-       mutex_init(&zfs_snapshot_lock, NULL, MUTEX_DEFAULT, NULL);
+       rw_init(&zfs_snapshot_lock, NULL, RW_DEFAULT, NULL);
 
        zfs_expire_taskq = taskq_create("z_unmount", 1, defclsyspri,
            1, 8, TASKQ_PREPOPULATE);
@@ -1271,7 +1292,7 @@ zfsctl_fini(void)
 
        avl_destroy(&zfs_snapshots_by_name);
        avl_destroy(&zfs_snapshots_by_objsetid);
-       mutex_destroy(&zfs_snapshot_lock);
+       rw_destroy(&zfs_snapshot_lock);
 }
 
 module_param(zfs_admin_snapshot, int, 0644);
index 712cb4656430292eedbc4653502e20e6e218b24c..c1eadd0dc2508c382a46661ebc4ab9dac5cd941a 100644 (file)
@@ -632,15 +632,22 @@ zfs_rmnode(znode_t *zp)
        }
 
        /*
-        * Free up all the data in the file.
+        * Free up all the data in the file.  We don't do this for directories
+        * because we need truncate and remove to be in the same tx, like in
+        * zfs_znode_delete(). Otherwise, if we crash here we'll end up with
+        * an inconsistent truncated zap object in the delete queue.  Note a
+        * truncated file is harmless since it only contains user data.
         */
-       error = dmu_free_long_range(os, zp->z_id, 0, DMU_OBJECT_END);
-       if (error) {
-               /*
-                * Not enough space.  Leave the file in the unlinked set.
-                */
-               zfs_znode_dmu_fini(zp);
-               return;
+       if (S_ISREG(ZTOI(zp)->i_mode)) {
+               error = dmu_free_long_range(os, zp->z_id, 0, DMU_OBJECT_END);
+               if (error) {
+                       /*
+                        * Not enough space.  Leave the file in the unlinked
+                        * set.
+                        */
+                       zfs_znode_dmu_fini(zp);
+                       return;
+               }
        }
 
        /*
index bf360f1bc6359343268ab8b8995078b03c2a9e8c..1eefec4d3e6400e26523f8cf40793ff463624d61 100644 (file)
@@ -484,7 +484,6 @@ zfs_inode_update(znode_t *zp)
        zfs_sb_t        *zsb;
        struct inode    *ip;
        uint32_t        blksize;
-       u_longlong_t    i_blocks;
        uint64_t        atime[2], mtime[2], ctime[2];
 
        ASSERT(zp != NULL);
@@ -499,8 +498,6 @@ zfs_inode_update(znode_t *zp)
        sa_lookup(zp->z_sa_hdl, SA_ZPL_MTIME(zsb), &mtime, 16);
        sa_lookup(zp->z_sa_hdl, SA_ZPL_CTIME(zsb), &ctime, 16);
 
-       dmu_object_size_from_db(sa_get_db(zp->z_sa_hdl), &blksize, &i_blocks);
-
        spin_lock(&ip->i_lock);
        ip->i_generation = zp->z_gen;
        ip->i_uid = SUID_TO_KUID(zp->z_uid);
@@ -509,7 +506,8 @@ zfs_inode_update(znode_t *zp)
        ip->i_mode = zp->z_mode;
        zfs_set_inode_flags(zp, ip);
        ip->i_blkbits = SPA_MINBLOCKSHIFT;
-       ip->i_blocks = i_blocks;
+       dmu_object_size_from_db(sa_get_db(zp->z_sa_hdl), &blksize,
+           (u_longlong_t *)&ip->i_blocks);
 
        ZFS_TIME_DECODE(&ip->i_atime, atime);
        ZFS_TIME_DECODE(&ip->i_mtime, mtime);
index c378742eda0a435cf826504114da2a0962cff906..794439bbe7db2f4af9b859c590a2b372accb8a28 100644 (file)
@@ -248,6 +248,20 @@ zio_data_buf_alloc(size_t size)
        return (kmem_cache_alloc(zio_data_buf_cache[c], KM_PUSHPAGE));
 }
 
+/*
+ * Use zio_buf_alloc_flags when specific allocation flags are needed.  e.g.
+ * passing KM_NOSLEEP when it is acceptable for an allocation to fail.
+ */
+void *
+zio_buf_alloc_flags(size_t size, int flags)
+{
+       size_t c = (size - 1) >> SPA_MINBLOCKSHIFT;
+
+       VERIFY3U(c, <, SPA_MAXBLOCKSIZE >> SPA_MINBLOCKSHIFT);
+
+       return (kmem_cache_alloc(zio_buf_cache[c], flags));
+}
+
 void
 zio_buf_free(void *buf, size_t size)
 {
@@ -3458,6 +3472,7 @@ zbookmark_is_before(const dnode_phys_t *dnp, const zbookmark_phys_t *zb1,
 EXPORT_SYMBOL(zio_type_name);
 EXPORT_SYMBOL(zio_buf_alloc);
 EXPORT_SYMBOL(zio_data_buf_alloc);
+EXPORT_SYMBOL(zio_buf_alloc_flags);
 EXPORT_SYMBOL(zio_buf_free);
 EXPORT_SYMBOL(zio_data_buf_free);
 
index 6475c72d710b19c9ff95f59d3369bc65a9824467..e0e8ee3ac58304efd0f013a8d4c180d12d6a0e63 100644 (file)
@@ -28,6 +28,7 @@
 #include <sys/zfs_vfsops.h>
 #include <sys/zfs_vnops.h>
 #include <sys/zfs_znode.h>
+#include <sys/dmu_objset.h>
 #include <sys/vfs.h>
 #include <sys/zpl.h>
 
@@ -500,7 +501,7 @@ zpl_revalidate(struct dentry *dentry, unsigned int flags)
                if (time_after(jiffies, zsb->z_snap_defer_time +
                    MAX(zfs_expire_snapshot * HZ / 2, HZ))) {
                        zsb->z_snap_defer_time = jiffies;
-                       zfsctl_snapshot_unmount_delay(
+                       zfsctl_snapshot_unmount_delay(zsb->z_os->os_spa,
                            dmu_objset_id(zsb->z_os), zfs_expire_snapshot);
                }
        }
index d224078efc95d0cf23365742557dcbf2ef17978c..d9d0673051e45e7806df607b6fef0d5f6837625c 100644 (file)
@@ -214,6 +214,7 @@ zpl_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size)
 
        crhold(cr);
        cookie = spl_fstrans_mark();
+       rrm_enter_read(&(zsb)->z_teardown_lock, FTAG);
        rw_enter(&zp->z_xattr_lock, RW_READER);
 
        if (zsb->z_use_sa && zp->z_is_sa) {
@@ -230,6 +231,7 @@ zpl_xattr_list(struct dentry *dentry, char *buffer, size_t buffer_size)
 out:
 
        rw_exit(&zp->z_xattr_lock);
+       rrm_exit(&(zsb)->z_teardown_lock, FTAG);
        spl_fstrans_unmark(cookie);
        crfree(cr);
 
@@ -339,15 +341,18 @@ static int
 zpl_xattr_get(struct inode *ip, const char *name, void *value, size_t size)
 {
        znode_t *zp = ITOZ(ip);
+       zfs_sb_t *zsb = ZTOZSB(zp);
        cred_t *cr = CRED();
        fstrans_cookie_t cookie;
        int error;
 
        crhold(cr);
        cookie = spl_fstrans_mark();
+       rrm_enter_read(&(zsb)->z_teardown_lock, FTAG);
        rw_enter(&zp->z_xattr_lock, RW_READER);
        error = __zpl_xattr_get(ip, name, value, size, cr);
        rw_exit(&zp->z_xattr_lock);
+       rrm_exit(&(zsb)->z_teardown_lock, FTAG);
        spl_fstrans_unmark(cookie);
        crfree(cr);
 
@@ -493,6 +498,7 @@ zpl_xattr_set(struct inode *ip, const char *name, const void *value,
 
        crhold(cr);
        cookie = spl_fstrans_mark();
+       rrm_enter_read(&(zsb)->z_teardown_lock, FTAG);
        rw_enter(&ITOZ(ip)->z_xattr_lock, RW_WRITER);
 
        /*
@@ -530,6 +536,7 @@ zpl_xattr_set(struct inode *ip, const char *name, const void *value,
        error = zpl_xattr_set_dir(ip, name, value, size, flags, cr);
 out:
        rw_exit(&ITOZ(ip)->z_xattr_lock);
+       rrm_exit(&(zsb)->z_teardown_lock, FTAG);
        spl_fstrans_unmark(cookie);
        crfree(cr);
        ASSERT3S(error, <=, 0);
index 574d3c306bc9964f24fa13ed1bf31f925c3f4371..613b47ef92fb362dadc0a3598f839203582e5a87 100644 (file)
@@ -74,6 +74,7 @@ typedef struct zvol_state {
        dev_t                   zv_dev;         /* device id */
        struct gendisk          *zv_disk;       /* generic disk */
        struct request_queue    *zv_queue;      /* request queue */
+       spinlock_t              zv_lock;        /* request queue lock */
        list_node_t             zv_next;        /* next zvol_state_t linkage */
 } zvol_state_t;
 
@@ -1206,6 +1207,7 @@ zvol_alloc(dev_t dev, const char *name)
 
        zv = kmem_zalloc(sizeof (zvol_state_t), KM_SLEEP);
 
+       spin_lock_init(&zv->zv_lock);
        list_link_init(&zv->zv_next);
 
        zv->zv_queue = blk_alloc_queue(GFP_ATOMIC);
index 8f4a8fd69b58074971f36303e6c8e0f33248ea2d..e3a85c1686e61894f6faedb43889fed3d9917e33 100644 (file)
  *
  *  You should have received a copy of the GNU General Public License along
  *  with ZPIOS.  If not, see <http://www.gnu.org/licenses/>.
- *
- *  Copyright (c) 2015, Intel Corporation.
  */
 
 #include <sys/zfs_context.h>
 #include <sys/dmu.h>
-#include <sys/spa.h>
 #include <sys/txg.h>
 #include <sys/dsl_destroy.h>
 #include <linux/miscdevice.h>
@@ -132,17 +129,8 @@ zpios_dmu_object_create(run_args_t *run_args, objset_t *os)
 {
        struct dmu_tx *tx;
        uint64_t obj = 0ULL;
-       uint64_t blksize = run_args->block_size;
        int rc;
 
-       if (blksize < SPA_MINBLOCKSIZE ||
-           blksize > spa_maxblocksize(dmu_objset_spa(os)) ||
-           !ISP2(blksize)) {
-               zpios_print(run_args->file,
-                   "invalid block size for pool: %d\n", (int)blksize);
-               return (obj);
-       }
-
        tx = dmu_tx_create(os);
        dmu_tx_hold_write(tx, DMU_NEW_OBJECT, 0, OBJ_SIZE);
        rc = dmu_tx_assign(tx, TXG_WAIT);
@@ -154,11 +142,10 @@ zpios_dmu_object_create(run_args_t *run_args, objset_t *os)
        }
 
        obj = dmu_object_alloc(os, DMU_OT_UINT64_OTHER, 0, DMU_OT_NONE, 0, tx);
-       rc = dmu_object_set_blocksize(os, obj, blksize, 0, tx);
+       rc = dmu_object_set_blocksize(os, obj, 128ULL << 10, 0, tx);
        if (rc) {
                zpios_print(run_args->file,
-                   "dmu_object_set_blocksize to %d failed: %d\n",
-                   (int)blksize, rc);
+                           "dmu_object_set_blocksize() failed: %d\n", rc);
                dmu_tx_abort(tx);
                return (obj);
        }
@@ -308,7 +295,6 @@ zpios_setup_run(run_args_t **run_args, zpios_cmd_t *kcmd, struct file *file)
        ra->chunk_noise         = kcmd->cmd_chunk_noise;
        ra->thread_delay        = kcmd->cmd_thread_delay;
        ra->flags               = kcmd->cmd_flags;
-       ra->block_size          = kcmd->cmd_block_size;
        ra->stats.wr_data       = 0;
        ra->stats.wr_chunks     = 0;
        ra->stats.rd_data       = 0;
diff --git a/zfs/rpm/Makefile.am b/zfs/rpm/Makefile.am
deleted file mode 100644 (file)
index f2cf72c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = generic redhat
diff --git a/zfs/rpm/Makefile.in b/zfs/rpm/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/rpm/generic/.gitignore b/zfs/rpm/generic/.gitignore
deleted file mode 100644 (file)
index 7f5daaf..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/zfs-dkms.spec
-/zfs-kmod.spec
-/zfs.spec
diff --git a/zfs/rpm/generic/Makefile.am b/zfs/rpm/generic/Makefile.am
deleted file mode 100644 (file)
index 89b1364..0000000
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = zfs.spec.in zfs-kmod.spec.in zfs-dkms.spec.in
diff --git a/zfs/rpm/generic/Makefile.in b/zfs/rpm/generic/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
index e432bc4142dba5719a161c7e0b4465542fc2d5d8..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,78 +1,2 @@
-%{?!packager: %define packager Brian Behlendorf <behlendorf1@llnl.gov>}
-
-%define module  @PACKAGE@
-%define mkconf  scripts/dkms.mkconf
-
-Name:           %{module}-dkms
-
-Version:        @VERSION@
-Release:        @RELEASE@%{?dist}
-Summary:        Kernel module(s) (dkms)
-
-Group:          System Environment/Kernel
-License:        @ZFS_META_LICENSE@
-URL:            http://zfsonlinux.org/
-Source0:        %{module}-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildArch:      noarch
-
-Requires:       dkms >= 2.2.0.3-20
-Requires:       spl-dkms = %{version}
-Requires:       gcc, make, perl
-Requires:       kernel-devel
-Provides:       %{module}-kmod = %{version}
-
-%description
-This package contains the dkms ZFS kernel modules.
-
-%prep
-%setup -q -n %{module}-%{version}
-
-%build
-%{mkconf} -n %{module} -v %{version} -f dkms.conf
-
-%install
-if [ "$RPM_BUILD_ROOT" != "/" ]; then
-    rm -rf $RPM_BUILD_ROOT
-fi
-mkdir -p $RPM_BUILD_ROOT/usr/src/
-cp -rf ${RPM_BUILD_DIR}/%{module}-%{version} $RPM_BUILD_ROOT/usr/src/
-
-%clean
-if [ "$RPM_BUILD_ROOT" != "/" ]; then
-    rm -rf $RPM_BUILD_ROOT
-fi
-
-%files
-%defattr(-,root,root)
-/usr/src/%{module}-%{version}
-
-%post
-for POSTINST in /usr/lib/dkms/common.postinst; do
-    if [ -f $POSTINST ]; then
-        $POSTINST %{module} %{version}
-        exit $?
-    fi
-    echo "WARNING: $POSTINST does not exist."
-done
-echo -e "ERROR: DKMS version is too old and %{module} was not"
-echo -e "built with legacy DKMS support."
-echo -e "You must either rebuild %{module} with legacy postinst"
-echo -e "support or upgrade DKMS to a more current version."
-exit 1
-
-%preun
-CONFIG_H="/var/lib/dkms/%{module}/%{version}/*/*/%{module}_config.h"
-SPEC_META_ALIAS="@PACKAGE@-@VERSION@-@RELEASE@"
-DKMS_META_ALIAS=`cat $CONFIG_H 2>/dev/null |
-    awk -F'"' '/META_ALIAS/ { print $2; exit 0 }'`
-if [ "$SPEC_META_ALIAS" = "$DKMS_META_ALIAS" ]; then
-    echo -e
-    echo -e "Uninstall of %{module} module ($SPEC_META_ALIAS) beginning:"
-    dkms remove -m %{module} -v %{version} --all --rpm_safe_upgrade
-fi
-exit 0
-
-%changelog
-* %(date "+%a %b %d %Y") %packager %{version}-%{release}
-- Automatic build by DKMS
+%:
+       #
index 68f94c19d10ef3a1fa16293645f1b5af1dae64a7..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,219 +1,2 @@
-%define module  @PACKAGE@
-
-%if !%{defined ksrc}
-%if 0%{?rhel}%{?fedora}
-%define ksrc    ${kernel_version##*___}
-%else
-%define ksrc    "$( \
-        if [ -e "/usr/src/linux-${kernel_version%%___*}" ]; then \
-            echo "/usr/src/linux-${kernel_version%%___*}"; \
-        elif [ -e "/lib/modules/${kernel_version%%___*}/source" ]; then \
-            echo "/lib/modules/${kernel_version%%___*}/source"; \
-        else \
-            echo "/lib/modules/${kernel_version%%___*}/build"; \
-        fi)"
-%endif
-%endif
-
-%if !%{defined kobj}
-%if 0%{?rhel}%{?fedora}
-%define kobj    ${kernel_version##*___}
-%else
-%define kobj    "$( \
-        if [ -e "/usr/src/linux-${kernel_version%%___*}" ]; then \
-            echo "/usr/src/linux-${kernel_version%%___*}"; \
-        else \
-            echo "/lib/modules/${kernel_version%%___*}/build"; \
-        fi)"
-%endif
-%endif
-
-#define repo    rpmfusion
-#define repo    chaos
-
-# (un)define the next line to either build for the newest or all current kernels
-%define buildforkernels newest
-#define buildforkernels current
-#define buildforkernels akmod
-
-%bcond_with     debug
-%bcond_with     debug_dmu_tx
-
-
-Name:           %{module}-kmod
-
-Version:        @VERSION@
-Release:        @RELEASE@%{?dist}
-Summary:        Kernel module(s)
-
-Group:          System Environment/Kernel
-License:        @ZFS_META_LICENSE@
-URL:            http://zfsonlinux.org/
-Source0:        %{module}-%{version}.tar.gz
-Source10:       kmodtool
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id} -u -n)
-
-# The developments headers will conflict with the dkms packages.
-Conflicts:      %{module}-dkms
-
-%if %{defined repo}
-
-# Building for a repository use the proper build-sysbuild package
-# to determine which kernel-devel packages should be installed.
-BuildRequires:  %{_bindir}/kmodtool
-%{!?kernels:BuildRequires: buildsys-build-%{repo}-kerneldevpkgs-%{?buildforkernels:%{buildforkernels}}%{!?buildforkernels:current}-%{_target_cpu}}
-
-%else
-
-# Building local packages attempt to to use the installed kernel.
-%{?rhel:BuildRequires: kernel-devel}
-%{?fedora:BuildRequires: kernel-devel}
-%{?suse_version:BuildRequires: kernel-source}
-
-%if !%{defined kernels} && !%{defined build_src_rpm}
-    %if 0%{?rhel}%{?fedora}%{?suse_version}
-        %define kernels %(ls -1 /usr/src/kernels)
-    %else
-        %define kernels %(ls -1 /lib/modules)
-    %endif
-%endif
-%endif
-
-%if 0%{?rhel}%{?fedora}%{?suse_version}
-BuildRequires:             kmod-spl-devel = %{version}
-%global KmodsRequires      kmod-spl
-%global KmodsDevelRequires kmod-spl-devel
-%global KmodsMetaRequires  spl-kmod
-%endif
-
-%if 0%{?fedora} >= 17
-%define prefix  /usr
-%endif
-
-# Kmodtool does its magic here.  A patched version of kmodtool is shipped
-# with the source rpm until kmod development packages are supported upstream.
-# https://bugzilla.rpmfusion.org/show_bug.cgi?id=2714
-%{expand:%(bash %{SOURCE10} --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null) }
-
-
-%description
-This package contains the ZFS kernel modules.
-
-%prep
-# Error out if there was something wrong with kmodtool.
-%{?kmodtool_check}
-
-# Print kmodtool output for debugging purposes:
-bash %{SOURCE10}  --target %{_target_cpu} %{?repo:--repo %{?repo}} --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} --devel %{?prefix:--prefix "%{?prefix}"} %{?kernels:--for-kernels "%{?kernels}"} %{?kernelbuildroot:--buildroot "%{?kernelbuildroot}"} 2>/dev/null
-
-%if %{with debug}
-    %define debug --enable-debug
-%else
-    %define debug --disable-debug
-%endif
-
-%if %{with debug_dmu_tx}
-    %define debug_dmu_tx --enable-debug-dmu-tx
-%else
-    %define debug_dmu_tx --disable-debug-dmu-tx
-%endif
-
-#
-# Allow the overriding of spl locations
-#
-%if %{defined require_splver}
-%define splver %{require_splver}
-%else
-%define splver %{version}
-%endif
-
-%if %{defined require_spldir}
-%define spldir %{require_spldir}
-%else
-%define spldir %{_usrsrc}/spl-%{splver}
-%endif
-
-%if %{defined require_splobj}
-%define splobj %{require_splobj}
-%else
-%define splobj %{spldir}/${kernel_version%%___*}
-%endif
-
-
-# Leverage VPATH from configure to avoid making multiple copies.
-%define _configure ../%{module}-%{version}/configure
-
-%setup -q -c -T -a 0
-
-for kernel_version in %{?kernel_versions}; do
-    %{__mkdir} _kmod_build_${kernel_version%%___*}
-done
-
-%build
-for kernel_version in %{?kernel_versions}; do
-    cd _kmod_build_${kernel_version%%___*}
-    %configure \
-        --with-config=kernel \
-        --with-linux=%{ksrc} \
-        --with-linux-obj=%{kobj} \
-        --with-spl="%{spldir}" \
-        --with-spl-obj="%{splobj}" \
-        %{debug} \
-        %{debug_dmu_tx}
-    make %{?_smp_mflags}
-    cd ..
-done
-
-
-%install
-rm -rf ${RPM_BUILD_ROOT}
-
-# Relies on the kernel 'modules_install' make target.
-for kernel_version in %{?kernel_versions}; do
-    cd _kmod_build_${kernel_version%%___*}
-    make install \
-        DESTDIR=${RPM_BUILD_ROOT} \
-        %{?prefix:INSTALL_MOD_PATH=%{?prefix}} \
-        INSTALL_MOD_DIR=%{kmodinstdir_postfix}
-    cd ..
-done
-chmod u+x ${RPM_BUILD_ROOT}%{kmodinstdir_prefix}/*/extra/*/*/*
-%{?akmod_install}
-
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%changelog
-* Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
-- Don't import all visible pools in zfs-import init script zfsonlinux/zfs#3777
-- Fix use-after-free in vdev_disk_physio_completion zfsonlinux/zfs#3920
-- Fix avl_is_empty(&dn->dn_dbufs) assertion zfsonlinux/zfs#3865
-* Wed Sep 30 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.2-1
-- Init script fixes zfsonlinux/zfs#3816
-- Fix uioskip crash when skip to end zfsonlinux/zfs#3806 zfsonlinux/zfs#3850
-- Userspace can trigger an assertion zfsonlinux/zfs#3792
-- Fix quota userused underflow bug zfsonlinux/zfs#3789
-- Fix performance regression from unwanted synchronous I/O zfsonlinux/zfs#3780
-- Fix deadlock during ARC reclaim zfsonlinux/zfs#3808 zfsonlinux/zfs#3834
-- Fix deadlock with zfs receive and clamscan zfsonlinux/zfs#3719
-- Allow NFS activity to defer snapshot unmounts zfsonlinux/zfs#3794
-- Linux 4.3 compatibility zfsonlinux/zfs#3799
-- Zed reload fixes zfsonlinux/zfs#3773
-- Fix PAX Patch/Grsec SLAB_USERCOPY panic zfsonlinux/zfs#3796
-- Always remove during dkms uninstall/update zfsonlinux/spl#476
-* Sat Sep 19 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.1-1
-- Fix zvol corruption with TRIM/discard zfsonlinux/zfs#3798
-- Fix NULL as mount(2) syscall data parameter zfsonlinux/zfs#3804
-- Fix xattr=sa dataset property not honored zfsonlinux/zfs#3787
-* Fri Sep 11 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5-1
-- Released 0.6.5-1, detailed release notes are available at:
-- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5
-* Wed Apr  8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
-- Released 0.6.4-1
-* Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
-- Released 0.6.3-1
-* Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
-- Released 0.6.2-1
-* Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
-- First official stable release.
+%:
+       #
index 20b59088ec580dbf9db6e18a0a89cc6fc580049b..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,366 +1,2 @@
-%global _sbindir    /sbin
-%global _libdir     /%{_lib}
-
-# Set the default udev directory based on distribution.
-%if %{undefined _udevdir}
-%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
-%global _udevdir    %{_prefix}/lib/udev
-%else
-%global _udevdir    /lib/udev
-%endif
-%endif
-
-# Set the default udevrule directory based on distribution.
-%if %{undefined _udevruledir}
-%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
-%global _udevruledir    %{_prefix}/lib/udev/rules.d
-%else
-%global _udevruledir    /lib/udev/rules.d
-%endif
-%endif
-
-# Set the default dracut directory based on distribution.
-%if %{undefined _dracutdir}
-%if 0%{?fedora} >= 17 || 0%{?rhel} >= 7 || 0%{?centos} >= 7
-%global _dracutdir  %{_prefix}/lib/dracut
-%else
-%global _dracutdir  %{_prefix}/share/dracut
-%endif
-%endif
-
-# Set the default _initconfdir when undefined.
-%if %{undefined _initconfdir}
-%global _initconfdir /etc/sysconfig
-%endif
-
-%bcond_with    debug
-%bcond_with    blkid
-%bcond_with    systemd
-
-# Generic enable switch for systemd
-%if %{with systemd}
-%define _systemd 1
-%endif
-
-# RHEL >= 7 comes with systemd
-%if 0%{?rhel} >= 7
-%define _systemd 1
-%endif
-
-# Fedora >= 15 comes with systemd, but only >= 18 has
-# the proper macros
-%if 0%{?fedora} >= 18
-%define _systemd 1
-%endif
-
-# opensuse >= 12.1 comes with systemd, but only >= 13.1
-# has the proper macros
-%if 0%{?suse_version} >= 1310
-%define _systemd 1
-%endif
-
-Name:           @PACKAGE@
-Version:        @VERSION@
-Release:        @RELEASE@%{?dist}
-Summary:        Commands to control the kernel modules and libraries
-
-Group:          System Environment/Kernel
-License:        @ZFS_META_LICENSE@
-URL:            http://zfsonlinux.org/
-Source0:        %{name}-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-ExclusiveArch:  i386 i686 x86_64
-
-# May build but untested on ppc/ppc64
-ExcludeArch:    ppc ppc64
-
-Requires:       spl = %{version}
-Requires:       libzpool2 = %{version}
-Requires:       libnvpair1 = %{version}
-Requires:       libuutil1 = %{version}
-Requires:       libzfs2 = %{version}
-Requires:       %{name}-kmod = %{version}
-Provides:       %{name}-kmod-common = %{version}
-
-# zfs-fuse provides the same commands and man pages that ZoL does. Renaming
-# those on either side would conflict with all available documentation.
-Conflicts:      zfs-fuse
-
-%if 0%{?rhel}%{?fedora}%{?suse_version}
-BuildRequires:  zlib-devel
-BuildRequires:  libuuid-devel
-%if %{with blkid}
-BuildRequires:  libblkid-devel
-%endif
-%endif
-%if 0%{?_systemd}
-Requires(post): systemd
-Requires(preun): systemd
-Requires(postun): systemd
-BuildRequires: systemd
-%endif
-
-%description
-This package contains the ZFS command line utilities.
-
-%package -n libzpool2
-Summary:        Native ZFS pool library for Linux
-Group:          System Environment/Kernel
-
-%description -n libzpool2
-This package contains the zpool library, which provides support
-for managing zpools
-
-%post -n libzpool2 -p /sbin/ldconfig
-%postun -n libzpool2 -p /sbin/ldconfig
-
-%package -n libnvpair1
-Summary:        Solaris name-value library for Linux
-Group:          System Environment/Kernel
-
-%description -n libnvpair1
-This package contains routines for packing and unpacking name-value
-pairs.  This functionality is used to portably transport data across
-process boundaries, between kernel and user space, and can be used
-to write self describing data structures on disk.
-
-%post -n libnvpair1 -p /sbin/ldconfig
-%postun -n libnvpair1 -p /sbin/ldconfig
-
-%package -n libuutil1
-Summary:        Solaris userland utility library for Linux
-Group:          System Environment/Kernel
-
-%description -n libuutil1
-This library provides a variety of compatibility functions for ZFS on Linux:
- * libspl: The Solaris Porting Layer userland library, which provides APIs
-   that make it possible to run Solaris user code in a Linux environment
-   with relatively minimal modification.
- * libavl: The Adelson-Velskii Landis balanced binary tree manipulation
-   library.
- * libefi: The Extensible Firmware Interface library for GUID disk
-   partitioning.
- * libshare: NFS, SMB, and iSCSI service integration for ZFS.
-
-%post -n libuutil1 -p /sbin/ldconfig
-%postun -n libuutil1 -p /sbin/ldconfig
-
-%package -n libzfs2
-Summary:        Native ZFS filesystem library for Linux
-Group:          System Environment/Kernel
-
-%description -n libzfs2
-This package provides support for managing ZFS filesystems
-
-%post -n libzfs2 -p /sbin/ldconfig
-%postun -n libzfs2 -p /sbin/ldconfig
-
-%package -n libzfs2-devel
-Summary:        Development headers
-Group:          System Environment/Kernel
-Requires:       libzfs2 = %{version}
-Requires:       libzpool2 = %{version}
-Requires:       libnvpair1 = %{version}
-Requires:       libuutil1 = %{version}
-Provides:       libzpool2-devel
-Provides:       libnvpair1-devel
-Provides:       libuutil1-devel
-Obsoletes:      zfs-devel
-
-%description -n libzfs2-devel
-This package contains the header files needed for building additional
-applications against the ZFS libraries.
-
-%package test
-Summary:        Test infrastructure
-Group:          System Environment/Kernel
-Requires:       %{name}%{?_isa} = %{version}-%{release}
-Requires:       parted
-Requires:       lsscsi
-Requires:       mdadm
-Requires:       bc
-
-%description test
-This package contains test infrastructure and support scripts for
-validating the file system.
-
-%package dracut
-Summary:        Dracut module
-Group:          System Environment/Kernel
-Requires:       %{name}%{?_isa} = %{version}-%{release}
-Requires:       dracut
-
-%description dracut
-This package contains a dracut module used to construct an initramfs
-image which is ZFS aware.
-
-%if 0%{?_initramfs}
-%package initramfs
-Summary:        Initramfs module
-Group:          System Environment/Kernel
-Requires:       %{name}%{?_isa} = %{version}-%{release}
-Requires:       %{name} = %{version}-%{release}
-Requires:       initramfs-tools
-
-%description initramfs
-This package contains a initramfs module used to construct an initramfs
-image which is ZFS aware.
-%endif
-
-%prep
-%if %{with debug}
-    %define debug --enable-debug
-%else
-    %define debug --disable-debug
-%endif
-%if %{with blkid}
-    %define blkid --with-blkid
-%else
-    %define blkid --without-blkid
-%endif
-%if 0%{?_systemd}
-    %define systemd --enable-systemd --with-systemdunitdir=%{_unitdir} --with-systemdpresetdir=%{_presetdir} --disable-sysvinit
-%else
-    %define systemd --enable-sysvinit --disable-systemd
-%endif
-
-%setup -q
-
-%build
-%configure \
-    --with-config=user \
-    --with-udevdir=%{_udevdir} \
-    --with-udevruledir=%{_udevruledir} \
-    --with-dracutdir=%{_dracutdir} \
-    --disable-static \
-    %{debug} \
-    %{blkid} \
-    %{systemd}
-make %{?_smp_mflags}
-
-%install
-%{__rm} -rf $RPM_BUILD_ROOT
-make install DESTDIR=%{?buildroot}
-find %{?buildroot}%{_libdir} -name '*.la' -exec rm -f {} \;
-
-%post
-%if 0%{?_systemd}
-%systemd_post zfs.target
-%else
-if [ -x /sbin/chkconfig ]; then
-    /sbin/chkconfig --add zfs-import
-    /sbin/chkconfig --add zfs-mount
-    /sbin/chkconfig --add zfs-share
-    /sbin/chkconfig --add zfs-zed
-fi
-%endif
-exit 0
-
-%preun
-%if 0%{?_systemd}
-%systemd_preun zfs.target
-%else
-if [ $1 -eq 0 ] && [ -x /sbin/chkconfig ]; then
-    /sbin/chkconfig --del zfs-import
-    /sbin/chkconfig --del zfs-mount
-    /sbin/chkconfig --del zfs-share
-    /sbin/chkconfig --del zfs-zed
-fi
-%endif
-exit 0
-
-%postun
-%if 0%{?_systemd}
-%systemd_postun zfs.target
-%endif
-
-%files
-%{_sbindir}/*
-%{_bindir}/*
-%{_libexecdir}/%{name}
-%{_mandir}/man1/*
-%{_mandir}/man5/*
-%{_mandir}/man8/*
-%{_udevdir}/vdev_id
-%{_udevdir}/zvol_id
-%{_udevdir}/rules.d/*
-%if 0%{?_systemd}
-/usr/lib/modules-load.d/*
-%{_unitdir}/*
-%{_presetdir}/*
-%else
-%config(noreplace) %{_sysconfdir}/init.d/*
-%config(noreplace) %{_initconfdir}/zfs
-%endif
-%config(noreplace) %{_sysconfdir}/%{name}
-
-%files -n libzpool2
-%{_libdir}/libzpool.so.*
-
-%files -n libnvpair1
-%{_libdir}/libnvpair.so.*
-
-%files -n libuutil1
-%{_libdir}/libuutil.so.*
-
-%files -n libzfs2
-%{_libdir}/libzfs*.so.*
-
-%files -n libzfs2-devel
-%{_datadir}/pkgconfig/libzfs.pc
-%{_datadir}/pkgconfig/libzfs_core.pc
-%{_libdir}/*.so
-%{_includedir}/*
-%doc AUTHORS COPYRIGHT DISCLAIMER
-%doc OPENSOLARIS.LICENSE README.markdown
-
-%files test
-%{_datadir}/%{name}
-
-%files dracut
-%doc contrib/dracut/README.dracut.markdown
-%{_dracutdir}/modules.d/*
-
-%if 0%{?_initramfs}
-%files initramfs
-%doc contrib/initramfs/README.initramfs.markdown
-/usr/share/initramfs-tools/*
-%else
-# Since we're not building the initramfs package,
-# ignore those files.
-%exclude /usr/share/initramfs-tools
-%endif
-
-%changelog
-* Tue Oct 13 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.3-1
-- Don't import all visible pools in zfs-import init script zfsonlinux/zfs#3777
-- Fix use-after-free in vdev_disk_physio_completion zfsonlinux/zfs#3920
-- Fix avl_is_empty(&dn->dn_dbufs) assertion zfsonlinux/zfs#3865
-* Wed Sep 30 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.2-1
-- Init script fixes zfsonlinux/zfs#3816
-- Fix uioskip crash when skip to end zfsonlinux/zfs#3806 zfsonlinux/zfs#3850
-- Userspace can trigger an assertion zfsonlinux/zfs#3792
-- Fix quota userused underflow bug zfsonlinux/zfs#3789
-- Fix performance regression from unwanted synchronous I/O zfsonlinux/zfs#3780
-- Fix deadlock during ARC reclaim zfsonlinux/zfs#3808 zfsonlinux/zfs#3834
-- Fix deadlock with zfs receive and clamscan zfsonlinux/zfs#3719
-- Allow NFS activity to defer snapshot unmounts zfsonlinux/zfs#3794
-- Linux 4.3 compatibility zfsonlinux/zfs#3799
-- Zed reload fixes zfsonlinux/zfs#3773
-- Fix PAX Patch/Grsec SLAB_USERCOPY panic zfsonlinux/zfs#3796
-- Always remove during dkms uninstall/update zfsonlinux/spl#476
-* Sat Sep 19 2015 Ned Bass <bass6@llnl.gov> - 0.6.5.1-1
-- Fix zvol corruption with TRIM/discard zfsonlinux/zfs#3798
-- Fix NULL as mount(2) syscall data parameter zfsonlinux/zfs#3804
-- Fix xattr=sa dataset property not honored zfsonlinux/zfs#3787
-* Fri Sep 11 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.5-1
-- Released 0.6.5-1, detailed release notes are available at:
-- https://github.com/zfsonlinux/zfs/releases/tag/zfs-0.6.5
-* Wed Apr  8 2015 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.4-1
-- Released 0.6.4-1
-* Thu Jun 12 2014 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.3-1
-- Released 0.6.3-1
-* Wed Aug 21 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.2-1
-- Released 0.6.2-1
-* Fri Mar 22 2013 Brian Behlendorf <behlendorf1@llnl.gov> - 0.6.1-1
-- First official stable release.
+%:
+       #
diff --git a/zfs/rpm/redhat/.gitignore b/zfs/rpm/redhat/.gitignore
deleted file mode 100644 (file)
index 7f5daaf..0000000
+++ /dev/null
@@ -1,3 +0,0 @@
-/zfs-dkms.spec
-/zfs-kmod.spec
-/zfs.spec
diff --git a/zfs/rpm/redhat/Makefile.am b/zfs/rpm/redhat/Makefile.am
deleted file mode 100644 (file)
index 89b1364..0000000
+++ /dev/null
@@ -1 +0,0 @@
-EXTRA_DIST = zfs.spec.in zfs-kmod.spec.in zfs-dkms.spec.in
diff --git a/zfs/rpm/redhat/Makefile.in b/zfs/rpm/redhat/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
deleted file mode 120000 (symlink)
index ffa051baaf0388804eaa38953b0a1b765a0a6241..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../generic/zfs-dkms.spec.in
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..b3e8c1303bda612cfbec58359220e20cc62e48d7
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
index ecc809bc6520fae762cadcfe89de2d2ce9ca86ec..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,86 +1,2 @@
-%bcond_with     debug
-%bcond_with     debug_dmu_tx
-
-Name:           @PACKAGE@-kmod
-Version:        @VERSION@
-Release:        @RELEASE@%{?dist}
-
-Summary:        Kernel module(s)
-Group:          System Environment/Kernel
-License:        @ZFS_META_LICENSE@
-URL:            http://zfsonlinux.org/
-BuildRequires:  %kernel_module_package_buildreqs
-BuildRequires:  kmod-spl-devel = %{version}
-Source0:        @PACKAGE@-%{version}.tar.gz
-BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-
-# Additional dependency information for the kmod sub-package must be specified
-# by generating a preamble text file which kmodtool can append to the spec file.
-%(/bin/echo -e "\
-Requires:       spl-kmod\n\
-Requires:       @PACKAGE@ = %{version}\n\
-Conflicts:      @PACKAGE@-dkms\n\n" > %{_sourcedir}/kmod-preamble)
-
-%description
-This package contains the ZFS kernel modules.
-
-%define kmod_name @PACKAGE@
-%define debug_package %{nil}
-
-%kernel_module_package -n %{kmod_name} -p %{_sourcedir}/kmod-preamble
-
-%define ksrc %{_usrsrc}/kernels/%{kverrel}
-%define kobj %{ksrc}
-%define splsrc %{_usrsrc}/spl-%{version}
-%define splobj %{splsrc}/%{kverrel}
-
-%package -n kmod-%{kmod_name}-devel
-Summary:        ZFS kernel module(s) devel common
-Group:          System Environment/Kernel
-Requires:       kmod-spl-devel = %{version}
-
-%description -n  kmod-%{kmod_name}-devel
-This package provides the header files and objects to build kernel modules
-which depend on the spl kernel module.
-
-%prep
-if ! [ -d "%{ksrc}"  ]; then
-        echo "Kernel build directory isn't set properly, cannot continue"
-        exit 1
-fi
-
-%if %{with debug}
-%define debug --enable-debug
-%else
-%define debug --disable-debug
-%endif
-
-%if %{with debug_dmu_tx}
-%define debug_dmu_tx --enable-debug-dmu-tx
-%else
-%define debug_dmu_tx --disable-debug-dmu-tx
-%endif
-
-%setup -n %{kmod_name}-%{version}
-%build
-%configure \
-        --with-config=kernel \
-        --with-linux=%{ksrc} \
-        --with-linux-obj=%{kobj} \
-        --with-spl="%{splsrc}" \
-        --with-spl-obj="%{splobj}" \
-        %{debug} \
-        %{debug_dmu_tx}
-make %{?_smp_mflags}
-
-%install
-make install \
-        DESTDIR=${RPM_BUILD_ROOT} \
-        INSTALL_MOD_DIR=extra/%{kmod_name}
-%{__rm} -f %{buildroot}/lib/modules/%{kverrel}/modules.*
-
-%clean
-rm -rf $RPM_BUILD_ROOT
-
-%files -n kmod-%{kmod_name}-devel
-%{_usrsrc}/%{kmod_name}-%{version}
+%:
+       #
deleted file mode 120000 (symlink)
index 4c8079166ff8f82a557fa008b51d90edde7597b3..0000000000000000000000000000000000000000
+++ /dev/null
@@ -1 +0,0 @@
-../generic/zfs.spec.in
\ No newline at end of file
new file mode 100644 (file)
index 0000000000000000000000000000000000000000..b3e8c1303bda612cfbec58359220e20cc62e48d7
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/scripts/.gitignore b/zfs/scripts/.gitignore
deleted file mode 100644 (file)
index 5621a6e..0000000
+++ /dev/null
@@ -1 +0,0 @@
-common.sh
diff --git a/zfs/scripts/Makefile.am b/zfs/scripts/Makefile.am
deleted file mode 100644 (file)
index 26f9207..0000000
+++ /dev/null
@@ -1,57 +0,0 @@
-SUBDIRS = zpool-config zpios-test zpios-profile
-
-EXTRA_DIST = dkms.mkconf dkms.postbuild kmodtool zfs2zol-patch.sed cstyle.pl
-
-pkgdatadir = $(datadir)/@PACKAGE@
-dist_pkgdata_SCRIPTS = \
-       $(top_builddir)/scripts/common.sh \
-       $(top_srcdir)/scripts/zconfig.sh \
-       $(top_srcdir)/scripts/zfault.sh \
-       $(top_srcdir)/scripts/ziltest.sh \
-       $(top_srcdir)/scripts/zimport.sh \
-       $(top_srcdir)/scripts/zfs.sh \
-       $(top_srcdir)/scripts/zpool-create.sh \
-       $(top_srcdir)/scripts/zpios.sh \
-       $(top_srcdir)/scripts/zpios-sanity.sh \
-       $(top_srcdir)/scripts/zpios-survey.sh \
-       $(top_srcdir)/scripts/smb.sh
-
-ZFS=$(top_builddir)/scripts/zfs.sh
-ZCONFIG=$(top_builddir)/scripts/zconfig.sh
-ZFAULT=$(top_builddir)/scripts/zfault.sh
-ZIMPORT=$(top_builddir)/scripts/zimport.sh
-ZTEST=$(top_builddir)/cmd/ztest/ztest
-ZPIOS_SANITY=$(top_builddir)/scripts/zpios-sanity.sh
-
-check:
-       @$(ZFS) -u
-       @echo
-       @echo -n "===================================="
-       @echo -n " ZTEST "
-       @echo    "===================================="
-       @echo
-       @$(ZFS)
-       @$(ZTEST) -V
-       @$(ZFS) -u
-       @echo
-       @echo
-       @echo -n "==================================="
-       @echo -n " ZCONFIG "
-       @echo    "==================================="
-       @echo
-       @$(ZCONFIG) -c
-       @echo
-       @echo -n "==================================="
-       @echo -n " ZFAULT "
-       @echo    "==================================="
-       @echo
-       @$(ZFAULT) -c
-       @echo
-       @echo -n "===================================="
-       @echo -n " ZPIOS "
-       @echo    "===================================="
-       @echo
-       @$(ZFS)
-       @$(ZPIOS_SANITY)
-       @$(ZFS) -u
-       @echo
diff --git a/zfs/scripts/Makefile.in b/zfs/scripts/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
index 2fac2a9191c2df00b4b506bd4aa5c9d0366cd041..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,787 +1,2 @@
-#!/bin/bash
-#
-# Common support functions for testing scripts.  If a script-config
-# files is available it will be sourced so in-tree kernel modules and
-# utilities will be used.  If no script-config can be found then the
-# installed kernel modules and utilities will be used.
-
-basedir="$(dirname $0)"
-
-SCRIPT_CONFIG=zfs-script-config.sh
-if [ -f "${basedir}/../${SCRIPT_CONFIG}" ]; then
-. "${basedir}/../${SCRIPT_CONFIG}"
-else
-KERNEL_MODULES=(zlib_deflate zlib_inflate)
-MODULES=(spl splat zavl znvpair zunicode zcommon zfs)
-fi
-
-PROG="<define PROG>"
-CLEANUP=
-VERBOSE=
-VERBOSE_FLAG=
-FORCE=
-FORCE_FLAG=
-DUMP_LOG=
-ERROR=
-RAID0S=()
-RAID10S=()
-RAIDZS=()
-RAIDZ2S=()
-TESTS_RUN=${TESTS_RUN:-'*'}
-TESTS_SKIP=${TESTS_SKIP:-}
-
-prefix=@prefix@
-exec_prefix=@exec_prefix@
-pkgdatadir=@datarootdir@/@PACKAGE@
-bindir=@bindir@
-sbindir=@sbindir@
-udevdir=@udevdir@
-udevruledir=@udevruledir@
-sysconfdir=@sysconfdir@
-localstatedir=@localstatedir@
-
-ETCDIR=${ETCDIR:-/etc}
-DEVDIR=${DEVDIR:-/dev/disk/by-vdev}
-ZPOOLDIR=${ZPOOLDIR:-${pkgdatadir}/zpool-config}
-ZPIOSDIR=${ZPIOSDIR:-${pkgdatadir}/zpios-test}
-ZPIOSPROFILEDIR=${ZPIOSPROFILEDIR:-${pkgdatadir}/zpios-profile}
-
-ZDB=${ZDB:-${sbindir}/zdb}
-ZFS=${ZFS:-${sbindir}/zfs}
-ZINJECT=${ZINJECT:-${sbindir}/zinject}
-ZPOOL=${ZPOOL:-${sbindir}/zpool}
-ZTEST=${ZTEST:-${sbindir}/ztest}
-ZPIOS=${ZPIOS:-${sbindir}/zpios}
-
-COMMON_SH=${COMMON_SH:-${pkgdatadir}/common.sh}
-ZFS_SH=${ZFS_SH:-${pkgdatadir}/zfs.sh}
-ZPOOL_CREATE_SH=${ZPOOL_CREATE_SH:-${pkgdatadir}/zpool-create.sh}
-ZPIOS_SH=${ZPIOS_SH:-${pkgdatadir}/zpios.sh}
-ZPIOS_SURVEY_SH=${ZPIOS_SURVEY_SH:-${pkgdatadir}/zpios-survey.sh}
-
-LDMOD=${LDMOD:-/sbin/modprobe}
-LSMOD=${LSMOD:-/sbin/lsmod}
-RMMOD=${RMMOD:-/sbin/rmmod}
-INFOMOD=${INFOMOD:-/sbin/modinfo}
-LOSETUP=${LOSETUP:-/sbin/losetup}
-MDADM=${MDADM:-/sbin/mdadm}
-PARTED=${PARTED:-/sbin/parted}
-BLOCKDEV=${BLOCKDEV:-/sbin/blockdev}
-LSSCSI=${LSSCSI:-/usr/bin/lsscsi}
-SCSIRESCAN=${SCSIRESCAN:-/usr/bin/scsi-rescan}
-SYSCTL=${SYSCTL:-/sbin/sysctl}
-UDEVADM=${UDEVADM:-/sbin/udevadm}
-AWK=${AWK:-/usr/bin/awk}
-
-ZED_PIDFILE=${ZED_PIDFILE:-${localstatedir}/run/zed.pid}
-
-COLOR_BLACK="\033[0;30m"
-COLOR_DK_GRAY="\033[1;30m"
-COLOR_BLUE="\033[0;34m"
-COLOR_LT_BLUE="\033[1;34m" 
-COLOR_GREEN="\033[0;32m"
-COLOR_LT_GREEN="\033[1;32m"
-COLOR_CYAN="\033[0;36m"
-COLOR_LT_CYAN="\033[1;36m"
-COLOR_RED="\033[0;31m"
-COLOR_LT_RED="\033[1;31m"
-COLOR_PURPLE="\033[0;35m"
-COLOR_LT_PURPLE="\033[1;35m"
-COLOR_BROWN="\033[0;33m"
-COLOR_YELLOW="\033[1;33m"
-COLOR_LT_GRAY="\033[0;37m"
-COLOR_WHITE="\033[1;37m"
-COLOR_RESET="\033[0m"
-
-die() {
-       echo -e "${PROG}: $1" >&2
-       exit 1
-}
-
-msg() {
-       if [ ${VERBOSE} ]; then
-               echo "$@"
-       fi
-}
-
-pass() {
-       echo -e "${COLOR_GREEN}Pass${COLOR_RESET}"
-}
-
-fail() {
-       echo -e "${COLOR_RED}Fail${COLOR_RESET} ($1)"
-       exit $1
-}
-
-skip() {
-       echo -e "${COLOR_BROWN}Skip${COLOR_RESET}"
-}
-
-populate() {
-       local ROOT=$1
-       local MAX_DIR_SIZE=$2
-       local MAX_FILE_SIZE=$3
-
-       mkdir -p $ROOT/{a,b,c,d,e,f,g}/{h,i}
-       DIRS=`find $ROOT`
-
-       for DIR in $DIRS; do
-               COUNT=$(($RANDOM % $MAX_DIR_SIZE))
-
-               for i in `seq $COUNT`; do
-                       FILE=`mktemp -p ${DIR}`
-                       SIZE=$(($RANDOM % $MAX_FILE_SIZE))
-                       dd if=/dev/urandom of=$FILE bs=1k count=$SIZE &>/dev/null
-               done
-       done
-
-       return 0
-}
-
-init() {
-       # Disable the udev rule 90-zfs.rules to prevent the zfs module
-       # stack from being loaded due to the detection of a zfs device.
-       # This is important because the test scripts require full control
-       # over when and how the modules are loaded/unloaded.  A trap is
-       # set to ensure the udev rule is correctly replaced on exit.
-       local RULE=${udevruledir}/90-zfs.rules
-       if test -e  ${RULE}; then
-               trap "mv ${RULE}.disabled ${RULE}" INT TERM EXIT
-               mv ${RULE} ${RULE}.disabled
-       fi
-
-       # Create a random directory tree of files and sub-directories to
-       # to act as a copy source for the various regression tests.
-       SRC_DIR=`mktemp -d -p /var/tmp/ zfs.src.XXXXXXXX`
-       trap "rm -Rf $SRC_DIR" INT TERM EXIT
-       populate $SRC_DIR 10 100
-}
-
-spl_dump_log() {
-       ${SYSCTL} -w kernel.spl.debug.dump=1 &>/dev/null
-       local NAME=`dmesg | tail -n 1 | cut -f5 -d' '`
-       ${SPLBUILD}/cmd/spl ${NAME} >${NAME}.log
-       echo
-       echo "Dumped debug log: ${NAME}.log"
-       tail -n1 ${NAME}.log
-       echo
-       return 0
-}
-
-check_modules() {
-       local LOADED_MODULES=()
-       local MISSING_MODULES=()
-
-       for MOD in ${MODULES[*]}; do
-               local NAME=`basename $MOD .ko`
-
-               if ${LSMOD} | egrep -q "^${NAME}"; then
-                       LOADED_MODULES=(${NAME} ${LOADED_MODULES[*]})
-               fi
-
-               if [ ${INFOMOD} ${MOD} 2>/dev/null ]; then
-                       MISSING_MODULES=("\t${MOD}\n" ${MISSING_MODULES[*]})
-               fi
-       done
-
-       if [ ${#LOADED_MODULES[*]} -gt 0 ]; then
-               ERROR="Unload these modules with '${PROG} -u':\n"
-               ERROR="${ERROR}${LOADED_MODULES[*]}"
-               return 1
-       fi
-
-       if [ ${#MISSING_MODULES[*]} -gt 0 ]; then
-               ERROR="The following modules can not be found,"
-               ERROR="${ERROR} ensure your source trees are built:\n"
-               ERROR="${ERROR}${MISSING_MODULES[*]}"
-               return 1
-       fi
-
-       return 0
-}
-
-load_module() {
-       local NAME=`basename $1 .ko`
-
-       if [ ${VERBOSE} ]; then
-               echo "Loading ${NAME} ($@)"
-       fi
-
-       ${LDMOD} $* &>/dev/null
-       if [ $? -ne 0 ]; then
-               echo "Failed to load ${NAME} ($@)"
-               return 1
-       fi
-
-       return 0
-}
-
-load_modules() {
-       mkdir -p /etc/zfs
-
-       for MOD in ${KERNEL_MODULES[*]}; do
-               load_module ${MOD} >/dev/null
-       done
-
-       for MOD in ${MODULES[*]}; do
-               local NAME=`basename ${MOD} .ko`
-               local VALUE=
-
-               for OPT in "$@"; do
-                       OPT_NAME=`echo ${OPT} | cut -f1 -d'='`
-
-                       if [ ${NAME} = "${OPT_NAME}" ]; then
-                               VALUE=`echo ${OPT} | cut -f2- -d'='`
-                       fi
-               done
-
-               load_module ${MOD} ${VALUE} || return 1
-       done
-
-       if [ ${VERBOSE} ]; then
-               echo "Successfully loaded ZFS module stack"
-       fi
-
-       return 0
-}
-
-unload_module() {
-       local NAME=`basename $1 .ko`
-
-       if [ ${VERBOSE} ]; then
-               echo "Unloading ${NAME} ($@)"
-       fi
-
-       ${RMMOD} ${NAME} || ERROR="Failed to unload ${NAME}" return 1
-
-       return 0
-}
-
-unload_modules() {
-       local MODULES_REVERSE=( $(echo ${MODULES[@]} |
-               ${AWK} '{for (i=NF;i>=1;i--) printf $i" "} END{print ""}') )
-
-       for MOD in ${MODULES_REVERSE[*]}; do
-               local NAME=`basename ${MOD} .ko`
-               local USE_COUNT=`${LSMOD} |
-                               egrep "^${NAME} "| ${AWK} '{print $3}'`
-
-               if [ "${USE_COUNT}" = 0 ] ; then
-
-                       if [ "${DUMP_LOG}" -a ${NAME} = "spl" ]; then
-                               spl_dump_log
-                       fi
-
-                       unload_module ${MOD} || return 1
-               fi
-       done
-
-       if [ ${VERBOSE} ]; then
-               echo "Successfully unloaded ZFS module stack"
-       fi
-
-       return 0
-}
-
-#
-# Check that the mdadm utilities are installed.
-#
-check_loop_utils() {
-        test -f ${LOSETUP} || die "${LOSETUP} utility must be installed"
-}
-
-
-#
-# Find and return an unused loop device.  A new /dev/loopN node will be
-# created if required.  The kernel loop driver will automatically register
-# the minor as long as it's less than /sys/module/loop/parameters/max_loop.
-#
-unused_loop_device() {
-       local DEVICE=`${LOSETUP} -f`
-       local MAX_LOOP_PATH="/sys/module/loop/parameters/max_loop"
-       local MAX_LOOP;
-
-       # An existing /dev/loopN device was available.
-       if [ -n "${DEVICE}" ]; then
-               echo "${DEVICE}"
-               return 0
-       fi
-
-       # Create a new /dev/loopN provided we are not at MAX_LOOP.
-       if [ -f "${MAX_LOOP_PATH}" ]; then
-               MAX_LOOP=`cat /sys/module/loop/parameters/max_loop`
-               if [ ${MAX_LOOP} -eq 0 ]; then
-                       MAX_LOOP=255
-               fi
-
-               for (( i=0; i<=${MAX_LOOP}; i++ )); do
-                       DEVICE="/dev/loop$i"
-
-                       if [ -b "${DEVICE}" ]; then
-                               continue
-                       else
-                               mknod -m660 "${DEVICE}" b 7 $i
-                               chown root.disk "${DEVICE}"
-                               chmod 666 "${DEVICE}"
-
-                               echo "${DEVICE}"
-                               return 0
-                       fi
-               done
-       fi
-
-       die "Error: Unable to create new loopback device"
-}
-
-#
-# This can be slightly dangerous because the loop devices we are
-# cleaning up may not be ours.  However, if the devices are currently
-# in use we will not be able to remove them, and we only remove
-# devices which include 'zpool' or 'deleted' in the name.  So any
-# damage we might do should be limited to other zfs related testing.
-#
-cleanup_loop_devices() {
-       local TMP_FILE=`mktemp`
-
-       ${LOSETUP} -a | tr -d '()' >${TMP_FILE}
-       ${AWK} -F":" -v losetup="$LOSETUP" \
-           '/zpool/ || /deleted/ { system("losetup -d "$1) }' ${TMP_FILE}
-       ${AWK} -F" " '/zpool/ || /deleted/ { system("rm -f "$3) }' ${TMP_FILE}
-
-       rm -f ${TMP_FILE}
-}
-
-#
-# Destroy the passed loopback devices, this is used when you know
-# the names of the loopback devices.
-#
-destroy_loop_devices() {
-       local LODEVICES="$1"
-
-       msg "Destroying ${LODEVICES}"
-        ${LOSETUP} -d ${LODEVICES} || \
-               die "Error $? destroying ${FILE} -> ${DEVICE} loopback"
-
-       rm -f ${FILES}
-       return 0
-}
-
-#
-# Create a device label taking care to briefly wait if udev needs to settle.
-#
-label() {
-       local DEVICE=$1
-       local LABEL=$2
-
-       wait_udev ${DEVICE} 30 || return 1
-       ${PARTED} ${DEVICE} --script -- mklabel ${LABEL} || return 2
-
-       return 0
-}
-
-#
-# Create a primary partition on a block device.
-#
-partition() {
-       local DEVICE=$1
-       local TYPE=$2
-       local START=$3
-       local END=$4
-
-       ${PARTED} --align optimal ${DEVICE} --script -- \
-           mkpart ${TYPE} ${START} ${END} || return 1
-       udev_trigger
-
-       return 0
-}
-
-#
-# Create a filesystem on the block device
-#
-format() {
-       local DEVICE=$1
-       local FSTYPE=$2
-
-       # Force 4K blocksize, else mkfs.ext2 tries to use 8K, which
-       # won't mount
-       /sbin/mkfs.${FSTYPE} -b 4096 -F -q ${DEVICE} >/dev/null || return 1
-
-       return 0
-}
-
-#
-# Check that the mdadm utilities are installed.
-#
-check_md_utils() {
-        test -f ${MDADM} || die "${MDADM} utility must be installed"
-       test -f ${PARTED} || die "${PARTED} utility must be installed"
-}
-
-check_md_partitionable() {
-       local LOFILE=`mktemp -p /tmp zpool-lo.XXXXXXXX`
-       local LODEVICE=`unused_loop_device`
-       local MDDEVICE=`unused_md_device`
-       local RESULT=1
-
-       check_md_utils
-
-       rm -f ${LOFILE}
-       dd if=/dev/zero of=${LOFILE} bs=1M count=0 seek=16 \
-               &>/dev/null || return ${RESULT}
-
-       msg "Creating ${LODEVICE} using ${LOFILE}"
-       ${LOSETUP} ${LODEVICE} ${LOFILE}
-       if [ $? -ne 0 ]; then
-               rm -f ${LOFILE}
-               return ${RESULT}
-       fi
-
-       msg "Creating ${MDDEVICE} using ${LODEVICE}"
-       ${MDADM} --build ${MDDEVICE} --level=faulty \
-               --raid-devices=1 ${LODEVICE} &>/dev/null
-       if [ $? -ne 0 ]; then
-               destroy_loop_devices ${LODEVICE}
-               rm -f ${LOFILE}
-               return ${RESULT}
-       fi
-       wait_udev ${MDDEVICE} 30
-
-       ${BLOCKDEV} --rereadpt ${MDDEVICE} 2>/dev/null
-       RESULT=$?
-
-       destroy_md_devices ${MDDEVICE}
-       destroy_loop_devices ${LODEVICE}
-       rm -f ${LOFILE}
-
-       return ${RESULT}
-}
-
-#
-# Find and return an unused md device.
-#
-unused_md_device() {
-       for (( i=0; i<32; i++ )); do
-               MDDEVICE=md${i}
-
-               # Skip active devicesudo in /proc/mdstat.
-               grep -q "${MDDEVICE} " /proc/mdstat && continue
-
-               # Device doesn't exist, use it.
-               if [ ! -e $/dev/{MDDEVICE} ]; then
-                       echo /dev/${MDDEVICE}
-                       return
-               fi
-
-               # Device exists but may not be in use.
-               if [ -b /dev/${MDDEVICE} ]; then
-                       ${MDADM} --detail /dev/${MDDEVICE} &>/dev/null
-                       if [ $? -eq 1 ]; then
-                               echo /dev/${MDDEVICE}
-                               return
-                       fi
-               fi
-        done
-
-        die "Error: Unable to find unused md device"
-}
-
-#
-# This can be slightly dangerous because it is possible the md devices
-# we are cleaning up may not be ours.  However, if the devices are
-# currently in use we will not be able to remove them, and even if
-# we remove devices which were not out we do not zero the super block
-# so you should be able to reconstruct them.
-#
-cleanup_md_devices() {
-       destroy_md_devices "`ls /dev/md* 2>/dev/null | grep -v p`"
-       udev_trigger
-}
-
-#
-# Destroy the passed md devices, this is used when you know
-# the names of the md devices.
-#
-destroy_md_devices() {
-       local MDDEVICES="$1"
-
-       msg "Destroying ${MDDEVICES}"
-       for MDDEVICE in ${MDDEVICES}; do
-               ${MDADM} --stop ${MDDEVICE} &>/dev/null
-               ${MDADM} --remove ${MDDEVICE} &>/dev/null
-               ${MDADM} --detail ${MDDEVICE} &>/dev/null
-       done
-
-       return 0
-}
-
-#
-# Check that the scsi utilities are installed.
-#
-check_sd_utils() {
-       ${INFOMOD} scsi_debug &>/dev/null || die "scsi_debug module required"
-       test -f ${LSSCSI} || die "${LSSCSI} utility must be installed"
-}
-
-#
-# Rescan the scsi bus for scsi_debug devices.  It is preferable to use the
-# scsi-rescan tool if it is installed, but if it's not we can fall back to
-# removing and readding the device manually.  This rescan will only effect
-# the first scsi_debug device if scsi-rescan is missing.
-#
-scsi_rescan() {
-       local AWK_SCRIPT="/scsi_debug/ { print \$1; exit }"
-
-       if [ -f ${SCSIRESCAN} ]; then
-               ${SCSIRESCAN} --forcerescan --remove &>/dev/null
-       else
-               local SCSIID=`${LSSCSI} | ${AWK} "${AWK_SCRIPT}" | tr -d '[]'`
-               local SCSIHOST=`echo ${SCSIID} | cut -f1 -d':'`
-               echo 1 >"/sys/class/scsi_device/${SCSIID}/device/delete"
-               udev_trigger
-               echo "- - -" >/sys/class/scsi_host/host${SCSIHOST}/scan
-               udev_trigger
-       fi
-}
-
-#
-# Trigger udev and wait for it to settle.
-#
-udev_trigger() {
-       if [ -f ${UDEVADM} ]; then
-               ${UDEVADM} trigger --action=change --subsystem-match=block
-               ${UDEVADM} settle
-       else
-               /sbin/udevtrigger
-               /sbin/udevsettle
-       fi
-}
-
-#
-# The following udev helper functions assume that the provided
-# udev rules file will create a /dev/disk/by-vdev/<CHANNEL><RANK>
-# disk mapping.  In this mapping each CHANNEL is represented by
-# the letters a-z, and the RANK is represented by the numbers
-# 1-n.  A CHANNEL should identify a group of RANKS which are all
-# attached to a single controller, each RANK represents a disk.
-# This provides a simply mechanism to locate a specific drive
-# given a known hardware configuration.
-#
-udev_setup() {
-       local SRC_PATH=$1
-
-       # When running in tree manually contruct symlinks in tree to
-       # the proper devices.  Symlinks are installed for all entires
-       # in the config file regardless of if that device actually
-       # exists.  When installed as a package udev can be relied on for
-       # this and it will only create links for devices which exist.
-       if [ ${INTREE} ]; then
-               PWD=`pwd`
-               mkdir -p ${DEVDIR}/
-               cd ${DEVDIR}/
-               ${AWK} '!/^#/ && /./ { system( \
-                       "ln -f -s /dev/disk/by-path/"$2" "$1";" \
-                       "ln -f -s /dev/disk/by-path/"$2"-part1 "$1"p1;" \
-                       "ln -f -s /dev/disk/by-path/"$2"-part9 "$1"p9;" \
-                       ) }' $SRC_PATH
-               cd ${PWD}
-       else
-               DST_FILE=`basename ${SRC_PATH} | cut -f1-2 -d'.'`
-               DST_PATH=/etc/zfs/${DST_FILE}
-
-               if [ -e ${DST_PATH} ]; then
-                       die "Error: Config ${DST_PATH} already exists"
-               fi
-
-               cp ${SRC_PATH} ${DST_PATH}
-               udev_trigger
-       fi
-
-       return 0
-}
-
-udev_cleanup() {
-       local SRC_PATH=$1
-
-       if [ ${INTREE} ]; then
-               PWD=`pwd`
-               cd ${DEVDIR}/
-               ${AWK} '!/^#/ && /./ { system( \
-                       "rm -f "$1" "$1"p1 "$1"p9") }' $SRC_PATH
-               cd ${PWD}
-       fi
-
-       return 0
-}
-
-udev_cr2d() {
-       local CHANNEL=`echo "obase=16; $1+96" | bc`
-       local RANK=$2
-
-       printf "\x${CHANNEL}${RANK}"
-}
-
-udev_raid0_setup() {
-       local RANKS=$1
-       local CHANNELS=$2
-       local IDX=0
-
-       RAID0S=()
-       for RANK in `seq 1 ${RANKS}`; do
-               for CHANNEL in `seq 1 ${CHANNELS}`; do
-                       DISK=`udev_cr2d ${CHANNEL} ${RANK}`
-                       RAID0S[${IDX}]="${DEVDIR}/${DISK}"
-                       let IDX=IDX+1
-               done
-       done
-
-       return 0
-}
-
-udev_raid10_setup() {
-       local RANKS=$1
-       local CHANNELS=$2
-       local IDX=0
-
-       RAID10S=()
-       for RANK in `seq 1 ${RANKS}`; do
-               for CHANNEL1 in `seq 1 2 ${CHANNELS}`; do
-                       let CHANNEL2=CHANNEL1+1
-                       DISK1=`udev_cr2d ${CHANNEL1} ${RANK}`
-                       DISK2=`udev_cr2d ${CHANNEL2} ${RANK}`
-                       GROUP="${DEVDIR}/${DISK1} ${DEVDIR}/${DISK2}"
-                       RAID10S[${IDX}]="mirror ${GROUP}"
-                       let IDX=IDX+1
-               done
-       done
-
-       return 0
-}
-
-udev_raidz_setup() {
-       local RANKS=$1
-       local CHANNELS=$2
-
-       RAIDZS=()
-       for RANK in `seq 1 ${RANKS}`; do
-               RAIDZ=("raidz")
-
-               for CHANNEL in `seq 1 ${CHANNELS}`; do
-                       DISK=`udev_cr2d ${CHANNEL} ${RANK}`
-                       RAIDZ[${CHANNEL}]="${DEVDIR}/${DISK}"
-               done
-
-               RAIDZS[${RANK}]="${RAIDZ[*]}"
-       done
-
-       return 0
-}
-
-udev_raidz2_setup() {
-       local RANKS=$1
-       local CHANNELS=$2
-
-       RAIDZ2S=()
-       for RANK in `seq 1 ${RANKS}`; do
-               RAIDZ2=("raidz2")
-
-               for CHANNEL in `seq 1 ${CHANNELS}`; do
-                       DISK=`udev_cr2d ${CHANNEL} ${RANK}`
-                       RAIDZ2[${CHANNEL}]="${DEVDIR}/${DISK}"
-               done
-
-               RAIDZ2S[${RANK}]="${RAIDZ2[*]}"
-       done
-
-       return 0
-}
-
-run_one_test() {
-       local TEST_NUM=$1
-       local TEST_NAME=$2
-
-       printf "%-4d %-34s " ${TEST_NUM} "${TEST_NAME}"
-       test_${TEST_NUM}
-}
-
-skip_one_test() {
-       local TEST_NUM=$1
-       local TEST_NAME=$2
-
-       printf "%-4d %-34s " ${TEST_NUM} "${TEST_NAME}"
-       skip
-}
-
-run_test() {
-       local TEST_NUM=$1
-       local TEST_NAME=$2
-
-       for i in ${TESTS_SKIP[@]}; do
-               if [[ $i == ${TEST_NUM} ]] ; then
-                       skip_one_test ${TEST_NUM} "${TEST_NAME}"
-                       return 0
-               fi
-       done
-
-       if [ "${TESTS_RUN[0]}" = "*" ]; then
-               run_one_test ${TEST_NUM} "${TEST_NAME}"
-       else
-               for i in ${TESTS_RUN[@]}; do
-                       if [[ $i == ${TEST_NUM} ]] ; then
-                               run_one_test ${TEST_NUM} "${TEST_NAME}"
-                               return 0
-                       fi
-               done
-
-               skip_one_test ${TEST_NUM} "${TEST_NAME}"
-       fi
-}
-
-wait_udev() {
-       local DEVICE=$1
-       local DELAY=$2
-       local COUNT=0
-
-       udev_trigger
-       while [ ! -e ${DEVICE} ]; do
-               if [ ${COUNT} -gt ${DELAY} ]; then
-                       return 1
-               fi
-
-               let COUNT=${COUNT}+1
-               sleep 1
-       done
-
-       return 0
-}
-
-stack_clear() {
-       local STACK_MAX_SIZE=/sys/kernel/debug/tracing/stack_max_size
-       local STACK_TRACER_ENABLED=/proc/sys/kernel/stack_tracer_enabled
-
-       if [ -e $STACK_MAX_SIZE ]; then
-               echo 1 >$STACK_TRACER_ENABLED
-               echo 0 >$STACK_MAX_SIZE
-       fi
-}
-
-stack_check() {
-       local STACK_MAX_SIZE=/sys/kernel/debug/tracing/stack_max_size
-       local STACK_TRACE=/sys/kernel/debug/tracing/stack_trace
-       local STACK_LIMIT=7000
-
-       if [ -e $STACK_MAX_SIZE ]; then
-               STACK_SIZE=`cat $STACK_MAX_SIZE`
-
-               if [ $STACK_SIZE -ge $STACK_LIMIT ]; then
-                       echo
-                       echo "Warning: max stack size $STACK_SIZE bytes"
-                       cat $STACK_TRACE
-               fi
-       fi
-}
-
-kill_zed() {
-        if [ -f $ZED_PIDFILE ]; then
-               kill $(cat $ZED_PIDFILE)
-        fi
-}
+%:
+       #
diff --git a/zfs/scripts/cstyle.pl b/zfs/scripts/cstyle.pl
deleted file mode 100755 (executable)
index 4df185e..0000000
+++ /dev/null
@@ -1,951 +0,0 @@
-#!/usr/bin/perl -w
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License (the "License").
-# You may not use this file except in compliance with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2008 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# @(#)cstyle 1.58 98/09/09 (from shannon)
-#ident "%Z%%M% %I%     %E% SMI"
-#
-# cstyle - check for some common stylistic errors.
-#
-#      cstyle is a sort of "lint" for C coding style.
-#      It attempts to check for the style used in the
-#      kernel, sometimes known as "Bill Joy Normal Form".
-#
-#      There's a lot this can't check for, like proper indentation
-#      of code blocks.  There's also a lot more this could check for.
-#
-#      A note to the non perl literate:
-#
-#              perl regular expressions are pretty much like egrep
-#              regular expressions, with the following special symbols
-#
-#              \s      any space character
-#              \S      any non-space character
-#              \w      any "word" character [a-zA-Z0-9_]
-#              \W      any non-word character
-#              \d      a digit [0-9]
-#              \D      a non-digit
-#              \b      word boundary (between \w and \W)
-#              \B      non-word boundary
-#
-
-require 5.0;
-use IO::File;
-use Getopt::Std;
-use strict;
-
-my $usage =
-"usage: cstyle [-chpvCP] [-o constructs] file ...
-       -c      check continuation indentation inside functions
-       -h      perform heuristic checks that are sometimes wrong
-       -p      perform some of the more picky checks
-       -v      verbose
-       -C      don't check anything in header block comments
-       -P      check for use of non-POSIX types
-       -o constructs
-               allow a comma-seperated list of optional constructs:
-                   doxygen     allow doxygen-style block comments (/** /*!)
-                   splint      allow splint-style lint comments (/*@ ... @*/)
-";
-
-my %opts;
-
-if (!getopts("cho:pvCP", \%opts)) {
-       print $usage;
-       exit 2;
-}
-
-my $check_continuation = $opts{'c'};
-my $heuristic = $opts{'h'};
-my $picky = $opts{'p'};
-my $verbose = $opts{'v'};
-my $ignore_hdr_comment = $opts{'C'};
-my $check_posix_types = $opts{'P'};
-
-my $doxygen_comments = 0;
-my $splint_comments = 0;
-
-if (defined($opts{'o'})) {
-       for my $x (split /,/, $opts{'o'}) {
-               if ($x eq "doxygen") {
-                       $doxygen_comments = 1;
-               } elsif ($x eq "splint") {
-                       $splint_comments = 1;
-               } else {
-                       print "cstyle: unrecognized construct \"$x\"\n";
-                       print $usage;
-                       exit 2;
-               }
-       }
-}
-
-my ($filename, $line, $prev);          # shared globals
-
-my $fmt;
-my $hdr_comment_start;
-
-if ($verbose) {
-       $fmt = "%s: %d: %s\n%s\n";
-} else {
-       $fmt = "%s: %d: %s\n";
-}
-
-if ($doxygen_comments) {
-       # doxygen comments look like "/*!" or "/**"; allow them.
-       $hdr_comment_start = qr/^\s*\/\*[\!\*]?$/;
-} else {
-       $hdr_comment_start = qr/^\s*\/\*$/;
-}
-
-# Note, following must be in single quotes so that \s and \w work right.
-my $typename = '(int|char|short|long|unsigned|float|double' .
-    '|\w+_t|struct\s+\w+|union\s+\w+|FILE)';
-
-# mapping of old types to POSIX compatible types
-my %old2posix = (
-       'unchar' => 'uchar_t',
-       'ushort' => 'ushort_t',
-       'uint' => 'uint_t',
-       'ulong' => 'ulong_t',
-       'u_int' => 'uint_t',
-       'u_short' => 'ushort_t',
-       'u_long' => 'ulong_t',
-       'u_char' => 'uchar_t',
-       'quad' => 'quad_t'
-);
-
-my $lint_re = qr/\/\*(?:
-       ARGSUSED[0-9]*|NOTREACHED|LINTLIBRARY|VARARGS[0-9]*|
-       CONSTCOND|CONSTANTCOND|CONSTANTCONDITION|EMPTY|
-       FALLTHRU|FALLTHROUGH|LINTED.*?|PRINTFLIKE[0-9]*|
-       PROTOLIB[0-9]*|SCANFLIKE[0-9]*|CSTYLED.*?
-    )\*\//x;
-
-my $splint_re = qr/\/\*@.*?@\*\//x;
-
-my $warlock_re = qr/\/\*\s*(?:
-       VARIABLES\ PROTECTED\ BY|
-       MEMBERS\ PROTECTED\ BY|
-       ALL\ MEMBERS\ PROTECTED\ BY|
-       READ-ONLY\ VARIABLES:|
-       READ-ONLY\ MEMBERS:|
-       VARIABLES\ READABLE\ WITHOUT\ LOCK:|
-       MEMBERS\ READABLE\ WITHOUT\ LOCK:|
-       LOCKS\ COVERED\ BY|
-       LOCK\ UNNEEDED\ BECAUSE|
-       LOCK\ NEEDED:|
-       LOCK\ HELD\ ON\ ENTRY:|
-       READ\ LOCK\ HELD\ ON\ ENTRY:|
-       WRITE\ LOCK\ HELD\ ON\ ENTRY:|
-       LOCK\ ACQUIRED\ AS\ SIDE\ EFFECT:|
-       READ\ LOCK\ ACQUIRED\ AS\ SIDE\ EFFECT:|
-       WRITE\ LOCK\ ACQUIRED\ AS\ SIDE\ EFFECT:|
-       LOCK\ RELEASED\ AS\ SIDE\ EFFECT:|
-       LOCK\ UPGRADED\ AS\ SIDE\ EFFECT:|
-       LOCK\ DOWNGRADED\ AS\ SIDE\ EFFECT:|
-       FUNCTIONS\ CALLED\ THROUGH\ POINTER|
-       FUNCTIONS\ CALLED\ THROUGH\ MEMBER|
-       LOCK\ ORDER:
-    )/x;
-
-my $err_stat = 0;              # exit status
-
-if ($#ARGV >= 0) {
-       foreach my $arg (@ARGV) {
-               my $fh = new IO::File $arg, "r";
-               if (!defined($fh)) {
-                       printf "%s: can not open\n", $arg;
-               } else {
-                       &cstyle($arg, $fh);
-                       close $fh;
-               }
-       }
-} else {
-       &cstyle("<stdin>", *STDIN);
-}
-exit $err_stat;
-
-my $no_errs = 0;               # set for CSTYLED-protected lines
-
-sub err($) {
-       my ($error) = @_;
-       unless ($no_errs) {
-               printf $fmt, $filename, $., $error, $line;
-               $err_stat = 1;
-       }
-}
-
-sub err_prefix($$) {
-       my ($prevline, $error) = @_;
-       my $out = $prevline."\n".$line;
-       unless ($no_errs) {
-               printf $fmt, $filename, $., $error, $out;
-               $err_stat = 1;
-       }
-}
-
-sub err_prev($) {
-       my ($error) = @_;
-       unless ($no_errs) {
-               printf $fmt, $filename, $. - 1, $error, $prev;
-               $err_stat = 1;
-       }
-}
-
-sub cstyle($$) {
-
-my ($fn, $filehandle) = @_;
-$filename = $fn;                       # share it globally
-
-my $in_cpp = 0;
-my $next_in_cpp = 0;
-
-my $in_comment = 0;
-my $in_header_comment = 0;
-my $comment_done = 0;
-my $in_warlock_comment = 0;
-my $in_function = 0;
-my $in_function_header = 0;
-my $in_declaration = 0;
-my $note_level = 0;
-my $nextok = 0;
-my $nocheck = 0;
-
-my $in_string = 0;
-
-my ($okmsg, $comment_prefix);
-
-$line = '';
-$prev = '';
-reset_indent();
-
-line: while (<$filehandle>) {
-       s/\r?\n$//;     # strip return and newline
-
-       # save the original line, then remove all text from within
-       # double or single quotes, we do not want to check such text.
-
-       $line = $_;
-
-       #
-       # C allows strings to be continued with a backslash at the end of
-       # the line.  We translate that into a quoted string on the previous
-       # line followed by an initial quote on the next line.
-       #
-       # (we assume that no-one will use backslash-continuation with character
-       # constants)
-       #
-       $_ = '"' . $_           if ($in_string && !$nocheck && !$in_comment);
-
-       #
-       # normal strings and characters
-       #
-       s/'([^\\']|\\[^xX0]|\\0[0-9]*|\\[xX][0-9a-fA-F]*)'/''/g;
-       s/"([^\\"]|\\.)*"/\"\"/g;
-
-       #
-       # detect string continuation
-       #
-       if ($nocheck || $in_comment) {
-               $in_string = 0;
-       } else {
-               #
-               # Now that all full strings are replaced with "", we check
-               # for unfinished strings continuing onto the next line.
-               #
-               $in_string =
-                   (s/([^"](?:"")*)"([^\\"]|\\.)*\\$/$1""/ ||
-                   s/^("")*"([^\\"]|\\.)*\\$/""/);
-       }
-
-       #
-       # figure out if we are in a cpp directive
-       #
-       $in_cpp = $next_in_cpp || /^\s*#/;      # continued or started
-       $next_in_cpp = $in_cpp && /\\$/;        # only if continued
-
-       # strip off trailing backslashes, which appear in long macros
-       s/\s*\\$//;
-
-       # an /* END CSTYLED */ comment ends a no-check block.
-       if ($nocheck) {
-               if (/\/\* *END *CSTYLED *\*\//) {
-                       $nocheck = 0;
-               } else {
-                       reset_indent();
-                       next line;
-               }
-       }
-
-       # a /*CSTYLED*/ comment indicates that the next line is ok.
-       if ($nextok) {
-               if ($okmsg) {
-                       err($okmsg);
-               }
-               $nextok = 0;
-               $okmsg = 0;
-               if (/\/\* *CSTYLED.*\*\//) {
-                       /^.*\/\* *CSTYLED *(.*) *\*\/.*$/;
-                       $okmsg = $1;
-                       $nextok = 1;
-               }
-               $no_errs = 1;
-       } elsif ($no_errs) {
-               $no_errs = 0;
-       }
-
-       # check length of line.
-       # first, a quick check to see if there is any chance of being too long.
-       if (($line =~ tr/\t/\t/) * 7 + length($line) > 80) {
-               # yes, there is a chance.
-               # replace tabs with spaces and check again.
-               my $eline = $line;
-               1 while $eline =~
-                   s/\t+/' ' x (length($&) * 8 - length($`) % 8)/e;
-               if (length($eline) > 80) {
-                       err("line > 80 characters");
-               }
-       }
-
-       # ignore NOTE(...) annotations (assumes NOTE is on lines by itself).
-       if ($note_level || /\b_?NOTE\s*\(/) { # if in NOTE or this is NOTE
-               s/[^()]//g;                       # eliminate all non-parens
-               $note_level += s/\(//g - length;  # update paren nest level
-               next;
-       }
-
-       # a /* BEGIN CSTYLED */ comment starts a no-check block.
-       if (/\/\* *BEGIN *CSTYLED *\*\//) {
-               $nocheck = 1;
-       }
-
-       # a /*CSTYLED*/ comment indicates that the next line is ok.
-       if (/\/\* *CSTYLED.*\*\//) {
-               /^.*\/\* *CSTYLED *(.*) *\*\/.*$/;
-               $okmsg = $1;
-               $nextok = 1;
-       }
-       if (/\/\/ *CSTYLED/) {
-               /^.*\/\/ *CSTYLED *(.*)$/;
-               $okmsg = $1;
-               $nextok = 1;
-       }
-
-       # universal checks; apply to everything
-       if (/\t +\t/) {
-               err("spaces between tabs");
-       }
-       if (/ \t+ /) {
-               err("tabs between spaces");
-       }
-       if (/\s$/) {
-               err("space or tab at end of line");
-       }
-       if (/[^ \t(]\/\*/ && !/\w\(\/\*.*\*\/\);/) {
-               err("comment preceded by non-blank");
-       }
-
-       # is this the beginning or ending of a function?
-       # (not if "struct foo\n{\n")
-       if (/^{$/ && $prev =~ /\)\s*(const\s*)?(\/\*.*\*\/\s*)?\\?$/) {
-               $in_function = 1;
-               $in_declaration = 1;
-               $in_function_header = 0;
-               $prev = $line;
-               next line;
-       }
-       if (/^}\s*(\/\*.*\*\/\s*)*$/) {
-               if ($prev =~ /^\s*return\s*;/) {
-                       err_prev("unneeded return at end of function");
-               }
-               $in_function = 0;
-               reset_indent();         # we don't check between functions
-               $prev = $line;
-               next line;
-       }
-       if (/^\w*\($/) {
-               $in_function_header = 1;
-       }
-
-       if ($in_warlock_comment && /\*\//) {
-               $in_warlock_comment = 0;
-               $prev = $line;
-               next line;
-       }
-
-       # a blank line terminates the declarations within a function.
-       # XXX - but still a problem in sub-blocks.
-       if ($in_declaration && /^$/) {
-               $in_declaration = 0;
-       }
-
-       if ($comment_done) {
-               $in_comment = 0;
-               $in_header_comment = 0;
-               $comment_done = 0;
-       }
-       # does this looks like the start of a block comment?
-       if (/$hdr_comment_start/) {
-               if (!/^\t*\/\*/) {
-                       err("block comment not indented by tabs");
-               }
-               $in_comment = 1;
-               /^(\s*)\//;
-               $comment_prefix = $1;
-               if ($comment_prefix eq "") {
-                       $in_header_comment = 1;
-               }
-               $prev = $line;
-               next line;
-       }
-       # are we still in the block comment?
-       if ($in_comment) {
-               if (/^$comment_prefix \*\/$/) {
-                       $comment_done = 1;
-               } elsif (/\*\//) {
-                       $comment_done = 1;
-                       err("improper block comment close")
-                           unless ($ignore_hdr_comment && $in_header_comment);
-               } elsif (!/^$comment_prefix \*[ \t]/ &&
-                   !/^$comment_prefix \*$/) {
-                       err("improper block comment")
-                           unless ($ignore_hdr_comment && $in_header_comment);
-               }
-       }
-
-       if ($in_header_comment && $ignore_hdr_comment) {
-               $prev = $line;
-               next line;
-       }
-
-       # check for errors that might occur in comments and in code.
-
-       # allow spaces to be used to draw pictures in all comments.
-       if (/[^ ]     / && !/".*     .*"/ && !$in_comment) {
-               err("spaces instead of tabs");
-       }
-       if (/^ / && !/^ \*[ \t\/]/ && !/^ \*$/ &&
-           (!/^    \w/ || $in_function != 0)) {
-               err("indent by spaces instead of tabs");
-       }
-       if (/^\t+ [^ \t\*]/ || /^\t+  \S/ || /^\t+   \S/) {
-               err("continuation line not indented by 4 spaces");
-       }
-       if (/$warlock_re/ && !/\*\//) {
-               $in_warlock_comment = 1;
-               $prev = $line;
-               next line;
-       }
-       if (/^\s*\/\*./ && !/^\s*\/\*.*\*\// && !/$hdr_comment_start/) {
-               err("improper first line of block comment");
-       }
-
-       if ($in_comment) {      # still in comment, don't do further checks
-               $prev = $line;
-               next line;
-       }
-
-       if ((/[^(]\/\*\S/ || /^\/\*\S/) &&
-           !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
-               err("missing blank after open comment");
-       }
-       if (/\S\*\/[^)]|\S\*\/$/ &&
-           !(/$lint_re/ || ($splint_comments && /$splint_re/))) {
-               err("missing blank before close comment");
-       }
-       if (/\/\/\S/) {         # C++ comments
-               err("missing blank after start comment");
-       }
-       # check for unterminated single line comments, but allow them when
-       # they are used to comment out the argument list of a function
-       # declaration.
-       if (/\S.*\/\*/ && !/\S.*\/\*.*\*\// && !/\(\/\*/) {
-               err("unterminated single line comment");
-       }
-
-       if (/^(#else|#endif|#include)(.*)$/) {
-               $prev = $line;
-               if ($picky) {
-                       my $directive = $1;
-                       my $clause = $2;
-                       # Enforce ANSI rules for #else and #endif: no noncomment
-                       # identifiers are allowed after #endif or #else.  Allow
-                       # C++ comments since they seem to be a fact of life.
-                       if ((($1 eq "#endif") || ($1 eq "#else")) &&
-                           ($clause ne "") &&
-                           (!($clause =~ /^\s+\/\*.*\*\/$/)) &&
-                           (!($clause =~ /^\s+\/\/.*$/))) {
-                               err("non-comment text following " .
-                                   "$directive (or malformed $directive " .
-                                   "directive)");
-                       }
-               }
-               next line;
-       }
-
-       #
-       # delete any comments and check everything else.  Note that
-       # ".*?" is a non-greedy match, so that we don't get confused by
-       # multiple comments on the same line.
-       #
-       s/\/\*.*?\*\//\ 1/g;
-       s/\/\/.*$/\ 1/;           # C++ comments
-
-       # delete any trailing whitespace; we have already checked for that.
-       s/\s*$//;
-
-       # following checks do not apply to text in comments.
-
-       if (/[^<>\s][!<>=]=/ || /[^<>][!<>=]=[^\s,]/ ||
-           (/[^->]>[^,=>\s]/ && !/[^->]>$/) ||
-           (/[^<]<[^,=<\s]/ && !/[^<]<$/) ||
-           /[^<\s]<[^<]/ || /[^->\s]>[^>]/) {
-               err("missing space around relational operator");
-       }
-       if (/\S>>=/ || /\S<<=/ || />>=\S/ || /<<=\S/ || /\S[-+*\/&|^%]=/ ||
-           (/[^-+*\/&|^%!<>=\s]=[^=]/ && !/[^-+*\/&|^%!<>=\s]=$/) ||
-           (/[^!<>=]=[^=\s]/ && !/[^!<>=]=$/)) {
-               # XXX - should only check this for C++ code
-               # XXX - there are probably other forms that should be allowed
-               if (!/\soperator=/) {
-                       err("missing space around assignment operator");
-               }
-       }
-       if (/[,;]\S/ && !/\bfor \(;;\)/) {
-               err("comma or semicolon followed by non-blank");
-       }
-       # allow "for" statements to have empty "while" clauses
-       if (/\s[,;]/ && !/^[\t]+;$/ && !/^\s*for \([^;]*; ;[^;]*\)/) {
-               err("comma or semicolon preceded by blank");
-       }
-       if (/^\s*(&&|\|\|)/) {
-               err("improper boolean continuation");
-       }
-       if (/\S   *(&&|\|\|)/ || /(&&|\|\|)   *\S/) {
-               err("more than one space around boolean operator");
-       }
-       if (/\b(for|if|while|switch|sizeof|return|case)\(/) {
-               err("missing space between keyword and paren");
-       }
-       if (/(\b(for|if|while|switch|return)\b.*){2,}/ && !/^#define/) {
-               # multiple "case" and "sizeof" allowed
-               err("more than one keyword on line");
-       }
-       if (/\b(for|if|while|switch|sizeof|return|case)\s\s+\(/ &&
-           !/^#if\s+\(/) {
-               err("extra space between keyword and paren");
-       }
-       # try to detect "func (x)" but not "if (x)" or
-       # "#define foo (x)" or "int (*func)();"
-       if (/\w\s\(/) {
-               my $s = $_;
-               # strip off all keywords on the line
-               s/\b(for|if|while|switch|return|case|sizeof)\s\(/XXX(/g;
-               s/#elif\s\(/XXX(/g;
-               s/^#define\s+\w+\s+\(/XXX(/;
-               # do not match things like "void (*f)();"
-               # or "typedef void (func_t)();"
-               s/\w\s\(+\*/XXX(*/g;
-               s/\b($typename|void)\s+\(+/XXX(/og;
-               if (/\w\s\(/) {
-                       err("extra space between function name and left paren");
-               }
-               $_ = $s;
-       }
-       # try to detect "int foo(x)", but not "extern int foo(x);"
-       # XXX - this still trips over too many legitimate things,
-       # like "int foo(x,\n\ty);"
-#              if (/^(\w+(\s|\*)+)+\w+\(/ && !/\)[;,](\s|\ 1)*$/ &&
-#                  !/^(extern|static)\b/) {
-#                      err("return type of function not on separate line");
-#              }
-       # this is a close approximation
-       if (/^(\w+(\s|\*)+)+\w+\(.*\)(\s|\ 1)*$/ &&
-           !/^(extern|static)\b/) {
-               err("return type of function not on separate line");
-       }
-       if (/^#define /) {
-               err("#define followed by space instead of tab");
-       }
-       if (/^\s*return\W[^;]*;/ && !/^\s*return\s*\(.*\);/) {
-               err("unparenthesized return expression");
-       }
-       if (/\bsizeof\b/ && !/\bsizeof\s*\(.*\)/) {
-               err("unparenthesized sizeof expression");
-       }
-       if (/\(\s/) {
-               err("whitespace after left paren");
-       }
-       # Allow "for" statements to have empty "continue" clauses.
-       # Allow right paren on its own line unless we're being picky (-p).
-       if (/\s\)/ && !/^\s*for \([^;]*;[^;]*; \)/ && ($picky || !/^\s*\)/)) {
-               err("whitespace before right paren");
-       }
-       if (/^\s*\(void\)[^ ]/) {
-               err("missing space after (void) cast");
-       }
-       if (/\S{/ && !/{{/) {
-               err("missing space before left brace");
-       }
-       if ($in_function && /^\s+{/ &&
-           ($prev =~ /\)\s*$/ || $prev =~ /\bstruct\s+\w+$/)) {
-               err("left brace starting a line");
-       }
-       if (/}(else|while)/) {
-               err("missing space after right brace");
-       }
-       if (/}\s\s+(else|while)/) {
-               err("extra space after right brace");
-       }
-       if (/\b_VOID\b|\bVOID\b|\bSTATIC\b/) {
-               err("obsolete use of VOID or STATIC");
-       }
-       if (/\b$typename\*/o) {
-               err("missing space between type name and *");
-       }
-       if (/^\s+#/) {
-               err("preprocessor statement not in column 1");
-       }
-       if (/^#\s/) {
-               err("blank after preprocessor #");
-       }
-       if (/!\s*(strcmp|strncmp|bcmp)\s*\(/) {
-               err("don't use boolean ! with comparison functions");
-       }
-
-       #
-       # We completely ignore, for purposes of indentation:
-       #  * lines outside of functions
-       #  * preprocessor lines
-       #
-       if ($check_continuation && $in_function && !$in_cpp) {
-               process_indent($_);
-       }
-       if ($picky) {
-               # try to detect spaces after casts, but allow (e.g.)
-               # "sizeof (int) + 1", "void (*funcptr)(int) = foo;", and
-               # "int foo(int) __NORETURN;"
-               if ((/^\($typename( \*+)?\)\s/o ||
-                   /\W\($typename( \*+)?\)\s/o) &&
-                   !/sizeof\s*\($typename( \*)?\)\s/o &&
-                   !/\($typename( \*+)?\)\s+=[^=]/o) {
-                       err("space after cast");
-               }
-               if (/\b$typename\s*\*\s/o &&
-                   !/\b$typename\s*\*\s+const\b/o) {
-                       err("unary * followed by space");
-               }
-       }
-       if ($check_posix_types) {
-               # try to detect old non-POSIX types.
-               # POSIX requires all non-standard typedefs to end in _t,
-               # but historically these have been used.
-               if (/\b(unchar|ushort|uint|ulong|u_int|u_short|u_long|u_char|quad)\b/) {
-                       err("non-POSIX typedef $1 used: use $old2posix{$1} instead");
-               }
-       }
-       if ($heuristic) {
-               # cannot check this everywhere due to "struct {\n...\n} foo;"
-               if ($in_function && !$in_declaration &&
-                   /}./ && !/}\s+=/ && !/{.*}[;,]$/ && !/}(\s|\ 1)*$/ &&
-                   !/} (else|while)/ && !/}}/) {
-                       err("possible bad text following right brace");
-               }
-               # cannot check this because sub-blocks in
-               # the middle of code are ok
-               if ($in_function && /^\s+{/) {
-                       err("possible left brace starting a line");
-               }
-       }
-       if (/^\s*else\W/) {
-               if ($prev =~ /^\s*}$/) {
-                       err_prefix($prev,
-                           "else and right brace should be on same line");
-               }
-       }
-       $prev = $line;
-}
-
-if ($prev eq "") {
-       err("last line in file is blank");
-}
-
-}
-
-#
-# Continuation-line checking
-#
-# The rest of this file contains the code for the continuation checking
-# engine.  It's a pretty simple state machine which tracks the expression
-# depth (unmatched '('s and '['s).
-#
-# Keep in mind that the argument to process_indent() has already been heavily
-# processed; all comments have been replaced by control-A, and the contents of
-# strings and character constants have been elided.
-#
-
-my $cont_in;           # currently inside of a continuation
-my $cont_off;          # skipping an initializer or definition
-my $cont_noerr;                # suppress cascading errors
-my $cont_start;                # the line being continued
-my $cont_base;         # the base indentation
-my $cont_first;                # this is the first line of a statement
-my $cont_multiseg;     # this continuation has multiple segments
-
-my $cont_special;      # this is a C statement (if, for, etc.)
-my $cont_macro;                # this is a macro
-my $cont_case;         # this is a multi-line case
-
-my @cont_paren;                # the stack of unmatched ( and [s we've seen
-
-sub
-reset_indent()
-{
-       $cont_in = 0;
-       $cont_off = 0;
-}
-
-sub
-delabel($)
-{
-       #
-       # replace labels with tabs.  Note that there may be multiple
-       # labels on a line.
-       #
-       local $_ = $_[0];
-
-       while (/^(\t*)( *(?:(?:\w+\s*)|(?:case\b[^:]*)): *)(.*)$/) {
-               my ($pre_tabs, $label, $rest) = ($1, $2, $3);
-               $_ = $pre_tabs;
-               while ($label =~ s/^([^\t]*)(\t+)//) {
-                       $_ .= "\t" x (length($2) + length($1) / 8);
-               }
-               $_ .= ("\t" x (length($label) / 8)).$rest;
-       }
-
-       return ($_);
-}
-
-sub
-process_indent($)
-{
-       require strict;
-       local $_ = $_[0];                       # preserve the global $_
-
-       s/\ 1//g; # No comments
-       s/\s+$//;       # Strip trailing whitespace
-
-       return                  if (/^$/);      # skip empty lines
-
-       # regexps used below; keywords taking (), macros, and continued cases
-       my $special = '(?:(?:\}\s*)?else\s+)?(?:if|for|while|switch)\b';
-       my $macro = '[A-Z_][A-Z_0-9]*\(';
-       my $case = 'case\b[^:]*$';
-
-       # skip over enumerations, array definitions, initializers, etc.
-       if ($cont_off <= 0 && !/^\s*$special/ &&
-           (/(?:(?:\b(?:enum|struct|union)\s*[^\{]*)|(?:\s+=\s*)){/ ||
-           (/^\s*{/ && $prev =~ /=\s*(?:\/\*.*\*\/\s*)*$/))) {
-               $cont_in = 0;
-               $cont_off = tr/{/{/ - tr/}/}/;
-               return;
-       }
-       if ($cont_off) {
-               $cont_off += tr/{/{/ - tr/}/}/;
-               return;
-       }
-
-       if (!$cont_in) {
-               $cont_start = $line;
-
-               if (/^\t* /) {
-                       err("non-continuation indented 4 spaces");
-                       $cont_noerr = 1;                # stop reporting
-               }
-               $_ = delabel($_);       # replace labels with tabs
-
-               # check if the statement is complete
-               return          if (/^\s*\}?$/);
-               return          if (/^\s*\}?\s*else\s*\{?$/);
-               return          if (/^\s*do\s*\{?$/);
-               return          if (/{$/);
-               return          if (/}[,;]?$/);
-
-               # Allow macros on their own lines
-               return          if (/^\s*[A-Z_][A-Z_0-9]*$/);
-
-               # cases we don't deal with, generally non-kosher
-               if (/{/) {
-                       err("stuff after {");
-                       return;
-               }
-
-               # Get the base line, and set up the state machine
-               /^(\t*)/;
-               $cont_base = $1;
-               $cont_in = 1;
-               @cont_paren = ();
-               $cont_first = 1;
-               $cont_multiseg = 0;
-
-               # certain things need special processing
-               $cont_special = /^\s*$special/? 1 : 0;
-               $cont_macro = /^\s*$macro/? 1 : 0;
-               $cont_case = /^\s*$case/? 1 : 0;
-       } else {
-               $cont_first = 0;
-
-               # Strings may be pulled back to an earlier (half-)tabstop
-               unless ($cont_noerr || /^$cont_base    / ||
-                   (/^\t*(?:    )?(?:gettext\()?\"/ && !/^$cont_base\t/)) {
-                       err_prefix($cont_start,
-                           "continuation should be indented 4 spaces");
-               }
-       }
-
-       my $rest = $_;                  # keeps the remainder of the line
-
-       #
-       # The split matches 0 characters, so that each 'special' character
-       # is processed separately.  Parens and brackets are pushed and
-       # popped off the @cont_paren stack.  For normal processing, we wait
-       # until a ; or { terminates the statement.  "special" processing
-       # (if/for/while/switch) is allowed to stop when the stack empties,
-       # as is macro processing.  Case statements are terminated with a :
-       # and an empty paren stack.
-       #
-       foreach $_ (split /[^\(\)\[\]\{\}\;\:]*/) {
-               next            if (length($_) == 0);
-
-               # rest contains the remainder of the line
-               my $rxp = "[^\Q$_\E]*\Q$_\E";
-               $rest =~ s/^$rxp//;
-
-               if (/\(/ || /\[/) {
-                       push @cont_paren, $_;
-               } elsif (/\)/ || /\]/) {
-                       my $cur = $_;
-                       tr/\)\]/\(\[/;
-
-                       my $old = (pop @cont_paren);
-                       if (!defined($old)) {
-                               err("unexpected '$cur'");
-                               $cont_in = 0;
-                               last;
-                       } elsif ($old ne $_) {
-                               err("'$cur' mismatched with '$old'");
-                               $cont_in = 0;
-                               last;
-                       }
-
-                       #
-                       # If the stack is now empty, do special processing
-                       # for if/for/while/switch and macro statements.
-                       #
-                       next            if (@cont_paren != 0);
-                       if ($cont_special) {
-                               if ($rest =~ /^\s*{?$/) {
-                                       $cont_in = 0;
-                                       last;
-                               }
-                               if ($rest =~ /^\s*;$/) {
-                                       err("empty if/for/while body ".
-                                           "not on its own line");
-                                       $cont_in = 0;
-                                       last;
-                               }
-                               if (!$cont_first && $cont_multiseg == 1) {
-                                       err_prefix($cont_start,
-                                           "multiple statements continued ".
-                                           "over multiple lines");
-                                       $cont_multiseg = 2;
-                               } elsif ($cont_multiseg == 0) {
-                                       $cont_multiseg = 1;
-                               }
-                               # We've finished this section, start
-                               # processing the next.
-                               goto section_ended;
-                       }
-                       if ($cont_macro) {
-                               if ($rest =~ /^$/) {
-                                       $cont_in = 0;
-                                       last;
-                               }
-                       }
-               } elsif (/\;/) {
-                       if ($cont_case) {
-                               err("unexpected ;");
-                       } elsif (!$cont_special) {
-                               err("unexpected ;")     if (@cont_paren != 0);
-                               if (!$cont_first && $cont_multiseg == 1) {
-                                       err_prefix($cont_start,
-                                           "multiple statements continued ".
-                                           "over multiple lines");
-                                       $cont_multiseg = 2;
-                               } elsif ($cont_multiseg == 0) {
-                                       $cont_multiseg = 1;
-                               }
-                               if ($rest =~ /^$/) {
-                                       $cont_in = 0;
-                                       last;
-                               }
-                               if ($rest =~ /^\s*special/) {
-                                       err("if/for/while/switch not started ".
-                                           "on its own line");
-                               }
-                               goto section_ended;
-                       }
-               } elsif (/\{/) {
-                       err("{ while in parens/brackets") if (@cont_paren != 0);
-                       err("stuff after {")            if ($rest =~ /[^\s}]/);
-                       $cont_in = 0;
-                       last;
-               } elsif (/\}/) {
-                       err("} while in parens/brackets") if (@cont_paren != 0);
-                       if (!$cont_special && $rest !~ /^\s*(while|else)\b/) {
-                               if ($rest =~ /^$/) {
-                                       err("unexpected }");
-                               } else {
-                                       err("stuff after }");
-                               }
-                               $cont_in = 0;
-                               last;
-                       }
-               } elsif (/\:/ && $cont_case && @cont_paren == 0) {
-                       err("stuff after multi-line case") if ($rest !~ /$^/);
-                       $cont_in = 0;
-                       last;
-               }
-               next;
-section_ended:
-               # End of a statement or if/while/for loop.  Reset
-               # cont_special and cont_macro based on the rest of the
-               # line.
-               $cont_special = ($rest =~ /^\s*$special/)? 1 : 0;
-               $cont_macro = ($rest =~ /^\s*$macro/)? 1 : 0;
-               $cont_case = 0;
-               next;
-       }
-       $cont_noerr = 0                 if (!$cont_in);
-}
diff --git a/zfs/scripts/dkms.mkconf b/zfs/scripts/dkms.mkconf
deleted file mode 100755 (executable)
index caba1be..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-#!/bin/sh
-
-PROG=$0
-
-pkgcfg=/etc/sysconfig/zfs
-
-while getopts "n:v:c:f:" opt; do
-       case $opt in
-               n) pkgname=$OPTARG ;;
-               v) pkgver=$OPTARG  ;;
-               c) pkgcfg=$OPTARG ;;
-               f) filename=$OPTARG ;;
-       esac
-done
-
-if [ -z "${pkgname}" -o -z "${pkgver}" -o -z "${filename}" ]; then
-       echo "Usage: $PROG -n <pkgname> -v <pkgver> -c <pkgcfg> -f <filename>"
-       exit 1
-fi
-
-cat >${filename} <<EOF
-PACKAGE_NAME="${pkgname}"
-PACKAGE_VERSION="${pkgver}"
-PACKAGE_CONFIG="${pkgcfg}"
-PRE_BUILD="configure
-  --prefix=/usr
-  --with-config=kernel
-  --with-linux=\${kernel_source_dir}
-  --with-linux-obj=\${kernel_source_dir}
-  --with-spl=\${source_tree}/spl-\${PACKAGE_VERSION}
-  --with-spl-obj=\${dkms_tree}/spl/\${PACKAGE_VERSION}/\${kernelver}/\${arch}
-  --with-spl-timeout=300
-  \$(
-    [[ -r \${PACKAGE_CONFIG} ]] \\
-    && source \${PACKAGE_CONFIG} \\
-    && shopt -q -s extglob \\
-    && \\
-    {
-      if [[ \${ZFS_DKMS_ENABLE_DEBUG,,} == @(y|yes) ]]
-      then
-        echo --enable-debug
-      fi
-      if [[ \${ZFS_DKMS_ENABLE_DMU_TX,,} == @(y|yes) ]]
-      then
-        echo --enable-debug-dmu-tx
-      fi
-    }
-  )
-"
-POST_BUILD="scripts/dkms.postbuild
-  -n \${PACKAGE_NAME}
-  -v \${PACKAGE_VERSION}
-  -a \${arch}
-  -k \${kernelver}
-  -t \${dkms_tree}
-"
-BUILD_DEPENDS[0]="spl"
-AUTOINSTALL="yes"
-REMAKE_INITRD="no"
-MAKE[0]="make"
-STRIP[0]="\$(
-  [[ -r \${PACKAGE_CONFIG} ]] \\
-  && source \${PACKAGE_CONFIG} \\
-  && shopt -q -s extglob \\
-  && [[ \${ZFS_DKMS_DISABLE_STRIP,,} == @(y|yes) ]] \\
-  && echo -n no
-)"
-STRIP[1]="\${STRIP[0]}"
-STRIP[2]="\${STRIP[0]}"
-STRIP[3]="\${STRIP[0]}"
-STRIP[4]="\${STRIP[0]}"
-STRIP[5]="\${STRIP[0]}"
-BUILT_MODULE_NAME[0]="zavl"
-BUILT_MODULE_LOCATION[0]="module/avl/"
-DEST_MODULE_LOCATION[0]="/extra/avl/avl"
-BUILT_MODULE_NAME[1]="znvpair"
-BUILT_MODULE_LOCATION[1]="module/nvpair/"
-DEST_MODULE_LOCATION[1]="/extra/nvpair/znvpair"
-BUILT_MODULE_NAME[2]="zunicode"
-BUILT_MODULE_LOCATION[2]="module/unicode/"
-DEST_MODULE_LOCATION[2]="/extra/unicode/zunicode"
-BUILT_MODULE_NAME[3]="zcommon"
-BUILT_MODULE_LOCATION[3]="module/zcommon/"
-DEST_MODULE_LOCATION[3]="/extra/zcommon/zcommon"
-BUILT_MODULE_NAME[4]="zfs"
-BUILT_MODULE_LOCATION[4]="module/zfs/"
-DEST_MODULE_LOCATION[4]="/extra/zfs/zfs"
-BUILT_MODULE_NAME[5]="zpios"
-BUILT_MODULE_LOCATION[5]="module/zpios/"
-DEST_MODULE_LOCATION[5]="/extra/zpios/zpios"
-EOF
diff --git a/zfs/scripts/dkms.postbuild b/zfs/scripts/dkms.postbuild
deleted file mode 100755 (executable)
index 3cbc7c7..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-
-PROG=$0
-
-while getopts "a:k:n:t:v:" opt; do
-       case $opt in
-               a) arch=$OPTARG    ;;
-               k) kver=$OPTARG    ;;
-               n) pkgname=$OPTARG ;;
-               t) tree=$OPTARG    ;;
-               v) pkgver=$OPTARG  ;;
-       esac
-done
-
-if [ -z "${arch}" -o -z "${kver}" -o -z "${pkgname}" -o \
-     -z "${tree}" -o -z "${pkgver}" ]; then
-       echo "Usage: $PROG -a <arch> -k <kver> -n <pkgname>" \
-            "-t <tree> -v <pkgver>"
-       exit 1
-fi
-
-cp ${tree}/${pkgname}/${pkgver}/build/zfs_config.h          \
-   ${tree}/${pkgname}/${pkgver}/build/module/Module.symvers \
-   ${tree}/${pkgname}/${pkgver}/${kver}/${arch}/
diff --git a/zfs/scripts/kmodtool b/zfs/scripts/kmodtool
deleted file mode 100755 (executable)
index ce3f042..0000000
+++ /dev/null
@@ -1,592 +0,0 @@
-#!/bin/bash
-
-# kmodtool - Helper script for building kernel module RPMs
-# Copyright (c) 2003-2012 Ville Skyttä <ville.skytta@iki.fi>,
-#                         Thorsten Leemhuis <fedora@leemhuis.info>
-#                         Nicolas Chauvet <kwizart@gmail.com>
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject to
-# the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-# LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-# OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-# WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-shopt -s extglob
-
-myprog="kmodtool-${repo}"
-myver="0.12.1"
-
-kmodname=
-build_kernels="current"
-kernels_known_variants=
-kernel_versions=
-kernel_versions_to_build_for=
-prefix=
-filterfile=
-target=
-buildroot=
-
-error_out()
-{
-       local errorlevel=${1}
-       shift
-       echo "Error: $@" >&2
-       # the next line is not multi-line safe -- not needed *yet*
-       echo "%global kmodtool_check echo \"kmodtool error: $@\"; exit ${errorlevel};"
-       exit ${errorlevel}
-}
-
-print_rpmtemplate_header()
-{
-       echo
-       echo '%global kmodinstdir_prefix  '${prefix}/lib/modules/
-       echo '%global kmodinstdir_postfix '/extra/${kmodname}/
-       echo '%global kernel_versions     '${kernel_versions}
-       echo
-}
-
-print_akmodtemplate ()
-{
-       echo
-       cat <<EOF
-
-%global akmod_install mkdir -p \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/; \\\
-LANG=C rpmbuild --define "_sourcedir %{_sourcedir}" \\\
---define "_srcrpmdir \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/" \\\
--bs --nodeps %{_specdir}/%{name}.spec ; \\\
-ln -s \$(ls \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/) \$RPM_BUILD_ROOT/%{_usrsrc}/akmods/${kmodname}-kmod.latest
-
-%package -n akmod-${kmodname}
-Summary:       Akmod package for ${kmodname} kernel module(s) 
-Group:                 System Environment/Kernel
-Requires:   kmodtool
-Requires:      akmods
-%{?AkmodsBuildRequires:Requires: %{AkmodsBuildRequires}}
-# same requires and provides as a kmods package would have
-Requires:      ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version}
-Provides:      ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
-EOF
-
-       if [[ ${obsolete_name} ]]; then
-               echo "Provides:   akmod-${obsolete_name} = ${obsolete_version}"
-               echo "Obsoletes:  akmod-${obsolete_name} < ${obsolete_version}"
-       fi
-
-       cat <<EOF
-
-%description -n akmod-${kmodname}
-This package provides the akmod package for the ${kmodname} kernel modules.
-
-%posttrans -n akmod-${kmodname}
-nohup ${prefix}/sbin/akmods --from-akmod-posttrans --akmod ${kmodname} &> /dev/null &
-
-%files -n akmod-${kmodname}
-%defattr(-,root,root,-)
-%{_usrsrc}/akmods/*
-
-EOF
-}
-
-print_akmodmeta ()
-{
-               cat <<EOF
-%package      -n kmod-${kmodname}
-Summary:         Metapackage which tracks in ${kmodname} kernel module for newest kernel${dashvariant}
-Group:           System Environment/Kernel
-
-Provides:        ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
-Provides:        kmod-${kmodname}-xen = %{?epoch:%{epoch}:}%{version}-%{release}
-Provides:        kmod-${kmodname}-smp = %{?epoch:%{epoch}:}%{version}-%{release}
-Provides:        kmod-${kmodname}-PAE = %{?epoch:%{epoch}:}%{version}-%{release}
-Requires:        akmod-${kmodname} = %{?epoch:%{epoch}:}%{version}-%{release}
-EOF
-
-       if [[ ${obsolete_name} ]]; then
-               echo "Provides:        kmod-${obsolete_name} = ${obsolete_version}"
-               echo "Obsoletes:       kmod-${obsolete_name} < ${obsolete_version}"
-       fi
-cat <<EOF
-
-%description  -n kmod-${kmodname}${dashvariant}
-This is a meta-package without payload which sole purpose is to require the
-${kmodname} kernel module(s) for the newest kernel${dashvariant},
-to make sure you get it together with a new kernel.
-
-%files        -n kmod-${kmodname}${dashvariant}
-%defattr(644,root,root,755)
-EOF
-}
-
-print_rpmtemplate_per_kmodpkg ()
-{
-       if [[ "${1}" == "--custom" ]]; then
-               shift
-               local customkernel=true
-       elif [[ "${1}" == "--redhat" ]]; then
-               # this is needed for akmods
-               shift
-               local redhatkernel=true
-       fi
-
-       local kernel_uname_r=${1}
-       local kernel_variant="${2:+-${2}}"
-
-    # first part
-       cat <<EOF
-%package       -n kmod-${kmodname}-${kernel_uname_r}
-Summary:          ${kmodname} kernel module(s) for ${kernel_uname_r}
-Group:            System Environment/Kernel
-Provides:         kernel-modules-for-kernel = ${kernel_uname_r}
-Provides:         kmod-${kmodname}-uname-r = ${kernel_uname_r}
-Provides:         ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
-Requires:         ${kmodname}-kmod-common >= %{?epoch:%{epoch}:}%{version}
-Requires(post):   ${prefix}/sbin/depmod
-Requires(postun): ${prefix}/sbin/depmod
-EOF
-
-       if [[ ${obsolete_name} ]]; then
-               echo "Provides:        kmod-${obsolete_name}-${kernel_uname_r} = ${obsolete_version}"
-               echo "Obsoletes:       kmod-${obsolete_name}-${kernel_uname_r} < ${obsolete_version}"
-       fi
-
-       # second part
-       if [[ ! "${customkernel}" ]]; then
-            cat <<EOF
-Requires:         kernel-uname-r = ${kernel_uname_r}
-BuildRequires:   kernel-devel-uname-r = ${kernel_uname_r}
-%{?KmodsRequires:Requires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
-%{?KmodsRequires:BuildRequires: %{KmodsRequires}-uname-r = ${kernel_uname_r}}
-%post          -n kmod-${kmodname}-${kernel_uname_r}
-${prefix}/sbin/depmod -aeF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} > /dev/null || :
-%postun        -n kmod-${kmodname}-${kernel_uname_r}
-${prefix}/sbin/depmod  -aF /boot/System.map-${kernel_uname_r} ${kernel_uname_r} &> /dev/null || :
-
-EOF
-       else
-         cat <<EOF
-%post          -n kmod-${kmodname}-${kernel_uname_r}
-[[ "$(uname -r)" == "${kernel_uname_r}"  ]] && ${prefix}/sbin/depmod -a > /dev/null || :
-%postun        -n kmod-${kmodname}-${kernel_uname_r}
-[[ "$(uname -r)" == "${kernel_uname_r}"  ]] && ${prefix}/sbin/depmod -a > /dev/null || :
-
-EOF
-       fi
-
-  # third part
-       cat <<EOF
-%description  -n kmod-${kmodname}-${kernel_uname_r}
-This package provides the ${kmodname} kernel modules built for the Linux
-kernel ${kernel_uname_r} for the %{_target_cpu} family of processors.
-%files        -n kmod-${kmodname}-${kernel_uname_r}
-%defattr(644,root,root,755)
-%dir $prefix/lib/modules/${kernel_uname_r}/extra
-${prefix}/lib/modules/${kernel_uname_r}/extra/${kmodname}/
-
-
-EOF
-}
-
-print_rpmtemplate_kmoddevelpkg ()
-{
-       if [[ "${1}" == "--custom" ]]; then
-               shift
-               local customkernel=true
-       elif [[ "${1}" == "--redhat" ]]; then
-               shift
-               local redhatkernel=true
-       fi
-
-       local kernel_uname_r=${1}
-
-       cat <<EOF
-%package       -n kmod-${kmodname}-devel
-Summary:          ${kmodname} kernel module(s) devel common
-Group:            System Environment/Kernel
-Provides:         ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
-EOF
-
-       if [[ ! ${customkernel} ]] && [[ ! ${redhatkernel} ]]; then
-               echo "Requires:        kmod-${kmodname}-devel-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%{release}"
-       fi
-
-       if [[ ${obsolete_name} ]]; then
-               echo "Provides:        kmod-${obsolete_name}-devel = ${obsolete_version}"
-               echo "Obsoletes:       kmod-${obsolete_name}-devel < ${obsolete_version}"
-       fi
-
-       cat <<EOF
-%description  -n kmod-${kmodname}-devel
-This package provides the common header files to build kernel modules
-which depend on the ${kmodname} kernel module.  It may optionally require
-the ${kmodname}-devel-<kernel> objects for the newest kernel.
-
-%files        -n kmod-${kmodname}-devel
-%defattr(644,root,root,755)
-%{_usrsrc}/${kmodname}-%{version}
-EOF
-
-       for kernel in ${1}; do
-               local kernel_uname_r=${kernel}
-               echo "%exclude %{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}"
-       done
-
-       echo
-       echo
-}
-
-print_rpmtemplate_per_kmoddevelpkg ()
-{
-       if [[ "${1}" == "--custom" ]]; then
-               shift
-               local customkernel=true
-       elif [[ "${1}" == "--redhat" ]]; then
-               # this is needed for akmods
-               shift
-               local redhatkernel=true
-       fi
-
-       local kernel_uname_r=${1}
-       local kernel_variant="${2:+-${2}}"
-
-       # first part
-       cat <<EOF
-%package       -n kmod-${kmodname}-devel-${kernel_uname_r}
-Summary:          ${kmodname} kernel module(s) devel for ${kernel_uname_r}
-Group:            System Environment/Kernel
-Provides:         kernel-objects-for-kernel = ${kernel_uname_r}
-Provides:         ${kmodname}-devel-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
-Provides:         kmod-${kmodname}-devel-uname-r = ${kernel_uname_r}
-EOF
-
-       if [[ ${obsolete_name} ]]; then
-               echo "Provides:        kmod-${obsolete_name}-devel-${kernel_uname_r} = ${obsolete_version}"
-               echo "Obsoletes:       kmod-${obsolete_name}-devel-${kernel_uname_r} < ${obsolete_version}"
-       fi
-
-       # second part
-       if [[ ! "${customkernel}" ]]; then
-               cat <<EOF
-Requires:         kernel-devel-uname-r = ${kernel_uname_r}
-BuildRequires:    kernel-devel-uname-r = ${kernel_uname_r}
-%{?KmodsDevelRequires:Requires: %{KmodsDevelRequires}-uname-r = ${kernel_uname_r}}
-%{?KmodsDevelRequires:BuildRequires: %{KmodsDevelRequires}-uname-r = ${kernel_uname_r}}
-EOF
-       fi
-
-       # third part
-       cat <<EOF
-%description  -n kmod-${kmodname}-devel-${kernel_uname_r}
-This package provides objects and symbols required to build kernel modules
-which depend on the ${kmodname} kernel modules built for the Linux
-kernel ${kernel_uname_r} for the %{_target_cpu} family of processors.
-%files        -n kmod-${kmodname}-devel-${kernel_uname_r}
-%defattr(644,root,root,755)
-%{_usrsrc}/${kmodname}-%{version}/${kernel_uname_r}
-
-
-EOF
-}
-
-print_rpmtemplate_kmodmetapkg ()
-{
-               local kernel_uname_r=${1}
-               local kernel_variant="${2:+-${2}}"
-
-               cat <<EOF
-%package      -n kmod-${kmodname}${kernel_variant}
-Summary:         Metapackage which tracks in ${kmodname} kernel module for newest kernel${kernel_variant}
-Group:           System Environment/Kernel
-
-Provides:        ${kmodname}-kmod = %{?epoch:%{epoch}:}%{version}-%{release}
-Requires:        kmod-${kmodname}-${kernel_uname_r} >= %{?epoch:%{epoch}:}%{version}-%{release}
-%{?KmodsMetaRequires:Requires: %{?KmodsMetaRequires}}
-EOF
-
-               if [[ ${obsolete_name} ]]; then
-                       echo "Provides:        kmod-${obsolete_name}${kernel_variant} = ${obsolete_version}"
-                       echo "Obsoletes:       kmod-${obsolete_name}${kernel_variant} < ${obsolete_version}"
-               fi
-
-               cat <<EOF
-
-%description  -n kmod-${kmodname}${kernel_variant}
-This is a meta-package without payload which sole purpose is to require the
-${kmodname} kernel module(s) for the newest kernel${kernel_variant}.
-to make sure you get it together with a new kernel.
-
-%files        -n kmod-${kmodname}${kernel_variant}
-%defattr(644,root,root,755)
-
-
-EOF
-}
-
-print_customrpmtemplate ()
-{
-       for kernel in ${1}
-       do
-               if [[ -e "${buildroot}/usr/src/kernels/${kernel}" ]] ; then
-                       # this looks like a Fedora/RH kernel -- print a normal template (which includes the proper BR) and be happy :)
-                       kernel_versions="${kernel_versions}${kernel}___${buildroot}%{_usrsrc}/kernels/${kernel} "
-
-                       # parse kernel versions string and print template
-                       local kernel_verrelarch=${kernel%%${kernels_known_variants}}
-                       print_rpmtemplate_per_kmodpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
-
-                       # create development package
-                       if [[ "${devel}" ]]; then
-                               # create devel package including common headers
-                               print_rpmtemplate_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
-
-                               # create devel package
-                               print_rpmtemplate_per_kmoddevelpkg --redhat ${kernel} ${kernel##${kernel_verrelarch}}
-                       fi
-               elif [[ -e ${prefix}/lib/modules/"${kernel}"/build/Makefile ]] ; then 
-                       # likely a user-build-kernel with available buildfiles
-                       # fixme: we should check if uname from Makefile is the same as ${kernel}
-
-                       kernel_versions="${kernel_versions}${kernel}___${prefix}/lib/modules/${kernel}/build/ "
-                       print_rpmtemplate_per_kmodpkg --custom "${kernel}"
-
-                       # create development package
-                       if [[ "${devel}" ]]; then
-                               # create devel package including common headers
-                               print_rpmtemplate_kmoddevelpkg --custom "${kernel}"
-
-                               # create devel package
-                               print_rpmtemplate_per_kmoddevelpkg --custom "${kernel}"
-                       fi
-               else
-                       error_out 2 "Don't know how to handle ${kernel} -- ${prefix}/lib/modules/${kernel}/build/Makefile not found"
-               fi
-       done
-
-       # well, it's no header anymore, but who cares ;-)
-       print_rpmtemplate_header
-}
-
-
-print_rpmtemplate ()
-{
-       # create kernel_versions var
-       for kernel_version in ${kernel_versions_to_build_for}
-       do
-               kernel_versions="${kernel_versions}${kernel_version}___%{_usrsrc}/kernels/${kernel_version} "
-       done
-
-       # and print it and some other required stuff as macro
-       print_rpmtemplate_header
-
-       # now print the packages itselfs
-       for kernel in ${kernel_versions_to_build_for} ; do
-
-               local kernel_verrelarch=${kernel%%${kernels_known_variants}}
-
-               # create metapackage 
-               print_rpmtemplate_kmodmetapkg ${kernel} ${kernel##${kernel_verrelarch}}
-
-               # create package
-               print_rpmtemplate_per_kmodpkg ${kernel} ${kernel##${kernel_verrelarch}}
-
-               if [[ "${devel}" ]]; then
-                       # create devel package including common headers
-                       print_rpmtemplate_kmoddevelpkg ${kernel} ${kernel##${kernel_verrelarch}}
-
-                       # create devel package
-                       print_rpmtemplate_per_kmoddevelpkg ${kernel} ${kernel##${kernel_verrelarch}}
-               fi
-       done
-}
-
-myprog_help ()
-{
-       echo "Usage: $(basename ${0}) [OPTIONS]"
-       echo $'\n'"Creates a template to be used during kmod building"
-       echo $'\n'"Available options:"
-       echo " --filterfile <file>  -- filter the results with grep --file <file>"
-       echo " --for-kernels <list> -- created templates only for these kernels"
-       echo " --kmodname <file>    -- name of the kmod (required)"
-       echo " --devel              -- make kmod-devel package"
-       echo " --noakmod            -- no akmod package"
-       echo " --repo <name>        -- use buildsys-build-<name>-kerneldevpkgs"
-       echo " --target <arch>      -- target-arch (required)"
-       echo " --buildroot <dir>    -- Build root (place to look for build files)"
-}
-
-while [ "${1}" ] ; do
-       case "${1}" in
-               --filterfile)
-                       shift
-                       if [[ ! "${1}" ]] ; then
-                               error_out 2 "Please provide path to a filter-file together with --filterfile" >&2
-                       elif [[ ! -e "${1}" ]]; then    
-                               error_out 2 "Filterfile ${1} not found" >&2
-                       fi
-                       filterfile="${1}"
-                       shift
-                       ;;
-               --kmodname)
-                       shift
-                       if [[ ! "${1}" ]] ; then
-                               error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
-                   fi
-                       # strip pending -kmod
-                       kmodname="${1%%-kmod}"
-                       shift
-                       ;;
-               --devel)
-                       shift
-                       devel="true"
-                       ;;
-               --prefix)
-                       shift
-                       if [[ ! "${1}" ]] ; then
-                               error_out 2 "Please provide a prefix with --prefix" >&2
-                   fi
-                       prefix="${1}"
-                       shift
-                       ;;
-               --repo)
-                       shift
-                       if [[ ! "${1}" ]] ; then
-                               error_out 2 "Please provide the name of the repo together with --repo" >&2
-                   fi
-                       repo=${1}
-                       shift
-                       ;;
-               --for-kernels)
-                       shift
-                       if [[ ! "${1}" ]] ; then
-                               error_out 2 "Please provide the name of the kmod together with --kmodname" >&2
-                       fi
-                       for_kernels="${1}"
-                       shift
-                       ;;
-               --noakmod)
-                       shift
-                       noakmod="true"
-                       ;;
-               --obsolete-name)
-                       shift
-                       if [[ ! "${1}" ]] ; then
-                               error_out 2 "Please provide the name of the kmod to obsolte together with --obsolete-name" >&2
-                       fi
-                       obsolete_name="${1}"
-                       shift
-                       ;;
-               --obsolete-version)
-                       shift
-                       if [[ ! "${1}" ]] ; then
-                               error_out 2 "Please provide the version of the kmod to obsolte together with --obsolete-version" >&2
-                       fi
-                       obsolete_version="${1}"
-                       shift
-                       ;;
-               --target)
-                       shift
-                       target="${1}"
-                       shift
-                       ;;
-               --akmod)
-                       shift
-                       build_kernels="akmod"
-                       ;;
-               --newest)
-                       shift
-                       build_kernels="newest"
-                       ;;
-               --current)
-                       shift
-                       build_kernels="current"
-                       ;;
-               --buildroot)
-                       shift
-                       buildroot="${1}"
-                       shift
-                       ;;
-               --help)
-                       myprog_help
-                       exit 0
-                       ;;
-               --version)
-                       echo "${myprog} ${myver}"
-                       exit 0
-                       ;;
-               *)
-                       echo "Error: Unknown option '${1}'." >&2
-                       usage >&2
-                       exit 2
-                       ;;
-       esac
-done
-
-if [[ -e ./kmodtool-kernel-variants ]]; then
-       kernels_known_variants="$(cat ./kmodtool-kernel-variants)"
-elif [[ -e /usr/share/kmodtool/kernel-variants ]] ; then
-       kernels_known_variants="$(cat /usr/share/kmodtool/kernel-variants)"
-else
-       kernels_known_variants="@(smp?(-debug)|PAE?(-debug)|debug|kdump|xen|kirkwood|highbank|imx|omap|tegra)"
-fi
-
-# general sanity checks
-if [[ ! "${target}" ]]; then
-               error_out 2 "please pass target arch with --target"
-elif [[ ! "${kmodname}" ]]; then
-               error_out 2 "please pass kmodname with --kmodname"
-elif [[ ! "${kernels_known_variants}" ]] ; then
-               error_out 2 "could not determine known variants"
-elif ( [[ "${obsolete_name}" ]] && [[ ! "${obsolete_version}" ]] ) ||  ( [[ ! "${obsolete_name}" ]] && [[ "${obsolete_version}" ]] ) ; then
-               error_out 2 "you need to provide both --obsolete-name and --obsolete-version"
-fi
-
-# go
-if [[ "${for_kernels}" ]]; then
-       # this is easy:
-       print_customrpmtemplate "${for_kernels}"
-elif [[ "${build_kernels}" == "akmod" ]]; then
-       # do only a akmod package
-       print_akmodtemplate
-       print_akmodmeta
-else
-       # seems we are on out own to decide for which kernels to build
-
-       # we need more sanity checks in this case
-       if [[ ! "${repo}" ]]; then
-               error_out 2 "please provide repo name with --repo"
-       elif ! $(which buildsys-build-${repo}-kerneldevpkgs &> /dev/null) ; then
-               error_out 2 "buildsys-build-${repo}-kerneldevpkgs not found"
-       fi
-
-       # call buildsys-build-${repo}-kerneldevpkgs to get the list of kernels
-       cmdoptions="--target ${target}"
-
-       # filterfile to filter list of kernels? 
-       if [[ "${filterfile}" ]] ; then
-                cmdoptions="${cmdoptions} --filterfile ${filterfile}"
-       fi
-
-       kernel_versions_to_build_for="$(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})"
-       returncode=$?
-       if (( ${returncode} != 0 )); then
-               error_out 2 "buildsys-build-${repo}-kerneldevpkgs failed: $(buildsys-build-${repo}-kerneldevpkgs --${build_kernels} ${cmdoptions})"
-       fi
-
-       if [[ "${build_kernels}" == "current" ]] && [[ ! "${noakmod}" ]]; then
-               print_akmodtemplate
-       fi
-
-       print_rpmtemplate 
-fi
diff --git a/zfs/scripts/smb.sh b/zfs/scripts/smb.sh
deleted file mode 100755 (executable)
index 7cf6c4b..0000000
+++ /dev/null
@@ -1,214 +0,0 @@
-#!/bin/bash
-
-BASETANK="share"
-DATE=`date "+%Y%m%d"`
-
-TEST_SMBFS=0
-TEST_DESTROY=0
-
-if [ -z "$1" ]; then
-       echo "Usage: `basename $0` [unpack]<[smbfs][snapshot][all]>"
-       exit 1
-fi
-
-set_onoff() {
-       type="$1"
-       dataset="$2"
-       toggle="$3"
-
-       current=`zfs get -H $type -o value $dataset`
-       if [ "$current" != "$toggle" ]; then
-               run "zfs set $type=$toggle $dataset"
-       fi
-}
-
-check_exists() {
-       dataset="$1"
-
-       extra=""
-       [ -n "$2" ] && extra="$2"
-
-       zfs get all "$dataset" > /dev/null 2>&1
-       if [ $? != 0 ]; then
-               run "zfs create $extra $dataset"
-       fi
-}
-
-check_shares() {
-       if [ "$TEST_SMBFS" == "1" ]; then
-               echo "Shares:"
-               echo "=> usershare list:"
-               net usershare list
-               echo
-               echo "=> /etc/dfs/sharetab:"
-               cat /etc/dfs/sharetab
-               echo
-       fi
-
-       sleep 2
-}
-
-test_header() {
-       echo "TEST: $*"
-       echo "======================================"
-}
-
-run() {
-       cmd="$*"
-
-       echo "CMD: $cmd"
-       $cmd
-}
-
-# ---------
-# Needs more work...
-if echo "$*" | grep -qi "unpack"; then
-       zfs unmount -a
-       zfs unshare -a
-       run "zfs destroy -r $BASETANK/tests"
-
-       sh /etc/init.d/zfs stop
-
-#      for tid in `grep ^tid /proc/net/iet/volume | sed "s@.*:\([0-9].*\) name.*@\1@"`
-#      do
-#              ietadm --op delete --tid $tid
-#      done
-
-       set -e
-       rmmod `lsmod | grep ^z | grep -v zlib_deflate | sed 's@ .*@@'` spl zlib_deflate
-
-       pushd / > /dev/null
-       [ -f "tmp/zfs.tgz" ] && tar xzf tmp/zfs.tgz && rm tmp/zfs.tgz
-       [ -f "tmp/spl.tgz" ] && tar xzf tmp/spl.tgz && rm tmp/spl.tgz
-       popd > /dev/null
-
-       depmod -a
-
-       sh /etc/init.d/zfs start
-       set +e
-fi
-
-# ---------
-if echo "$*" | egrep -qi "smbfs|all"; then
-       check_exists $BASETANK/tests
-
-       TEST_SMBFS=1
-
-       test_header "Exists || Create"
-       str=
-       for volnr in 1 2 3; do
-               check_exists $BASETANK/tests/smbfs$volnr
-
-               str="$str $BASETANK/tests/smbfs$volnr"
-       done
-       run "zfs get sharesmb $str"
-
-       # Set sharesmb=on
-       test_header "Enable SMB share"
-       for volnr in 1 2 3; do
-           set_onoff sharesmb "$BASETANK/tests/smbfs$volnr" on
-           check_shares
-       done
-
-       # Share all
-       test_header "Share all (individually)"
-       for volnr in 1 2 3; do
-           run "zfs share $BASETANK/tests/smbfs$volnr"
-           check_shares
-       done
-
-       # Unshare all
-       test_header "Unshare all (individually)"
-       for volnr in 1 2 3; do
-           run "zfs unshare $BASETANK/tests/smbfs$volnr"
-           check_shares
-       done
-
-       # Change mountpoint - first unshare and then share individual
-       test_header "Change mount point (unshare ; share)"
-       mkdir -p /tests
-       set_onoff sharesmb "$str" off
-       for volnr in 3 1 2; do
-               run "zfs set mountpoint=/tests/smbfs$volnr $BASETANK/tests/smbfs$volnr"
-               echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr"
-               mount | grep ^$BASETANK/tests/smbfs$volnr
-               echo
-
-               run "zfs mount $BASETANK/tests/smbfs$volnr"
-               echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr"
-               mount | grep ^$BASETANK/tests/smbfs$volnr
-               echo
-
-               set_onoff sharesmb "$BASETANK/tests/smbfs$volnr" on
-               check_shares
-
-               run "zfs share $BASETANK/tests/smbfs$volnr"
-               check_shares
-
-               echo "-------------------"
-       done
-
-       # Change mountpoint - remounting
-       test_header "Change mount point (remounting)"
-       for volnr in 3 1 2; do
-               run "zfs set mountpoint=/$BASETANK/tests/smbfs$volnr $BASETANK/tests/smbfs$volnr"
-               echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr"
-               mount | grep ^$BASETANK/tests/smbfs$volnr
-               echo
-               # => Doesn't seem to remount (!?)
-
-               run "zfs mount $BASETANK/tests/smbfs$volnr"
-               echo "CMD: mount | grep ^$BASETANK/tests/smbfs$volnr"
-               mount | grep ^$BASETANK/tests/smbfs$volnr
-               echo
-               # => Doesn't seem to reshare (!?)
-
-               check_shares
-
-               run "zfs share $BASETANK/tests/smbfs$volnr"
-               check_shares
-
-               echo "-------------------"
-       done
-fi
-
-# ---------
-if echo "$*" | egrep -qi "smbfs|all"; then
-       test_header "Unshare + Share all"
-
-       run "zfs share -a" ; check_shares
-       run "zfs unshare -a" ; check_shares
-fi
-
-# ---------
-if echo "$*" | grep -qi "snapshot|all"; then
-       test_header "Snapshots"
-
-       echo ; echo "-------------------"
-       check_exists $BASETANK/tests/destroy
-       check_exists $BASETANK/tests/destroy/destroy1
-       run "zfs destroy -r $BASETANK/tests/destroy"
-
-       echo ; echo "-------------------"
-       check_exists $BASETANK/tests/destroy
-       run "zfs snapshot $BASETANK/tests/destroy@$DATE"
-       run "zfs destroy -r $BASETANK/tests/destroy"
-
-       echo ; echo "-------------------"
-       check_exists $BASETANK/tests/destroy
-       run "zfs snapshot $BASETANK/tests/destroy@$DATE"
-       run "zfs destroy -r $BASETANK/tests/destroy@$DATE"
-       run "zfs destroy -r $BASETANK/tests/destroy"
-fi
-
-if echo "$*" | egrep -qi "smbfs|snapshot|all"; then
-       test_header "Cleanup (Share all + Destroy all)"
-
-       run "zfs share -a"
-       check_shares
-
-       run "zfs destroy -r $BASETANK/tests"
-       check_shares
-
-       run "zfs list"
-fi
diff --git a/zfs/scripts/zconfig.sh b/zfs/scripts/zconfig.sh
deleted file mode 100755 (executable)
index 45ccf62..0000000
+++ /dev/null
@@ -1,674 +0,0 @@
-#!/bin/bash
-#
-# ZFS/ZPOOL configuration test script.
-
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zconfig.sh
-
-usage() {
-cat << EOF
-USAGE:
-$0 [hvcts]
-
-DESCRIPTION:
-       ZFS/ZPOOL configuration tests
-
-OPTIONS:
-       -h      Show this message
-       -v      Verbose
-       -c      Cleanup lo+file devices at start
-       -t <#>  Run listed tests
-       -s <#>  Skip listed tests
-
-EOF
-}
-
-while getopts 'hvct:s:?' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               ;;
-       c)
-               CLEANUP=1
-               ;;
-       t)
-               TESTS_RUN=($OPTARG)
-               ;;
-       s)
-               TESTS_SKIP=($OPTARG)
-               ;;
-       ?)
-               usage
-               exit
-               ;;
-       esac
-done
-
-if [ $(id -u) != 0 ]; then
-       die "Must run as root"
-fi
-
-# Initialize the test suite
-init
-
-# Perform pre-cleanup is requested
-if [ ${CLEANUP} ]; then
-       ${ZFS_SH} -u
-       cleanup_md_devices
-       cleanup_loop_devices
-       rm -f /tmp/zpool.cache.*
-fi
-
-# Check if we need to skip the tests that require scsi_debug and lsscsi.
-SCSI_DEBUG=0
-${INFOMOD} scsi_debug &>/dev/null && SCSI_DEBUG=1
-HAVE_LSSCSI=0
-test -f ${LSSCSI} && HAVE_LSSCSI=1
-if [ ${SCSI_DEBUG} -eq 0 ] || [ ${HAVE_LSSCSI} -eq 0 ]; then
-       echo "Skipping test 10 which requires the scsi_debug " \
-               "module and the ${LSSCSI} utility"
-fi
-
-# Validate persistent zpool.cache configuration.
-test_1() {
-       local POOL_NAME=test1
-       local TMP_FILE1=`mktemp`
-       local TMP_FILE2=`mktemp`
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create a pool save its status for comparison.
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE1} || fail 3
-
-       # Unload/load the module stack and verify the pool persists.
-       ${ZFS_SH} -u || fail 4
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 5
-       ${ZPOOL} import -c ${TMP_CACHE} ${POOL_NAME} || fail 5
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE2} || fail 6
-       cmp ${TMP_FILE1} ${TMP_FILE2} || fail 7
-
-       # Cleanup the test pool and temporary files
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 8
-       rm -f ${TMP_FILE1} ${TMP_FILE2} ${TMP_CACHE} || fail 9
-       ${ZFS_SH} -u || fail 10
-
-       pass
-}
-run_test 1 "persistent zpool.cache"
-
-# Validate ZFS disk scanning and import w/out zpool.cache configuration.
-test_2() {
-       local POOL_NAME=test2
-       local TMP_FILE1=`mktemp`
-       local TMP_FILE2=`mktemp`
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create a pool save its status for comparison.
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE1} || fail 3
-
-       # Unload the module stack, remove the cache file, load the module
-       # stack and attempt to probe the disks to import the pool.  As
-       # a cross check verify the old pool state against the imported.
-       ${ZFS_SH} -u || fail 4
-       rm -f ${TMP_CACHE} || fail 5
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 6
-       ${ZPOOL} import -d /dev ${POOL_NAME} || fail 8
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE2} || fail 9
-       cmp ${TMP_FILE1} ${TMP_FILE2} || fail 10
-
-       # Cleanup the test pool and temporary files
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 11
-       rm -f ${TMP_FILE1} ${TMP_FILE2} || fail 12
-       ${ZFS_SH} -u || fail 13
-
-       pass
-}
-run_test 2 "scan disks for pools to import"
-
-zconfig_zvol_device_stat() {
-       local EXPECT=$1
-       local POOL_NAME=/dev/zvol/$2
-       local ZVOL_NAME=/dev/zvol/$3
-       local SNAP_NAME=/dev/zvol/$4
-       local CLONE_NAME=/dev/zvol/$5
-       local COUNT=0
-
-       # Briefly delay for udev
-       udev_trigger
-
-       # Pool exists
-       stat ${POOL_NAME} &>/dev/null   && let COUNT=$COUNT+1
-
-       # Volume and partitions
-       stat ${ZVOL_NAME}  &>/dev/null  && let COUNT=$COUNT+1
-       stat ${ZVOL_NAME}-part1 &>/dev/null  && let COUNT=$COUNT+1
-       stat ${ZVOL_NAME}-part2 &>/dev/null  && let COUNT=$COUNT+1
-
-       # Snapshot with partitions
-       stat ${SNAP_NAME}  &>/dev/null  && let COUNT=$COUNT+1
-       stat ${SNAP_NAME}-part1 &>/dev/null  && let COUNT=$COUNT+1
-       stat ${SNAP_NAME}-part2 &>/dev/null  && let COUNT=$COUNT+1
-
-       # Clone with partitions
-       stat ${CLONE_NAME}  &>/dev/null && let COUNT=$COUNT+1
-       stat ${CLONE_NAME}-part1 &>/dev/null && let COUNT=$COUNT+1
-       stat ${CLONE_NAME}-part2 &>/dev/null && let COUNT=$COUNT+1
-
-       if [ $EXPECT -ne $COUNT ]; then
-               return 1
-       fi
-
-       return 0
-}
-
-# zpool import/export device check
-# (1 volume, 2 partitions, 1 snapshot, 1 clone)
-test_3() {
-       local POOL_NAME=tank
-       local ZVOL_NAME=volume
-       local SNAP_NAME=snap
-       local CLONE_NAME=clone
-       local FULL_ZVOL_NAME=${POOL_NAME}/${ZVOL_NAME}
-       local FULL_SNAP_NAME=${POOL_NAME}/${ZVOL_NAME}@${SNAP_NAME}
-       local FULL_CLONE_NAME=${POOL_NAME}/${CLONE_NAME}
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create a pool, volume, partition, snapshot, and clone.
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
-       ${ZFS} create -V 100M ${FULL_ZVOL_NAME} || fail 3
-       ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
-       label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 1% 50% || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 51% -1 || fail 4
-       ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 5
-       ${ZFS} clone ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 6
-
-       # Verify the devices were created
-       zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 7
-
-       # Export the pool
-       ${ZPOOL} export ${POOL_NAME} || fail 8
-
-       # verify the devices were removed
-       zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9
-
-       # Import the pool, wait 1 second for udev
-       ${ZPOOL} import ${POOL_NAME} || fail 10
-
-       # Verify the devices were created
-       zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 11
-
-       # Destroy the pool and consequently the devices
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 12
-
-       # verify the devices were removed
-       zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 13
-
-       ${ZFS_SH} -u || fail 14
-       rm -f ${TMP_CACHE} || fail 15
-
-       pass
-}
-run_test 3 "zpool import/export device"
-
-# zpool insmod/rmmod device check (1 volume, 1 snapshot, 1 clone)
-test_4() {
-       POOL_NAME=tank
-       ZVOL_NAME=volume
-       SNAP_NAME=snap
-       CLONE_NAME=clone
-       FULL_ZVOL_NAME=${POOL_NAME}/${ZVOL_NAME}
-       FULL_SNAP_NAME=${POOL_NAME}/${ZVOL_NAME}@${SNAP_NAME}
-       FULL_CLONE_NAME=${POOL_NAME}/${CLONE_NAME}
-       TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create a pool, volume, snapshot, and clone
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
-       ${ZFS} create -V 100M ${FULL_ZVOL_NAME} || fail 3
-       ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
-       label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 1% 50% || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 51% -1 || fail 4
-       ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 5
-       ${ZFS} clone ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 6
-
-       # Verify the devices were created
-       zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 7
-
-       # Unload the modules
-       ${ZFS_SH} -u || fail 8
-
-       # Verify the devices were removed
-       zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 9
-
-       # Load the modules, list the pools to ensure they are opened
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 10
-       ${ZPOOL} import -c ${TMP_CACHE} ${POOL_NAME} || fail 10
-       ${ZPOOL} list &>/dev/null
-
-       # Verify the devices were created
-       zconfig_zvol_device_stat 10 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 11
-
-       # Destroy the pool and consequently the devices
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 12
-
-       # Verify the devices were removed
-       zconfig_zvol_device_stat 0 ${POOL_NAME} ${FULL_ZVOL_NAME} \
-           ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 13
-
-       ${ZFS_SH} -u || fail 14
-       rm -f ${TMP_CACHE} || fail 15
-
-       pass
-}
-run_test 4 "zpool insmod/rmmod device"
-
-# ZVOL volume sanity check
-test_5() {
-       local POOL_NAME=tank
-       local ZVOL_NAME=fish
-       local FULL_NAME=${POOL_NAME}/${ZVOL_NAME}
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create a pool and volume.
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raid0 || fail 2
-       ${ZFS} create -V 800M ${FULL_NAME} || fail 3
-       label /dev/zvol/${FULL_NAME} msdos || fail 4
-       partition /dev/zvol/${FULL_NAME} primary 1 -1 || fail 4
-       format /dev/zvol/${FULL_NAME}-part1 ext2 || fail 5
-
-       # Mount the ext2 filesystem and copy some data to it.
-       mkdir -p /tmp/${ZVOL_NAME}-part1 || fail 6
-       mount /dev/zvol/${FULL_NAME}-part1 /tmp/${ZVOL_NAME}-part1 || fail 7
-       cp -RL ${SRC_DIR} /tmp/${ZVOL_NAME}-part1 || fail 8
-       sync
-
-       # Verify the copied files match the original files.
-       diff -ur ${SRC_DIR} /tmp/${ZVOL_NAME}-part1/${SRC_DIR##*/} \
-               &>/dev/null || fail 9
-
-       # Remove the files, umount, destroy the volume and pool.
-       rm -Rf /tmp/${ZVOL_NAME}-part1/${SRC_DIR##*/} || fail 10
-       umount /tmp/${ZVOL_NAME}-part1 || fail 11
-       rmdir /tmp/${ZVOL_NAME}-part1 || fail 12
-
-       ${ZFS} destroy ${FULL_NAME} || fail 13
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 14
-       ${ZFS_SH} -u || fail 15
-       rm -f ${TMP_CACHE} || fail 16
-
-       pass
-}
-run_test 5 "zvol+ext2 volume"
-
-# ZVOL snapshot sanity check
-test_6() {
-       local POOL_NAME=tank
-       local ZVOL_NAME=fish
-       local SNAP_NAME=pristine
-       local FULL_ZVOL_NAME=${POOL_NAME}/${ZVOL_NAME}
-       local FULL_SNAP_NAME=${POOL_NAME}/${ZVOL_NAME}@${SNAP_NAME}
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create a pool and volume.
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raid0 || fail 2
-       ${ZFS} create -V 800M ${FULL_ZVOL_NAME} || fail 3
-       ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
-       label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 1 -1 || fail 4
-       format /dev/zvol/${FULL_ZVOL_NAME}-part1 ext2 || fail 5
-
-       # Mount the ext2 filesystem and copy some data to it.
-       mkdir -p /tmp/${ZVOL_NAME}-part1 || fail 6
-       mount /dev/zvol/${FULL_ZVOL_NAME}-part1 /tmp/${ZVOL_NAME}-part1 \
-               || fail 7
-
-       # Snapshot the pristine ext2 filesystem and mount it read-only.
-       ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 8
-       wait_udev /dev/zvol/${FULL_SNAP_NAME}-part1 30 || fail 8
-       mkdir -p /tmp/${SNAP_NAME}-part1 || fail 9
-       mount /dev/zvol/${FULL_SNAP_NAME}-part1 /tmp/${SNAP_NAME}-part1 \
-               &>/dev/null || fail 10
-
-       # Copy to original volume
-       cp -RL ${SRC_DIR} /tmp/${ZVOL_NAME}-part1 || fail 11
-       sync
-
-       # Verify the copied files match the original files,
-       # and the copied files do NOT appear in the snapshot.
-       diff -ur ${SRC_DIR} /tmp/${ZVOL_NAME}-part1/${SRC_DIR##*/} \
-               &>/dev/null || fail 12
-       diff -ur ${SRC_DIR} /tmp/${SNAP_NAME}-part1/${SRC_DIR##*/} \
-               &>/dev/null && fail 13
-
-       # umount, destroy the snapshot, volume, and pool.
-       umount /tmp/${SNAP_NAME}-part1 || fail 14
-       rmdir /tmp/${SNAP_NAME}-part1 || fail 15
-       ${ZFS} destroy ${FULL_SNAP_NAME} || fail 16
-
-       umount /tmp/${ZVOL_NAME}-part1 || fail 17
-       rmdir /tmp/${ZVOL_NAME}-part1 || fail 18
-       ${ZFS} destroy ${FULL_ZVOL_NAME} || fail 19
-
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 20
-       ${ZFS_SH} -u || fail 21
-       rm -f ${TMP_CACHE} || fail 22
-
-       pass
-}
-run_test 6 "zvol+ext2 snapshot"
-
-# ZVOL clone sanity check
-test_7() {
-       local POOL_NAME=tank
-       local ZVOL_NAME=fish
-       local SNAP_NAME=pristine
-       local CLONE_NAME=clone
-       local FULL_ZVOL_NAME=${POOL_NAME}/${ZVOL_NAME}
-       local FULL_SNAP_NAME=${POOL_NAME}/${ZVOL_NAME}@${SNAP_NAME}
-       local FULL_CLONE_NAME=${POOL_NAME}/${CLONE_NAME}
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create a pool and volume.
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
-       ${ZFS} create -V 300M ${FULL_ZVOL_NAME} || fail 3
-       ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME} || fail 3
-       label /dev/zvol/${FULL_ZVOL_NAME} msdos || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME} primary 1 -1 || fail 4
-       format /dev/zvol/${FULL_ZVOL_NAME}-part1 ext2 || fail 5
-
-       # Snapshot the pristine ext2 filesystem.
-       ${ZFS} snapshot ${FULL_SNAP_NAME} || fail 6
-       wait_udev /dev/zvol/${FULL_SNAP_NAME}-part1 30 || fail 7
-
-       # Mount the ext2 filesystem so some data can be copied to it.
-       mkdir -p /tmp/${ZVOL_NAME}-part1 || fail 7
-       mount /dev/zvol/${FULL_ZVOL_NAME}-part1 \
-               /tmp/${ZVOL_NAME}-part1 || fail 8
-
-       # Mount the pristine ext2 snapshot.
-       mkdir -p /tmp/${SNAP_NAME}-part1 || fail 9
-       mount /dev/zvol/${FULL_SNAP_NAME}-part1 \
-               /tmp/${SNAP_NAME}-part1 &>/dev/null || fail 10
-
-       # Copy to original volume.
-       cp -RL ${SRC_DIR} /tmp/${ZVOL_NAME}-part1 || fail 11
-       sync
-
-       # Verify the copied files match the original files,
-       # and the copied files do NOT appear in the snapshot.
-       diff -ur ${SRC_DIR} /tmp/${ZVOL_NAME}-part1/${SRC_DIR##*/} \
-               &>/dev/null || fail 12
-       diff -ur ${SRC_DIR} /tmp/${SNAP_NAME}-part1/${SRC_DIR##*/} \
-               &>/dev/null && fail 13
-
-       # Clone from the original pristine snapshot
-       ${ZFS} clone ${FULL_SNAP_NAME} ${FULL_CLONE_NAME} || fail 14
-       wait_udev /dev/zvol/${FULL_CLONE_NAME}-part1 30 || fail 14
-       mkdir -p /tmp/${CLONE_NAME}-part1 || fail 15
-       mount /dev/zvol/${FULL_CLONE_NAME}-part1 \
-               /tmp/${CLONE_NAME}-part1 || fail 16
-
-       # Verify the clone matches the pristine snapshot,
-       # and the files copied to the original volume are NOT there.
-       diff -ur /tmp/${SNAP_NAME}-part1 /tmp/${CLONE_NAME}-part1 \
-               &>/dev/null || fail 17
-       diff -ur /tmp/${ZVOL_NAME}-part1 /tmp/${CLONE_NAME}-part1 \
-               &>/dev/null && fail 18
-
-       # Copy to cloned volume.
-       cp -RL ${SRC_DIR} /tmp/${CLONE_NAME}-part1 || fail 19
-       sync
-
-       # Verify the clone matches the modified original volume.
-       diff -ur /tmp/${ZVOL_NAME}-part1 /tmp/${CLONE_NAME}-part1 \
-               &>/dev/null || fail 20
-
-       # umount, destroy the snapshot, volume, and pool.
-       umount /tmp/${CLONE_NAME}-part1 || fail 21
-       rmdir /tmp/${CLONE_NAME}-part1 || fail 22
-       ${ZFS} destroy ${FULL_CLONE_NAME} || fail 23
-
-       umount /tmp/${SNAP_NAME}-part1 || fail 24
-       rmdir /tmp/${SNAP_NAME}-part1 || fail 25
-       ${ZFS} destroy ${FULL_SNAP_NAME} || fail 26
-
-       umount /tmp/${ZVOL_NAME}-part1 || fail 27
-       rmdir /tmp/${ZVOL_NAME}-part1 || fail 28
-       ${ZFS} destroy ${FULL_ZVOL_NAME} || fail 29
-
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 30
-       ${ZFS_SH} -u || fail 31
-       rm -f ${TMP_CACHE} || fail 32
-
-       pass
-}
-run_test 7 "zvol+ext2 clone"
-
-# Send/Receive sanity check
-test_8() {
-       local POOL_NAME1=tank1
-       local POOL_NAME2=tank2
-       local ZVOL_NAME=fish
-       local SNAP_NAME=snap
-       local FULL_ZVOL_NAME1=${POOL_NAME1}/${ZVOL_NAME}
-       local FULL_ZVOL_NAME2=${POOL_NAME2}/${ZVOL_NAME}
-       local FULL_SNAP_NAME1=${POOL_NAME1}/${ZVOL_NAME}@${SNAP_NAME}
-       local FULL_SNAP_NAME2=${POOL_NAME2}/${ZVOL_NAME}@${SNAP_NAME}
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-
-       # Create two pools and a volume
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME1} -c lo-raidz2 || fail 2
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME2} -c lo-raidz2 || fail 2
-       ${ZFS} create -V 300M ${FULL_ZVOL_NAME1} || fail 3
-       ${ZFS} set snapdev=visible ${FULL_ZVOL_NAME1} || fail 3
-       label /dev/zvol/${FULL_ZVOL_NAME1} msdos || fail 4
-       partition /dev/zvol/${FULL_ZVOL_NAME1} primary 1 -1 || fail 4
-       format /dev/zvol/${FULL_ZVOL_NAME1}-part1 ext2 || fail 5
-
-       # Mount the ext2 filesystem and copy some data to it.
-       mkdir -p /tmp/${FULL_ZVOL_NAME1}-part1 || fail 6
-       mount /dev/zvol/${FULL_ZVOL_NAME1}-part1 \
-               /tmp/${FULL_ZVOL_NAME1}-part1 || fail 7
-       cp -RL ${SRC_DIR} /tmp/${FULL_ZVOL_NAME1}-part1 || fail 8
-
-       # Unmount, snapshot, mount the ext2 filesystem so it may be sent.
-       # We only unmount to ensure the ext2 filesystem is clean.
-       umount /tmp/${FULL_ZVOL_NAME1}-part1 || fail 9
-       ${ZFS} snapshot ${FULL_SNAP_NAME1} || fail 10
-       wait_udev /dev/zvol/${FULL_SNAP_NAME1} 30 || fail 10
-       mount /dev/zvol/${FULL_ZVOL_NAME1}-part1 \
-               /tmp/${FULL_ZVOL_NAME1}-part1 || 11
-
-       # Send/receive the snapshot from POOL_NAME1 to POOL_NAME2
-       (${ZFS} send ${FULL_SNAP_NAME1} | \
-       ${ZFS} receive ${FULL_ZVOL_NAME2}) || fail 12
-       wait_udev /dev/zvol/${FULL_ZVOL_NAME2}-part1 30 || fail 12
-
-       # Mount the sent ext2 filesystem.
-       mkdir -p /tmp/${FULL_ZVOL_NAME2}-part1 || fail 13
-       mount /dev/zvol/${FULL_ZVOL_NAME2}-part1 \
-               /tmp/${FULL_ZVOL_NAME2}-part1 || fail 14
-
-       # Verify the contents of the volumes match
-       diff -ur /tmp/${FULL_ZVOL_NAME1}-part1 /tmp/${FULL_ZVOL_NAME2}-part1 \
-           &>/dev/null || fail 15
-
-       # Umount, destroy the volume and pool.
-       umount /tmp/${FULL_ZVOL_NAME1}-part1 || fail 16
-       umount /tmp/${FULL_ZVOL_NAME2}-part1 || fail 17
-       rmdir /tmp/${FULL_ZVOL_NAME1}-part1 || fail 18
-       rmdir /tmp/${FULL_ZVOL_NAME2}-part1 || fail 19
-       rmdir /tmp/${POOL_NAME1} || fail 20
-       rmdir /tmp/${POOL_NAME2} || fail 21
-
-       ${ZFS} destroy ${FULL_SNAP_NAME1} || fail 22
-       ${ZFS} destroy ${FULL_SNAP_NAME2} || fail 23
-       ${ZFS} destroy ${FULL_ZVOL_NAME1} || fail 24
-       ${ZFS} destroy ${FULL_ZVOL_NAME2} || fail 25
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME1} -c lo-raidz2 -d || fail 26
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME2} -c lo-raidz2 -d || fail 27
-       ${ZFS_SH} -u || fail 28
-       rm -f ${TMP_CACHE} || fail 29
-
-       pass
-}
-run_test 8 "zfs send/receive"
-
-# zpool event sanity check
-test_9() {
-       local POOL_NAME=tank
-       local ZVOL_NAME=fish
-       local FULL_NAME=${POOL_NAME}/${ZVOL_NAME}
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       local TMP_EVENTS=`mktemp -p /tmp zpool.events.XXXXXXXX`
-
-       # Create a pool and volume.
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
-       ${ZFS} create -V 300M ${FULL_NAME} || fail 3
-       udev_trigger
-
-       # Dump the events, there should be at least 5 lines.
-       ${ZPOOL} events >${TMP_EVENTS} || fail 4
-       EVENTS=`wc -l ${TMP_EVENTS} | cut -f1 -d' '`
-       [ $EVENTS -lt 5 ] && fail 5
-
-       # Clear the events and ensure there are none.
-       ${ZPOOL} events -c >/dev/null || fail 6
-       ${ZPOOL} events >${TMP_EVENTS} || fail 7
-       EVENTS=`wc -l ${TMP_EVENTS} | cut -f1 -d' '`
-       [ $EVENTS -gt 1 ] && fail 8
-
-       ${ZFS} destroy ${FULL_NAME} || fail 9
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 10
-       ${ZFS_SH} -u || fail 11
-       rm -f ${TMP_CACHE} || fail 12
-       rm -f ${TMP_EVENTS} || fail 13
-
-       pass
-}
-run_test 9 "zpool events"
-
-zconfig_add_vdev() {
-       local POOL_NAME=$1
-       local TYPE=$2
-       local DEVICE=$3
-       local TMP_FILE1=`mktemp`
-       local TMP_FILE2=`mktemp`
-       local TMP_FILE3=`mktemp`
-
-       BASE_DEVICE=`basename ${DEVICE}`
-
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE1}
-       ${ZPOOL} add -f ${POOL_NAME} ${TYPE} ${DEVICE} 2>/dev/null || return 1
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE2}
-       diff ${TMP_FILE1} ${TMP_FILE2} > ${TMP_FILE3}
-
-       [ `wc -l ${TMP_FILE3}|${AWK} '{print $1}'` -eq 3 ] || return 1
-
-       PARENT_VDEV=`tail -2 ${TMP_FILE3} | head -1 | ${AWK} '{print $NF}'`
-       case $TYPE in
-       cache)
-               [ "${PARENT_VDEV}" = "${TYPE}" ] || return 1
-               ;;
-       log)
-               [ "${PARENT_VDEV}" = "logs" ] || return 1
-               ;;
-       esac
-
-       if ! tail -1 ${TMP_FILE3} |
-           egrep -q "^>[[:space:]]+${BASE_DEVICE}[[:space:]]+ONLINE" ; then
-               return 1
-       fi
-       rm -f ${TMP_FILE1} ${TMP_FILE2} ${TMP_FILE3}
-
-       return 0
-}
-
-# zpool add and remove sanity check
-test_10() {
-       local POOL_NAME=tank
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       local TMP_FILE1=`mktemp`
-       local TMP_FILE2=`mktemp`
-
-       if [ ${SCSI_DEBUG} -eq 0 ] || [ ${HAVE_LSSCSI} -eq 0 ] ; then
-               skip
-               return
-       fi
-
-       test `${LSMOD} | grep -c scsi_debug` -gt 0 && \
-               (${RMMOD} scsi_debug || exit 1)
-
-       /sbin/modprobe scsi_debug dev_size_mb=128 ||
-               die "Error $? creating scsi_debug device"
-       udev_trigger
-
-       SDDEVICE=`${LSSCSI}|${AWK} '/scsi_debug/ { print $6; exit }'`
-       BASE_SDDEVICE=`basename $SDDEVICE`
-
-       # Create a pool
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 || fail 2
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE1} || fail 3
-
-       # Add and remove a cache vdev by full path
-       zconfig_add_vdev ${POOL_NAME} cache ${SDDEVICE} || fail 4
-       ${ZPOOL} remove ${POOL_NAME} ${SDDEVICE} || fail 5
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE2} || fail 6
-       cmp ${TMP_FILE1} ${TMP_FILE2} || fail 7
-       sleep 1
-
-       # Add and remove a cache vdev by shorthand path
-       zconfig_add_vdev ${POOL_NAME} cache ${BASE_SDDEVICE} || fail 8
-       ${ZPOOL} remove ${POOL_NAME} ${BASE_SDDEVICE} || fail 9
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE2} || fail 10
-       cmp ${TMP_FILE1} ${TMP_FILE2} || fail 11
-       sleep 1
-
-       # Add and remove a log vdev
-       zconfig_add_vdev ${POOL_NAME} log ${BASE_SDDEVICE} || fail 12
-       ${ZPOOL} remove ${POOL_NAME} ${BASE_SDDEVICE} || fail 13
-       ${ZPOOL} status ${POOL_NAME} >${TMP_FILE2} || fail 14
-       cmp ${TMP_FILE1} ${TMP_FILE2} || fail 15
-
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c lo-raidz2 -d || fail 16
-       ${ZFS_SH} -u || fail 17
-       ${RMMOD} scsi_debug || fail 18
-
-       rm -f ${TMP_FILE1} ${TMP_FILE2} ${TMP_CACHE} || fail 19
-
-       pass
-}
-run_test 10 "zpool add/remove vdev"
-
-exit 0
diff --git a/zfs/scripts/zfault.sh b/zfs/scripts/zfault.sh
deleted file mode 100755 (executable)
index a5f1f3c..0000000
+++ /dev/null
@@ -1,955 +0,0 @@
-#!/bin/bash
-#
-# ZPOOL fault verification test script.
-#
-# The current suite of fault tests should not be thought of an exhaustive
-# list of failure modes.  Rather it is simply an starting point which trys
-# to cover the bulk the of the 'easy' and hopefully common, failure modes.
-#
-# Additional tests should be added but the current suite as new interesting
-# failures modes are observed.  Additional failure modes I'd like to see
-# tests for include, but are not limited too:
-#
-#      * Slow but successful IO.
-#      * SCSI sense codes generated as zevents.
-#      * 4k sectors
-#      * noise
-#      * medium error
-#      * recovered error
-#
-# The current infrastructure using the 'mdadm' faulty device and the
-# 'scsi_debug' simulated scsi devices.  The idea is to inject the error
-# below the zfs stack to validate all the error paths.  More targeted
-# failure testing should be added using the 'zinject' command line util.
-#
-# Requires the following packages:
-# * mdadm
-# * lsscsi
-# * sg3-utils
-#
-
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zfault.sh
-
-usage() {
-cat << EOF
-USAGE:
-$0 [hvcts]
-
-DESCRIPTION:
-       ZPOOL fault verification tests
-
-OPTIONS:
-       -h      Show this message
-       -v      Verbose
-       -c      Cleanup md+lo+file devices at start
-       -t <#>  Run listed tests
-       -s <#>  Skip listed tests
-
-EOF
-}
-
-while getopts 'hvct:s:?' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               ;;
-       c)
-               CLEANUP=1
-               ;;
-       t)
-               TESTS_RUN=($OPTARG)
-               ;;
-       s)
-               TESTS_SKIP=($OPTARG)
-               ;;
-       ?)
-               usage
-               exit
-               ;;
-       esac
-done
-
-if [ $(id -u) != 0 ]; then
-       die "Must run as root"
-fi
-
-# Initialize the test suite
-init
-
-# Perform pre-cleanup is requested
-if [ ${CLEANUP} ]; then
-       ${ZFS_SH} -u
-       cleanup_md_devices
-       cleanup_loop_devices
-       rm -f /tmp/zpool.cache.*
-fi
-
-# Check if we need to skip all md based tests.
-MD_PARTITIONABLE=0
-check_md_partitionable && MD_PARTITIONABLE=1
-if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-       echo "Skipping tests 1-7 which require partitionable md devices"
-fi
-
-# Check if we need to skip all the scsi_debug tests.
-SCSI_DEBUG=0
-${INFOMOD} scsi_debug &>/dev/null && SCSI_DEBUG=1
-if [ ${SCSI_DEBUG} -eq 0 ]; then
-       echo "Skipping tests 8-9 which require the scsi_debug module"
-fi
-
-if [ ${MD_PARTITIONABLE} -eq 0 ] || [ ${SCSI_DEBUG} -eq 0 ]; then
-       echo
-fi
-
-printf "%40s%s\t%s\t%s\t%s\t%s\n" "" "raid0" "raid10" "raidz" "raidz2" "raidz3"
-
-pass_nonewline() {
-       echo -n -e "${COLOR_GREEN}Pass${COLOR_RESET}\t"
-}
-
-skip_nonewline() {
-       echo -n -e "${COLOR_BROWN}Skip${COLOR_RESET}\t"
-}
-
-nth_zpool_vdev() {
-       local POOL_NAME=$1
-       local DEVICE_TYPE=$2
-       local DEVICE_NTH=$3
-
-       ${ZPOOL} status ${POOL_NAME} | grep ${DEVICE_TYPE} ${TMP_STATUS} |   \
-               head -n${DEVICE_NTH} | tail -n1 | ${AWK} "{ print \$1 }"
-}
-
-vdev_status() {
-       local POOL_NAME=$1
-       local VDEV_NAME=$2
-
-       ${ZPOOL} status ${POOL_NAME} | ${AWK} "/${VDEV_NAME}/ { print \$2 }"
-}
-
-# Required format is x.yz[KMGTP]
-expand_numeric_suffix() {
-       local VALUE=$1
-
-       VALUE=`echo "${VALUE/%K/*1000}"`
-       VALUE=`echo "${VALUE/%M/*1000000}"`
-       VALUE=`echo "${VALUE/%G/*1000000000}"`
-       VALUE=`echo "${VALUE/%T/*1000000000000}"`
-       VALUE=`echo "${VALUE/%P/*1000000000000000}"`
-       VALUE=`echo "${VALUE}" | bc | cut -d'.' -f1`
-
-       echo "${VALUE}"
-}
-
-vdev_read_errors() {
-       local POOL_NAME=$1
-       local VDEV_NAME=$2
-       local VDEV_ERRORS=`${ZPOOL} status ${POOL_NAME} |
-               ${AWK} "/${VDEV_NAME}/ { print \\$3 }"`
-
-       expand_numeric_suffix ${VDEV_ERRORS}
-}
-
-vdev_write_errors() {
-       local POOL_NAME=$1
-       local VDEV_NAME=$2
-       local VDEV_ERRORS=`${ZPOOL} status ${POOL_NAME} |
-               ${AWK} "/${VDEV_NAME}/ { print \\$4 }"`
-
-       expand_numeric_suffix ${VDEV_ERRORS}
-}
-
-vdev_cksum_errors() {
-       local POOL_NAME=$1
-       local VDEV_NAME=$2
-       local VDEV_ERRORS=`${ZPOOL} status ${POOL_NAME} |
-               ${AWK} "/${VDEV_NAME}/ { print \\$5 }"`
-
-       expand_numeric_suffix ${VDEV_ERRORS}
-}
-
-zpool_state() {
-       local POOL_NAME=$1
-
-       ${ZPOOL} status ${POOL_NAME} | ${AWK} "/state/ { print \$2; exit }"
-}
-
-zpool_event() {
-       local EVENT_NAME=$1
-       local EVENT_KEY=$2
-
-       SCRIPT1="BEGIN {RS=\"\"; FS=\"\n\"} /${EVENT_NAME}/ { print \$0; exit }"
-       SCRIPT2="BEGIN {FS=\"=\"} /${EVENT_KEY}/ { print \$2; exit }"
-
-       ${ZPOOL} events -vH | ${AWK} "${SCRIPT1}" | ${AWK} "${SCRIPT2}"
-}
-
-zpool_scan_errors() {
-       local POOL_NAME=$1
-
-       ${ZPOOL} status ${POOL_NAME} | ${AWK} "/scan: scrub/ { print \$8 }"
-       ${ZPOOL} status ${POOL_NAME} | ${AWK} "/scan: resilver/ { print \$7 }"
-}
-
-pattern_create() {
-       local PATTERN_BLOCK_SIZE=$1
-       local PATTERN_BLOCK_COUNT=$2
-       local PATTERN_NAME=`mktemp -p /tmp zpool.pattern.XXXXXXXX`
-
-       echo ${PATTERN_NAME}
-       dd if=/dev/urandom of=${PATTERN_NAME} bs=${PATTERN_BLOCK_SIZE}   \
-               count=${PATTERN_BLOCK_COUNT} &>/dev/null
-       return $?
-}
-
-pattern_write() {
-       local PATTERN_NAME=$1
-       local PATTERN_BLOCK_SIZE=$2
-       local PATTERN_BLOCK_COUNT=$3
-       local DEVICE_NAME=$4
-
-       dd if=${PATTERN_NAME} of=${DEVICE_NAME} bs=${PATTERN_BLOCK_SIZE} \
-               count=${PATTERN_BLOCK_COUNT} oflag=direct &>/dev/null
-       return $?
-}
-
-pattern_write_bg() {
-       local PATTERN_NAME=$1
-       local PATTERN_BLOCK_SIZE=$2
-       local PATTERN_BLOCK_COUNT=$3
-       local DEVICE_NAME=$4
-
-       dd if=${PATTERN_NAME} of=${DEVICE_NAME} bs=${PATTERN_BLOCK_SIZE} \
-               count=${PATTERN_BLOCK_COUNT} oflag=direct &>/dev/null &
-       return $?
-}
-
-pattern_verify() {
-       local PATTERN_NAME=$1
-       local PATTERN_BLOCK_SIZE=$2
-       local PATTERN_BLOCK_COUNT=$3
-       local DEVICE_NAME=$4
-       local DEVICE_FILE=`mktemp -p /tmp zpool.pattern.XXXXXXXX`
-
-       dd if=${DEVICE_NAME} of=${DEVICE_FILE} bs=${PATTERN_BLOCK_SIZE} \
-               count=${PATTERN_BLOCK_COUNT} iflag=direct &>/dev/null
-       cmp -s ${PATTERN_NAME} ${DEVICE_FILE}
-       RC=$?
-       rm -f ${DEVICE_FILE}
-
-       return ${RC}
-}
-
-pattern_remove() {
-       local PATTERN_NAME=$1
-
-       rm -f ${PATTERN_NAME}
-       return $?
-}
-
-fault_set_md() {
-       local VDEV_FAULTY=$1
-       local FAULT_TYPE=$2
-
-       ${MDADM} /dev/${VDEV_FAULTY} --grow --level=faulty \
-               --layout=${FAULT_TYPE} >/dev/null
-       return $?
-}
-
-fault_clear_md() {
-       local VDEV_FAULTY=$1
-
-       # Clear all failure injection.
-       ${MDADM} /dev/${VDEV_FAULTY} --grow --level=faulty \
-               --layout=clear >/dev/null || return $?
-       ${MDADM} /dev/${VDEV_FAULTY} --grow --level=faulty \
-               --layout=flush >/dev/null || return $?
-       return $?
-}
-
-fault_set_sd() {
-       local OPTS=$1
-       local NTH=$2
-
-       echo ${OPTS} >/sys/bus/pseudo/drivers/scsi_debug/opts
-       echo ${NTH}  >/sys/bus/pseudo/drivers/scsi_debug/every_nth
-}
-
-fault_clear_sd() {
-       echo 0 >/sys/bus/pseudo/drivers/scsi_debug/every_nth
-       echo 0 >/sys/bus/pseudo/drivers/scsi_debug/opts
-}
-
-test_setup() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local ZVOL_NAME=$3
-       local TMP_CACHE=$4
-
-       ${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || fail 1
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c ${POOL_CONFIG} || fail 2
-       ${ZFS} create -V 64M ${POOL_NAME}/${ZVOL_NAME} || fail 3
-
-       # Trigger udev and re-read the partition table to ensure all of
-       # this IO is out of the way before we begin injecting failures.
-       udev_trigger || fail 4
-       ${BLOCKDEV} --rereadpt /dev/${POOL_NAME}/${ZVOL_NAME} || fail 5
-}
-
-test_cleanup() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local ZVOL_NAME=$3
-       local TMP_CACHE=$4
-
-       ${ZFS} destroy ${POOL_NAME}/${ZVOL_NAME} || fail 101
-       ${ZPOOL_CREATE_SH} -p ${POOL_NAME} -c ${POOL_CONFIG} -d || fail 102
-       ${ZFS_SH} -u || fail 103
-       rm -f ${TMP_CACHE} || fail 104
-}
-
-test_write_soft() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-
-       if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Set soft write failure for first vdev device.
-       local VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md 1`
-       fault_set_md ${VDEV_FAULTY} write-transient
-
-       # The application must not observe an error.
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-       fault_clear_md ${VDEV_FAULTY}
-
-       # Soft errors will not be logged to 'zpool status'
-       local WRITE_ERRORS=`vdev_write_errors ${POOL_NAME} ${VDEV_FAULTY}`
-       test ${WRITE_ERRORS} -eq 0 || fail 13
-
-       # Soft errors will still generate an EIO (5) event.
-       test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 14
-
-       # Verify the known pattern.
-       pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 15
-       pattern_remove ${TMP_PATTERN} || fail 16
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-# Soft write error.
-test_1() {
-       test_write_soft tank lo-faulty-raid0  0
-       test_write_soft tank lo-faulty-raid10 1
-       test_write_soft tank lo-faulty-raidz  1
-       test_write_soft tank lo-faulty-raidz2 1
-       test_write_soft tank lo-faulty-raidz3 1
-       echo
-}
-run_test 1 "soft write error"
-
-test_write_hard() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-
-       if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Set hard write failure for first vdev device.
-       local VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md 1`
-       fault_set_md ${VDEV_FAULTY} write-persistent
-
-       # The application must not observe an error.
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-       fault_clear_md ${VDEV_FAULTY}
-
-       local WRITE_ERRORS=`vdev_write_errors ${POOL_NAME} ${VDEV_FAULTY}`
-       if [ ${POOL_REDUNDANT} -eq 1 ]; then
-               # For redundant configurations hard errors will not be
-               # logged to 'zpool status' but will generate EIO events.
-               test ${WRITE_ERRORS} -eq 0 || fail 21
-               test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 22
-       else
-               # For non-redundant configurations hard errors will be
-               # logged to 'zpool status' and generate EIO events.  They
-               # will also trigger a scrub of the impacted sectors.
-               sleep 10
-               test ${WRITE_ERRORS} -gt 0 || fail 31
-               test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 32
-               test `zpool_event "zfs.resilver.start" "ena"` != "" || fail 33
-               test `zpool_event "zfs.resilver.finish" "ena"` != "" || fail 34
-               test `zpool_scan_errors ${POOL_NAME}` -eq 0 || fail 35
-       fi
-
-       # Verify the known pattern.
-       pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 41
-       pattern_remove ${TMP_PATTERN} || fail 42
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-# Hard write error.
-test_2() {
-       test_write_hard tank lo-faulty-raid0  0
-       test_write_hard tank lo-faulty-raid10 1
-       test_write_hard tank lo-faulty-raidz  1
-       test_write_hard tank lo-faulty-raidz2 1
-       test_write_hard tank lo-faulty-raidz3 1
-       echo
-}
-run_test 2 "hard write error"
-
-test_write_all() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-
-       if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Set all write failures for first vdev device.
-       local VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md 1`
-       fault_set_md ${VDEV_FAULTY} write-all
-
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       if [ ${POOL_REDUNDANT} -eq 1 ]; then
-               # The application must not observe an error.
-               pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-       else
-               # The application is expected to hang in the background until
-               # the faulty device is repaired and 'zpool clear' is run.
-               pattern_write_bg ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 13
-               sleep 10
-       fi
-       fault_clear_md ${VDEV_FAULTY}
-
-       local WRITE_ERRORS=`vdev_write_errors ${POOL_NAME} ${VDEV_FAULTY}`
-       local VDEV_STATUS=`vdev_status ${POOL_NAME} ${VDEV_FAULTY}`
-       local POOL_STATE=`zpool_state ${POOL_NAME}`
-       # For all configurations write errors are logged to 'zpool status',
-       # and EIO events are generated.  However, only a redundant config
-       # will cause the vdev to be FAULTED and pool DEGRADED.  In a non-
-       # redundant config the IO will hang until 'zpool clear' is run.
-       test ${WRITE_ERRORS} -gt 0 || fail 14
-       test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 15
-
-       if [ ${POOL_REDUNDANT} -eq 1 ]; then
-               test "${VDEV_STATUS}" = "FAULTED" || fail 21
-               test "${POOL_STATE}" = "DEGRADED" || fail 22
-       else
-               BLOCKED=`ps a | grep "${ZVOL_DEVICE}" | grep -c -v "grep"`
-               ${ZPOOL} clear  ${POOL_NAME} || fail 31
-               test ${BLOCKED} -eq 1 || fail 32
-               wait
-       fi
-
-       # Verify the known pattern.
-       pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 41
-       pattern_remove ${TMP_PATTERN} || fail 42
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-# All write errors.
-test_3() {
-       test_write_all tank lo-faulty-raid0  0
-       test_write_all tank lo-faulty-raid10 1
-       test_write_all tank lo-faulty-raidz  1
-       test_write_all tank lo-faulty-raidz2 1
-       test_write_all tank lo-faulty-raidz3 1
-       echo
-}
-run_test 3 "all write errors"
-
-test_read_soft() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-       local READ_ERRORS=0
-
-       if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Create a pattern to be verified during a read error.
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-
-       # Set soft read failure for all the vdevs to ensure we hit it.
-       for (( i=1; i<=4; i++ )); do
-               fault_set_md `nth_zpool_vdev ${POOL_NAME} md $i` read-transient
-       done
-
-       pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 13
-       pattern_remove ${TMP_PATTERN} || fail 14
-
-       # Clear all failure injection and sum read errors.
-       for (( i=1; i<=4; i++ )); do
-               local VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md $i`
-               local VDEV_ERRORS=`vdev_read_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               let READ_ERRORS=${READ_ERRORS}+${VDEV_ERRORS}
-               fault_clear_md ${VDEV_FAULTY}
-       done
-
-       # Soft errors will not be logged to 'zpool status'.
-       test ${READ_ERRORS} -eq 0 || fail 15
-
-       # Soft errors will still generate an EIO (5) event.
-       test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 16
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-# Soft read error.
-test_4() {
-       test_read_soft tank lo-faulty-raid0  0
-       test_read_soft tank lo-faulty-raid10 1
-       test_read_soft tank lo-faulty-raidz  1
-       test_read_soft tank lo-faulty-raidz2 1
-       test_read_soft tank lo-faulty-raidz3 1
-       echo
-}
-run_test 4 "soft read error"
-
-test_read_hard() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-       local READ_ERRORS=0
-
-       if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Create a pattern to be verified during a read error.
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-
-       # Set hard read failure for the fourth vdev.
-       local VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md 4`
-       fault_set_md ${VDEV_FAULTY} read-persistent
-
-       # For a redundant pool there must be no IO error, for a non-redundant
-       # pool we expect permanent damage and an IO error during verify, unless
-       # we get exceptionally lucky and have just damaged redundant metadata.
-       if [ ${POOL_REDUNDANT} -eq 1 ]; then
-               pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 21
-               local READ_ERRORS=`vdev_read_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               test ${READ_ERRORS} -eq 0 || fail 22
-       else
-               pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE}
-               ${ZPOOL} scrub ${POOL_NAME} || fail 32
-               local READ_ERRORS=`vdev_read_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               test ${READ_ERRORS} -gt 0 || fail 33
-               ${ZPOOL} status -v ${POOL_NAME} |     \
-                       grep -A8 "Permanent errors" | \
-                       grep -q "${POOL_NAME}" || fail 34
-       fi
-       pattern_remove ${TMP_PATTERN} || fail 41
-
-       # Clear all failure injection and sum read errors.
-       fault_clear_md ${VDEV_FAULTY}
-
-       # Hard errors will generate an EIO (5) event.
-       test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 42
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-# Hard read error.
-test_5() {
-       test_read_hard tank lo-faulty-raid0  0
-       test_read_hard tank lo-faulty-raid10 1
-       test_read_hard tank lo-faulty-raidz  1
-       test_read_hard tank lo-faulty-raidz2 1
-       test_read_hard tank lo-faulty-raidz3 1
-       echo
-}
-run_test 5 "hard read error"
-
-# Fixable read error.
-test_read_fixable() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-       local READ_ERRORS=0
-
-       if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Create a pattern to be verified during a read error.
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-
-       # Set hard read failure for the fourth vdev.
-       local VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md 4`
-       fault_set_md ${VDEV_FAULTY} read-fixable
-
-       # For a redundant pool there must be no IO error, for a non-redundant
-       # pool we expect permanent damage and an IO error during verify, unless
-       # we get exceptionally lucky and have just damaged redundant metadata.
-       if [ ${POOL_REDUNDANT} -eq 1 ]; then
-               pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 21
-               local READ_ERRORS=`vdev_read_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               test ${READ_ERRORS} -eq 0 || fail 22
-       else
-               pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE}
-               ${ZPOOL} scrub ${POOL_NAME} || fail 32
-               local READ_ERRORS=`vdev_read_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               test ${READ_ERRORS} -gt 0 || fail 33
-               ${ZPOOL} status -v ${POOL_NAME} |     \
-                       grep -A8 "Permanent errors" | \
-                       grep -q "${POOL_NAME}" || fail 34
-       fi
-       pattern_remove ${TMP_PATTERN} || fail 41
-
-       # Clear all failure injection and sum read errors.
-       fault_clear_md ${VDEV_FAULTY}
-
-       # Hard errors will generate an EIO (5) event.
-       test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 42
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-# Read errors fixable with a write.
-test_6() {
-       test_read_fixable tank lo-faulty-raid0  0
-       test_read_fixable tank lo-faulty-raid10 1
-       test_read_fixable tank lo-faulty-raidz  1
-       test_read_fixable tank lo-faulty-raidz2 1
-       test_read_fixable tank lo-faulty-raidz3 1
-       echo
-}
-run_test 6 "fixable read error"
-
-test_cksum() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local VDEV_DAMAGE="$4"
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-
-       if [ ${MD_PARTITIONABLE} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Create a pattern to be verified.
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-
-       # Verify the pattern and that no vdev has cksum errors.
-       pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 13
-       for (( i=1; i<4; i++ )); do
-               VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md ${i}`
-               CKSUM_ERRORS=`vdev_cksum_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               test ${CKSUM_ERRORS} -eq 0 || fail 14
-       done
-
-       # Corrupt the bulk of a vdev with random garbage, we damage as many
-       # vdevs as we have levels of redundancy.  For example for a raidz3
-       # configuration we can trash 3 vdevs and still expect correct data.
-       # This improves the odds that we read one of the damaged vdevs.
-       for VDEV in ${VDEV_DAMAGE}; do
-               VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} md $VDEV`
-               pattern_write /dev/urandom 1M 64 /dev/${VDEV_FAULTY}p1
-       done
-
-       # Verify the pattern is still correct.  For non-redundant pools
-       # expect failure and for redundant pools success due to resilvering.
-       if [ ${POOL_REDUNDANT} -eq 1 ]; then
-               pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 16
-       else
-               pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} && fail 17
-       fi
-
-       CKSUM_ERRORS=`vdev_cksum_errors ${POOL_NAME} ${VDEV_FAULTY}`
-       test ${CKSUM_ERRORS} -gt 0 || fail 18
-       STATUS=`vdev_status ${POOL_NAME} ${VDEV_FAULTY}`
-       test "${STATUS}" = "ONLINE" || fail 19
-
-       # The checksum errors must be logged as an event.
-       local CKSUM_ERRORS=`zpool_event "zfs.checksum" "zio_err"`
-       test ${CKSUM_ERRORS} = "0x34" || test ${CKSUM_ERRORS} = "0x0" || fail 20
-
-       # Verify permant errors for non-redundant pools, and for redundant
-       # pools trigger a scrub and check that all checksums have been fixed.
-       if [ ${POOL_REDUNDANT} -eq 1 ]; then
-               # Scrub the checksum errors and clear the faults.
-               ${ZPOOL} scrub ${POOL_NAME} || fail 21
-               sleep 3
-               ${ZPOOL} clear ${POOL_NAME} || fail 22
-
-               # Re-verify the pattern for fixed checksums.
-               pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 23
-               CKSUM_ERRORS=`vdev_cksum_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               test ${CKSUM_ERRORS} -eq 0 || fail 24
-
-               # Re-verify the entire pool for fixed checksums.
-               ${ZPOOL} scrub ${POOL_NAME} || fail 25
-               CKSUM_ERRORS=`vdev_cksum_errors ${POOL_NAME} ${VDEV_FAULTY}`
-               test ${CKSUM_ERRORS} -eq 0 || fail 26
-       else
-               ${ZPOOL} status -v ${POOL_NAME} |     \
-                       grep -A8 "Permanent errors" | \
-                       grep -q "${POOL_NAME}/${ZVOL_NAME}" || fail 31
-               ${ZPOOL} clear ${POOL_NAME} || fail 32
-       fi
-       pattern_remove ${TMP_PATTERN} || fail 41
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-# Silent data corruption
-test_7() {
-       test_cksum tank lo-faulty-raid0  0 "1"
-       test_cksum tank lo-faulty-raid10 1 "1 3"
-       test_cksum tank lo-faulty-raidz  1 "4"
-       test_cksum tank lo-faulty-raidz2 1 "3 4"
-       test_cksum tank lo-faulty-raidz3 1 "2 3 4"
-       echo
-}
-run_test 7 "silent data corruption"
-
-# Soft write timeout at the scsi device layer.
-test_write_timeout_soft() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local POOL_NTH=$4
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-
-       if [ ${SCSI_DEBUG} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       # Set timeout(0x4) for every nth command.
-       fault_set_sd  4 ${POOL_NTH}
-
-       # The application must not observe an error.
-       local TMP_PATTERN=`pattern_create 1M 8` || fail 11
-       pattern_write ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 12
-       fault_clear_sd
-
-       # Intermittent write timeouts even with FAILFAST set may not cause
-       # an EIO (5) event.  This is because how FAILFAST is handled depends
-       # a log on the low level driver and the exact nature of the failure.
-       # We will however see a 'zfs.delay' event logged due to the timeout.
-       VDEV_DELAY=`zpool_event "zfs.delay" "zio_delay"`
-       test `printf "%d" ${VDEV_DELAY}` -ge 30000 || fail 13
-
-       # Verify the known pattern.
-       pattern_verify ${TMP_PATTERN} 1M 8 ${ZVOL_DEVICE} || fail 14
-       pattern_remove ${TMP_PATTERN} || fail 15
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-test_8() {
-       test_write_timeout_soft tank scsi_debug-raid0  0 50
-       test_write_timeout_soft tank scsi_debug-raid10 1 100
-       test_write_timeout_soft tank scsi_debug-raidz  1 75
-       test_write_timeout_soft tank scsi_debug-raidz2 1 150
-       test_write_timeout_soft tank scsi_debug-raidz3 1 300
-       echo
-}
-run_test 8 "soft write timeout"
-
-# Persistent write timeout at the scsi device layer.
-test_write_timeout_hard() {
-       local POOL_NAME=$1
-       local POOL_CONFIG=$2
-       local POOL_REDUNDANT=$3
-       local POOL_NTH=$4
-       local ZVOL_NAME="zvol"
-       local ZVOL_DEVICE="/dev/${POOL_NAME}/${ZVOL_NAME}"
-       local RESCAN=1
-
-       if [ ${SCSI_DEBUG} -eq 0 ]; then
-               skip_nonewline
-               return
-       fi
-
-       local TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-       test_setup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-
-       local TMP_PATTERN1=`pattern_create 1M 8`
-       local TMP_PATTERN2=`pattern_create 1M 8`
-       local TMP_PATTERN3=`pattern_create 1M 8`
-
-       # Create three partitions each one gets a unique pattern.  The first
-       # pattern is written before the failure, the second pattern during
-       # the failure, and the third pattern while the vdev is degraded.
-       # All three patterns are verified while the vdev is degraded and
-       # then again once it is brought back online.
-       ${PARTED} -s ${ZVOL_DEVICE} mklabel gpt || fail 11
-       ${PARTED} -s ${ZVOL_DEVICE} mkpart primary 1M 16M || fail 12
-       ${PARTED} -s ${ZVOL_DEVICE} mkpart primary 16M 32M || fail 13
-       ${PARTED} -s ${ZVOL_DEVICE} mkpart primary 32M 48M || fail 14
-
-       wait_udev ${ZVOL_DEVICE}1 30
-       wait_udev ${ZVOL_DEVICE}2 30
-       wait_udev ${ZVOL_DEVICE}3 30
-
-       # Before the failure.
-       pattern_write ${TMP_PATTERN1} 1M 8 ${ZVOL_DEVICE}1 || fail 15
-
-       # Get the faulty vdev name.
-       local VDEV_FAULTY=`nth_zpool_vdev ${POOL_NAME} sd 1`
-
-       # Set timeout(0x4) for every nth command.
-       fault_set_sd  4 ${POOL_NTH}
-
-       # During the failure.
-       pattern_write ${TMP_PATTERN2} 1M 8 ${ZVOL_DEVICE}2 || fail 21
-
-       # Expect write errors to be logged to 'zpool status'
-       local WRITE_ERRORS=`vdev_write_errors ${POOL_NAME} ${VDEV_FAULTY}`
-       test ${WRITE_ERRORS} -gt 0 || fail 22
-
-       local VDEV_STATUS=`vdev_status ${POOL_NAME} ${VDEV_FAULTY}`
-       test "${VDEV_STATUS}" = "UNAVAIL" || fail 23
-
-       # Clear the error and remove it from /dev/.
-       fault_clear_sd
-       rm -f /dev/${VDEV_FAULTY}[0-9]
-
-       # Verify the first two patterns and write out the third.
-       pattern_write ${TMP_PATTERN3} 1M 8 ${ZVOL_DEVICE}3 || fail 31
-       pattern_verify ${TMP_PATTERN1} 1M 8 ${ZVOL_DEVICE}1 || fail 32
-       pattern_verify ${TMP_PATTERN2} 1M 8 ${ZVOL_DEVICE}2 || fail 33
-       pattern_verify ${TMP_PATTERN3} 1M 8 ${ZVOL_DEVICE}3 || fail 34
-
-       # Bring the device back online by rescanning for it.  It must appear
-       # in lsscsi and be available to dd before allowing ZFS to bring it
-       # online.  This is not required but provides additional sanity.
-       while [ ${RESCAN} -eq 1 ]; do
-               scsi_rescan
-               wait_udev /dev/${VDEV_FAULTY} 30
-
-               if [ `${LSSCSI} | grep -c "/dev/${VDEV_FAULTY}"` -eq 0 ]; then
-                       continue
-               fi
-
-               dd if=/dev/${VDEV_FAULTY} of=/dev/null bs=8M count=1 &>/dev/null
-               if [ $? -ne 0 ]; then
-                       continue
-               fi
-
-               RESCAN=0
-       done
-
-       # Bring the device back online.  We expect it to be automatically
-       # resilvered without error and we should see minimally the zfs.io,
-       # zfs.statechange (VDEV_STATE_HEALTHY (0x7)), and zfs.resilver.*
-       # events posted.
-       ${ZPOOL} online ${POOL_NAME} ${VDEV_FAULTY} || fail 51
-       sleep 3
-       test `zpool_event "zfs.io" "zio_err"` = "0x5" || fail 52
-       test `zpool_event "zfs.statechange" "vdev_state"` = "0x7" || fail 53
-       test `zpool_event "zfs.resilver.start" "ena"` != "" || fail 54
-       test `zpool_event "zfs.resilver.finish" "ena"` != "" || fail 55
-       test `zpool_scan_errors ${POOL_NAME}` -eq 0 || fail 56
-
-       local VDEV_STATUS=`vdev_status ${POOL_NAME} ${VDEV_FAULTY}`
-       test "${VDEV_STATUS}" = "ONLINE" || fail 57
-
-       # Verify the known pattern.
-       pattern_verify ${TMP_PATTERN1} 1M 8 ${ZVOL_DEVICE}1 || fail 61
-       pattern_verify ${TMP_PATTERN2} 1M 8 ${ZVOL_DEVICE}2 || fail 62
-       pattern_verify ${TMP_PATTERN3} 1M 8 ${ZVOL_DEVICE}3 || fail 63
-       pattern_remove ${TMP_PATTERN1} || fail 64
-       pattern_remove ${TMP_PATTERN2} || fail 65
-       pattern_remove ${TMP_PATTERN3} || fail 66
-
-       test_cleanup ${POOL_NAME} ${POOL_CONFIG} ${ZVOL_NAME} ${TMP_CACHE}
-       pass_nonewline
-}
-
-test_9() {
-       skip_nonewline # Skip non-redundant config
-       test_write_timeout_hard tank scsi_debug-raid10 1 -50
-       test_write_timeout_hard tank scsi_debug-raidz  1 -50
-       test_write_timeout_hard tank scsi_debug-raidz2 1 -50
-       test_write_timeout_hard tank scsi_debug-raidz3 1 -50
-       echo
-}
-run_test 9 "hard write timeout"
-
-exit 0
diff --git a/zfs/scripts/zfs.sh b/zfs/scripts/zfs.sh
deleted file mode 100755 (executable)
index 55584dd..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# A simple script to simply the loading/unloading the ZFS module stack.
-
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zfs.sh
-UNLOAD=
-
-usage() {
-cat << EOF
-USAGE:
-$0 [hvud] [module-options]
-
-DESCRIPTION:
-       Load/unload the ZFS module stack.
-
-OPTIONS:
-       -h      Show this message
-       -v      Verbose
-       -u      Unload modules
-       -d      Save debug log on unload
-
-MODULE-OPTIONS:
-       Must be of the from module="options", for example:
-
-$0 zfs="zfs_prefetch_disable=1"
-$0 zfs="zfs_prefetch_disable=1 zfs_mdcomp_disable=1"
-
-EOF
-}
-
-while getopts 'hvud' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               ;;
-       u)
-               UNLOAD=1
-               ;;
-       d)
-               DUMP_LOG=1
-               ;;
-       ?)
-               usage
-               exit
-               ;;
-       esac
-done
-
-if [ $(id -u) != 0 ]; then
-       die "Must run as root"
-fi
-
-if [ ${UNLOAD} ]; then
-       kill_zed
-       umount -t zfs -a
-       stack_check
-       unload_modules
-else
-       stack_clear
-       check_modules || die "${ERROR}"
-       load_modules "$@" || die "Failed to load modules"
-       wait_udev /dev/zfs 30 || die "'/dev/zfs' was not created"
-fi
-
-exit 0
diff --git a/zfs/scripts/zfs2zol-patch.sed b/zfs/scripts/zfs2zol-patch.sed
deleted file mode 100755 (executable)
index 3a7280f..0000000
+++ /dev/null
@@ -1,15 +0,0 @@
-#!/bin/sed -f
-
-s:usr/src/uts/common/fs/zfs/sys:include/sys:g
-s:usr/src/uts/common/fs/zfs:module/zfs:g
-s:usr/src/lib/libzpool:lib/libzpool:g
-s:usr/src/cmd:cmd:g
-s:usr/src/common/nvpair:module/nvpair:g
-s:usr/src/lib/libzfs/common/libzfs.h:include/libzfs.h:g
-s:usr/src/man/man1m/zfs.1m:man/man8/zfs.8:g
-s:usr/src/uts/common/sys:include/sys:g
-s:usr/src/lib/libzfs_core/common/libzfs_core.h:include/libzfs_core.h:g
-s:usr/src/lib/libzfs/common:lib/libzfs:g
-s:usr/src/lib/libzfs_core/common:lib/libzfs_core:g
-s:lib/libzpool/common/sys:include/sys:g
-s:lib/libzpool/common:lib/libzpool:g
diff --git a/zfs/scripts/ziltest.sh b/zfs/scripts/ziltest.sh
deleted file mode 100755 (executable)
index 62cf09e..0000000
+++ /dev/null
@@ -1,301 +0,0 @@
-#!/bin/bash
-#
-# CDDL HEADER START
-#
-# The contents of this file are subject to the terms of the
-# Common Development and Distribution License, Version 1.0 only
-# (the "License").  You may not use this file except in compliance
-# with the License.
-#
-# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
-# or http://www.opensolaris.org/os/licensing.
-# See the License for the specific language governing permissions
-# and limitations under the License.
-#
-# When distributing Covered Code, include this CDDL HEADER in each
-# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
-# If applicable, add the following below this CDDL HEADER, with the
-# fields enclosed by brackets "[]" replaced with your own identifying
-# information: Portions Copyright [yyyy] [name of copyright owner]
-#
-# CDDL HEADER END
-#
-#
-# Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
-# Use is subject to license terms.
-#
-# Linux version
-#
-# To run just type ziltest.sh
-#
-# - creates a 200MB pool in /var/tmp/
-# - prints information on:
-#      working set files
-#      ZIL records written
-#      ZIL block usage
-#      verification results
-# - returns status of 0 on success
-#
-##########################################################################
-#
-# Here's how it all works:
-#
-# The general idea is to build up
-# an intent log from a bunch of diverse user commands
-# without actually committing them to the file system.
-# Then copy the file system, replay the intent
-# log and compare the file system and the copy.
-#
-# To enable this automated testing of the intent log
-# requires some but minimal support from the file system.
-# In particular, a "freeze" command is required to flush
-# the in-flight transactions; to stop the actual
-# committing of transactions; and to ensure no deltas are
-# discarded. All deltas past a freeze point are kept for
-# replay and comparison later. Here is the flow:
-#
-#      create an empty file system (FS)
-#      freeze FS
-#      run various user commands that create files, directories and ACLs
-#      copy FS to temporary location (COPY)
-#      unmount filesystem
-#      <at this stage FS is empty again and unfrozen, and the
-#       intent log contains a complete set of deltas to replay it>
-#      remount FS <which replays the intent log>
-#      compare FS against the COPY
-#
-
-PATH=/usr/bin
-PATH=$PATH:/usr/sbin
-PATH=$PATH:/bin
-PATH=$PATH:/sbin
-export PATH
-
-# ====================================================================
-# SETUP
-# ====================================================================
-CMD=$(basename "$0")
-POOL=ziltestpool.$$
-DEVSIZE=${DEVSIZE-200m}
-POOLDIR=/var/tmp
-POOLFILE=$POOLDIR/ziltest_poolfile.$$
-SLOGFILE=$POOLDIR/ziltest_slog.$$
-FS=$POOL/fs
-ROOT=/$FS
-COPY=/var/tmp/${POOL}
-KEEP=no
-
-cleanup()
-{
-       zfs destroy -rf $FS
-       echo "$CMD: pool I/O summary & status:"
-       echo "----------------------------------------------------"
-       zpool iostat $POOL
-       echo
-       zpool status $POOL
-       echo "----------------------------------------------------"
-       echo
-       zpool destroy -f $POOL
-       rm -rf $COPY
-       rm $POOLFILE $SLOGFILE
-}
-
-bail()
-{
-       test $KEEP = no && cleanup
-       echo "$1"
-       exit 1
-}
-
-test $# -eq 0 || bail "usage: $CMD"
-
-# ====================================================================
-# PREP
-#
-# Create a pool using a file based vdev
-# Create a destination for runtime copy of FS
-# Freeze transaction syncing in the pool
-# ====================================================================
-truncate -s "$DEVSIZE" $POOLFILE || bail "can't make $POOLFILE"
-truncate -s "$DEVSIZE" $SLOGFILE || bail "can't make $SLOGFILE"
-zpool create $POOL $POOLFILE log $SLOGFILE || bail "can't create pool
-$POOL"
-zpool list $POOL
-
-zfs set compression=on $POOL || bail "can't enable compression on $POOL"
-zfs create $FS || bail "can't create $FS"
-mkdir -p $COPY || bail "can't create $COPY"
-
-#
-# This dd command works around an issue where ZIL records aren't created
-# after freezing the pool unless a ZIL header already exists. Create a file
-# synchronously to force ZFS to write one out.
-#
-dd if=/dev/zero of=$ROOT/sync conv=fdatasync,fsync bs=1 count=1 2> /dev/null
-
-zpool freeze $POOL || bail "can't freeze $POOL"
-
-# ====================================================================
-# TESTS
-#
-# Add operations here that will add commit records to the ZIL
-#
-# Use $ROOT for all file name prefixes
-# ====================================================================
-
-#
-# TX_CREATE
-#
-touch $ROOT/a
-
-#
-# TX_RENAME
-#
-mv $ROOT/a $ROOT/b
-
-#
-# TX_SYMLINK
-#
-touch $ROOT/c
-ln -s $ROOT/c $ROOT/d
-
-#
-# TX_LINK
-#
-touch $ROOT/e
-ln $ROOT/e $ROOT/f
-
-#
-# TX_MKDIR
-#
-mkdir $ROOT/dir_to_delete
-
-#
-# TX_RMDIR
-#
-rmdir $ROOT/dir_to_delete
-
-#
-# Create a simple validation payload
-#
-PAYLOAD=$(modinfo -F filename zfs)
-cp "$PAYLOAD" "$ROOT/payload"
-CHECKSUM_BEFORE=$(sha256sum -b "$PAYLOAD")
-
-#
-# TX_WRITE (small file with ordering)
-#
-cp /etc/mtab $ROOT/small_file
-cp /etc/profile $ROOT/small_file
-
-#
-# TX_CREATE, TX_MKDIR, TX_REMOVE, TX_RMDIR
-#
-cp -R /usr/share/dict $ROOT
-rm -rf $ROOT/dict
-
-#
-# TX_SETATTR
-#
-touch $ROOT/setattr
-chmod 567 $ROOT/setattr
-chgrp root $ROOT/setattr
-touch -cm -t 201311271200 $ROOT/setattr
-
-#
-# TX_TRUNCATE (to zero)
-#
-cp /etc/services $ROOT/truncated_file
-> $ROOT/truncated_file
-
-#
-# Write to an open but removed file
-#
-(sleep 2; date) > $ROOT/date & sleep 1; rm $ROOT/date; wait
-
-#
-# TX_WRITE (large file)
-#
-dd if=/usr/share/lib/termcap of=$ROOT/large bs=128k oflag=sync 2> /dev/null
-
-#
-# Write zeroes, which compresss to holes, in the middle of a file
-#
-dd if=$POOLFILE of=$ROOT/holes.1 bs=128k count=8 2> /dev/null
-dd if=/dev/zero of=$ROOT/holes.1 bs=128k count=2 2> /dev/null
-
-dd if=$POOLFILE of=$ROOT/holes.2 bs=128k count=8 2> /dev/null
-dd if=/dev/zero of=$ROOT/holes.2 bs=128k count=2 oseek=2 2> /dev/null
-
-dd if=$POOLFILE of=$ROOT/holes.3 bs=128k count=8 2> /dev/null
-dd if=/dev/zero of=$ROOT/holes.3 bs=128k count=2 oseek=2 conv=notrunc 2> /dev/null
-
-#
-# TX_MKXATTR
-#
-mkdir $ROOT/xattr.dir
-attr -qs fileattr -V HelloWorld $ROOT/xattr.dir
-attr -qs tmpattr -V HelloWorld $ROOT/xattr.dir
-attr -qr tmpattr $ROOT/xattr.dir
-
-touch $ROOT/xattr.file
-attr -qs fileattr -V HelloWorld $ROOT/xattr.file
-attr -qs tmpattr -V HelloWorld $ROOT/xattr.file
-attr -qr tmpattr $ROOT/xattr.file
-rm $ROOT/xattr.file
-
-
-# ====================================================================
-# REPLAY
-# ====================================================================
-
-KEEP=yes       # keep stuff around if we fail, so we can look at it
-
-cd $ROOT
-find . | cpio -pdmu --quiet $COPY
-echo
-cd /
-
-zfs unmount $FS || bail "can't unmount $FS"
-
-echo "$CMD: transactions to replay:"
-echo "----------------------------------------------------"
-zdb -ivv $FS || bail "can't run zdb on $POOL"
-echo "----------------------------------------------------"
-echo
-
-#
-# Export and reimport the pool to unfreeze it and claim log blocks.
-# It has to be import -f because we can't write a frozen pool's labels!
-#
-zpool export $POOL || bail "can't export $POOL"
-zpool import -f -d $POOLDIR $POOL || bail "can't import $POOL"
-
-# ====================================================================
-# VERIFY
-# ====================================================================
-
-echo "$CMD: current block usage:"
-echo "----------------------------------------------------"
-zdb -bcv $POOL || bail "blocks were leaked!"
-echo "----------------------------------------------------"
-echo
-
-echo "$CMD: Copy of xattrs:"
-echo "----------------------------------------------------"
-attr -l $ROOT/xattr.dir || bail "can't list xattrs"
-echo "----------------------------------------------------"
-echo
-
-echo "$CMD: Results of workingset diff:"
-echo "----------------------------------------------------"
-diff -r $ROOT $COPY > /dev/null || diff -r $ROOT $COPY || bail "replay diffs!"
-
-echo "$CHECKSUM_BEFORE" | sha256sum -c || bail "payload checksums don't match"
-echo "payload checksum matched"
-echo "----------------------------------------------------"
-echo
-
-cleanup
-
-exit 0
diff --git a/zfs/scripts/zimport.sh b/zfs/scripts/zimport.sh
deleted file mode 100755 (executable)
index 3488460..0000000
+++ /dev/null
@@ -1,505 +0,0 @@
-#!/bin/bash
-#
-# Verify that an assortment of known good reference pools can be imported
-# using different versions of the ZoL code.
-#
-# By default references pools for the major ZFS implementation will be
-# checked against the most recent ZoL tags and the master development branch.
-# Alternate tags or branches may be verified with the '-s <src-tag> option.
-# Passing the keyword "installed" will instruct the script to test whatever
-# version is installed.
-#
-# Preferentially a reference pool is used for all tests.  However, if one
-# does not exist and the pool-tag matches one of the src-tags then a new
-# reference pool will be created using binaries from that source build.
-# This is particularly useful when you need to test your changes before
-# opening a pull request.  The keyword 'all' can be used as short hand
-# refer to all available reference pools.
-#
-# New reference pools may be added by placing a bzip2 compressed tarball
-# of the pool in the scripts/zfs-images directory and then passing
-# the -p <pool-tag> option.  To increase the test coverage reference pools
-# should be collected for all the major ZFS implementations.  Having these
-# pools easily available is also helpful to the developers.
-#
-# Care should be taken to run these tests with a kernel supported by all
-# the listed tags.  Otherwise build failure will cause false positives.
-#
-#
-# EXAMPLES:
-#
-# The following example will verify the zfs-0.6.2 tag, the master branch,
-# and the installed zfs version can correctly import the listed pools.
-# Note there is no reference pool available for master and installed but
-# because binaries are available one is automatically constructed.  The
-# working directory is also preserved between runs (-k) preventing the
-# need to rebuild from source for multiple runs.
-#
-#  zimport.sh -k -f /var/tmp/zimport \
-#      -s "zfs-0.6.2 master installed" \
-#      -p "zevo-1.1.1 zol-0.6.2 zol-0.6.2-173 master installed"
-#
-# --------------------- ZFS on Linux Source Versions --------------
-#                 zfs-0.6.2       master          0.6.2-175_g36eb554
-# -----------------------------------------------------------------
-# Clone SPL       Local                Local           Skip
-# Clone ZFS       Local                Local           Skip
-# Build SPL       Pass         Pass            Skip
-# Build ZFS       Pass         Pass            Skip
-# -----------------------------------------------------------------
-# zevo-1.1.1      Pass         Pass            Pass
-# zol-0.6.2       Pass         Pass            Pass
-# zol-0.6.2-173   Fail         Pass            Pass
-# master          Pass         Pass            Pass
-# installed       Pass         Pass            Pass
-#
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zimport.sh
-
-SRC_TAGS="zfs-0.6.1 zfs-0.6.2 master"
-POOL_TAGS="all master"
-TEST_DIR=`mktemp -u -d -p /var/tmp zimport.XXXXXXXX`
-KEEP=0
-VERBOSE=0
-COLOR=1
-REPO="https://github.com/zfsonlinux"
-IMAGES_DIR="$SCRIPTDIR/zfs-images/"
-IMAGES_TAR="https://github.com/zfsonlinux/zfs-images/tarball/master"
-ERROR=0
-
-CONFIG_LOG="configure.log"
-CONFIG_OPTIONS=${CONFIG_OPTIONS:-""}
-MAKE_LOG="make.log"
-MAKE_OPTIONS=${MAKE_OPTIONS:-"-s -j$(nproc)"}
-
-usage() {
-cat << EOF
-USAGE:
-zimport.sh [hvl] [-r repo] [-s src-tag] [-i pool-dir] [-p pool-tag] [-f path]
-
-DESCRIPTION:
-       ZPOOL import verification tests
-
-OPTIONS:
-       -h                Show this message
-       -v                Verbose
-       -c                No color
-       -k                Keep temporary directory
-       -r <repo>         Source repository ($REPO)
-       -s <src-tag>...   Verify ZoL versions with the listed tags
-       -i <pool-dir>     Pool image directory
-       -p <pool-tag>...  Verify pools created with the listed tags
-       -f <path>         Temporary directory to use
-
-EOF
-}
-
-while getopts 'hvckr:s:i:p:f:?' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               ;;
-       c)
-               COLOR=0
-               ;;
-       k)
-               KEEP=1
-               ;;
-       r)
-               REPO="$OPTARG"
-               ;;
-       s)
-               SRC_TAGS="$OPTARG"
-               ;;
-       i)
-               IMAGES_DIR="$OPTARG"
-               ;;
-       p)
-               POOL_TAGS="$OPTARG"
-               ;;
-       f)
-               TEST_DIR="$OPTARG"
-               ;;
-       ?)
-               usage
-               exit
-               ;;
-       esac
-done
-
-# Initialize the test suite
-init
-check_modules || die "ZFS modules must be unloaded"
-
-SRC_DIR="$TEST_DIR/src"
-SRC_DIR_SPL="$SRC_DIR/spl"
-SRC_DIR_ZFS="$SRC_DIR/zfs"
-
-if [ $COLOR -eq 0 ]; then
-       COLOR_GREEN=""
-       COLOR_BROWN=""
-       COLOR_RED=""
-       COLOR_RESET=""
-fi
-
-pass_nonewline() {
-       echo -n -e "${COLOR_GREEN}Pass${COLOR_RESET}\t\t"
-}
-
-skip_nonewline() {
-       echo -n -e "${COLOR_BROWN}Skip${COLOR_RESET}\t\t"
-}
-
-fail_nonewline() {
-       echo -n -e "${COLOR_RED}Fail${COLOR_RESET}\t\t"
-}
-
-#
-# Set several helper variables which are derived from a source tag.
-#
-# SPL_TAG - The tag zfs-x.y.z is translated to spl-x.y.z.
-# SPL_DIR - The spl directory name.
-# SPL_URL - The spl github URL to fetch the tarball.
-# ZFS_TAG - The passed zfs-x.y.z tag
-# ZFS_DIR - The zfs directory name
-# ZFS_URL - The zfs github URL to fetch the tarball
-#
-src_set_vars() {
-       local TAG=$1
-
-       SPL_TAG=`echo $TAG | sed -e 's/zfs/spl/'`
-       SPL_DIR=$SRC_DIR_SPL/$SPL_TAG
-       SPL_URL=$REPO/spl/tarball/$SPL_TAG
-
-       ZFS_TAG=$TAG
-       ZFS_DIR=$SRC_DIR_ZFS/$ZFS_TAG
-       ZFS_URL=$REPO/zfs/tarball/$ZFS_TAG
-
-       if [ "$TAG" = "installed" ]; then
-               ZPOOL_CMD=`which zpool`
-               ZFS_CMD=`which zfs`
-               ZFS_SH="/usr/share/zfs/zfs.sh"
-               ZPOOL_CREATE="/usr/share/zfs/zpool-create.sh"
-       else
-               ZPOOL_CMD="./cmd/zpool/zpool"
-               ZFS_CMD="./cmd/zfs/zfs"
-               ZFS_SH="./scripts/zfs.sh"
-               ZPOOL_CREATE="./scripts/zpool-create.sh"
-       fi
-}
-
-#
-# Set several helper variables which are derived from a pool name such
-# as zol-0.6.x, zevo-1.1.1, etc.  These refer to example pools from various
-# ZFS implementations which are used to verify compatibility.
-#
-# POOL_TAG          - The example pools name in scripts/zfs-images/.
-# POOL_BZIP         - The full path to the example bzip2 compressed pool.
-# POOL_DIR          - The top level test path for this pool.
-# POOL_DIR_PRISTINE - The directory containing a pristine version of the pool.
-# POOL_DIR_COPY     - The directory containing a working copy of the pool.
-# POOL_DIR_SRC      - Location of a source build if it exists for this pool.
-#
-pool_set_vars() {
-       local TAG=$1
-
-       POOL_TAG=$TAG
-       POOL_BZIP=$IMAGES_DIR/$POOL_TAG.tar.bz2
-       POOL_DIR=$TEST_DIR/pools/$POOL_TAG
-       POOL_DIR_PRISTINE=$POOL_DIR/pristine
-       POOL_DIR_COPY=$POOL_DIR/copy
-       POOL_DIR_SRC=`echo -n "$SRC_DIR_ZFS/"; \
-           echo "$POOL_TAG" | sed -e 's/zol/zfs/'`
-}
-
-#
-# Construct a non-trivial pool given a specific version of the source.  More
-# interesting pools provide better test coverage so this function should
-# extended as needed to create more realistic pools.
-#
-pool_create() {
-       pool_set_vars $1
-       src_set_vars $1
-
-       if [ "$POOL_TAG" != "installed" ]; then
-               cd $POOL_DIR_SRC
-       fi
-
-       $ZFS_SH zfs="spa_config_path=$POOL_DIR_PRISTINE" || fail 1
-
-       # Create a file vdev RAIDZ pool.
-       FILEDIR="$POOL_DIR_PRISTINE" $ZPOOL_CREATE \
-           -c file-raidz -p $POOL_TAG -v -x >/dev/null || fail 2
-
-       # Create a pool/fs filesystem with some random contents.
-       $ZFS_CMD create $POOL_TAG/fs || fail 3
-       populate /$POOL_TAG/fs/ 10 100
-
-       # Snapshot that filesystem, clone it, remove the files/dirs,
-       # replace them with new files/dirs.
-       $ZFS_CMD snap $POOL_TAG/fs@snap || fail 4
-       $ZFS_CMD clone $POOL_TAG/fs@snap $POOL_TAG/clone || fail 5
-       rm -Rf /$POOL_TAG/clone/* || fail 6
-       populate /$POOL_TAG/clone/ 10 100
-
-       # Scrub the pool, delay slightly, then export it.  It is now
-       # somewhat interesting for testing purposes.
-       $ZPOOL_CMD scrub $POOL_TAG || fail 7
-       sleep 10
-       $ZPOOL_CMD export $POOL_TAG || fail 8
-
-       $ZFS_SH -u || fail 9
-}
-
-# If the zfs-images directory doesn't exist fetch a copy from Github then
-# cache it in the $TEST_DIR and update $IMAGES_DIR.
-if [ ! -d $IMAGES_DIR ]; then
-       IMAGES_DIR="$TEST_DIR/zfs-images"
-       mkdir -p $IMAGES_DIR
-       curl -sL $IMAGES_TAR | \
-           tar -xz -C $IMAGES_DIR --strip-components=1 || fail 10
-fi
-
-# Given the available images in the zfs-images directory substitute the
-# list of available images for the reserved keywork 'all'.
-for TAG in $POOL_TAGS; do
-
-       if  [ "$TAG" = "all" ]; then
-               ALL_TAGS=`ls $IMAGES_DIR | grep "tar.bz2" | \
-                   sed 's/.tar.bz2//' | tr '\n' ' '`
-               NEW_TAGS="$NEW_TAGS $ALL_TAGS"
-       else
-               NEW_TAGS="$NEW_TAGS $TAG"
-       fi
-done
-POOL_TAGS="$NEW_TAGS"
-
-if [ $VERBOSE -ne 0 ]; then
-       echo "---------------------------- Options ----------------------------"
-       echo "VERBOSE=$VERBOSE"
-       echo "KEEP=$KEEP"
-       echo "REPO=$REPO"
-       echo "SRC_TAGS="$SRC_TAGS""
-       echo "POOL_TAGS="$POOL_TAGS""
-       echo "PATH=$TEST_DIR"
-       echo
-fi
-
-if [ ! -d $TEST_DIR ]; then
-       mkdir -p $TEST_DIR
-fi
-
-if [ ! -d $SRC_DIR ]; then
-       mkdir -p $SRC_DIR
-fi
-
-# Print a header for all tags which are being tested.
-echo "--------------------- ZFS on Linux Source Versions --------------"
-printf "%-16s" " "
-for TAG in $SRC_TAGS; do
-       src_set_vars $TAG
-
-       if [ "$TAG" = "installed" ]; then
-               ZFS_VERSION=`modinfo zfs | awk '/version:/ { print $2; exit }'`
-               if [ -n "$ZFS_VERSION" ]; then
-                       printf "%-16s" $ZFS_VERSION
-               else
-                       echo "ZFS is not installed\n"
-                       fail
-               fi
-       else
-               printf "%-16s" $TAG
-       fi
-done
-echo -e "\n-----------------------------------------------------------------"
-
-#
-# Attempt to generate the tarball from your local git repository, if that
-# fails then attempt to download the tarball from Github.
-#
-printf "%-16s" "Clone SPL"
-for TAG in $SRC_TAGS; do
-       src_set_vars $TAG
-
-       if [ -d $SPL_DIR ]; then
-               skip_nonewline
-       elif  [ "$SPL_TAG" = "installed" ]; then
-               skip_nonewline
-       else
-               cd $SRC_DIR
-
-               if [ ! -d $SRC_DIR_SPL ]; then
-                       mkdir -p $SRC_DIR_SPL
-               fi
-
-               git archive --format=tar --prefix=$SPL_TAG/ $SPL_TAG \
-                   -o $SRC_DIR_SPL/$SPL_TAG.tar &>/dev/nul || \
-                   rm $SRC_DIR_SPL/$SPL_TAG.tar
-               if [ -s $SRC_DIR_SPL/$SPL_TAG.tar ]; then
-                       tar -xf $SRC_DIR_SPL/$SPL_TAG.tar -C $SRC_DIR_SPL
-                       rm $SRC_DIR_SPL/$SPL_TAG.tar
-                       echo -n -e "${COLOR_GREEN}Local${COLOR_RESET}\t\t"
-               else
-                       mkdir -p $SPL_DIR || fail 1
-                       curl -sL $SPL_URL | tar -xz -C $SPL_DIR \
-                           --strip-components=1 || fail 2
-                       echo -n -e "${COLOR_GREEN}Remote${COLOR_RESET}\t\t"
-               fi
-       fi
-done
-printf "\n"
-
-#
-# Attempt to generate the tarball from your local git repository, if that
-# fails then attempt to download the tarball from Github.
-#
-printf "%-16s" "Clone ZFS"
-for TAG in $SRC_TAGS; do
-       src_set_vars $TAG
-
-       if [ -d $ZFS_DIR ]; then
-               skip_nonewline
-       elif  [ "$ZFS_TAG" = "installed" ]; then
-               skip_nonewline
-       else
-               cd $SRC_DIR
-
-               if [ ! -d $SRC_DIR_ZFS ]; then
-                       mkdir -p $SRC_DIR_ZFS
-               fi
-
-               git archive --format=tar --prefix=$ZFS_TAG/ $ZFS_TAG \
-                   -o $SRC_DIR_ZFS/$ZFS_TAG.tar &>/dev/nul || \
-                   rm $SRC_DIR_ZFS/$ZFS_TAG.tar
-               if [ -s $SRC_DIR_ZFS/$ZFS_TAG.tar ]; then
-                       tar -xf $SRC_DIR_ZFS/$ZFS_TAG.tar -C $SRC_DIR_ZFS
-                       rm $SRC_DIR_ZFS/$ZFS_TAG.tar
-                       echo -n -e "${COLOR_GREEN}Local${COLOR_RESET}\t\t"
-               else
-                       mkdir -p $ZFS_DIR || fail 1
-                       curl -sL $ZFS_URL | tar -xz -C $ZFS_DIR \
-                           --strip-components=1 || fail 2
-                       echo -n -e "${COLOR_GREEN}Remote${COLOR_RESET}\t\t"
-               fi
-       fi
-done
-printf "\n"
-
-# Build the listed tags
-printf "%-16s" "Build SPL"
-for TAG in $SRC_TAGS; do
-       src_set_vars $TAG
-
-       if [ -f $SPL_DIR/module/spl/spl.ko ]; then
-               skip_nonewline
-       elif  [ "$SPL_TAG" = "installed" ]; then
-               skip_nonewline
-       else
-               cd $SPL_DIR
-               make distclean &>/dev/null
-               ./autogen.sh >>$CONFIG_LOG 2>&1 || fail 1
-               ./configure $CONFIG_OPTIONS >>$CONFIG_LOG 2>&1 || fail 2
-               make ${MAKE_OPTIONS} >>$MAKE_LOG 2>&1 || fail 3
-               pass_nonewline
-       fi
-done
-printf "\n"
-
-# Build the listed tags
-printf "%-16s" "Build ZFS"
-for TAG in $SRC_TAGS; do
-       src_set_vars $TAG
-
-       if [ -f $ZFS_DIR/module/zfs/zfs.ko ]; then
-               skip_nonewline
-       elif  [ "$ZFS_TAG" = "installed" ]; then
-               skip_nonewline
-       else
-               cd $ZFS_DIR
-               make distclean &>/dev/null
-               ./autogen.sh >>$CONFIG_LOG 2>&1 || fail 1
-               ./configure --with-spl=$SPL_DIR $CONFIG_OPTIONS \
-                    >>$CONFIG_LOG 2>&1 || fail 2
-               make ${MAKE_OPTIONS} >>$MAKE_LOG 2>&1 || fail 3
-               pass_nonewline
-       fi
-done
-printf "\n"
-echo "-----------------------------------------------------------------"
-
-# Either create a new pool using 'zpool create', or alternately restore an
-# existing pool from another ZFS implementation for compatibility testing.
-for TAG in $POOL_TAGS; do
-       pool_set_vars $TAG
-       SKIP=0
-
-       printf "%-16s" $POOL_TAG
-       rm -Rf $POOL_DIR
-       mkdir -p $POOL_DIR_PRISTINE
-
-       # Use the existing compressed image if available.
-       if [ -f $POOL_BZIP ]; then
-               tar -xjf $POOL_BZIP -C $POOL_DIR_PRISTINE \
-                   --strip-components=1 || fail 1
-       # Use the installed version to create the pool.
-       elif  [ "$TAG" = "installed" ]; then
-               pool_create $TAG
-       # A source build is available to create the pool.
-       elif [ -d $POOL_DIR_SRC ]; then
-               pool_create $TAG
-       else
-               SKIP=1
-       fi
-
-       # Verify 'zpool import' works for all listed source versions.
-       for TAG in $SRC_TAGS; do
-
-               if [ $SKIP -eq 1 ]; then
-                       skip_nonewline
-                       continue
-               fi
-
-               src_set_vars $TAG
-               if [ "$TAG" != "installed" ]; then
-                       cd $ZFS_DIR
-               fi
-               $ZFS_SH zfs="spa_config_path=$POOL_DIR_COPY"
-
-               cp -a --sparse=always $POOL_DIR_PRISTINE \
-                   $POOL_DIR_COPY || fail 2
-               POOL_NAME=`$ZPOOL_CMD import -d $POOL_DIR_COPY | \
-                   awk '/pool:/ { print $2; exit 0 }'`
-
-               $ZPOOL_CMD import -N -d $POOL_DIR_COPY $POOL_NAME &>/dev/null
-               if [ $? -ne 0 ]; then
-                       fail_nonewline
-                       ERROR=1
-               else
-                       $ZPOOL_CMD export $POOL_NAME || fail 3
-                       pass_nonewline
-               fi
-
-               rm -Rf $POOL_DIR_COPY
-
-               $ZFS_SH -u || fail 4
-       done
-       printf "\n"
-done
-
-if [ ! $KEEP ]; then
-       rm -Rf $TEST_DIR
-fi
-
-exit $ERROR
diff --git a/zfs/scripts/zpios-profile/Makefile.am b/zfs/scripts/zpios-profile/Makefile.am
deleted file mode 100644 (file)
index c87f169..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-pkgdataprofiledir = $(pkgdatadir)/zpios-profile
-dist_pkgdataprofile_SCRIPTS = \
-       $(top_srcdir)/scripts/zpios-profile/zpios-profile-disk.sh \
-       $(top_srcdir)/scripts/zpios-profile/zpios-profile-pids.sh \
-       $(top_srcdir)/scripts/zpios-profile/zpios-profile-post.sh \
-       $(top_srcdir)/scripts/zpios-profile/zpios-profile-pre.sh \
-       $(top_srcdir)/scripts/zpios-profile/zpios-profile.sh
diff --git a/zfs/scripts/zpios-profile/Makefile.in b/zfs/scripts/zpios-profile/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/scripts/zpios-profile/zpios-profile-disk.sh b/zfs/scripts/zpios-profile/zpios-profile-disk.sh
deleted file mode 100755 (executable)
index b56ee1e..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-#
-# /proc/diskinfo <after skipping major/minor>
-# Field 1 -- device name
-# Field 2 -- # of reads issued
-# Field 3 -- # of reads merged
-# Field 4 -- # of sectors read
-# Field 5 -- # of milliseconds spent reading
-# Field 6 -- # of writes completed
-# Field 7 -- # of writes merged
-# Field 8 -- # of sectors written
-# Field 9 -- # of milliseconds spent writing
-# Field 10 -- # of I/Os currently in progress
-# Field 11 -- # of milliseconds spent doing I/Os
-# Field 12 -- weighted # of milliseconds spent doing I/Os
-
-PROG=zpios-profile-disk.sh
-
-RUN_PIDS=${0}
-RUN_LOG_DIR=${1}
-RUN_ID=${2}
-
-create_table() {
-       local FIELD=$1
-       local ROW_M=()
-       local ROW_N=()
-       local HEADER=1
-       local STEP=1
-
-       for DISK_FILE in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/disk-[0-9]*`; do
-               ROW_M=( ${ROW_N[@]} )
-               ROW_N=( `cat ${DISK_FILE} | grep sd | cut -c11- | cut -f${FIELD} -d' ' | tr "\n" "\t"` )
-
-               if [ $HEADER -eq 1 ]; then
-                       echo -n "step, "
-                       cat ${DISK_FILE} | grep sd | cut -c11- | cut -f1 -d' ' | tr "\n" ", "
-                       echo "total"
-                       HEADER=0
-               fi
-
-               if [ ${#ROW_M[@]} -eq 0 ]; then
-                       continue
-               fi
-
-               if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
-                       echo "Badly formatted profile data in ${DISK_FILE}"
-                       break
-               fi
-
-               TOTAL=0
-               echo -n "${STEP}, "
-               for (( i=0; i<${#ROW_N[@]}; i++ )); do
-                       DELTA=`echo "${ROW_N[${i}]}-${ROW_M[${i}]}" | bc`
-                       let TOTAL=${TOTAL}+${DELTA}
-                       echo -n "${DELTA}, "
-               done
-               echo "${TOTAL}, "
-
-               let STEP=${STEP}+1
-       done
-}
-
-create_table_mbs() {
-       local FIELD=$1
-       local TIME=$2
-       local ROW_M=()
-       local ROW_N=()
-       local HEADER=1
-       local STEP=1
-
-       for DISK_FILE in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/disk-[0-9]*`; do
-               ROW_M=( ${ROW_N[@]} )
-               ROW_N=( `cat ${DISK_FILE} | grep sd | cut -c11- | cut -f${FIELD} -d' ' | tr "\n" "\t"` )
-
-               if [ $HEADER -eq 1 ]; then
-                       echo -n "step, "
-                       cat ${DISK_FILE} | grep sd | cut -c11- | cut -f1 -d' ' | tr "\n" ", "
-                       echo "total"
-                       HEADER=0
-               fi
-
-               if [ ${#ROW_M[@]} -eq 0 ]; then
-                       continue
-               fi
-
-               if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
-                       echo "Badly formatted profile data in ${DISK_FILE}"
-                       break
-               fi
-
-               TOTAL=0
-               echo -n "${STEP}, "
-               for (( i=0; i<${#ROW_N[@]}; i++ )); do
-                       DELTA=`echo "${ROW_N[${i}]}-${ROW_M[${i}]}" | bc`
-                       MBS=`echo "scale=2; ((${DELTA}*512)/${TIME})/(1024*1024)" | bc`
-                       TOTAL=`echo "scale=2; ${TOTAL}+${MBS}" | bc`
-                       echo -n "${MBS}, "
-               done
-               echo "${TOTAL}, "
-
-               let STEP=${STEP}+1
-       done
-}
-
-echo
-echo "Reads issued per device"
-create_table 2
-echo
-echo "Reads merged per device"
-create_table 3
-echo
-echo "Sectors read per device"
-create_table 4
-echo "MB/s per device"
-create_table_mbs 4 3
-
-echo
-echo "Writes issued per device"
-create_table 6
-echo
-echo "Writes merged per device"
-create_table 7
-echo
-echo "Sectors written per device"
-create_table 8
-echo "MB/s per device"
-create_table_mbs 8 3
-
-exit 0
diff --git a/zfs/scripts/zpios-profile/zpios-profile-pids.sh b/zfs/scripts/zpios-profile/zpios-profile-pids.sh
deleted file mode 100755 (executable)
index 3514b38..0000000
+++ /dev/null
@@ -1,131 +0,0 @@
-#!/bin/bash
-
-PROG=zpios-profile-pids.sh
-
-RUN_PIDS=${0}
-RUN_LOG_DIR=${1}
-RUN_ID=${2}
-
-ROW_M=()
-ROW_N=()
-ROW_N_SCHED=()
-ROW_N_WAIT=()
-
-HEADER=1
-STEP=1
-
-for PID_FILE in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/pids-[0-9]*`; do
-       ROW_M=( ${ROW_N[@]} )
-       ROW_N=( 0 0 0 0  0 0 0 0  0 0 0 0  0 0 0 0  0 0 0 )
-       ROW_N_SCHED=( `cat ${PID_FILE} | cut -f15 -d' ' | tr "\n" "\t"` )
-       ROW_N_WAIT=(  `cat ${PID_FILE} | cut -f17 -d' ' | tr "\n" "\t"` )
-       ROW_N_NAMES=( `cat ${PID_FILE} | cut -f2  -d' ' | cut -f2 -d'(' | 
-                       cut -f1 -d')'   | cut -f1  -d'/' | tr "\n" "\t"` )
-
-       for (( i=0; i<${#ROW_N_SCHED[@]}; i++ )); do
-               SUM=`echo "${ROW_N_WAIT[${i}]}+${ROW_N_SCHED[${i}]}" | bc`
-
-               case ${ROW_N_NAMES[${i}]} in
-                       zio_taskq)      IDX=0;;
-                       zio_req_nul)    IDX=1;;
-                       zio_irq_nul)    IDX=2;;
-                       zio_req_rd)     IDX=3;;
-                       zio_irq_rd)     IDX=4;;
-                       zio_req_wr)     IDX=5;;
-                       zio_irq_wr)     IDX=6;;
-                       zio_req_fr)     IDX=7;;
-                       zio_irq_fr)     IDX=8;;
-                       zio_req_cm)     IDX=9;;
-                       zio_irq_cm)     IDX=10;;
-                       zio_req_ctl)    IDX=11;;
-                       zio_irq_ctl)    IDX=12;;
-                       txg_quiesce)    IDX=13;;
-                       txg_sync)       IDX=14;;
-                       txg_timelimit)  IDX=15;;
-                       arc_reclaim)    IDX=16;;
-                       l2arc_feed)     IDX=17;;
-                       zpios_io)       IDX=18;;
-                       *)              continue;;
-               esac
-
-               let ROW_N[${IDX}]=${ROW_N[${IDX}]}+${SUM}
-       done
-
-       if [ $HEADER -eq 1 ]; then
-               echo "step, zio_taskq, zio_req_nul, zio_irq_nul, "        \
-                     "zio_req_rd, zio_irq_rd, zio_req_wr, zio_irq_wr, "   \
-                     "zio_req_fr, zio_irq_fr, zio_req_cm, zio_irq_cm, "   \
-                     "zio_req_ctl, zio_irq_ctl, txg_quiesce, txg_sync, "  \
-                     "txg_timelimit, arc_reclaim, l2arc_feed, zpios_io, " \
-                    "idle"
-               HEADER=0
-       fi
-
-       if [ ${#ROW_M[@]} -eq 0 ]; then
-               continue
-       fi
-
-       if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
-               echo "Badly formatted profile data in ${PID_FILE}"
-               break
-       fi
-
-       # Original values are in jiffies and we expect HZ to be 1000
-       # on most 2.6 systems thus we divide by 10 to get a percentage.
-       IDLE=1000
-        echo -n "${STEP}, "
-       for (( i=0; i<${#ROW_N[@]}; i++ )); do
-               DELTA=`echo "${ROW_N[${i}]}-${ROW_M[${i}]}" | bc`
-               DELTA_PERCENT=`echo "scale=1; ${DELTA}/10" | bc`
-               let IDLE=${IDLE}-${DELTA}
-               echo -n "${DELTA_PERCENT}, "
-       done
-       ILDE_PERCENT=`echo "scale=1; ${IDLE}/10" | bc`
-       echo "${ILDE_PERCENT}"
-
-       let STEP=${STEP}+1
-done
-
-exit
-
-echo
-echo "Percent of total system time per pid"
-for PID_FILE in `ls -r --sort=time --time=ctime ${RUN_LOG_DIR}/${RUN_ID}/pids-[0-9]*`; do
-       ROW_M=( ${ROW_N[@]} )
-       ROW_N_SCHED=( `cat ${PID_FILE} | cut -f15 -d' ' | tr "\n" "\t"` )
-       ROW_N_WAIT=( `cat ${PID_FILE} | cut -f17 -d' ' | tr "\n" "\t"` )
-
-       for (( i=0; i<${#ROW_N_SCHED[@]}; i++ )); do
-               ROW_N[${i}]=`echo "${ROW_N_WAIT[${i}]}+${ROW_N_SCHED[${i}]}" | bc`
-       done
-
-       if [ $HEADER -eq 1 ]; then
-               echo -n "step, "
-               cat ${PID_FILE} | cut -f2 -d' ' | tr "\n" ", "
-               echo
-               HEADER=0
-       fi
-
-       if [ ${#ROW_M[@]} -eq 0 ]; then
-               continue
-       fi
-
-       if [ ${#ROW_M[@]} -ne ${#ROW_N[@]} ]; then
-               echo "Badly formatted profile data in ${PID_FILE}"
-               break
-       fi
-
-       # Original values are in jiffies and we expect HZ to be 1000
-       # on most 2.6 systems thus we divide by 10 to get a percentage.
-        echo -n "${STEP}, "
-       for (( i=0; i<${#ROW_N[@]}; i++ )); do
-               DELTA=`echo "scale=1; (${ROW_N[${i}]}-${ROW_M[${i}]})/10" | bc`
-               echo -n "${DELTA}, "
-       done
-
-       echo
-       let STEP=${STEP}+1
-done
-
-
-exit 0
diff --git a/zfs/scripts/zpios-profile/zpios-profile-post.sh b/zfs/scripts/zpios-profile/zpios-profile-post.sh
deleted file mode 100755 (executable)
index 3a454ba..0000000
+++ /dev/null
@@ -1,129 +0,0 @@
-#!/bin/bash
-
-PROG=zpios-profile-post.sh
-
-RUN_POST=${0}
-RUN_PHASE=${1}
-RUN_DIR=${2}
-RUN_ID=${3}
-RUN_POOL=${4}
-RUN_CHUNK_SIZE=${5}
-RUN_REGION_SIZE=${6}
-RUN_THRD_COUNT=${7}
-RUN_REGION_COUNT=${8}
-RUN_OFFSET=${9}
-RUN_REGION_NOISE=${10}
-RUN_CHUNK_NOISE=${11}
-RUN_THRD_DELAY=${12}
-RUN_FLAGS=${13}
-RUN_RESULT=${14}
-
-# Summarize system time per process
-zpios_profile_post_pids() {
-       ${PROFILE_PIDS} ${PROFILE_RUN_CR_PIDS_LOG} >${PROFILE_RUN_CR_PIDS_CSV}
-       ${PROFILE_PIDS} ${PROFILE_RUN_WR_PIDS_LOG} >${PROFILE_RUN_WR_PIDS_CSV}
-       ${PROFILE_PIDS} ${PROFILE_RUN_RD_PIDS_LOG} >${PROFILE_RUN_RD_PIDS_CSV}
-       ${PROFILE_PIDS} ${PROFILE_RUN_RM_PIDS_LOG} >${PROFILE_RUN_RM_PIDS_CSV}
-}
-
-zpios_profile_post_disk() {
-       ${PROFILE_DISK} ${PROFILE_RUN_CR_DISK_LOG} >${PROFILE_RUN_CR_DISK_CSV}
-       ${PROFILE_DISK} ${PROFILE_RUN_WR_DISK_LOG} >${PROFILE_RUN_WR_DISK_CSV}
-       ${PROFILE_DISK} ${PROFILE_RUN_RD_DISK_LOG} >${PROFILE_RUN_RD_DISK_CSV}
-       ${PROFILE_DISK} ${PROFILE_RUN_RM_DISK_LOG} >${PROFILE_RUN_RM_DISK_CSV}
-}
-
-# Summarize per device performance
-
-# Stop a user defined profiling script which is gathering additional data
-zpios_profile_post_stop() {
-       local PROFILE_PID=$1
-
-       kill -s SIGHUP `cat ${PROFILE_PID}`
-
-
-       # Sleep waiting for profile script to exit
-       while [ -f ${PROFILE_PID} ]; do
-               sleep 0.01
-       done
-}
-
-zpios_profile_post_proc_stop() {
-       local PROC_DIR=$1
-
-       if [ -f ${PROFILE_ARC_PROC} ]; then
-               cat ${PROFILE_ARC_PROC} >${PROC_DIR}/arcstats.txt
-       fi
-
-       if [ -f ${PROFILE_VDEV_CACHE_PROC} ]; then
-               cat ${PROFILE_VDEV_CACHE_PROC} >${PROC_DIR}/vdev_cache_stats.txt
-       fi
-}
-
-zpios_profile_post_oprofile_stop() {
-       local OPROFILE_LOG=$1
-       local OPROFILE_ARGS="-a -g -l -p ${OPROFILE_KERNEL_DIR},${OPROFILE_SPL_DIR},${OPROFILE_ZFS_DIR}"
-
-       /usr/bin/opcontrol --stop >>${OPROFILE_LOG} 2>&1
-       /usr/bin/opcontrol --dump >>${OPROFILE_LOG} 2>&1
-       /usr/bin/opreport ${OPROFILE_ARGS} >${OPROFILE_LOG} 2>&1
-       /usr/bin/oparchive
-}
-
-zpios_profile_post_create() {
-       zpios_profile_post_oprofile_stop ${PROFILE_RUN_CR_OPROFILE_LOG}
-       zpios_profile_post_proc_stop ${PROFILE_RUN_CR_DIR}
-       zpios_profile_post_stop ${PROFILE_RUN_CR_PID}
-}
-
-zpios_profile_post_write() {
-       zpios_profile_post_oprofile_stop ${PROFILE_RUN_WR_OPROFILE_LOG}
-       zpios_profile_post_proc_stop ${PROFILE_RUN_WR_DIR}
-       zpios_profile_post_stop ${PROFILE_RUN_WR_PID}
-}
-
-zpios_profile_post_read() {
-       zpios_profile_post_oprofile_stop ${PROFILE_RUN_CR_RD_LOG}
-       zpios_profile_post_proc_stop ${PROFILE_RUN_RD_DIR}
-       zpios_profile_post_stop ${PROFILE_RUN_RD_PID}
-}
-
-zpios_profile_post_remove() {
-       zpios_profile_post_oprofile_stop ${PROFILE_RUN_RM_OPROFILE_LOG}
-       zpios_profile_post_proc_stop ${PROFILE_RUN_RM_DIR}
-       zpios_profile_post_stop ${PROFILE_RUN_RM_PID}
-}
-
-# Source global zpios test configuration
-if [ -f ${RUN_DIR}/zpios-config.sh ]; then
-       . ${RUN_DIR}/zpios-config.sh
-fi
-
-# Source global per-run test configuration
-if [ -f ${RUN_DIR}/${RUN_ID}/zpios-config-run.sh ]; then
-       . ${RUN_DIR}/${RUN_ID}/zpios-config-run.sh
-fi
-
-case "${RUN_PHASE}" in
-       post-run)
-               zpios_profile_post_pids
-               zpios_profile_post_disk
-               ;;
-       post-create)
-               zpios_profile_post_create
-               ;;
-       post-write)
-               zpios_profile_post_write
-               ;;
-       post-read)
-               zpios_profile_post_read
-               ;;
-       post-remove)
-               zpios_profile_post_remove
-               ;;
-       *)
-               echo "Usage: ${PROG} {post-run|post-create|post-write|post-read|post-remove}"
-               exit 1
-esac
-
-exit 0
diff --git a/zfs/scripts/zpios-profile/zpios-profile-pre.sh b/zfs/scripts/zpios-profile/zpios-profile-pre.sh
deleted file mode 100755 (executable)
index a2a8857..0000000
+++ /dev/null
@@ -1,184 +0,0 @@
-#!/bin/bash
-
-PROG=zpios-profile-pre.sh
-
-PROFILE_RDY=0
-trap "PROFILE_RDY=1" SIGHUP
-
-RUN_PRE=${0}
-RUN_PHASE=${1}
-RUN_DIR=${2}
-RUN_ID=${3}
-RUN_POOL=${4}
-RUN_CHUNK_SIZE=${5}
-RUN_REGION_SIZE=${6}
-RUN_THRD_COUNT=${7}
-RUN_REGION_COUNT=${8}
-RUN_OFFSET=${9}
-RUN_REGION_NOISE=${10}
-RUN_CHUNK_NOISE=${11}
-RUN_THRD_DELAY=${12}
-RUN_FLAGS=${13}
-RUN_RESULT=${14}
-
-zpios_profile_pre_run_cfg() {
-cat > ${RUN_DIR}/${RUN_ID}/zpios-config-run.sh << EOF
-#
-# Zpios Profiling Configuration for Run ${RUN_ID}
-#
-
-PROFILE_RUN_DIR=${RUN_DIR}/${RUN_ID}
-
-PROFILE_RUN_CR_DIR=${RUN_DIR}/${RUN_ID}/create
-PROFILE_RUN_CR_PID=${RUN_DIR}/${RUN_ID}/create/profile.pid
-PROFILE_RUN_CR_OPROFILE_LOG=${RUN_DIR}/${RUN_ID}/create/oprofile.txt
-PROFILE_RUN_CR_PIDS_LOG=${RUN_DIR}/${RUN_ID}/create/pids.txt
-PROFILE_RUN_CR_PIDS_CSV=${RUN_DIR}/${RUN_ID}/create/pids.csv
-PROFILE_RUN_CR_DISK_LOG=${RUN_DIR}/${RUN_ID}/create/disk.txt
-PROFILE_RUN_CR_DISK_CSV=${RUN_DIR}/${RUN_ID}/create/disk.csv
-
-PROFILE_RUN_WR_DIR=${RUN_DIR}/${RUN_ID}/write
-PROFILE_RUN_WR_PID=${RUN_DIR}/${RUN_ID}/write/profile.pid
-PROFILE_RUN_WR_OPROFILE_LOG=${RUN_DIR}/${RUN_ID}/write/oprofile.txt
-PROFILE_RUN_WR_PIDS_LOG=${RUN_DIR}/${RUN_ID}/write/pids.txt
-PROFILE_RUN_WR_PIDS_CSV=${RUN_DIR}/${RUN_ID}/write/pids.csv
-PROFILE_RUN_WR_DISK_LOG=${RUN_DIR}/${RUN_ID}/write/disk.txt
-PROFILE_RUN_WR_DISK_CSV=${RUN_DIR}/${RUN_ID}/write/disk.csv
-
-PROFILE_RUN_RD_DIR=${RUN_DIR}/${RUN_ID}/read
-PROFILE_RUN_RD_PID=${RUN_DIR}/${RUN_ID}/read/profile.pid
-PROFILE_RUN_RD_OPROFILE_LOG=${RUN_DIR}/${RUN_ID}/read/oprofile.txt
-PROFILE_RUN_RD_PIDS_LOG=${RUN_DIR}/${RUN_ID}/read/pids.txt
-PROFILE_RUN_RD_PIDS_CSV=${RUN_DIR}/${RUN_ID}/read/pids.csv
-PROFILE_RUN_RD_DISK_LOG=${RUN_DIR}/${RUN_ID}/read/disk.txt
-PROFILE_RUN_RD_DISK_CSV=${RUN_DIR}/${RUN_ID}/read/disk.csv
-
-PROFILE_RUN_RM_DIR=${RUN_DIR}/${RUN_ID}/remove
-PROFILE_RUN_RM_PID=${RUN_DIR}/${RUN_ID}/remove/profile.pid
-PROFILE_RUN_RM_OPROFILE_LOG=${RUN_DIR}/${RUN_ID}/remove/oprofile.txt
-PROFILE_RUN_RM_PIDS_LOG=${RUN_DIR}/${RUN_ID}/remove/pids.txt
-PROFILE_RUN_RM_PIDS_CSV=${RUN_DIR}/${RUN_ID}/remove/pids.csv
-PROFILE_RUN_RM_DISK_LOG=${RUN_DIR}/${RUN_ID}/remove/disk.txt
-PROFILE_RUN_RM_DISK_CSV=${RUN_DIR}/${RUN_ID}/remove/disk.csv
-
-# PROFILE_PIDS_LOG=${RUN_DIR}/${RUN_ID}/pids-summary.csv
-# PROFILE_DISK_LOG=${RUN_DIR}/${RUN_ID}/disk-summary.csv
-EOF
-}
-
-zpios_profile_pre_run_args() {
-cat > ${RUN_DIR}/${RUN_ID}/zpios-args.txt << EOF
-#
-# Zpios Arguments for Run ${RUN_ID}
-#
-
-DIR=${RUN_DIR}
-ID=${RUN_ID}
-POOL=${RUN_POOL}
-CHUNK_SIZE=${RUN_CHUNK_SIZE}
-REGION_SIZE=${RUN_REGION_SIZE}
-THRD_COUNT=${RUN_THRD_COUNT}
-REGION_COUNT=${RUN_REGION_COUNT}
-OFFSET=${RUN_OFFSET}
-REGION_NOISE=${RUN_REGION_NOISE}
-CHUNK_NOISE=${RUN_CHUNK_NOISE}
-THRD_DELAY=${RUN_THRD_DELAY}
-FLAGS=${RUN_FLAGS}
-RESULT=${RUN_RESULT}
-EOF
-}
-
-# Spawn a user defined profiling script to gather additional data
-zpios_profile_pre_start() {
-       local PROFILE_PID=$1
-
-       ${PROFILE_USER} ${RUN_PHASE} ${RUN_DIR} ${RUN_ID} &
-       echo "$!" >${PROFILE_PID}
-
-       # Sleep waiting for profile script to be ready, it will
-       # signal us via SIGHUP when it is ready to start profiling.
-       while [ ${PROFILE_RDY} -eq 0 ]; do
-               sleep 0.01
-       done
-}
-
-zpios_profile_post_proc_start() { 
-
-        if [ -f ${PROFILE_ARC_PROC} ]; then
-                echo 0 >${PROFILE_ARC_PROC}
-        fi
-
-        if [ -f ${PROFILE_VDEV_CACHE_PROC} ]; then
-                echo 0 >${PROFILE_VDEV_CACHE_PROC}
-        fi
-}
-
-zpios_profile_pre_oprofile_start() {
-       local OPROFILE_LOG=$1
-
-       /usr/bin/opcontrol --reset >>${OPROFILE_LOG} 2>&1
-       /usr/bin/opcontrol --start >>${OPROFILE_LOG} 2>&1
-}
-
-zpios_profile_pre_create() {
-       mkdir ${PROFILE_RUN_CR_DIR}
-       zpios_profile_pre_start ${PROFILE_RUN_CR_PID}
-       zpios_profile_post_proc_start
-       zpios_profile_pre_oprofile_start ${PROFILE_RUN_CR_OPROFILE_LOG}
-}
-
-zpios_profile_pre_write() {
-       mkdir ${PROFILE_RUN_WR_DIR}
-       zpios_profile_pre_start ${PROFILE_RUN_WR_PID}
-       zpios_profile_post_proc_start
-       zpios_profile_pre_oprofile_start ${PROFILE_RUN_WR_OPROFILE_LOG}
-}
-
-zpios_profile_pre_read() {
-       mkdir ${PROFILE_RUN_RD_DIR}
-       zpios_profile_pre_start ${PROFILE_RUN_RD_PID}
-       zpios_profile_post_proc_start
-       zpios_profile_pre_oprofile_start ${PROFILE_RUN_CR_RD_LOG}
-}
-
-zpios_profile_pre_remove() {
-       mkdir ${PROFILE_RUN_RM_DIR}
-       zpios_profile_pre_start ${PROFILE_RUN_RM_PID}
-       zpios_profile_post_proc_start
-       zpios_profile_pre_oprofile_start ${PROFILE_RUN_RM_OPROFILE_LOG}
-}
-
-# Source global zpios test configuration
-if [ -f ${RUN_DIR}/zpios-config.sh ]; then
-       . ${RUN_DIR}/zpios-config.sh
-fi
-
-# Source global per-run test configuration
-if [ -f ${RUN_DIR}/${RUN_ID}/zpios-config-run.sh ]; then
-       . ${RUN_DIR}/${RUN_ID}/zpios-config-run.sh
-fi
-
-case "${RUN_PHASE}" in
-       pre-run)
-               mkdir -p ${RUN_DIR}/${RUN_ID}/
-               zpios_profile_pre_run_cfg
-               zpios_profile_pre_run_args
-               ;;
-       pre-create)
-               zpios_profile_pre_create
-               ;;
-       pre-write)
-               zpios_profile_pre_write
-               ;;
-       pre-read)
-               zpios_profile_pre_read
-               ;;
-       pre-remove)
-               zpios_profile_pre_remove
-               ;;
-       *)
-               echo "Usage: ${PROG} {pre-run|pre-create|pre-write|pre-read|pre-remove}"
-               exit 1
-esac
-
-exit 0
diff --git a/zfs/scripts/zpios-profile/zpios-profile.sh b/zfs/scripts/zpios-profile/zpios-profile.sh
deleted file mode 100755 (executable)
index f4f0ee9..0000000
+++ /dev/null
@@ -1,226 +0,0 @@
-#!/bin/bash
-
-
-PROG=zpios-profile.sh
-
-trap "RUN_DONE=1" SIGHUP
-
-RUN_PHASE=${1}
-RUN_LOG_DIR=${2}
-RUN_ID=${3}
-RUN_DONE=0
-
-POLL_INTERVAL=2.99
-
-# Log these pids, the exact pid numbers will vary from system to system
-# so I harvest pid for all the following type of processes from /proc/<pid>/
-#
-# zio_taskq/#
-# spa_zio_issue/#
-# spa_zio_intr/#
-# txg_quiesce_thr
-# txg_sync_thread
-# txg_timelimit_t
-# arc_reclaim_thr
-# l2arc_feed_thre
-# zpios_io/#
-
-ZIO_TASKQ_PIDS=()
-ZIO_REQ_NUL_PIDS=() 
-ZIO_IRQ_NUL_PIDS=() 
-ZIO_REQ_RD_PIDS=() 
-ZIO_IRQ_RD_PIDS=() 
-ZIO_REQ_WR_PIDS=() 
-ZIO_IRQ_WR_PIDS=()
-ZIO_REQ_FR_PIDS=() 
-ZIO_IRQ_FR_PIDS=()
-ZIO_REQ_CM_PIDS=() 
-ZIO_IRQ_CM_PIDS=()
-ZIO_REQ_CTL_PIDS=() 
-ZIO_IRQ_CTL_PIDS=()
-
-TXG_QUIESCE_PIDS=()
-TXG_SYNC_PIDS=() 
-TXG_TIMELIMIT_PIDS=()
-
-ARC_RECLAIM_PIDS=()
-L2ARC_FEED_PIDS=()
-
-ZPIOS_IO_PIDS=()
-
-show_pids() {
-       echo "* zio_taskq:     { ${ZIO_TASKQ_PIDS[@]} } = ${#ZIO_TASKQ_PIDS[@]}"
-       echo "* zio_req_nul:   { ${ZIO_REQ_NUL_PIDS[@]} } = ${#ZIO_REQ_NUL_PIDS[@]}"
-       echo "* zio_irq_nul:   { ${ZIO_IRQ_NUL_PIDS[@]} } = ${#ZIO_IRQ_NUL_PIDS[@]}"
-       echo "* zio_req_rd:    { ${ZIO_REQ_RD_PIDS[@]} } = ${#ZIO_REQ_RD_PIDS[@]}"
-       echo "* zio_irq_rd:    { ${ZIO_IRQ_RD_PIDS[@]} } = ${#ZIO_IRQ_RD_PIDS[@]}"
-       echo "* zio_req_wr:    { ${ZIO_REQ_WR_PIDS[@]} } = ${#ZIO_REQ_WR_PIDS[@]}"
-       echo "* zio_irq_wr:    { ${ZIO_IRQ_WR_PIDS[@]} } = ${#ZIO_IRQ_WR_PIDS[@]}"
-       echo "* zio_req_fr:    { ${ZIO_REQ_FR_PIDS[@]} } = ${#ZIO_REQ_FR_PIDS[@]}"
-       echo "* zio_irq_fr:    { ${ZIO_IRQ_FR_PIDS[@]} } = ${#ZIO_IRQ_FR_PIDS[@]}"
-       echo "* zio_req_cm:    { ${ZIO_REQ_CM_PIDS[@]} } = ${#ZIO_REQ_CM_PIDS[@]}"
-       echo "* zio_irq_cm:    { ${ZIO_IRQ_CM_PIDS[@]} } = ${#ZIO_IRQ_CM_PIDS[@]}"
-       echo "* zio_req_ctl:   { ${ZIO_REQ_CTL_PIDS[@]} } = ${#ZIO_REQ_CTL_PIDS[@]}"
-       echo "* zio_irq_ctl:   { ${ZIO_IRQ_CTL_PIDS[@]} } = ${#ZIO_IRQ_CTL_PIDS[@]}"
-       echo "* txg_quiesce:   { ${TXG_QUIESCE_PIDS[@]} } = ${#TXG_QUIESCE_PIDS[@]}"
-       echo "* txg_sync:      { ${TXG_SYNC_PIDS[@]} } = ${#TXG_SYNC_PIDS[@]}"
-       echo "* txg_timelimit: { ${TXG_TIMELIMIT_PIDS[@]} } = ${#TXG_TIMELIMIT_PIDS[@]}"
-       echo "* arc_reclaim:   { ${ARC_RECLAIM_PIDS[@]} } = ${#ARC_RECLAIM_PIDS[@]}"
-       echo "* l2arc_feed:    { ${L2ARC_FEED_PIDS[@]} } = ${#L2ARC_FEED_PIDS[@]}"
-       echo "* zpios_io:      { ${ZPIOS_IO_PIDS[@]} } = ${#ZPIOS_IO_PIDS[@]}"
-}
-
-check_pid() {
-       local PID=$1
-       local NAME=$2
-       local TYPE=$3
-       local PIDS=( "$4" )
-        local NAME_STRING=`echo ${NAME} | cut -f1 -d'/'`
-        local NAME_NUMBER=`echo ${NAME} | cut -f2 -d'/'`
-
-       if [ "${NAME_STRING}" == "${TYPE}" ]; then
-               if [ -n "${NAME_NUMBER}" ]; then
-                       PIDS[${NAME_NUMBER}]=${PID}
-               else
-                       PIDS[${#PIDS[@]}]=${PID}
-
-               fi
-       fi
-
-       echo "${PIDS[@]}"
-}
-
-# NOTE: This whole process is crazy slow but it will do for now
-aquire_pids() {
-       echo "--- Aquiring ZFS pids ---"
-
-       for PID in `ls /proc/ | grep [0-9] | sort -n -u`; do
-               if [ ! -e /proc/${PID}/status ]; then
-                       continue
-               fi
-
-               NAME=`cat /proc/${PID}/status  | head -n1 | cut -f2`
-
-               ZIO_TASKQ_PIDS=( `check_pid ${PID} ${NAME} "zio_taskq" \
-                                "$(echo "${ZIO_TASKQ_PIDS[@]}")"` )
-
-               ZIO_REQ_NUL_PIDS=( `check_pid ${PID} ${NAME} "zio_req_nul" \
-                                  "$(echo "${ZIO_REQ_NUL_PIDS[@]}")"` )
-
-               ZIO_IRQ_NUL_PIDS=( `check_pid ${PID} ${NAME} "zio_irq_nul" \
-                                  "$(echo "${ZIO_IRQ_NUL_PIDS[@]}")"` )
-
-               ZIO_REQ_RD_PIDS=( `check_pid ${PID} ${NAME} "zio_req_rd" \
-                                  "$(echo "${ZIO_REQ_RD_PIDS[@]}")"` )
-
-               ZIO_IRQ_RD_PIDS=( `check_pid ${PID} ${NAME} "zio_irq_rd" \
-                                  "$(echo "${ZIO_IRQ_RD_PIDS[@]}")"` )
-
-               ZIO_REQ_WR_PIDS=( `check_pid ${PID} ${NAME} "zio_req_wr" \
-                                  "$(echo "${ZIO_REQ_WR_PIDS[@]}")"` )
-
-               ZIO_IRQ_WR_PIDS=( `check_pid ${PID} ${NAME} "zio_irq_wr" \
-                                  "$(echo "${ZIO_IRQ_WR_PIDS[@]}")"` )
-
-               ZIO_REQ_FR_PIDS=( `check_pid ${PID} ${NAME} "zio_req_fr" \
-                                  "$(echo "${ZIO_REQ_FR_PIDS[@]}")"` )
-
-               ZIO_IRQ_FR_PIDS=( `check_pid ${PID} ${NAME} "zio_irq_fr" \
-                                  "$(echo "${ZIO_IRQ_FR_PIDS[@]}")"` )
-
-               ZIO_REQ_CM_PIDS=( `check_pid ${PID} ${NAME} "zio_req_cm" \
-                                  "$(echo "${ZIO_REQ_CM_PIDS[@]}")"` )
-
-               ZIO_IRQ_CM_PIDS=( `check_pid ${PID} ${NAME} "zio_irq_cm" \
-                                  "$(echo "${ZIO_IRQ_CM_PIDS[@]}")"` )
-
-               ZIO_REQ_CTL_PIDS=( `check_pid ${PID} ${NAME} "zio_req_ctl" \
-                                  "$(echo "${ZIO_REQ_CTL_PIDS[@]}")"` )
-
-               ZIO_IRQ_CTL_PIDS=( `check_pid ${PID} ${NAME} "zio_irq_ctl" \
-                                  "$(echo "${ZIO_IRQ_CTL_PIDS[@]}")"` )
-
-               TXG_QUIESCE_PIDS=( `check_pid ${PID} ${NAME} "txg_quiesce" \
-                                  "$(echo "${TXG_QUIESCE_PIDS[@]}")"` )
-
-               TXG_SYNC_PIDS=( `check_pid ${PID} ${NAME} "txg_sync" \
-                               "$(echo "${TXG_SYNC_PIDS[@]}")"` )
-
-               TXG_TIMELIMIT_PIDS=( `check_pid ${PID} ${NAME} "txg_timelimit" \
-                                    "$(echo "${TXG_TIMELIMIT_PIDS[@]}")"` )
-
-               ARC_RECLAIM_PIDS=( `check_pid ${PID} ${NAME} "arc_reclaim" \
-                                     "$(echo "${ARC_RECLAIM_PIDS[@]}")"` )
-
-               L2ARC_FEED_PIDS=( `check_pid ${PID} ${NAME} "l2arc_feed" \
-                                  "$(echo "${L2ARC_FEED_PIDS[@]}")"` )
-       done
-
-       # Wait for zpios_io threads to start
-       kill -s SIGHUP ${PPID}
-       echo "* Waiting for zpios_io threads to start"
-       while [ ${RUN_DONE} -eq 0 ]; do
-               ZPIOS_IO_PIDS=( `ps ax | grep zpios_io | grep -v grep | \
-                                 sed 's/^ *//g' | cut -f1 -d' '` )
-               if [ ${#ZPIOS_IO_PIDS[@]} -gt 0 ]; then
-                       break;
-               fi
-               sleep 0.1
-       done
-
-       echo "`show_pids`" >${RUN_LOG_DIR}/${RUN_ID}/pids.txt
-}
-
-log_pids() {
-       echo "--- Logging ZFS profile to ${RUN_LOG_DIR}/${RUN_ID}/ ---"
-       ALL_PIDS=( ${ZIO_TASKQ_PIDS[@]}     \
-                   ${ZIO_REQ_NUL_PIDS[@]}   \
-                   ${ZIO_IRQ_NUL_PIDS[@]}   \
-                   ${ZIO_REQ_RD_PID[@]}     \
-                   ${ZIO_IRQ_RD_PIDS[@]}    \
-                   ${ZIO_REQ_WR_PIDS[@]}    \
-                   ${ZIO_IRQ_WR_PIDS[@]}    \
-                   ${ZIO_REQ_FR_PIDS[@]}    \ 
-                   ${ZIO_IRQ_FR_PIDS[@]}    \
-                   ${ZIO_REQ_CM_PIDS[@]}    \ 
-                   ${ZIO_IRQ_CM_PIDS[@]}    \
-                   ${ZIO_REQ_CTL_PIDS[@]}   \
-                   ${ZIO_IRQ_CTL_PIDS[@]}   \
-                   ${TXG_QUIESCE_PIDS[@]}   \
-                   ${TXG_SYNC_PIDS[@]}      \
-                   ${TXG_TIMELIMIT_PIDS[@]} \
-                   ${ARC_RECLAIM_PIDS[@]}   \
-                   ${L2ARC_FEED_PIDS[@]}    \
-                   ${ZPIOS_IO_PIDS[@]} )
-
-       while [ ${RUN_DONE} -eq 0 ]; do
-               NOW=`date +%s.%N`
-               LOG_PIDS="${RUN_LOG_DIR}/${RUN_ID}/pids-${NOW}"
-               LOG_DISK="${RUN_LOG_DIR}/${RUN_ID}/disk-${NOW}"
-
-               for PID in "${ALL_PIDS[@]}"; do
-                       if [ -z ${PID} ]; then
-                               continue;
-                       fi
-
-                       if [ -e /proc/${PID}/stat ]; then
-                               cat /proc/${PID}/stat | head -n1 >>${LOG_PIDS}
-                       else
-                               echo "<${PID} exited>" >>${LOG_PIDS}
-                       fi
-               done
-
-               cat /proc/diskstats >${LOG_DISK}
-
-               NOW2=`date +%s.%N`
-               DELTA=`echo "${POLL_INTERVAL}-(${NOW2}-${NOW})" | bc`
-               sleep ${DELTA}
-       done
-}
-
-aquire_pids
-log_pids
-
-# rm ${PROFILE_PID}
-
-exit 0
diff --git a/zfs/scripts/zpios-sanity.sh b/zfs/scripts/zpios-sanity.sh
deleted file mode 100755 (executable)
index 0f44115..0000000
+++ /dev/null
@@ -1,171 +0,0 @@
-#!/bin/bash
-#
-# ZFS/ZPOOL configuration test script.
-
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zpios-sanity.sh
-HEADER=
-FAILS=0
-
-usage() {
-cat << EOF
-USAGE:
-$0 [hvxfc]
-
-DESCRIPTION:
-        ZPIOS sanity tests
-
-OPTIONS:
-        -h      Show this message
-        -v      Verbose
-        -x      Destructive hd/sd/md/dm/ram tests
-       -f      Don't prompt due to -x
-       -c      Cleanup lo+file devices at start
-
-EOF
-}
-
-while getopts 'hvxfc?' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               ;;
-       x)
-               DANGEROUS=1
-               ;;
-       f)
-               FORCE=1
-               ;;
-       c)
-               CLEANUP=1
-               ;;
-       ?)
-               usage
-               exit
-               ;;
-       esac
-done
-
-if [ $(id -u) != 0 ]; then
-       die "Must run as root"
-fi
-
-# Initialize the test suite
-init
-
-# Perform pre-cleanup is requested
-if [ ${CLEANUP} ]; then
-       ${ZFS_SH} -u
-       cleanup_md_devices
-       cleanup_loop_devices
-       rm -f /tmp/zpool.cache.*
-fi
-
-zpios_test() {
-       CONFIG=$1
-       TEST=$2
-       LOG=`mktemp`
-
-       ${ZPIOS_SH} -f -c ${CONFIG} -t ${TEST} &>${LOG}
-       if [ $? -ne 0 ]; then
-               FAILS=1
-
-               if [ ${VERBOSE} ]; then
-                       printf "FAIL:     %-13s\n" ${CONFIG}
-                       cat ${LOG}
-               else
-                       if [ ! ${HEADER} ]; then
-                               head -2 ${LOG}
-                               HEADER=1
-                       fi
-
-                       printf "FAIL:     %-13s" ${CONFIG}
-                       tail -1 ${LOG}
-               fi
-       else
-               if [ ${VERBOSE} ]; then
-                       cat ${LOG}
-               else
-                       if [ ! ${HEADER} ]; then
-                               head -2 ${LOG}
-                               HEADER=1
-                       fi
-
-                       tail -1 ${LOG}
-               fi
-       fi
-
-       rm -f ${LOG}
-}
-
-if [ ${DANGEROUS} ] && [ ! ${FORCE} ]; then
-       cat << EOF
-The -x option was passed which will result in UNRECOVERABLE DATA LOSS
-on on the following block devices:
-
-  /dev/sd[abcd]
-  /dev/hda
-  /dev/ram0
-  /dev/md0
-  /dev/dm-0
-
-To continue please confirm by entering YES:
-EOF
-       read CONFIRM
-       if [ ${CONFIRM} != "YES" ] && [ ${CONFIRM} != "yes" ]; then
-               exit 0;
-       fi
-fi
-
-#
-# These configurations are all safe and pose no risk to any data on
-# the system which runs them.  They will confine all their IO to a
-# file in /tmp or a loopback device configured to use a file in /tmp.
-#
-SAFE_CONFIGS=(                                         \
-       file-raid0 file-raid10 file-raidz file-raidz2   \
-       lo-raid0 lo-raid10 lo-raidz lo-raidz2           \
-)
-
-#
-# These configurations are down right dangerous.  They will attempt
-# to use various real block devices on your system which may contain
-# data you car about.  You are STRONGLY advised not to run this unless
-# you are certain there is no data on the system you care about.
-#
-DANGEROUS_CONFIGS=(                                    \
-       hda-raid0                                       \
-       sda-raid0                                       \
-       ram0-raid0                                      \
-       md0-raid10 md0-raid5                            \
-       dm0-raid0                                       \
-)
-
-TMP_CACHE=`mktemp -p /tmp zpool.cache.XXXXXXXX`
-${ZFS_SH} zfs="spa_config_path=${TMP_CACHE}" || die "Unable to load modules"
-
-for CONFIG in ${SAFE_CONFIGS[*]}; do
-       zpios_test $CONFIG tiny
-done
-
-if [ ${DANGEROUS} ]; then
-       for CONFIG in ${DANGEROUS_CONFIGS[*]}; do
-               zpios_test $CONFIG tiny
-       done
-fi
-
-${ZFS_SH} -u
-
-exit $FAILS
diff --git a/zfs/scripts/zpios-survey.sh b/zfs/scripts/zpios-survey.sh
deleted file mode 100755 (executable)
index 7860169..0000000
+++ /dev/null
@@ -1,187 +0,0 @@
-#!/bin/bash
-#
-# Wrapper script for easily running a survey of zpios based tests
-#
-
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zpios-survey.sh
-
-usage() {
-cat << EOF
-USAGE:
-$0 [hvp] <-c config> <-t test>
-
-DESCRIPTION:
-        Helper script for easy zpios survey benchmarking.
-
-OPTIONS:
-        -h      Show this message
-        -v      Verbose
-        -p      Enable profiling
-        -c      Zpool configuration
-        -t      Zpios test
-        -l      Zpios survey log
-
-EOF
-}
-
-print_header() {
-tee -a ${ZPIOS_SURVEY_LOG} << EOF
-
-================================================================
-Test: $1
-EOF
-}
-
-# Baseline performance for an out of the box config with no manual tuning.
-# Ideally, we want everything to be automatically tuned for your system and
-# for this to perform reasonably well.
-zpios_survey_base() {
-       TEST_NAME="${ZPOOL_CONFIG}+${ZPIOS_TEST}+baseline"
-       print_header ${TEST_NAME}
-
-       ${ZFS_SH} ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZFS_SH} -u ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-}
-
-# Disable ZFS's prefetching.  For some reason still not clear to me
-# current prefetching policy is quite bad for a random workload.
-# Allowing the algorithm to detect a random workload and not do 
-# anything may be the way to address this issue.
-zpios_survey_prefetch() {
-       TEST_NAME="${ZPOOL_CONFIG}+${ZPIOS_TEST}+prefetch"
-       print_header ${TEST_NAME}
-
-       ${ZFS_SH} ${VERBOSE_FLAG}               \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
-               -o "--noprefetch" |                                    \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZFS_SH} -u ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-}
-
-# Simulating a zerocopy IO path should improve performance by freeing up
-# lots of CPU which is wasted move data between buffers.
-zpios_survey_zerocopy() {
-       TEST_NAME="${ZPOOL_CONFIG}+${ZPIOS_TEST}+zerocopy"
-       print_header ${TEST_NAME}
-
-       ${ZFS_SH} ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
-               -o "--zerocopy" |                                      \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZFS_SH} -u ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-}
-
-# Disabling checksumming should show some (if small) improvement
-# simply due to freeing up a modest amount of CPU.
-zpios_survey_checksum() {
-       TEST_NAME="${ZPOOL_CONFIG}+${ZPIOS_TEST}+checksum"
-       print_header ${TEST_NAME}
-
-       ${ZFS_SH} ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
-               -s "set checksum=off" |                                \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZFS_SH} -u ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-}
-
-# Increasing the pending IO depth also seems to improve things likely
-# at the expense of latency.  This should be explored more because I'm
-# seeing a much bigger impact there that I would have expected.  There
-# may be some low hanging fruit to be found here.
-zpios_survey_pending() {
-       TEST_NAME="${ZPOOL_CONFIG}+${ZPIOS_TEST}+pending"
-       print_header ${TEST_NAME}
-
-       ${ZFS_SH} ${VERBOSE_FLAG}                  \
-               zfs="zfs_vdev_max_pending=1024" | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZFS_SH} -u ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-}
-
-# Apply all possible turning concurrently to get a best case number
-zpios_survey_all() {
-       TEST_NAME="${ZPOOL_CONFIG}+${ZPIOS_TEST}+all"
-       print_header ${TEST_NAME}
-
-       ${ZFS_SH} ${VERBOSE_FLAG}                \  
-               zfs="zfs_vdev_max_pending=1024" | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZPIOS_SH} ${VERBOSE_FLAG} -c ${ZPOOL_CONFIG} -t ${ZPIOS_TEST} \
-               -o "--noprefetch --zerocopy"                           \
-               -s "set checksum=off" |                                \
-               tee -a ${ZPIOS_SURVEY_LOG}
-       ${ZFS_SH} -u ${VERBOSE_FLAG} | \
-               tee -a ${ZPIOS_SURVEY_LOG}
-}
-
-
-PROFILE=
-ZPOOL_NAME=zpios-survey
-ZPOOL_CONFIG=zpool-config.sh
-ZPIOS_TEST=zpios-test.sh
-ZPIOS_SURVEY_LOG=/dev/null
-
-while getopts 'hvpc:t:l:' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               VERBOSE_FLAG="-v"
-               ;;
-       p)
-               PROFILE=1
-               PROFILE_FLAG="-p"
-               ;;
-       c)
-               ZPOOL_CONFIG=${OPTARG}
-               ;;
-       t)
-               ZPIOS_TEST=${OPTARG}
-               ;;
-       l)
-               ZPIOS_SURVEY_LOG=${OPTARG}
-               ;;
-       ?)
-               usage
-               exit
-               ;;
-       esac
-done
-
-if [ $(id -u) != 0 ]; then
-       die "Must run as root"
-fi
-
-zpios_survey_base
-zpios_survey_prefetch
-zpios_survey_zerocopy
-zpios_survey_checksum
-zpios_survey_pending
-zpios_survey_all
-
-exit 0
diff --git a/zfs/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh b/zfs/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh
deleted file mode 100755 (executable)
index cbd9c69..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-#
-# Usage: zpios
-#        --threadcount       -t    =values
-#        --threadcount_low   -l    =value
-#        --threadcount_high  -h    =value
-#        --threadcount_incr  -e    =value
-#        --regioncount       -n    =values
-#        --regioncount_low   -i    =value
-#        --regioncount_high  -j    =value
-#        --regioncount_incr  -k    =value
-#        --offset            -o    =values
-#        --offset_low        -m    =value
-#        --offset_high       -q    =value
-#        --offset_incr       -r    =value
-#        --chunksize         -c    =values
-#        --chunksize_low     -a    =value
-#        --chunksize_high    -b    =value
-#        --chunksize_incr    -g    =value
-#        --regionsize        -s    =values
-#        --regionsize_low    -A    =value
-#        --regionsize_high   -B    =value
-#        --regionsize_incr   -C    =value
-#        --load              -L    =dmuio|ssf|fpp
-#        --pool              -p    =pool name
-#        --name              -M    =test name
-#        --cleanup           -x
-#        --prerun            -P    =pre-command
-#        --postrun           -R    =post-command
-#        --log               -G    =log directory
-#        --regionnoise       -I    =shift
-#        --chunknoise        -N    =bytes
-#        --threaddelay       -T    =jiffies
-#        --verify            -V
-#        --zerocopy          -z
-#        --nowait            -O
-#        --human-readable    -H
-#        --verbose           -v    =increase verbosity
-#        --help              -?    =this help
-
-ZPIOS_CMD="${ZPIOS}                                              \
-       --load=dmuio                                             \
-       --pool=${ZPOOL_NAME}                                     \
-       --name=${ZPOOL_CONFIG}                                   \
-       --threadcount=16                                         \
-       --regioncount=8192                                       \
-       --regionsize=4M                                          \
-       --chunksize=1M                                           \
-       --offset=4M                                              \
-       --cleanup                                                \
-       --human-readable                                         \
-       ${ZPIOS_OPTIONS}"
-
-zpios_start() {
-       if [ ${VERBOSE} ]; then
-               ZPIOS_CMD="${ZPIOS_CMD} --verbose"
-               echo ${ZPIOS_CMD}
-       fi
-
-       ${ZPIOS_CMD} || exit 1
-}
-
-zpios_stop() {
-       [ ${VERBOSE} ] && echo
-}
diff --git a/zfs/scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh b/zfs/scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh
deleted file mode 100755 (executable)
index cd3c50b..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-#
-# Usage: zpios
-#        --threadcount       -t    =values
-#        --threadcount_low   -l    =value
-#        --threadcount_high  -h    =value
-#        --threadcount_incr  -e    =value
-#        --regioncount       -n    =values
-#        --regioncount_low   -i    =value
-#        --regioncount_high  -j    =value
-#        --regioncount_incr  -k    =value
-#        --offset            -o    =values
-#        --offset_low        -m    =value
-#        --offset_high       -q    =value
-#        --offset_incr       -r    =value
-#        --chunksize         -c    =values
-#        --chunksize_low     -a    =value
-#        --chunksize_high    -b    =value
-#        --chunksize_incr    -g    =value
-#        --regionsize        -s    =values
-#        --regionsize_low    -A    =value
-#        --regionsize_high   -B    =value
-#        --regionsize_incr   -C    =value
-#        --load              -L    =dmuio|ssf|fpp
-#        --pool              -p    =pool name
-#        --name              -M    =test name
-#        --cleanup           -x
-#        --prerun            -P    =pre-command
-#        --postrun           -R    =post-command
-#        --log               -G    =log directory
-#        --regionnoise       -I    =shift
-#        --chunknoise        -N    =bytes
-#        --threaddelay       -T    =jiffies
-#        --verify            -V
-#        --zerocopy          -z
-#        --nowait            -O
-#        --human-readable    -H
-#        --verbose           -v    =increase verbosity
-#        --help              -?    =this help
-
-
-ZPIOS_CMD="${ZPIOS}                                              \
-       --load=dmuio                                             \
-       --pool=${ZPOOL_NAME}                                     \
-       --name=${ZPOOL_CONFIG}                                   \
-       --threadcount=1                                          \
-       --regioncount=16                                         \
-       --regionsize=4M                                          \
-       --chunksize=1M                                           \
-       --offset=4M                                              \
-       --cleanup                                                \
-       --human-readable                                         \
-       ${ZPIOS_OPTIONS}"
-
-zpios_start() {
-       if [ ${VERBOSE} ]; then
-               ZPIOS_CMD="${ZPIOS_CMD} --verbose"
-               echo ${ZPIOS_CMD}
-       fi
-
-       ${ZPIOS_CMD} || exit 1
-}
-
-zpios_stop() {
-       [ ${VERBOSE} ] && echo
-}
diff --git a/zfs/scripts/zpios-test/1x256th-65536rc-4rs-1cs-4off.sh b/zfs/scripts/zpios-test/1x256th-65536rc-4rs-1cs-4off.sh
deleted file mode 100755 (executable)
index 743e97b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-#
-# Usage: zpios
-#        --threadcount       -t    =values
-#        --threadcount_low   -l    =value
-#        --threadcount_high  -h    =value
-#        --threadcount_incr  -e    =value
-#        --regioncount       -n    =values
-#        --regioncount_low   -i    =value
-#        --regioncount_high  -j    =value
-#        --regioncount_incr  -k    =value
-#        --offset            -o    =values
-#        --offset_low        -m    =value
-#        --offset_high       -q    =value
-#        --offset_incr       -r    =value
-#        --chunksize         -c    =values
-#        --chunksize_low     -a    =value
-#        --chunksize_high    -b    =value
-#        --chunksize_incr    -g    =value
-#        --regionsize        -s    =values
-#        --regionsize_low    -A    =value
-#        --regionsize_high   -B    =value
-#        --regionsize_incr   -C    =value
-#        --load              -L    =dmuio|ssf|fpp
-#        --pool              -p    =pool name
-#        --name              -M    =test name
-#        --cleanup           -x
-#        --prerun            -P    =pre-command
-#        --postrun           -R    =post-command
-#        --log               -G    =log directory
-#        --regionnoise       -I    =shift
-#        --chunknoise        -N    =bytes
-#        --threaddelay       -T    =jiffies
-#        --verify            -V
-#        --zerocopy          -z
-#        --nowait            -O
-#        --human-readable    -H
-#        --verbose           -v    =increase verbosity
-#        --help              -?    =this help
-
-ZPIOS_CMD="${ZPIOS}                                              \
-       --load=dmuio                                             \
-       --pool=${ZPOOL_NAME}                                     \
-       --name=${ZPOOL_CONFIG}                                   \
-       --threadcount=1,2,4,8,16,32,64,128,256                   \
-       --regioncount=65536                                      \
-       --regionsize=4M                                          \
-       --chunksize=1M                                           \
-       --offset=4M                                              \
-        --cleanup                                                \
-       --human-readable                                         \
-       ${ZPIOS_OPTIONS}"
-
-zpios_start() {
-       if [ ${VERBOSE} ]; then
-               ZPIOS_CMD="${ZPIOS_CMD} --verbose"
-               echo ${ZPIOS_CMD}
-       fi
-
-       ${ZPIOS_CMD} || exit 1
-}
-
-zpios_stop() {
-       [ ${VERBOSE} ] && echo
-}
diff --git a/zfs/scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh b/zfs/scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh
deleted file mode 100755 (executable)
index 92a3b77..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-#
-# Usage: zpios
-#        --threadcount       -t    =values
-#        --threadcount_low   -l    =value
-#        --threadcount_high  -h    =value
-#        --threadcount_incr  -e    =value
-#        --regioncount       -n    =values
-#        --regioncount_low   -i    =value
-#        --regioncount_high  -j    =value
-#        --regioncount_incr  -k    =value
-#        --offset            -o    =values
-#        --offset_low        -m    =value
-#        --offset_high       -q    =value
-#        --offset_incr       -r    =value
-#        --chunksize         -c    =values
-#        --chunksize_low     -a    =value
-#        --chunksize_high    -b    =value
-#        --chunksize_incr    -g    =value
-#        --regionsize        -s    =values
-#        --regionsize_low    -A    =value
-#        --regionsize_high   -B    =value
-#        --regionsize_incr   -C    =value
-#        --load              -L    =dmuio|ssf|fpp
-#        --pool              -p    =pool name
-#        --name              -M    =test name
-#        --cleanup           -x
-#        --prerun            -P    =pre-command
-#        --postrun           -R    =post-command
-#        --log               -G    =log directory
-#        --regionnoise       -I    =shift
-#        --chunknoise        -N    =bytes
-#        --threaddelay       -T    =jiffies
-#        --verify            -V
-#        --zerocopy          -z
-#        --nowait            -O
-#        --human-readable    -H
-#        --verbose           -v    =increase verbosity
-#        --help              -?    =this help
-
-ZPIOS_CMD="${ZPIOS}                                              \
-       --load=dmuio                                             \
-       --pool=${ZPOOL_NAME}                                     \
-       --name=${ZPOOL_CONFIG}                                   \
-       --threadcount=256                                        \
-       --regioncount=65536                                      \
-       --regionsize=4M                                          \
-       --chunksize=1M                                           \
-       --offset=4M                                              \
-        --cleanup                                                \
-       --human-readable                                         \
-       ${ZPIOS_OPTIONS}"
-
-zpios_start() {
-       if [ ${VERBOSE} ]; then
-               ZPIOS_CMD="${ZPIOS_CMD} --verbose"
-               echo ${ZPIOS_CMD}
-       fi
-
-       ${ZPIOS_CMD} || exit 1
-}
-
-zpios_stop() {
-       [ ${VERBOSE} ] && echo
-}
diff --git a/zfs/scripts/zpios-test/4th-1024rc-4rs-1cs-4off.sh b/zfs/scripts/zpios-test/4th-1024rc-4rs-1cs-4off.sh
deleted file mode 100755 (executable)
index 0db952c..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-#!/bin/bash
-#
-# Usage: zpios
-#        --threadcount       -t    =values
-#        --threadcount_low   -l    =value
-#        --threadcount_high  -h    =value
-#        --threadcount_incr  -e    =value
-#        --regioncount       -n    =values
-#        --regioncount_low   -i    =value
-#        --regioncount_high  -j    =value
-#        --regioncount_incr  -k    =value
-#        --offset            -o    =values
-#        --offset_low        -m    =value
-#        --offset_high       -q    =value
-#        --offset_incr       -r    =value
-#        --chunksize         -c    =values
-#        --chunksize_low     -a    =value
-#        --chunksize_high    -b    =value
-#        --chunksize_incr    -g    =value
-#        --regionsize        -s    =values
-#        --regionsize_low    -A    =value
-#        --regionsize_high   -B    =value
-#        --regionsize_incr   -C    =value
-#        --load              -L    =dmuio|ssf|fpp
-#        --pool              -p    =pool name
-#        --name              -M    =test name
-#        --cleanup           -x
-#        --prerun            -P    =pre-command
-#        --postrun           -R    =post-command
-#        --log               -G    =log directory
-#        --regionnoise       -I    =shift
-#        --chunknoise        -N    =bytes
-#        --threaddelay       -T    =jiffies
-#        --verify            -V
-#        --zerocopy          -z
-#        --nowait            -O
-#        --human-readable    -H
-#        --verbose           -v    =increase verbosity
-#        --help              -?    =this help
-
-ZPIOS_CMD="${ZPIOS}                                              \
-       --load=dmuio                                             \
-       --pool=${ZPOOL_NAME}                                     \
-       --name=${ZPOOL_CONFIG}                                   \
-       --threadcount=4                                          \
-       --regioncount=1024                                       \
-       --regionsize=4M                                          \
-       --chunksize=1M                                           \
-       --offset=4M                                              \
-       --cleanup                                                \
-       --human-readable                                         \
-       ${ZPIOS_OPTIONS}"
-
-zpios_start() {
-       if [ ${VERBOSE} ]; then
-               ZPIOS_CMD="${ZPIOS_CMD} --verbose"
-               echo ${ZPIOS_CMD}
-       fi
-
-       ${ZPIOS_CMD} || exit 1
-}
-
-zpios_stop() {
-       [ ${VERBOSE} ] && echo
-}
diff --git a/zfs/scripts/zpios-test/Makefile.am b/zfs/scripts/zpios-test/Makefile.am
deleted file mode 100644 (file)
index c74e24f..0000000
+++ /dev/null
@@ -1,13 +0,0 @@
-pkgdatatestdir = $(pkgdatadir)/zpios-test
-dist_pkgdatatest_SCRIPTS = \
-       $(top_srcdir)/scripts/zpios-test/16th-8192rc-4rs-1cs-4off.sh \
-       $(top_srcdir)/scripts/zpios-test/1th-16rc-4rs-1cs-4off.sh \
-       $(top_srcdir)/scripts/zpios-test/1x256th-65536rc-4rs-1cs-4off.sh \
-       $(top_srcdir)/scripts/zpios-test/256th-65536rc-4rs-1cs-4off.sh \
-       $(top_srcdir)/scripts/zpios-test/4th-1024rc-4rs-1cs-4off.sh \
-       $(top_srcdir)/scripts/zpios-test/large.sh \
-       $(top_srcdir)/scripts/zpios-test/large-thread-survey.sh \
-       $(top_srcdir)/scripts/zpios-test/medium.sh \
-       $(top_srcdir)/scripts/zpios-test/small.sh \
-       $(top_srcdir)/scripts/zpios-test/tiny.sh \
-       $(top_srcdir)/scripts/zpios-test/lustre.sh
diff --git a/zfs/scripts/zpios-test/Makefile.in b/zfs/scripts/zpios-test/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/scripts/zpios-test/large-thread-survey.sh b/zfs/scripts/zpios-test/large-thread-survey.sh
deleted file mode 120000 (symlink)
index 90b6e3c..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1x256th-65536rc-4rs-1cs-4off.sh
\ No newline at end of file
diff --git a/zfs/scripts/zpios-test/large.sh b/zfs/scripts/zpios-test/large.sh
deleted file mode 120000 (symlink)
index b8e22bf..0000000
+++ /dev/null
@@ -1 +0,0 @@
-256th-65536rc-4rs-1cs-4off.sh
\ No newline at end of file
diff --git a/zfs/scripts/zpios-test/lustre.sh b/zfs/scripts/zpios-test/lustre.sh
deleted file mode 100644 (file)
index e02df22..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/bin/bash
-#
-# Usage: zpios
-#        --threadcount       -t    =values
-#        --threadcount_low   -l    =value
-#        --threadcount_high  -h    =value
-#        --threadcount_incr  -e    =value
-#        --regioncount       -n    =values
-#        --regioncount_low   -i    =value
-#        --regioncount_high  -j    =value
-#        --regioncount_incr  -k    =value
-#        --offset            -o    =values
-#        --offset_low        -m    =value
-#        --offset_high       -q    =value
-#        --offset_incr       -r    =value
-#        --chunksize         -c    =values
-#        --chunksize_low     -a    =value
-#        --chunksize_high    -b    =value
-#        --chunksize_incr    -g    =value
-#        --regionsize        -s    =values
-#        --regionsize_low    -A    =value
-#        --regionsize_high   -B    =value
-#        --regionsize_incr   -C    =value
-#        --load              -L    =dmuio|ssf|fpp
-#        --pool              -p    =pool name
-#        --name              -M    =test name
-#        --cleanup           -x
-#        --prerun            -P    =pre-command
-#        --postrun           -R    =post-command
-#        --log               -G    =log directory
-#        --regionnoise       -I    =shift
-#        --chunknoise        -N    =bytes
-#        --threaddelay       -T    =jiffies
-#        --verify            -V
-#        --zerocopy          -z
-#        --nowait            -O
-#        --human-readable    -H
-#        --verbose           -v    =increase verbosity
-#        --help              -?    =this help
-
-ZPIOS_CMD="${ZPIOS}                                              \
-       --load=dmuio,fpp                                         \
-       --pool=${ZPOOL_NAME}                                     \
-       --name=${ZPOOL_DESC}                                     \
-       --threadcount=128                                        \
-       --regioncount=4096                                       \
-       --regionsize=16M                                         \
-       --chunksize=1M                                           \
-       --offset=0M                                              \
-       --threaddelay=0                                          \
-       --cleanup                                                \
-       --human-readable                                         \
-       ${ZPIOS_OPTIONS}"
-
-zpios_start() {
-       if [ ${VERBOSE} ]; then
-               ZPIOS_CMD="${ZPIOS_CMD} --verbose"
-               echo ${ZPIOS_CMD}
-       fi
-
-       ${ZPIOS_CMD} || exit 1
-}
-
-zpios_stop() {
-       [ ${VERBOSE} ] && echo
-}
diff --git a/zfs/scripts/zpios-test/medium.sh b/zfs/scripts/zpios-test/medium.sh
deleted file mode 120000 (symlink)
index d81027b..0000000
+++ /dev/null
@@ -1 +0,0 @@
-16th-8192rc-4rs-1cs-4off.sh
\ No newline at end of file
diff --git a/zfs/scripts/zpios-test/small.sh b/zfs/scripts/zpios-test/small.sh
deleted file mode 120000 (symlink)
index cbf03b5..0000000
+++ /dev/null
@@ -1 +0,0 @@
-4th-1024rc-4rs-1cs-4off.sh
\ No newline at end of file
diff --git a/zfs/scripts/zpios-test/tiny.sh b/zfs/scripts/zpios-test/tiny.sh
deleted file mode 120000 (symlink)
index ba8b7cd..0000000
+++ /dev/null
@@ -1 +0,0 @@
-1th-16rc-4rs-1cs-4off.sh
\ No newline at end of file
diff --git a/zfs/scripts/zpios.sh b/zfs/scripts/zpios.sh
deleted file mode 100755 (executable)
index 0fcb88d..0000000
+++ /dev/null
@@ -1,281 +0,0 @@
-#!/bin/bash
-#
-# Wrapper script for easily running zpios based tests
-#
-
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zpios.sh
-DATE=`date +%Y%m%d-%H%M%S`
-if [ "${ZPIOS_MODULES}" ]; then
-       MODULES=(${ZPIOS_MODULES[*]})
-else
-       MODULES=(zpios)
-fi
-
-usage() {
-cat << EOF
-USAGE:
-$0 [hvp] <-c config> <-t test>
-
-DESCRIPTION:
-        Helper script for easy zpios benchmarking.
-
-OPTIONS:
-        -h      Show this message
-        -v      Verbose
-        -f      Force everything
-        -p      Enable profiling
-        -c      Zpool configuration
-        -t      Zpios test
-        -o      Additional zpios options
-        -l      Additional zpool options
-        -s      Additional zfs options
-
-EOF
-}
-
-unload_die() {
-       unload_modules
-       while [ -c /dev/zpios ]; do
-               sleep 1
-       done
-
-       exit 1
-}
-
-print_header() {
-       echo --------------------- ZPIOS RESULTS ----------------------------
-       echo -n "Date: "; date
-       echo -n "Kernel: "; uname -r
-       dmesg | grep "Loaded Solaris Porting Layer" | tail -n1
-       dmesg | grep "Loaded ZFS Filesystem" | tail -n1
-       echo
-}
-
-print_spl_info() {
-       echo --------------------- SPL Tunings ------------------------------
-       ${SYSCTL} -A | grep spl
-
-       if [ -d /sys/module/spl/parameters ]; then
-               grep [0-9] /sys/module/spl/parameters/*
-       else
-               grep [0-9] /sys/module/spl/*
-       fi
-
-       echo
-}
-
-print_zfs_info() {
-       echo --------------------- ZFS Tunings ------------------------------
-       ${SYSCTL} -A | grep zfs
-
-       if [ -d /sys/module/zfs/parameters ]; then
-               grep [0-9] /sys/module/zfs/parameters/*
-       else
-               grep [0-9] /sys/module/zfs/*
-       fi
-
-       echo
-}
-
-print_stats() {
-       echo ---------------------- Statistics -------------------------------
-       ${SYSCTL} -A | grep spl | grep stack_max
-
-       if [ -d /proc/spl/kstat/ ]; then
-               if [ -f /proc/spl/kstat/zfs/arcstats ]; then
-                       echo "* ARC"
-                       cat /proc/spl/kstat/zfs/arcstats
-                       echo
-               fi
-
-               if [ -f /proc/spl/kstat/zfs/vdev_cache_stats ]; then
-                       echo "* VDEV Cache"
-                       cat /proc/spl/kstat/zfs/vdev_cache_stats
-                       echo
-               fi
-       fi
-
-       if [ -f /proc/spl/kmem/slab ]; then
-               echo "* SPL SLAB"
-               cat /proc/spl/kmem/slab
-               echo
-       fi
-
-       echo
-}
-
-check_test() {
-
-       if [ ! -f ${ZPIOS_TEST} ]; then
-               local NAME=`basename ${ZPIOS_TEST} .sh`
-               ERROR="Unknown test '${NAME}', available tests are:\n"
-
-               for TST in `ls ${ZPIOSDIR}/ | grep ".sh"`; do
-                       local NAME=`basename ${TST} .sh`
-                       ERROR="${ERROR}${NAME}\n"
-               done
-
-               return 1
-       fi
-
-       return 0
-}
-
-zpios_profile_config() {
-cat > ${PROFILE_DIR}/zpios-config.sh << EOF
-#
-# Zpios Profiling Configuration
-#
-
-PROFILE_DIR=/tmp/zpios/${ZPOOL_CONFIG}+${ZPIOS_TEST_ARG}+${DATE}
-PROFILE_PRE=${ZPIOSPROFILEDIR}/zpios-profile-pre.sh
-PROFILE_POST=${ZPIOSPROFILEDIR}/zpios-profile-post.sh
-PROFILE_USER=${ZPIOSPROFILEDIR}/zpios-profile.sh
-PROFILE_PIDS=${ZPIOSPROFILEDIR}/zpios-profile-pids.sh
-PROFILE_DISK=${ZPIOSPROFILEDIR}/zpios-profile-disk.sh
-PROFILE_ARC_PROC=/proc/spl/kstat/zfs/arcstats
-PROFILE_VDEV_CACHE_PROC=/proc/spl/kstat/zfs/vdev_cache_stats
-
-OPROFILE_KERNEL="/boot/vmlinux-`uname -r`"
-OPROFILE_KERNEL_DIR="/lib/modules/`uname -r`/kernel/"
-OPROFILE_SPL_DIR=${SPLBUILD}/module/
-OPROFILE_ZFS_DIR=${MODDIR}
-
-EOF
-}
-
-zpios_profile_start() {
-       PROFILE_DIR=/tmp/zpios/${ZPOOL_CONFIG}+${ZPIOS_TEST_ARG}+${DATE}
-
-       mkdir -p ${PROFILE_DIR}
-       zpios_profile_config
-       . ${PROFILE_DIR}/zpios-config.sh
-
-       ZPIOS_OPTIONS="${ZPIOS_OPTIONS} --log=${PROFILE_DIR}"
-       ZPIOS_OPTIONS="${ZPIOS_OPTIONS} --prerun=${PROFILE_PRE}"
-       ZPIOS_OPTIONS="${ZPIOS_OPTIONS} --postrun=${PROFILE_POST}"
-
-       /usr/bin/opcontrol --init
-       /usr/bin/opcontrol --setup --vmlinux=${OPROFILE_KERNEL}
-}
-
-zpios_profile_stop() {
-       /usr/bin/opcontrol --shutdown
-       /usr/bin/opcontrol --deinit
-}
-
-PROFILE=
-ZPOOL_CONFIG=zpool-config.sh
-ZPIOS_TEST=zpios-test.sh
-ZPOOL_NAME=zpios
-ZPIOS_OPTIONS=
-ZPOOL_OPTIONS=""
-ZFS_OPTIONS=""
-
-while getopts 'hvfpc:t:o:l:s:' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               VERBOSE_FLAG="-v"
-               ;;
-       f)
-               FORCE=1
-               FORCE_FLAG="-f"
-               ;;
-       p)
-               PROFILE=1
-               ;;
-       c)
-               ZPOOL_CONFIG=${OPTARG}
-               ;;
-       t)
-               ZPIOS_TEST_ARG=${OPTARG}
-               ZPIOS_TEST=${ZPIOSDIR}/${OPTARG}.sh
-               ;;
-       o)
-               ZPIOS_OPTIONS=${OPTARG}
-               ;;
-       l)      # Passed through to zpool-create.sh 
-               ZPOOL_OPTIONS=${OPTARG}
-               ;;
-       s)      # Passed through to zpool-create.sh
-               ZFS_OPTIONS=${OPTARG}
-               ;;
-       ?)
-               usage
-               exit
-               ;;
-       esac
-done
-
-if [ $(id -u) != 0 ]; then
-        die "Must run as root"
-fi
-
-# Validate and source your test config
-check_test || die "${ERROR}"
-. ${ZPIOS_TEST}
-
-# Pull in the zpios test module if not loaded.  If this fails, it is
-# likely because the full module stack was not yet loaded with zfs.sh
-if check_modules; then
-       if ! load_modules; then
-               die "Run 'zfs.sh' to ensure the full module stack is loaded"
-       fi
-fi
-
-# Wait for device creation
-while [ ! -c /dev/zpios ]; do
-       sleep 1
-done
-
-if [ ${VERBOSE} ]; then
-       print_header
-       print_spl_info
-       print_zfs_info
-fi
-
-# Create the zpool configuration
-${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} ${FORCE_FLAG} \
-       -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} \
-       -l "${ZPOOL_OPTIONS}" -s "${ZFS_OPTIONS}" || unload_die
-
-if [ ${PROFILE} ]; then
-       zpios_profile_start
-fi
-
-zpios_start
-zpios_stop
-
-if [ ${PROFILE} ]; then
-       zpios_profile_stop
-fi
-
-if [ ${VERBOSE} ]; then
-       print_stats
-fi
-
-# Destroy the zpool configuration
-${ZPOOL_CREATE_SH} ${VERBOSE_FLAG} ${FORCE_FLAG} \
-       -p ${ZPOOL_NAME} -c ${ZPOOL_CONFIG} -d || unload_die
-
-# Unload the test module stack and wait for device removal
-unload_modules
-while [ -c /dev/zpios ]; do
-       sleep 1
-done
-
-exit 0
diff --git a/zfs/scripts/zpool-config/Makefile.am b/zfs/scripts/zpool-config/Makefile.am
deleted file mode 100644 (file)
index 2d77994..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-pkgdataconfigdir = $(pkgdatadir)/zpool-config
-dist_pkgdataconfig_SCRIPTS = \
-       $(top_srcdir)/scripts/zpool-config/dm0-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/file-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/file-raid10.sh \
-       $(top_srcdir)/scripts/zpool-config/file-raidz2.sh \
-       $(top_srcdir)/scripts/zpool-config/file-raidz.sh \
-       $(top_srcdir)/scripts/zpool-config/hda-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-raid10.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-raidz2.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-raidz.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-faulty-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-faulty-raid10.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-faulty-raidz.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-faulty-raidz2.sh \
-       $(top_srcdir)/scripts/zpool-config/lo-faulty-raidz3.sh \
-       $(top_srcdir)/scripts/zpool-config/md0-raid10.sh \
-       $(top_srcdir)/scripts/zpool-config/md0-raid5.sh \
-       $(top_srcdir)/scripts/zpool-config/ram0-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/scsi_debug-noraid.sh \
-       $(top_srcdir)/scripts/zpool-config/scsi_debug-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/scsi_debug-raid10.sh \
-       $(top_srcdir)/scripts/zpool-config/scsi_debug-raidz.sh \
-       $(top_srcdir)/scripts/zpool-config/scsi_debug-raidz2.sh \
-       $(top_srcdir)/scripts/zpool-config/scsi_debug-raidz3.sh \
-       $(top_srcdir)/scripts/zpool-config/sda-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/zpool-raid0.sh \
-       $(top_srcdir)/scripts/zpool-config/zpool-raid10.sh \
-       $(top_srcdir)/scripts/zpool-config/zpool-raidz.sh
diff --git a/zfs/scripts/zpool-config/Makefile.in b/zfs/scripts/zpool-config/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/scripts/zpool-config/dm0-raid0.sh b/zfs/scripts/zpool-config/dm0-raid0.sh
deleted file mode 100644 (file)
index f7fa8f6..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/bash
-#
-# Four disk Raid-0 DM in a single Raid-0 Configuration
-#
-
-PVCREATE=${PVCREATE:-/sbin/pvcreate}
-PVREMOVE=${PVREMOVE:-/sbin/pvremove}
-PVDEVICES=${PVDEVICES:-"/dev/sd[abcd]"}
-
-VGCREATE=${VGCREATE:-/sbin/vgcreate}
-VGREMOVE=${VGREMOVE:-/sbin/vgremove}
-VGNAME=${VGNAME:-"vg_tank"}
-
-LVCREATE=${LVCREATE:-/sbin/lvcreate}
-LVREMOVE=${LVREMOVE:-/sbin/lvremove}
-LVNAME=${LVNAME:-"lv_tank"}
-LVSTRIPES=${LVSTRIPES:-4}
-LVSIZE=${LVSIZE:-32G}
-
-DEVICES="/dev/${VGNAME}/${LVNAME}"
-
-zpool_dm_destroy() {
-       msg ${LVREMOVE} -f ${VGNAME}/${LVNAME}
-       ${LVREMOVE} -f ${VGNAME}/${LVNAME} >/dev/null
-
-       msg ${VGREMOVE} -f ${VGNAME}
-       ${VGREMOVE} -f ${VGNAME} >/dev/null
-
-       msg ${PVREMOVE} ${PVDEVICES}
-       ${PVREMOVE} ${PVDEVICES} >/dev/null
-}
-
-zpool_create() {
-       # Remove EFI labels which cause pvcreate failure
-       for DEVICE in ${PVDEVICES}; do
-               dd if=/dev/urandom of=${DEVICE} bs=1k count=32 &>/dev/null
-       done
-
-       msg ${PVCREATE} -f ${PVDEVICES}
-       ${PVCREATE} -f ${PVDEVICES} >/dev/null || exit 1
-
-       msg ${VGCREATE} ${VGNAME} ${PVDEVICES}
-       ${VGCREATE} ${VGNAME} ${PVDEVICES} >/dev/null || exit 2
-
-       msg ${LVCREATE} --size=${LVSIZE} --stripes=${LVSTRIPES} \
-               --name=${LVNAME} ${VGNAME}
-       ${LVCREATE} --size=${LVSIZE} --stripes=${LVSTRIPES} \
-               --name=${LVNAME} ${VGNAME} >/dev/null || exit 3
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} \
-               ${DEVICES} || (zpool_dm_destroy && exit 4)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       zpool_dm_destroy
-}
diff --git a/zfs/scripts/zpool-config/file-raid0.sh b/zfs/scripts/zpool-config/file-raid0.sh
deleted file mode 100644 (file)
index 24b6aec..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# 4 File Raid-0 Configuration
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-
-zpool_create() {
-       for FILE in ${FILES}; do
-               msg "Creating ${FILE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${FILES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${FILES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               msg "Removing ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/file-raid10.sh b/zfs/scripts/zpool-config/file-raid10.sh
deleted file mode 100644 (file)
index 92b22c2..0000000
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/bin/bash
-#
-# 4 File Raid-10 Configuration
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
-FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-FILES="${FILES_M1} ${FILES_M2}"
-
-zpool_create() {
-       for FILE in ${FILES}; do
-               msg "Creating ${FILE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} \
-               mirror ${FILES_M1} mirror ${FILES_M2}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} \
-               mirror ${FILES_M1} mirror ${FILES_M2} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               msg "Removing ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/file-raidz.sh b/zfs/scripts/zpool-config/file-raidz.sh
deleted file mode 100644 (file)
index 4112deb..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# 4 File Raid-Z Configuration
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-
-zpool_create() {
-       for FILE in ${FILES}; do
-               msg "Creating ${FILE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${FILES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${FILES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               msg "Removing ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/file-raidz2.sh b/zfs/scripts/zpool-config/file-raidz2.sh
deleted file mode 100644 (file)
index 6e03da8..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-#!/bin/bash
-#
-# 4 File Raid-Z2 Configuration
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-
-zpool_create() {
-       for FILE in ${FILES}; do
-               msg "Creating ${FILE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${FILES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${FILES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               msg "Removing ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/hda-raid0.sh b/zfs/scripts/zpool-config/hda-raid0.sh
deleted file mode 100644 (file)
index 0623963..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Single disk /dev/hda Raid-0 Configuration
-#
-
-DEVICES="/dev/hda"
-
-zpool_create() {
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME} || exit 1
-}
diff --git a/zfs/scripts/zpool-config/lo-faulty-raid0.sh b/zfs/scripts/zpool-config/lo-faulty-raid0.sh
deleted file mode 100644 (file)
index 72894ee..0000000
+++ /dev/null
@@ -1,77 +0,0 @@
-#!/bin/bash
-#
-# 4 loopback devices using the md faulty level for easy
-# fault injection on top of which is layered raid0 (striped).
-#
-#     zpool-vdev0    zpool-vdev1    zpool-vdev2    zpool-vdev3
-#     loop0          loop1          loop2          loop3
-#     md0 (faulty)   md1 (faulty)   md2 (faulty)   md3 (faulty)
-#     <--------------------- raid0 zpool --------------------->
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-LODEVICES=""
-MDDEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_md_utils
-       check_md_partitionable || die "Error non-partitionable md devices"
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-               MDDEVICE=`unused_md_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1M count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || \
-                       die "Error $? creating ${LODEVICE} using ${FILE}"
-
-               LODEVICES="${LODEVICES} ${LODEVICE}"
-
-               # Setup the md device on the loopback device.
-               msg "Creating ${MDDEVICE} using ${LODEVICE}"
-               ${MDADM} --build ${MDDEVICE} --level=faulty                  \
-                       --raid-devices=1 ${LODEVICE} &>/dev/null ||          \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error $? creating ${MDDEVICE} using ${LODEVICE}")
-               wait_udev ${MDDEVICE} 30 ||                                  \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error udev never created ${MDDEVICE}")
-
-               # Check if the md device support partitions
-               ${BLOCKDEV} --rereadpt ${MDDEVICE} 2>/dev/null ||            \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error ${MDDEVICE} does not support partitions")
-
-               # Create a GPT/EFI partition table for ZFS to use.
-               ${PARTED} --script ${MDDEVICE} mklabel gpt
-               MDDEVICES="${MDDEVICES} ${MDDEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${MDDEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${MDDEVICES} ||          \
-               (destroy_md_devices "${MDDEVICES}" &&                        \
-               destroy_loop_devices "${LODEVICES}" && exit 1)
-
-       echo "$LODEVICES" >/tmp/zpool-lo.txt
-       echo "$MDDEVICES" >/tmp/zpool-md.txt
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-       destroy_md_devices "`cat /tmp/zpool-md.txt`"
-       destroy_loop_devices "`cat /tmp/zpool-lo.txt`"
-
-       rm -f /tmp/zpool-md.txt /tmp/zpool-lo.txt
-}
diff --git a/zfs/scripts/zpool-config/lo-faulty-raid10.sh b/zfs/scripts/zpool-config/lo-faulty-raid10.sh
deleted file mode 100644 (file)
index 1a523ec..0000000
+++ /dev/null
@@ -1,84 +0,0 @@
-#!/bin/bash
-#
-# 4 loopback devices using the md faulty level for easy
-# fault injection on top of which is layered raid10 (mirrored).
-#
-#     zpool-vdev0    zpool-vdev1    zpool-vdev2    zpool-vdev3
-#     loop0          loop1          loop2          loop3
-#     md0 (faulty)   md1 (faulty)   md2 (faulty)   md3 (faulty)
-#     <--------------------- raid10 zpool --------------------->
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
-FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-FILES="${FILES_M1} ${FILES_M2}"
-LODEVICES=""
-MDDEVICES=""
-MDDEVICES_M1=""
-MDDEVICES_M2=""
-
-zpool_create() {
-       local COUNT=0
-
-       check_loop_utils
-       check_md_utils
-       check_md_partitionable || die "Error non-partitionable md devices"
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-               MDDEVICE=`unused_md_device`
-               let COUNT=${COUNT}+1
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1M count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || \
-                       die "Error $? creating ${LODEVICE} using ${FILE}"
-
-               LODEVICES="${LODEVICES} ${LODEVICE}"
-
-               # Setup the md device on the loopback device.
-               msg "Creating ${MDDEVICE} using ${LODEVICE}"
-               ${MDADM} --build ${MDDEVICE} --level=faulty                  \
-                       --raid-devices=1 ${LODEVICE} &>/dev/null ||          \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error $? creating ${MDDEVICE} using ${LODEVICE}")
-               wait_udev ${MDDEVICE} 30 ||                                  \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error udev never created ${MDDEVICE}")
-
-               # Create empty GPT/EFI partition table.
-               ${PARTED} --script ${MDDEVICE} mklabel gpt
-               MDDEVICES="${MDDEVICES} ${MDDEVICE}"
-               if [ $((COUNT % 2)) -eq 0 ]; then
-                       MDDEVICES_M2="${MDDEVICES_M2} ${MDDEVICE}"
-               else
-                       MDDEVICES_M1="${MDDEVICES_M1} ${MDDEVICE}"
-               fi 
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME}                      \
-               mirror ${MDDEVICES_M1} mirror ${MDDEVICES_M2}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME}                          \
-               mirror ${MDDEVICES_M1} mirror ${MDDEVICES_M2} ||             \
-               (destroy_md_devices "${MDDEVICES}" &&                        \
-               destroy_loop_devices "${LODEVICES}" && exit 1)
-
-       echo "$LODEVICES" >/tmp/zpool-lo.txt
-       echo "$MDDEVICES" >/tmp/zpool-md.txt
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-       destroy_md_devices "`cat /tmp/zpool-md.txt`"
-       destroy_loop_devices "`cat /tmp/zpool-lo.txt`"
-
-       rm -f /tmp/zpool-md.txt /tmp/zpool-lo.txt
-}
diff --git a/zfs/scripts/zpool-config/lo-faulty-raidz.sh b/zfs/scripts/zpool-config/lo-faulty-raidz.sh
deleted file mode 100644 (file)
index c8f88b3..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-#
-# 4 loopback devices using the md faulty level for easy
-# fault injection on top of which is layered raidz.
-#
-#     zpool-vdev0    zpool-vdev1    zpool-vdev2    zpool-vdev3
-#     loop0          loop1          loop2          loop3
-#     md0 (faulty)   md1 (faulty)   md2 (faulty)   md3 (faulty)
-#     <--------------------- raidz zpool --------------------->
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-LODEVICES=""
-MDDEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_md_utils
-       check_md_partitionable || die "Error non-partitionable md devices"
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-               MDDEVICE=`unused_md_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1M count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || \
-                       die "Error $? creating ${LODEVICE} using ${FILE}"
-
-               LODEVICES="${LODEVICES} ${LODEVICE}"
-
-               # Setup the md device on the loopback device.
-               msg "Creating ${MDDEVICE} using ${LODEVICE}"
-               ${MDADM} --build ${MDDEVICE} --level=faulty                  \
-                       --raid-devices=1 ${LODEVICE} &>/dev/null ||          \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error $? creating ${MDDEVICE} using ${LODEVICE}")
-               wait_udev ${MDDEVICE} 30 ||                                  \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error udev never created ${MDDEVICE}")
-
-               # Create empty GPT/EFI partition table.
-               ${PARTED} --script ${MDDEVICE} mklabel gpt
-               MDDEVICES="${MDDEVICES} ${MDDEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${MDDEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${MDDEVICES} ||    \
-               (destroy_md_devices "${MDDEVICES}" &&                        \
-               destroy_loop_devices "${LODEVICES}" && exit 1)
-
-       echo "$LODEVICES" >/tmp/zpool-lo.txt
-       echo "$MDDEVICES" >/tmp/zpool-md.txt
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-       destroy_md_devices "`cat /tmp/zpool-md.txt`"
-       destroy_loop_devices "`cat /tmp/zpool-lo.txt`"
-
-       rm -f /tmp/zpool-md.txt /tmp/zpool-lo.txt
-}
diff --git a/zfs/scripts/zpool-config/lo-faulty-raidz2.sh b/zfs/scripts/zpool-config/lo-faulty-raidz2.sh
deleted file mode 100644 (file)
index 85b7d46..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-#!/bin/bash
-#
-# 4 loopback devices using the md faulty level for easy
-# fault injection on top of which is layered raidz2.
-#
-#     zpool-vdev0    zpool-vdev1    zpool-vdev2    zpool-vdev3
-#     loop0          loop1          loop2          loop3
-#     md0 (faulty)   md1 (faulty)   md2 (faulty)   md3 (faulty)
-#     <--------------------- raidz2 zpool -------------------->
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-LODEVICES=""
-MDDEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_md_utils
-       check_md_partitionable || die "Error non-partitionable md devices"
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-               MDDEVICE=`unused_md_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1M count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || \
-                       die "Error $? creating ${LODEVICE} using ${FILE}"
-
-               LODEVICES="${LODEVICES} ${LODEVICE}"
-
-               # Setup the md device on the loopback device.
-               msg "Creating ${MDDEVICE} using ${LODEVICE}"
-               ${MDADM} --build ${MDDEVICE} --level=faulty                  \
-                       --raid-devices=1 ${LODEVICE} &>/dev/null ||          \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error $? creating ${MDDEVICE} using ${LODEVICE}")
-               wait_udev ${MDDEVICE} 30 ||                                  \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error udev never created ${MDDEVICE}")
-
-               # Create empty GPT/EFI partition table.
-               ${PARTED} --script ${MDDEVICE} mklabel gpt
-               MDDEVICES="${MDDEVICES} ${MDDEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${MDDEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${MDDEVICES} ||   \
-               (destroy_md_devices "${MDDEVICES}" &&                        \
-               destroy_loop_devices "${LODEVICES}" && exit 1)
-
-       echo "$LODEVICES" >/tmp/zpool-lo.txt
-       echo "$MDDEVICES" >/tmp/zpool-md.txt
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-       destroy_md_devices "`cat /tmp/zpool-md.txt`"
-       destroy_loop_devices "`cat /tmp/zpool-lo.txt`"
-
-       rm -f /tmp/zpool-md.txt /tmp/zpool-lo.txt
-}
diff --git a/zfs/scripts/zpool-config/lo-faulty-raidz3.sh b/zfs/scripts/zpool-config/lo-faulty-raidz3.sh
deleted file mode 100644 (file)
index 7836b5f..0000000
+++ /dev/null
@@ -1,72 +0,0 @@
-#!/bin/bash
-#
-# 4 loopback devices using the md faulty level for easy
-# fault injection on top of which is layered raidz3.
-#
-#     zpool-vdev0    zpool-vdev1    zpool-vdev2    zpool-vdev3
-#     loop0          loop1          loop2          loop3
-#     md0 (faulty)   md1 (faulty)   md2 (faulty)   md3 (faulty)
-#     <--------------------- raidz3 zpool -------------------->
-#
-
-FILES="/tmp/zpool-vdev0  \
-       /tmp/zpool-vdev1  \
-       /tmp/zpool-vdev2  \
-       /tmp/zpool-vdev3"
-LODEVICES=""
-MDDEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_md_utils
-       check_md_partitionable || die "Error non-partitionable md devices"
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-               MDDEVICE=`unused_md_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1M count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || \
-                       die "Error $? creating ${LODEVICE} using ${FILE}"
-
-               LODEVICES="${LODEVICES} ${LODEVICE}"
-
-               # Setup the md device on the loopback device.
-               msg "Creating ${MDDEVICE} using ${LODEVICE}"
-               ${MDADM} --build ${MDDEVICE} --level=faulty                  \
-                       --raid-devices=1 ${LODEVICE} &>/dev/null ||          \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error $? creating ${MDDEVICE} using ${LODEVICE}")
-               wait_udev ${MDDEVICE} 30 ||                                  \
-                       (destroy_md_devices "${MDDEVICES}" &&                \
-                       destroy_loop_devices "${LODEVICES}" &&               \
-                       die "Error udev never created ${MDDEVICE}")
-
-               # Create empty GPT/EFI partition table.
-               ${PARTED} --script ${MDDEVICE} mklabel gpt
-               MDDEVICES="${MDDEVICES} ${MDDEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz3 ${MDDEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz3 ${MDDEVICES} ||   \
-               (destroy_md_devices "${MDDEVICES}" &&                        \
-               destroy_loop_devices "${LODEVICES}" && exit 1)
-
-       echo "$LODEVICES" >/tmp/zpool-lo.txt
-       echo "$MDDEVICES" >/tmp/zpool-md.txt
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-       destroy_md_devices "`cat /tmp/zpool-md.txt`"
-       destroy_loop_devices "`cat /tmp/zpool-lo.txt`"
-
-       rm -f /tmp/zpool-md.txt /tmp/zpool-lo.txt
-}
diff --git a/zfs/scripts/zpool-config/lo-raid0.sh b/zfs/scripts/zpool-config/lo-raid0.sh
deleted file mode 100644 (file)
index 3f2cfe5..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-#
-# 4 Device Loopback Raid-0 Configuration
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-DEVICES=""
-
-zpool_create() {
-       check_loop_utils
-
-       for FILE in ${FILES}; do
-               DEVICE=`unused_loop_device`
-               msg "Creating ${FILE} using loopback device ${DEVICE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-               ${LOSETUP} ${DEVICE} ${FILE} ||
-                       die "Error $? creating ${FILE} -> ${DEVICE} loopback"
-               DEVICES="${DEVICES} ${DEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       # Delay to ensure device is closed before removing loop device
-       sleep 1
-
-       for FILE in ${FILES}; do
-               DEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${FILE} using loopback device ${DEVICE}"
-               ${LOSETUP} -d ${DEVICE} ||
-                       die "Error $? destroying ${FILE} -> ${DEVICE} loopback"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/lo-raid10.sh b/zfs/scripts/zpool-config/lo-raid10.sh
deleted file mode 100644 (file)
index 580ed1f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-#!/bin/bash
-#
-# 4 Device Loopback Raid-0 Configuration
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES_M1=${FILES_M1:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1"}
-FILES_M2=${FILES_M2:-"$FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-FILES="${FILES_M1} ${FILES_M2}"
-DEVICES_M1=""
-DEVICES_M2=""
-
-zpool_create() {
-       check_loop_utils
-
-       for FILE in ${FILES_M1}; do
-               DEVICE=`unused_loop_device`
-               msg "Creating ${FILE} using loopback device ${DEVICE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-               ${LOSETUP} ${DEVICE} ${FILE} ||
-                       die "Error $? creating ${FILE} -> ${DEVICE} loopback"
-               DEVICES_M1="${DEVICES_M1} ${DEVICE}"
-       done
-
-       for FILE in ${FILES_M2}; do
-               DEVICE=`unused_loop_device`
-               msg "Creating ${FILE} using loopback device ${DEVICE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-               ${LOSETUP} ${DEVICE} ${FILE} ||
-                       die "Error $? creating ${FILE} -> ${DEVICE} loopback"
-               DEVICES_M2="${DEVICES_M2} ${DEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} \
-               mirror ${DEVICES_M1} mirror ${DEVICES_M2}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} \
-               mirror ${DEVICES_M1} mirror ${DEVICES_M2}
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       # Delay to ensure device is closed before removing loop device
-       sleep 1
-
-       for FILE in ${FILES}; do
-               DEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${FILE} using loopback device ${DEVICE}"
-               ${LOSETUP} -d ${DEVICE} ||
-                       die "Error $? destroying ${FILE} -> ${DEVICE} loopback"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/lo-raidz.sh b/zfs/scripts/zpool-config/lo-raidz.sh
deleted file mode 100644 (file)
index 90b26c5..0000000
+++ /dev/null
@@ -1,42 +0,0 @@
-#!/bin/bash
-#
-# 4 Device Loopback Raid-0 Configuration
-#
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-DEVICES=""
-
-zpool_create() {
-       check_loop_utils
-
-       for FILE in ${FILES}; do
-               DEVICE=`unused_loop_device`
-               msg "Creating ${FILE} using loopback device ${DEVICE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-               ${LOSETUP} ${DEVICE} ${FILE} ||
-                       die "Error $? creating ${FILE} -> ${DEVICE} loopback"
-               DEVICES="${DEVICES} ${DEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${DEVICES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       # Delay to ensure device is closed before removing loop device
-       sleep 1
-
-       for FILE in ${FILES}; do
-               DEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${FILE} using loopback device ${DEVICE}"
-               ${LOSETUP} -d ${DEVICE} ||
-                       die "Error $? destroying ${FILE} -> ${DEVICE} loopback"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/lo-raidz2.sh b/zfs/scripts/zpool-config/lo-raidz2.sh
deleted file mode 100644 (file)
index 9e58b2a..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/bash
-#
-# 4 Device Loopback Raid-0 Configuration
-#
-
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 \
-    $FILEDIR/file-vdev2 $FILEDIR/file-vdev3"}
-DEVICES=""
-
-zpool_create() {
-       check_loop_utils
-
-       for FILE in ${FILES}; do
-               DEVICE=`unused_loop_device`
-               msg "Creating ${FILE} using loopback device ${DEVICE}"
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256 \
-                       &>/dev/null || die "Error $? creating ${FILE}"
-               ${LOSETUP} ${DEVICE} ${FILE} ||
-                       die "Error $? creating ${FILE} -> ${DEVICE} loopback"
-               DEVICES="${DEVICES} ${DEVICE}"
-       done
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${DEVICES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       # Delay to ensure device is closed before removing loop device
-       sleep 1
-
-       for FILE in ${FILES}; do
-               DEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${FILE} using loopback device ${DEVICE}"
-               ${LOSETUP} -d ${DEVICE} ||
-                       die "Error $? destroying ${FILE} -> ${DEVICE} loopback"
-               rm -f ${FILE} || exit 1
-       done
-}
diff --git a/zfs/scripts/zpool-config/md0-raid10.sh b/zfs/scripts/zpool-config/md0-raid10.sh
deleted file mode 100644 (file)
index 65cae6a..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# Four disk Raid-10 in a single Raid-0 Configuration
-#
-
-MDADM=${MDADM:-/sbin/mdadm}
-MDDEVICES=${MDDEVICES:-"/dev/sd[abcd]"}
-MDCOUNT=${MDCOUNT:-4}
-MDRAID=${MDRAID:-10}
-
-DEVICES="/dev/md0"
-
-zpool_md_destroy() {
-       msg ${MDADM} --manage --stop ${DEVICES}
-       ${MDADM} --manage --stop ${DEVICES} &>/dev/null
-
-       msg ${MDADM} --zero-superblock ${MDDEVICES}
-       ${MDADM} --zero-superblock ${MDDEVICES} >/dev/null
-}
-
-zpool_create() {
-       msg ${MDADM} --create ${DEVICES} --level=${MDRAID} \
-               --raid-devices=${MDCOUNT} ${MDDEVICES}
-       ${MDADM} --create ${DEVICES} --level=${MDRAID} \
-               --raid-devices=${MDCOUNT} ${MDDEVICES} \
-               &>/dev/null || (zpool_md_destroy && exit 1)
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} \
-               ${DEVICES} || (zpool_md_destroy && exit 2)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       zpool_md_destroy
-}
diff --git a/zfs/scripts/zpool-config/md0-raid5.sh b/zfs/scripts/zpool-config/md0-raid5.sh
deleted file mode 100644 (file)
index 373034b..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/bin/bash
-#
-# Four disk Raid-5 in a single Raid-0 Configuration
-#
-
-MDADM=${MDADM:-/sbin/mdadm}
-MDDEVICES=${MDDEVICES:-"/dev/sd[abcd]"}
-MDCOUNT=${MDCOUNT:-4}
-MDRAID=${MDRAID:-5}
-
-DEVICES="/dev/md0"
-
-zpool_md_destroy() {
-       msg ${MDADM} --manage --stop ${DEVICES}
-       ${MDADM} --manage --stop ${DEVICES} &>/dev/null
-
-       msg ${MDADM} --zero-superblock ${MDDEVICES}
-       ${MDADM} --zero-superblock ${MDDEVICES} >/dev/null
-}
-
-zpool_create() {
-       msg ${MDADM} --create ${DEVICES} --level=${MDRAID} \
-               --raid-devices=${MDCOUNT} ${MDDEVICES}
-       ${MDADM} --create ${DEVICES} --level=${MDRAID} \
-               --raid-devices=${MDCOUNT} ${MDDEVICES} \
-               &>/dev/null || (zpool_md_destroy && exit 1)
-
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} \
-               ${DEVICES} || (zpool_md_destroy && exit 2)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       zpool_md_destroy
-}
diff --git a/zfs/scripts/zpool-config/ram0-raid0.sh b/zfs/scripts/zpool-config/ram0-raid0.sh
deleted file mode 100644 (file)
index 801c912..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Single ram disk /dev/ram0 Raid-0 Configuration
-#
-
-DEVICES="/dev/ram0"
-
-zpool_create() {
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME} || exit 1
-}
diff --git a/zfs/scripts/zpool-config/scsi_debug-noraid.sh b/zfs/scripts/zpool-config/scsi_debug-noraid.sh
deleted file mode 100644 (file)
index c508ffb..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-#!/bin/bash
-#
-# 1 scsi_debug devices on top of which is layered no raid.
-#
-
-SDSIZE=${SDSIZE:-128}
-SDHOSTS=${SDHOSTS:-1}
-SDTGTS=${SDTGTS:-1}
-SDLUNS=${SDLUNS:-1}
-LDMOD=/sbin/modprobe
-
-zpool_create() {
-       check_sd_utils
-
-       test `${LSMOD} | grep -c scsi_debug` -gt 0 && \
-               (echo 0 >/sys/module/scsi_debug/parameters/every_nth &&      \
-               ${RMMOD} scsi_debug || exit 1)
-       udev_trigger
-
-       msg "${LDMOD} scsi_debug dev_size_mb=${SDSIZE} "                     \
-               "add_host=${SDHOSTS} num_tgts=${SDTGTS} "                    \
-               "max_luns=${SDLUNS}"
-       ${LDMOD} scsi_debug                                                  \
-               dev_size_mb=${SDSIZE}                                        \
-               add_host=${SDHOSTS}                                          \
-               num_tgts=${SDTGTS}                                           \
-               max_luns=${SDLUNS} ||                                        \
-               die "Error $? creating scsi_debug devices"
-       udev_trigger
-       SDDEVICE=`${LSSCSI}|${AWK} '/scsi_debug/ { print $6; exit }'`
-
-       msg "${PARTED} -s ${SDDEVICE} mklabel gpt"
-       ${PARTED} -s ${SDDEVICE} mklabel gpt ||                              \
-               (${RMMOD} scsi_debug && die "Error $? creating gpt label")
-
-       msg "${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${SDDEVICE}"
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${SDDEVICE} ||           \
-               (${RMMOD} scsi_debug && exit 1)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-       msg "${RMMOD} scsi_debug"
-       ${RMMOD} scsi_debug || die "Error $? removing scsi_debug devices"
-}
diff --git a/zfs/scripts/zpool-config/scsi_debug-raid0.sh b/zfs/scripts/zpool-config/scsi_debug-raid0.sh
deleted file mode 100644 (file)
index 6672085..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# 1 scsi_debug device for fault injection and 3 loopback devices
-# on top of which is layered raid0 (striped).
-#
-
-SDSIZE=${SDSIZE:-256}
-SDHOSTS=${SDHOSTS:-1}
-SDTGTS=${SDTGTS:-1}
-SDLUNS=${SDLUNS:-1}
-LDMOD=/sbin/modprobe
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
-DEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_sd_utils
-
-       test `${LSMOD} | grep -c scsi_debug` -gt 0 &&                        \
-               (echo 0 >/sys/module/scsi_debug/parameters/every_nth &&      \
-               ${RMMOD} scsi_debug || exit 1)
-       udev_trigger
-
-       msg "${LDMOD} scsi_debug dev_size_mb=${SDSIZE} "                     \
-               "add_host=${SDHOSTS} num_tgts=${SDTGTS} "                    \
-               "max_luns=${SDLUNS}"
-       ${LDMOD} scsi_debug                                                  \
-               dev_size_mb=${SDSIZE}                                        \
-               add_host=${SDHOSTS}                                          \
-               num_tgts=${SDTGTS}                                           \
-               max_luns=${SDLUNS} ||                                        \
-               die "Error $? creating scsi_debug devices"
-       udev_trigger
-
-       SDDEVICE=`${LSSCSI} | ${AWK} '/scsi_debug/ { print $6; exit }'`
-       msg "${PARTED} -s ${SDDEVICE} mklabel gpt"
-       ${PARTED} -s ${SDDEVICE} mklabel gpt ||                              \
-               (${RMMOD} scsi_debug && die "Error $? creating gpt label")
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256         \
-                       &>/dev/null || (${RMMOD} scsi_debug &&               \
-                       die "Error $? creating ${FILE}")
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || (${RMMOD} scsi_debug       \
-                       die "Error $? creating ${LODEVICE} using ${FILE}")
-
-               DEVICES="${DEVICES} ${LODEVICE}"
-       done
-
-       DEVICES="${DEVICES} ${SDDEVICE}"
-
-       msg "${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}"
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES} ||            \
-               (${RMMOD} scsi_debug && exit 1)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               LODEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${LODEVICE} using ${FILE}"
-               ${LOSETUP} -d ${LODEVICE} ||
-                       die "Error $? destroying ${LODEVICE} using ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-
-       msg "${RMMOD} scsi_debug"
-       ${RMMOD} scsi_debug || die "Error $? removing scsi_debug devices"
-}
diff --git a/zfs/scripts/zpool-config/scsi_debug-raid10.sh b/zfs/scripts/zpool-config/scsi_debug-raid10.sh
deleted file mode 100644 (file)
index caff1a0..0000000
+++ /dev/null
@@ -1,92 +0,0 @@
-#!/bin/bash
-#
-# 1 scsi_debug device for fault injection and 3 loopback devices
-# on top of which is layered raid10 (mirrored).
-#
-
-SDSIZE=${SDSIZE:-256}
-SDHOSTS=${SDHOSTS:-1}
-SDTGTS=${SDTGTS:-1}
-SDLUNS=${SDLUNS:-1}
-LDMOD=/sbin/modprobe
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
-DEVICES_M1=""
-DEVICES_M2=""
-
-zpool_create() {
-       local COUNT=0
-
-       check_loop_utils
-       check_sd_utils
-
-       test `${LSMOD} | grep -c scsi_debug` -gt 0 &&                        \
-               (echo 0 >/sys/module/scsi_debug/parameters/every_nth &&      \
-               ${RMMOD} scsi_debug || exit 1)
-       udev_trigger
-
-       msg "${LDMOD} scsi_debug dev_size_mb=${SDSIZE} "                     \
-               "add_host=${SDHOSTS} num_tgts=${SDTGTS} "                    \
-               "max_luns=${SDLUNS}"
-       ${LDMOD} scsi_debug                                                  \
-               dev_size_mb=${SDSIZE}                                        \
-               add_host=${SDHOSTS}                                          \
-               num_tgts=${SDTGTS}                                           \
-               max_luns=${SDLUNS} ||                                        \
-               die "Error $? creating scsi_debug devices"
-       udev_trigger
-       SDDEVICE=`${LSSCSI}|${AWK} '/scsi_debug/ { print $6; exit }'`
-       msg "${PARTED} -s ${SDDEVICE} mklabel gpt"
-       ${PARTED} -s ${SDDEVICE} mklabel gpt ||                              \
-               (${RMMOD} scsi_debug && die "Error $? creating gpt label")
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256         \
-                       &>/dev/null || (${RMMOD} scsi_debug &&               \
-                       die "Error $? creating ${FILE}")
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || (${RMMOD} scsi_debug       \
-                       die "Error $? creating ${LODEVICE} using ${FILE}")
-
-               DEVICES="${DEVICES} ${LODEVICE}"
-       done
-
-        DEVICES="${DEVICES} ${SDDEVICE}"
-
-        for DEVICE in ${DEVICES}; do
-               let COUNT=${COUNT}+1
-
-               if [ $((COUNT % 2)) -eq 0 ]; then
-                       DEVICES_M2="${DEVICES_M2} ${DEVICE}"
-               else
-                       DEVICES_M1="${DEVICES_M1} ${DEVICE}"
-               fi
-       done
-
-       msg "${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} "                   \
-               "mirror ${DEVICES_M1} mirror ${DEVICES_M2}"
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME}                          \
-               mirror ${DEVICES_M1} mirror ${DEVICES_M2} ||                 \
-               (${RMMOD} scsi_debug && exit 1)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               LODEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${LODEVICE} using ${FILE}"
-               ${LOSETUP} -d ${LODEVICE} ||
-                       die "Error $? destroying ${LODEVICE} using ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-
-       msg "${RMMOD} scsi_debug"
-       ${RMMOD} scsi_debug || die "Error $? removing scsi_debug devices"
-}
diff --git a/zfs/scripts/zpool-config/scsi_debug-raidz.sh b/zfs/scripts/zpool-config/scsi_debug-raidz.sh
deleted file mode 100644 (file)
index bc22d10..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# 1 scsi_debug device for fault injection and 3 loopback devices
-# on top of which is layered raidz.
-#
-
-SDSIZE=${SDSIZE:-256}
-SDHOSTS=${SDHOSTS:-1}
-SDTGTS=${SDTGTS:-1}
-SDLUNS=${SDLUNS:-1}
-LDMOD=/sbin/modprobe
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
-DEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_sd_utils
-
-       test `${LSMOD} | grep -c scsi_debug` -gt 0 &&                        \
-               (echo 0 >/sys/module/scsi_debug/parameters/every_nth &&      \
-               ${RMMOD} scsi_debug || exit 1)
-       udev_trigger
-
-       msg "${LDMOD} scsi_debug dev_size_mb=${SDSIZE} "                     \
-               "add_host=${SDHOSTS} num_tgts=${SDTGTS} "                    \
-               "max_luns=${SDLUNS}"
-       ${LDMOD} scsi_debug                                                  \
-               dev_size_mb=${SDSIZE}                                        \
-               add_host=${SDHOSTS}                                          \
-               num_tgts=${SDTGTS}                                           \
-               max_luns=${SDLUNS} ||                                        \
-               die "Error $? creating scsi_debug devices"
-       udev_trigger
-
-       SDDEVICE=`${LSSCSI} | ${AWK} '/scsi_debug/ { print $6; exit }'`
-       msg "${PARTED} -s ${SDDEVICE} mklabel gpt"
-       ${PARTED} -s ${SDDEVICE} mklabel gpt ||                              \
-               (${RMMOD} scsi_debug && die "Error $? creating gpt label")
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256         \
-                       &>/dev/null || (${RMMOD} scsi_debug &&               \
-                       die "Error $? creating ${FILE}")
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || (${RMMOD} scsi_debug       \
-                       die "Error $? creating ${LODEVICE} using ${FILE}")
-
-               DEVICES="${DEVICES} ${LODEVICE}"
-       done
-
-       DEVICES="${DEVICES} ${SDDEVICE}"
-
-       msg "${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${DEVICES}"
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz ${DEVICES} ||      \
-               (${RMMOD} scsi_debug && exit 1)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               LODEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${LODEVICE} using ${FILE}"
-               ${LOSETUP} -d ${LODEVICE} ||
-                       die "Error $? destroying ${LODEVICE} using ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-
-       msg "${RMMOD} scsi_debug"
-       ${RMMOD} scsi_debug || die "Error $? removing scsi_debug devices"
-}
diff --git a/zfs/scripts/zpool-config/scsi_debug-raidz2.sh b/zfs/scripts/zpool-config/scsi_debug-raidz2.sh
deleted file mode 100644 (file)
index 67a6f24..0000000
+++ /dev/null
@@ -1,78 +0,0 @@
-#!/bin/bash
-#
-# 1 scsi_debug device for fault injection and 3 loopback devices
-# on top of which is layered raidz2.
-#
-
-SDSIZE=${SDSIZE:-256}
-SDHOSTS=${SDHOSTS:-1}
-SDTGTS=${SDTGTS:-1}
-SDLUNS=${SDLUNS:-1}
-LDMOD=/sbin/modprobe
-FILEDIR=${FILEDIR:-/var/tmp}
-FILES=${FILES:-"$FILEDIR/file-vdev0 $FILEDIR/file-vdev1 $FILEDIR/file-vdev2"}
-DEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_sd_utils
-
-       test `${LSMOD} | grep -c scsi_debug` -gt 0 &&                        \
-               (echo 0 >/sys/module/scsi_debug/parameters/every_nth &&      \
-               ${RMMOD} scsi_debug || exit 1)
-       udev_trigger
-
-       msg "${LDMOD} scsi_debug dev_size_mb=${SDSIZE} "                     \
-               "add_host=${SDHOSTS} num_tgts=${SDTGTS} "                    \
-               "max_luns=${SDLUNS}"
-       ${LDMOD} scsi_debug                                                  \
-               dev_size_mb=${SDSIZE}                                        \
-               add_host=${SDHOSTS}                                          \
-               num_tgts=${SDTGTS}                                           \
-               max_luns=${SDLUNS} ||                                        \
-               die "Error $? creating scsi_debug devices"
-       udev_trigger
-
-       SDDEVICE=`${LSSCSI} | ${AWK} '/scsi_debug/ { print $6; exit }'`
-       msg "${PARTED} -s ${SDDEVICE} mklabel gpt"
-       ${PARTED} -s ${SDDEVICE} mklabel gpt ||                              \
-               (${RMMOD} scsi_debug && die "Error $? creating gpt label")
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256         \
-                       &>/dev/null || (${RMMOD} scsi_debug &&               \
-                       die "Error $? creating ${FILE}")
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || (${RMMOD} scsi_debug       \
-                       die "Error $? creating ${LODEVICE} using ${FILE}")
-
-               DEVICES="${DEVICES} ${LODEVICE}"
-       done
-
-       DEVICES="${DEVICES} ${SDDEVICE}"
-
-       msg "${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${DEVICES}"
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz2 ${DEVICES} ||     \
-               (${RMMOD} scsi_debug && exit 1)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               LODEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${LODEVICE} using ${FILE}"
-               ${LOSETUP} -d ${LODEVICE} ||
-                       die "Error $? destroying ${LODEVICE} using ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-
-       msg "${RMMOD} scsi_debug"
-       ${RMMOD} scsi_debug || die "Error $? removing scsi_debug devices"
-}
diff --git a/zfs/scripts/zpool-config/scsi_debug-raidz3.sh b/zfs/scripts/zpool-config/scsi_debug-raidz3.sh
deleted file mode 100644 (file)
index d7ef209..0000000
+++ /dev/null
@@ -1,79 +0,0 @@
-#!/bin/bash
-#
-# 1 scsi_debug device for fault injection and 3 loopback devices
-# on top of which is layered raidz3.
-#
-
-SDSIZE=${SDSIZE:-256}
-SDHOSTS=${SDHOSTS:-1}
-SDTGTS=${SDTGTS:-1}
-SDLUNS=${SDLUNS:-1}
-LDMOD=/sbin/modprobe
-FILES="/tmp/zpool-vdev0  \
-       /tmp/zpool-vdev1  \
-       /tmp/zpool-vdev2"
-DEVICES=""
-
-zpool_create() {
-       check_loop_utils
-       check_sd_utils
-
-       test `${LSMOD} | grep -c scsi_debug` -gt 0 &&                        \
-               (echo 0 >/sys/module/scsi_debug/parameters/every_nth &&      \
-               ${RMMOD} scsi_debug || exit 1)
-       udev_trigger
-
-       msg "${LDMOD} scsi_debug dev_size_mb=${SDSIZE} "                     \
-               "add_host=${SDHOSTS} num_tgts=${SDTGTS} "                    \
-               "max_luns=${SDLUNS}"
-       ${LDMOD} scsi_debug                                                  \
-               dev_size_mb=${SDSIZE}                                        \
-               add_host=${SDHOSTS}                                          \
-               num_tgts=${SDTGTS}                                           \
-               max_luns=${SDLUNS} ||                                        \
-               die "Error $? creating scsi_debug devices"
-       udev_trigger
-
-       SDDEVICE=`${LSSCSI} | ${AWK} '/scsi_debug/ { print $6; exit }'`
-       msg "${PARTED} -s ${SDDEVICE} mklabel gpt"
-       ${PARTED} -s ${SDDEVICE} mklabel gpt ||                              \
-               (${RMMOD} scsi_debug && die "Error $? creating gpt label")
-
-       for FILE in ${FILES}; do
-               LODEVICE=`unused_loop_device`
-
-               rm -f ${FILE} || exit 1
-               dd if=/dev/zero of=${FILE} bs=1024k count=0 seek=256         \
-                       &>/dev/null || (${RMMOD} scsi_debug &&               \
-                       die "Error $? creating ${FILE}")
-
-               # Setup the loopback device on the file.
-               msg "Creating ${LODEVICE} using ${FILE}"
-               ${LOSETUP} ${LODEVICE} ${FILE} || (${RMMOD} scsi_debug       \
-                       die "Error $? creating ${LODEVICE} using ${FILE}")
-
-               DEVICES="${DEVICES} ${LODEVICE}"
-       done
-
-       DEVICES="${DEVICES} ${SDDEVICE}"
-
-       msg "${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz3 ${DEVICES}"
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} raidz3 ${DEVICES} ||     \
-               (${RMMOD} scsi_debug && exit 1)
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-
-       for FILE in ${FILES}; do
-               LODEVICE=`${LOSETUP} -a | grep ${FILE} | head -n1|cut -f1 -d:`
-               msg "Removing ${LODEVICE} using ${FILE}"
-               ${LOSETUP} -d ${LODEVICE} ||
-                       die "Error $? destroying ${LODEVICE} using ${FILE}"
-               rm -f ${FILE} || exit 1
-       done
-
-       msg "${RMMOD} scsi_debug"
-       ${RMMOD} scsi_debug || die "Error $? removing scsi_debug devices"
-}
diff --git a/zfs/scripts/zpool-config/sda-raid0.sh b/zfs/scripts/zpool-config/sda-raid0.sh
deleted file mode 100644 (file)
index 48dc96d..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/bash
-#
-# Single disk /dev/sda Raid-0 Configuration
-#
-
-DEVICES="/dev/sda"
-
-zpool_create() {
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${DEVICES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME} || exit 1
-}
diff --git a/zfs/scripts/zpool-config/zpool-raid0.sh b/zfs/scripts/zpool-config/zpool-raid0.sh
deleted file mode 100644 (file)
index c757755..0000000
+++ /dev/null
@@ -1,80 +0,0 @@
-#!/bin/bash
-#
-# Zpool Raid-0 Configuration
-#
-# This script is used to test with the /dev/disk/by-vdev/[A-Z][1-n] devices.
-# It assumes that you have already populated /dev/disk/by-vdev/ by creating
-# an /etc/zfs/vdev_id.conf file based on your system design.
-#
-# You can then use either the zpool-create.sh or the zpios.sh test script to
-# test various Raid-0 configurations by adjusting the following tunables.
-# For example if you wanted to create and test a single 4-disk Raid-0
-# configuration using disks [A-D]1 with dedicated ZIL and L2ARC devices
-# you could run the following.
-#
-# ZIL="log A2" L2ARC="cache B2" RANKS=1 CHANNELS=4 \
-# zpool-create.sh -c zpool-raid0
-#
-# zpool status tank
-#   pool: tank
-#  state: ONLINE
-#  scan: none requested
-# config:
-# 
-#      NAME        STATE     READ WRITE CKSUM
-#      tank        ONLINE       0     0     0
-#        A1        ONLINE       0     0     0
-#        B1        ONLINE       0     0     0
-#        C1        ONLINE       0     0     0
-#        D1        ONLINE       0     0     0
-#      logs
-#        A2        ONLINE       0     0     0
-#      cache
-#        B2        ONLINE       0     0     0
-#
-# errors: No known data errors
-# 
-
-# Number of interior vdevs to create using the following rank ids.
-RANKS=${RANKS:-1}
-RANK_LIST=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 )
-
-# Number of devices per vdev using the following channel ids.
-CHANNELS=${CHANNELS:-8}
-CHANNEL_LIST=( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z )
-
-# Create a ZIL vdev as follows.
-ZIL=${ZIL:-}
-
-# Create an L2ARC vdev as follows.
-L2ARC=${L2ARC:-}
-
-
-raid0_setup() {
-        local RANKS=$1
-        local CHANNELS=$2
-
-        RAID0S=()
-       for (( i=0, k=0; i<${RANKS}; i++ )); do
-               RANK=${RANK_LIST[$i]}
-
-               for (( j=0; j<${CHANNELS}; j++, k++ )); do
-                        RAID0S[${k}]="${CHANNEL_LIST[$j]}${RANK}"
-                done
-        done
-
-        return 0
-}
-
-zpool_create() {
-        raid0_setup ${RANKS} ${CHANNELS}
-
-       ZPOOL_DEVICES="${RAID0S[*]} ${ZIL} ${L2ARC}"
-        msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${ZPOOL_DEVICES}
-        ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${ZPOOL_DEVICES} || exit 1
-}
-
-zpool_destroy() {
-        msg ${ZPOOL} destroy ${ZPOOL_NAME}
-        ${ZPOOL} destroy ${ZPOOL_NAME}
-}
diff --git a/zfs/scripts/zpool-config/zpool-raid10.sh b/zfs/scripts/zpool-config/zpool-raid10.sh
deleted file mode 100644 (file)
index d71c4d3..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-#!/bin/bash
-#
-# Zpool Raid-10 Configuration
-#
-# This script is used to test with the /dev/disk/by-vdev/[A-Z][1-n] devices.
-# It assumes that you have already populated /dev/disk/by-vdev/ by creating
-# an /etc/zfs/vdev_id.conf file based on your system design.
-#
-# You can then use either the zpool-create.sh or the zpios.sh test script to
-# test various Raid-10 configurations by adjusting the following tunables.
-# For example if you wanted to create and test a single 4-disk Raid-10
-# configuration using disks [A-D]1 with dedicated ZIL and L2ARC devices
-# you could run the following.
-#
-# ZIL="log A2" L2ARC="cache B2" RANKS=1 CHANNELS=4 \
-# zpool-create.sh -c zpool-raid10
-#
-# zpool status tank
-#   pool: tank
-#  state: ONLINE
-#  scan: none requested
-# config:
-# 
-#      NAME        STATE     READ WRITE CKSUM
-#      tank        ONLINE       0     0     0
-#        mirror-0  ONLINE       0     0     0
-#          A1      ONLINE       0     0     0
-#          B1      ONLINE       0     0     0
-#        mirror-1  ONLINE       0     0     0
-#          C1      ONLINE       0     0     0
-#          D1      ONLINE       0     0     0
-#      logs
-#        A2        ONLINE       0     0     0
-#      cache
-#        B2        ONLINE       0     0     0
-#
-# errors: No known data errors
-#
-
-# Number of interior vdevs to create using the following rank ids.
-RANKS=${RANKS:-1}
-RANK_LIST=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 )
-
-# Number of devices per vdev using the following channel ids.
-CHANNELS=${CHANNELS:-8}
-CHANNEL_LIST=( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z )
-
-# Create a ZIL vdev as follows.
-ZIL=${ZIL:-}
-
-# Create an L2ARC vdev as follows.
-L2ARC=${L2ARC:-}
-
-
-raid10_setup() {
-       local RANKS=$1
-       local CHANNELS=$2
-       local IDX=0
-
-       RAID10S=()
-       for (( i=0, l=0 ; i<${RANKS}; i++ )); do
-               RANK=${RANK_LIST[$i]}
-
-               for (( j=0, k=1; j<${CHANNELS}; j+=2,k+=2,l++ )); do
-                       DISK1="${CHANNEL_LIST[$j]}${RANK}"
-                       DISK2="${CHANNEL_LIST[$k]}${RANK}"
-                       RAID10S[$l]="mirror ${DISK1} ${DISK2}"
-               done
-       done
-
-       return 0
-}
-
-zpool_create() {
-       raid10_setup ${RANKS} ${CHANNELS}
-
-       ZPOOL_DEVICES="${RAID10S[*]} ${ZIL} ${L2ARC}"
-       msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${ZPOOL_DEVICES}
-       ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${ZPOOL_DEVICES} || exit 1
-}
-
-zpool_destroy() {
-       msg ${ZPOOL} destroy ${ZPOOL_NAME}
-       ${ZPOOL} destroy ${ZPOOL_NAME}
-}
diff --git a/zfs/scripts/zpool-config/zpool-raidz.sh b/zfs/scripts/zpool-config/zpool-raidz.sh
deleted file mode 100644 (file)
index b3f21a0..0000000
+++ /dev/null
@@ -1,87 +0,0 @@
-#!/bin/bash
-#
-# Zpool Raid-Z Configuration
-#
-# This script is used to test with the /dev/disk/by-vdev/[A-Z][1-n] devices.
-# It assumes that you have already populated /dev/disk/by-vdev/ by creating
-# an /etc/zfs/vdev_id.conf file based on your system design.
-#
-# You can then use either the zpool-create.sh or the zpios.sh test script to
-# test various Raid-Z configurations by adjusting the following tunables.
-# For example if you wanted to create and test a single 4-disk Raid-Z2
-# configuration using disks [A-D]1 with dedicated ZIL and L2ARC devices
-# you could run the following.
-#
-# ZIL="log A2" L2ARC="cache B2" RANKS=1 CHANNELS=4 LEVEL=2 \
-# zpool-create.sh -c zpool-raidz
-#
-# zpool status tank
-#   pool: tank
-#  state: ONLINE
-#  scan: none requested
-# config:
-# 
-#      NAME        STATE     READ WRITE CKSUM
-#      tank        ONLINE       0     0     0
-#        raidz2-0  ONLINE       0     0     0
-#          A1      ONLINE       0     0     0
-#          B1      ONLINE       0     0     0
-#          C1      ONLINE       0     0     0
-#          D1      ONLINE       0     0     0
-#      logs
-#        A2        ONLINE       0     0     0
-#      cache
-#        B2        ONLINE       0     0     0
-#  
-# errors: No known data errors
-# 
-
-# Number of interior vdevs to create using the following rank ids.
-RANKS=${RANKS:-1}
-RANK_LIST=( 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 )
-
-# Number of devices per vdev using the following channel ids.
-CHANNELS=${CHANNELS:-8}
-CHANNEL_LIST=( A B C D E F G H I J K L M N O P Q R S T U V W X Y Z )
-
-# Raid-Z Level: 1, 2, or 3.
-LEVEL=${LEVEL:-2}
-
-# Create a ZIL vdev as follows.
-ZIL=${ZIL:-}
-
-# Create an L2ARC vdev as follows.
-L2ARC=${L2ARC:-}
-
-
-raidz_setup() {
-        local RANKS=$1
-        local CHANNELS=$2
-
-        RAIDZS=()
-        for (( i=0; i<${RANKS}; i++ )); do
-                RANK=${RANK_LIST[$i]}
-                RAIDZ=("raidz${LEVEL}")
-
-                for (( j=0, k=1; j<${CHANNELS}; j++, k++ )); do
-                        RAIDZ[$k]="${CHANNEL_LIST[$j]}${RANK}"
-                done
-
-                RAIDZS[$i]="${RAIDZ[*]}"
-        done
-
-        return 0
-}
-
-zpool_create() {
-        raidz_setup ${RANKS} ${CHANNELS}
-
-       ZPOOL_DEVICES="${RAIDZS[*]} ${ZIL} ${L2ARC}"
-        msg ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${ZPOOL_DEVICES}
-        ${ZPOOL} create ${ZPOOL_FLAGS} ${ZPOOL_NAME} ${ZPOOL_DEVICES} || exit 1
-}
-
-zpool_destroy() {
-        msg ${ZPOOL} destroy ${ZPOOL_NAME}
-        ${ZPOOL} destroy ${ZPOOL_NAME}
-}
diff --git a/zfs/scripts/zpool-create.sh b/zfs/scripts/zpool-create.sh
deleted file mode 100755 (executable)
index 16ee671..0000000
+++ /dev/null
@@ -1,139 +0,0 @@
-#!/bin/bash
-
-basedir="$(dirname $0)"
-
-SCRIPT_COMMON=common.sh
-if [ -f "${basedir}/${SCRIPT_COMMON}" ]; then
-. "${basedir}/${SCRIPT_COMMON}"
-else
-echo "Missing helper script ${SCRIPT_COMMON}" && exit 1
-fi
-
-PROG=zpool-create.sh
-
-usage() {
-cat << EOF
-USAGE:
-$0 [hvfxcp]
-
-DESCRIPTION:
-        Create one of several predefined zpool configurations.
-
-OPTIONS:
-        -h      Show this message
-        -v      Verbose
-        -f      Force everything
-        -x      Disable all zpool features
-        -c      Configuration for zpool
-        -p      Name for zpool
-        -d      Destroy zpool (default create)
-        -l      Additional zpool options
-        -s      Additional zfs options
-
-EOF
-}
-
-check_config() {
-
-       if [ ! -f ${ZPOOL_CONFIG} ]; then
-               local NAME=`basename ${ZPOOL_CONFIG} .sh`
-               ERROR="Unknown config '${NAME}', available configs are:\n"
-
-               for CFG in `ls ${ZPOOLDIR}/ | grep ".sh"`; do
-                       local NAME=`basename ${CFG} .sh`
-                       ERROR="${ERROR}${NAME}\n"
-               done
-
-               return 1
-       fi
-
-       return 0
-}
-
-ZPOOL_CONFIG=unknown
-ZPOOL_NAME=tank
-ZPOOL_DESTROY=
-ZPOOL_FLAGS=${ZPOOL_FLAGS:-""}
-ZPOOL_OPTIONS=""
-ZFS_OPTIONS=""
-
-while getopts 'hvfxc:p:dl:s:' OPTION; do
-       case $OPTION in
-       h)
-               usage
-               exit 1
-               ;;
-       v)
-               VERBOSE=1
-               VERBOSE_FLAG="-v"
-               ;;
-       f)
-               FORCE=1
-               ZPOOL_FLAGS="$ZPOOL_FLAGS -f"
-               ;;
-       x)
-               NO_FEATURES=1
-               ZPOOL_FLAGS="$ZPOOL_FLAGS -d"
-               ;;
-       c)
-               ZPOOL_CONFIG=${ZPOOLDIR}/${OPTARG}.sh
-               ;;
-       p)
-               ZPOOL_NAME=${OPTARG}
-               ;;
-       d)
-               ZPOOL_DESTROY=1
-               ;;
-       l)
-               ZPOOL_OPTIONS=${OPTARG}
-               ;;
-       s)
-               ZFS_OPTIONS=${OPTARG}
-               ;;
-       ?)
-               usage
-               exit 1
-               ;;
-       esac
-done
-
-if [ $(id -u) != 0 ]; then
-        die "Must run as root"
-fi
-
-check_config || die "${ERROR}"
-. ${ZPOOL_CONFIG}
-
-if [ ${ZPOOL_DESTROY} ]; then
-       zpool_destroy
-else
-       zpool_create
-
-       if [ "${ZPOOL_OPTIONS}" ]; then
-               if [ ${VERBOSE} ]; then
-                       echo
-                       echo "${ZPOOL} ${ZPOOL_OPTIONS} ${ZPOOL_NAME}"
-               fi
-               ${ZPOOL} ${ZPOOL_OPTIONS} ${ZPOOL_NAME} || exit 1
-       fi
-
-       if [ "${ZFS_OPTIONS}" ]; then
-               if [ ${VERBOSE} ]; then
-                       echo
-                       echo "${ZFS} ${ZFS_OPTIONS} ${ZPOOL_NAME}"
-               fi
-               ${ZFS} ${ZFS_OPTIONS} ${ZPOOL_NAME} || exit 1
-       fi
-
-       if [ ${VERBOSE} ]; then
-               echo
-               echo "zpool list"
-               ${ZPOOL} list || exit 1
-
-               echo
-               echo "zpool status ${ZPOOL_NAME}"
-               ${ZPOOL} status ${ZPOOL_NAME} || exit 1
-       fi
-fi
-
-exit 0
diff --git a/zfs/udev/Makefile.am b/zfs/udev/Makefile.am
deleted file mode 100644 (file)
index f930941..0000000
+++ /dev/null
@@ -1 +0,0 @@
-SUBDIRS = rules.d
diff --git a/zfs/udev/Makefile.in b/zfs/udev/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/udev/rules.d/.gitignore b/zfs/udev/rules.d/.gitignore
deleted file mode 100644 (file)
index e7f7be8..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-69-vdev.rules
-60-zpool.rules
-60-zvol.rules
-90-zfs.rules
index 199f77e0ceb944d9b4be65ff6432a66a5d3149c1..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,6 +1,2 @@
-# Persistent links for zvol
-#
-# persistent disk links: /dev/zvol/dataset_name
-# also creates compatibilty symlink of /dev/dataset_name
-
-KERNEL=="zd*" SUBSYSTEM=="block" ACTION=="add|change" PROGRAM="@udevdir@/zvol_id $tempnode" SYMLINK+="zvol/%c %c"
+%:
+       #
index 5c2940af64773e4cea9942587951a9dfcc00773e..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,9 +1,2 @@
-#
-# @udevdir@/rules.d/69-vdev.rules
-#
-
-ENV{DEVTYPE}=="disk", IMPORT{program}="@udevdir@/vdev_id -d %k"
-
-KERNEL=="*[!0-9]", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
-KERNEL=="*[0-9]", ENV{SUBSYSTEM}=="block", ENV{DEVTYPE}=="partition", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}-part%n"
-KERNEL=="dm-[0-9]*", ENV{SUBSYSTEM}=="block", ENV{ID_VDEV}=="?*", SYMLINK+="$env{ID_VDEV_PATH}"
+%:
+       #
index a2715d2e78140c51f0314b06ac6c152691d21d7e..b3e8c1303bda612cfbec58359220e20cc62e48d7 100644 (file)
@@ -1,12 +1,2 @@
-SUBSYSTEM!="block|misc", GOTO="zfs_end"
-ACTION!="add|change", GOTO="zfs_end"
-
-ENV{ID_FS_TYPE}=="zfs", RUN+="/sbin/modprobe zfs"
-ENV{ID_FS_TYPE}=="zfs_member", RUN+="/sbin/modprobe zfs"
-
-KERNEL=="null", SYMLINK+="root"
-SYMLINK=="null", SYMLINK+="root"
-
-SUBSYSTEM=="misc", KERNEL=="zfs", RUN+="@sbindir@/zpool list"
-
-LABEL="zfs_end"
+%:
+       #
diff --git a/zfs/udev/rules.d/Makefile.am b/zfs/udev/rules.d/Makefile.am
deleted file mode 100644 (file)
index febbb48..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-udevrule_DATA = \
-       69-vdev.rules \
-       60-zvol.rules \
-       90-zfs.rules
-
-EXTRA_DIST = \
-       $(top_srcdir)/udev/rules.d/69-vdev.rules.in \
-       $(top_srcdir)/udev/rules.d/60-zvol.rules.in \
-       $(top_srcdir)/udev/rules.d/90-zfs.rules.in
-
-$(udevrule_DATA):
-       -$(SED) -e 's,@bindir\@,$(bindir),g' \
-               -e 's,@sbindir\@,$(sbindir),g' \
-               -e 's,@udevdir\@,$(udevdir),g' \
-               -e 's,@udevruledir\@,$(udevruledir),g' \
-               -e 's,@sysconfdir\@,$(sysconfdir),g' \
-               "$(top_srcdir)/udev/rules.d/$@.in" > '$@'
-
-distclean-local::
-       -$(RM) $(udevrule_DATA)
diff --git a/zfs/udev/rules.d/Makefile.in b/zfs/udev/rules.d/Makefile.in
new file mode 100644 (file)
index 0000000..b3e8c13
--- /dev/null
@@ -0,0 +1,2 @@
+%:
+       #
diff --git a/zfs/zfs_config.h.in b/zfs/zfs_config.h.in
new file mode 100644 (file)
index 0000000..fd79274
--- /dev/null
@@ -0,0 +1,429 @@
+/* zfs_config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define to 1 to enabled dmu tx validation */
+#undef DEBUG_DMU_TX
+
+/* bio_end_io_t wants 1 arg */
+#undef HAVE_1ARG_BIO_END_IO_T
+
+/* invalidate_bdev() wants 1 arg */
+#undef HAVE_1ARG_INVALIDATE_BDEV
+
+/* kmap_atomic wants 1 args */
+#undef HAVE_1ARG_KMAP_ATOMIC
+
+/* bdi_setup_and_register() wants 2 args */
+#undef HAVE_2ARGS_BDI_SETUP_AND_REGISTER
+
+/* bdi_setup_and_register() wants 3 args */
+#undef HAVE_3ARGS_BDI_SETUP_AND_REGISTER
+
+/* blkdev_get() wants 3 args */
+#undef HAVE_3ARG_BLKDEV_GET
+
+/* sget() wants 5 args */
+#undef HAVE_5ARG_SGET
+
+/* security_inode_init_security wants 6 args */
+#undef HAVE_6ARGS_SECURITY_INODE_INIT_SECURITY
+
+/* dops->automount() exists */
+#undef HAVE_AUTOMOUNT
+
+/* struct block_device_operations use bdevs */
+#undef HAVE_BDEV_BLOCK_DEVICE_OPERATIONS
+
+/* bdev_logical_block_size() is available */
+#undef HAVE_BDEV_LOGICAL_BLOCK_SIZE
+
+/* bdev_physical_block_size() is available */
+#undef HAVE_BDEV_PHYSICAL_BLOCK_SIZE
+
+/* bio has bi_iter */
+#undef HAVE_BIO_BVEC_ITER
+
+/* BIO_RW_BARRIER is defined */
+#undef HAVE_BIO_RW_BARRIER
+
+/* BIO_RW_DISCARD is defined */
+#undef HAVE_BIO_RW_DISCARD
+
+/* BIO_RW_FAILFAST_* are defined */
+#undef HAVE_BIO_RW_FAILFAST_DTD
+
+/* blkdev_get_by_path() is available */
+#undef HAVE_BLKDEV_GET_BY_PATH
+
+/* blk_queue_flush() is available */
+#undef HAVE_BLK_QUEUE_FLUSH
+
+/* blk_queue_flush() is GPL-only */
+#undef HAVE_BLK_QUEUE_FLUSH_GPL_ONLY
+
+/* blk_queue_max_hw_sectors() is available */
+#undef HAVE_BLK_QUEUE_MAX_HW_SECTORS
+
+/* blk_queue_max_segments() is available */
+#undef HAVE_BLK_QUEUE_MAX_SEGMENTS
+
+/* struct block_device_operations.release returns void */
+#undef HAVE_BLOCK_DEVICE_OPERATIONS_RELEASE_VOID
+
+/* security_inode_init_security wants callback */
+#undef HAVE_CALLBACK_SECURITY_INODE_INIT_SECURITY
+
+/* iops->check_acl() exists */
+#undef HAVE_CHECK_ACL
+
+/* iops->check_acl() wants flags */
+#undef HAVE_CHECK_ACL_WITH_FLAGS
+
+/* check_disk_size_change() is available */
+#undef HAVE_CHECK_DISK_SIZE_CHANGE
+
+/* clear_inode() is available */
+#undef HAVE_CLEAR_INODE
+
+/* eops->commit_metadata() exists */
+#undef HAVE_COMMIT_METADATA
+
+/* dentry uses const struct dentry_operations */
+#undef HAVE_CONST_DENTRY_OPERATIONS
+
+/* super_block uses const struct xattr_hander */
+#undef HAVE_CONST_XATTR_HANDLER
+
+/* iops->create() passes nameidata */
+#undef HAVE_CREATE_NAMEIDATA
+
+/* current->bio_list exists */
+#undef HAVE_CURRENT_BIO_LIST
+
+/* current->bio_tail exists */
+#undef HAVE_CURRENT_BIO_TAIL
+
+/* current_umask() exists */
+#undef HAVE_CURRENT_UMASK
+
+/* DECLARE_EVENT_CLASS() is available */
+#undef HAVE_DECLARE_EVENT_CLASS
+
+/* xattr_handler->get() wants dentry */
+#undef HAVE_DENTRY_XATTR_GET
+
+/* xattr_handler->list() wants dentry */
+#undef HAVE_DENTRY_XATTR_LIST
+
+/* xattr_handler->set() wants dentry */
+#undef HAVE_DENTRY_XATTR_SET
+
+/* sops->dirty_inode() wants flags */
+#undef HAVE_DIRTY_INODE_WITH_FLAGS
+
+/* ql->discard_granularity is available */
+#undef HAVE_DISCARD_GRANULARITY
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* d_make_root() is available */
+#undef HAVE_D_MAKE_ROOT
+
+/* d_obtain_alias() is available */
+#undef HAVE_D_OBTAIN_ALIAS
+
+/* d_prune_aliases() is available */
+#undef HAVE_D_PRUNE_ALIASES
+
+/* dops->d_revalidate() operation takes nameidata */
+#undef HAVE_D_REVALIDATE_NAMEIDATA
+
+/* d_set_d_op() is available */
+#undef HAVE_D_SET_D_OP
+
+/* elevator_change() is available */
+#undef HAVE_ELEVATOR_CHANGE
+
+/* eops->encode_fh() wants child and parent inodes */
+#undef HAVE_ENCODE_FH_WITH_INODE
+
+/* sops->evict_inode() exists */
+#undef HAVE_EVICT_INODE
+
+/* fops->fallocate() exists */
+#undef HAVE_FILE_FALLOCATE
+
+/* file_inode() is available */
+#undef HAVE_FILE_INODE
+
+/* kernel defines fmode_t */
+#undef HAVE_FMODE_T
+
+/* follow_down_one() is available */
+#undef HAVE_FOLLOW_DOWN_ONE
+
+/* iops->follow_link() nameidata */
+#undef HAVE_FOLLOW_LINK_NAMEIDATA
+
+/* sops->free_cached_objects() exists */
+#undef HAVE_FREE_CACHED_OBJECTS
+
+/* fops->fsync() with range */
+#undef HAVE_FSYNC_RANGE
+
+/* fops->fsync() without dentry */
+#undef HAVE_FSYNC_WITHOUT_DENTRY
+
+/* fops->fsync() with dentry */
+#undef HAVE_FSYNC_WITH_DENTRY
+
+/* generic_start_io_acct()/generic_end_io_acct() avaliable */
+#undef HAVE_GENERIC_IO_ACCT
+
+/* iops->get_acl() exists */
+#undef HAVE_GET_ACL
+
+/* blk_disk_ro() is available */
+#undef HAVE_GET_DISK_RO
+
+/* get_gendisk() is available */
+#undef HAVE_GET_GENDISK
+
+/* xattr_handler->get() wants xattr_handler */
+#undef HAVE_HANDLER_XATTR_GET
+
+/* xattr_handler->list() wants xattr_handler */
+#undef HAVE_HANDLER_XATTR_LIST
+
+/* xattr_handler->set() wants xattr_handler */
+#undef HAVE_HANDLER_XATTR_SET
+
+/* fops->fallocate() exists */
+#undef HAVE_INODE_FALLOCATE
+
+/* inode_owner_or_capable() exists */
+#undef HAVE_INODE_OWNER_OR_CAPABLE
+
+/* iops->truncate_range() exists */
+#undef HAVE_INODE_TRUNCATE_RANGE
+
+/* insert_inode_locked() is available */
+#undef HAVE_INSERT_INODE_LOCKED
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* is_owner_or_cap() exists */
+#undef HAVE_IS_OWNER_OR_CAP
+
+/* kernel defines KOBJ_NAME_LEN */
+#undef HAVE_KOBJ_NAME_LEN
+
+/* Define if you have libblkid */
+#undef HAVE_LIBBLKID
+
+/* Define if you have libuuid */
+#undef HAVE_LIBUUID
+
+/* Define to 1 if you have the `z' library (-lz). */
+#undef HAVE_LIBZ
+
+/* lookup_bdev() is available */
+#undef HAVE_LOOKUP_BDEV
+
+/* iops->lookup() passes nameidata */
+#undef HAVE_LOOKUP_NAMEIDATA
+
+/* lseek_execute() is available */
+#undef HAVE_LSEEK_EXECUTE
+
+/* Noting that make_request_fn() returns int */
+#undef HAVE_MAKE_REQUEST_FN_RET_INT
+
+/* Noting that make_request_fn() returns blk_qc_t */
+#undef HAVE_MAKE_REQUEST_FN_RET_QC
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* iops->create()/mkdir()/mknod() take umode_t */
+#undef HAVE_MKDIR_UMODE_T
+
+/* Define to 1 if you have the `mlockall' function. */
+#undef HAVE_MLOCKALL
+
+/* mount_nodev() is available */
+#undef HAVE_MOUNT_NODEV
+
+/* sops->nr_cached_objects() exists */
+#undef HAVE_NR_CACHED_OBJECTS
+
+/* open_bdev_exclusive() is available */
+#undef HAVE_OPEN_BDEV_EXCLUSIVE
+
+/* iops->permission() exists */
+#undef HAVE_PERMISSION
+
+/* iops->permission() with nameidata exists */
+#undef HAVE_PERMISSION_WITH_NAMEIDATA
+
+/* inode contains i_acl and i_default_acl */
+#undef HAVE_POSIX_ACL_CACHING
+
+/* posix_acl_chmod() exists */
+#undef HAVE_POSIX_ACL_CHMOD
+
+/* posix_acl_equiv_mode wants umode_t* */
+#undef HAVE_POSIX_ACL_EQUIV_MODE_UMODE_T
+
+/* posix_acl_from_xattr() needs user_ns */
+#undef HAVE_POSIX_ACL_FROM_XATTR_USERNS
+
+/* posix_acl_release() is available */
+#undef HAVE_POSIX_ACL_RELEASE
+
+/* posix_acl_release() is GPL-only */
+#undef HAVE_POSIX_ACL_RELEASE_GPL_ONLY
+
+/* iops->put_link() nameidata */
+#undef HAVE_PUT_LINK_NAMEIDATA
+
+/* REQ_FAILFAST_MASK is defined */
+#undef HAVE_REQ_FAILFAST_MASK
+
+/* set_nlink() is available */
+#undef HAVE_SET_NLINK
+
+/* sops->show_options() with dentry */
+#undef HAVE_SHOW_OPTIONS_WITH_DENTRY
+
+/* struct super_block has s_shrink */
+#undef HAVE_SHRINK
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_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/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* struct super_block has s_d_op */
+#undef HAVE_S_D_OP
+
+/* struct super_block has s_instances list_head */
+#undef HAVE_S_INSTANCES_LIST_HEAD
+
+/* truncate_setsize() is available */
+#undef HAVE_TRUNCATE_SETSIZE
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* fops->iterate() is available */
+#undef HAVE_VFS_ITERATE
+
+/* fops->readdir() is available */
+#undef HAVE_VFS_READDIR
+
+/* fops->read/write_iter() are available */
+#undef HAVE_VFS_RW_ITERATE
+
+/* Define if you have zlib */
+#undef HAVE_ZLIB
+
+/* __posix_acl_chmod() exists */
+#undef HAVE___POSIX_ACL_CHMOD
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
+/* make_request_fn() returns blk_qc_t */
+#undef MAKE_REQUEST_FN_RET
+
+/* Name of package */
+#undef PACKAGE
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* struct shrink_control has nid */
+#undef SHRINK_CONTROL_HAS_NID
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Version number of package */
+#undef VERSION
+
+/* zfs debugging enabled */
+#undef ZFS_DEBUG
+
+/* Define to 1 if GPL-only symbols can be used */
+#undef ZFS_IS_GPL_COMPATIBLE
+
+/* Define the project alias string. */
+#undef ZFS_META_ALIAS
+
+/* Define the project author. */
+#undef ZFS_META_AUTHOR
+
+/* Define the project release date. */
+#undef ZFS_META_DATA
+
+/* Define the project license. */
+#undef ZFS_META_LICENSE
+
+/* Define the libtool library 'age' version information. */
+#undef ZFS_META_LT_AGE
+
+/* Define the libtool library 'current' version information. */
+#undef ZFS_META_LT_CURRENT
+
+/* Define the libtool library 'revision' version information. */
+#undef ZFS_META_LT_REVISION
+
+/* Define the project name. */
+#undef ZFS_META_NAME
+
+/* Define the project release. */
+#undef ZFS_META_RELEASE
+
+/* Define the project version. */
+#undef ZFS_META_VERSION
+
+
+#undef PACKAGE
+#undef PACKAGE_BUGREPORT
+#undef PACKAGE_NAME
+#undef PACKAGE_STRING
+#undef PACKAGE_TARNAME
+#undef PACKAGE_VERSION
+#undef STDC_HEADERS
+#undef VERSION